xref: /openbsd-src/sys/dev/pci/drm/include/linux/acpi.h (revision 99fd087599a8791921855f21bd7e36130f39aadc)
1 /* Public domain. */
2 
3 #ifndef _LINUX_ACPI_H
4 #define _LINUX_ACPI_H
5 
6 #include <sys/types.h>
7 #include <sys/param.h>
8 
9 #ifdef __HAVE_ACPI
10 #include <dev/acpi/acpireg.h>
11 #include <dev/acpi/acpivar.h>
12 #endif
13 
14 typedef size_t acpi_size;
15 typedef int acpi_status;
16 typedef struct aml_node *acpi_handle;
17 
18 struct acpi_bus_event {
19 	const char *device_class;
20 	int type;
21 };
22 
23 struct acpi_buffer {
24 	size_t length;
25 	void *pointer;
26 };
27 
28 #define ACPI_ALLOCATE_BUFFER	(size_t)-1
29 
30 union acpi_object {
31 	int type;
32 	struct {
33 		int type;
34 		uint64_t value;
35 	} integer;
36 	struct {
37 		int type;
38 		size_t length;
39 		void *pointer;
40 	} buffer;
41 };
42 
43 #define ACPI_TYPE_INTEGER	1
44 #define ACPI_TYPE_BUFFER	3
45 
46 struct acpi_object_list {
47 	int count;
48 	union acpi_object *pointer;
49 };
50 
51 struct acpi_table_header;
52 
53 #define ACPI_SUCCESS(x) ((x) == 0)
54 #define ACPI_FAILURE(x) ((x) != 0)
55 
56 #define AE_ERROR		1
57 #define AE_NOT_FOUND		2
58 #define AE_BAD_PARAMETER	3
59 
60 acpi_status acpi_evaluate_object(acpi_handle, const char *,
61 	struct acpi_object_list *, struct acpi_buffer *);
62 
63 acpi_status acpi_get_handle(acpi_handle, const char *, acpi_handle *);
64 acpi_status acpi_get_name(acpi_handle, int, struct acpi_buffer *);
65 acpi_status acpi_get_table(const char *, int, struct acpi_table_header **);
66 
67 #define ACPI_FULL_PATHNAME 1
68 
69 #define ACPI_VIDEO_CLASS   "video"
70 
71 #define ACPI_VIDEO_NOTIFY_PROBE		0x81
72 
73 #define ACPI_HANDLE(x)	((x)->node)
74 
75 const char *acpi_format_exception(acpi_status);
76 
77 struct notifier_block;
78 
79 int register_acpi_notifier(struct notifier_block *);
80 int unregister_acpi_notifier(struct notifier_block *);
81 
82 #endif
83