12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 2009-2010, Intel Corporation.
23 * All rights reserved.
24 */
25
26 #ifndef _SYS_ACPIDEV_H
27 #define _SYS_ACPIDEV_H
28 #include <sys/types.h>
29 #include <sys/obpdefs.h>
30 #include <sys/sunddi.h>
31 #ifdef _KERNEL
32 #include <sys/acpi/acpi.h>
33 #include <sys/acpica.h>
34 #endif
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 /* Maximum recursion levels when enumerating objects in ACPI namespace. */
41 #define ACPIDEV_MAX_ENUM_LEVELS 32
42
43 /* Maximum length of device name for ACPI object. */
44 #define ACPIDEV_MAX_NAMELEN OBP_MAXDRVNAME
45
46 /* Pseudo ACPI device HID for ACPI root object. */
47 #define ACPIDEV_HID_ROOTNEX "SOLA0001"
48 /* Pseudo ACPI device HID for ACPI virtual bus. */
49 #define ACPIDEV_HID_VIRTNEX "SOLA0002"
50 #define ACPIDEV_HID_SCOPE "SOLA0003"
51 #define ACPIDEV_HID_PROCESSOR "SOLA0004"
52
111 ACPIDEV_CLASS_ID_SCOPE = 2,
112 ACPIDEV_CLASS_ID_DEVICE = 3,
113 ACPIDEV_CLASS_ID_CONTAINER = 4,
114 ACPIDEV_CLASS_ID_CPU = 5,
115 ACPIDEV_CLASS_ID_MEMORY = 6,
116 ACPIDEV_CLASS_ID_PCI = 7,
117 ACPIDEV_CLASS_ID_PCIEX = 8,
118 ACPIDEV_CLASS_ID_MAX
119 } acpidev_class_id_t;
120
121 /* Flags for acpidev_options boot options. */
122 #define ACPIDEV_OUSER_NO_CPU 0x1
123 #define ACPIDEV_OUSER_NO_MEM 0x2
124 #define ACPIDEV_OUSER_NO_CONTAINER 0x4
125 #define ACPIDEV_OUSER_NO_PCI 0x8
126 #define ACPIDEV_OUSER_NO_CACHE 0x10000
127
128 #ifdef _KERNEL
129
130 /* Common ACPI object names. */
131 #define ACPIDEV_OBJECT_NAME_SB ACPI_NS_SYSTEM_BUS
132 #define ACPIDEV_OBJECT_NAME_PR "_PR_"
133
134 /* Common ACPI method names. */
135 #define ACPIDEV_METHOD_NAME_MAT "_MAT"
136 #define ACPIDEV_METHOD_NAME_EJ0 "_EJ0"
137 #define ACPIDEV_METHOD_NAME_EDL "_EDL"
138 #define ACPIDEV_METHOD_NAME_EJD "_EJD"
139 #define ACPIDEV_METHOD_NAME_OST "_OST"
140 #define ACPIDEV_METHOD_NAME_PXM "_PXM"
141 #define ACPIDEV_METHOD_NAME_SLI "_SLI"
142
143 /* Source event code for _OST. */
144 #define ACPI_OST_EVENT_EJECTING 0x103
145 #define ACPI_OST_EVENT_INSERTING 0x200
146
147 /* Status code for _OST. */
148 #define ACPI_OST_STA_SUCCESS 0x0
149
150 /* Non-specific failure. */
151 #define ACPI_OST_STA_FAILURE 0x1
|
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 2009-2010, Intel Corporation.
23 * All rights reserved.
24 */
25
26 #ifndef _SYS_ACPIDEV_H
27 #define _SYS_ACPIDEV_H
28 #include <sys/types.h>
29 #include <sys/obpdefs.h>
30 #include <sys/sunddi.h>
31 #ifdef _KERNEL
32 #include <acpica/include/acpi.h>
33 #include <sys/acpica.h>
34 #endif
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 /* Maximum recursion levels when enumerating objects in ACPI namespace. */
41 #define ACPIDEV_MAX_ENUM_LEVELS 32
42
43 /* Maximum length of device name for ACPI object. */
44 #define ACPIDEV_MAX_NAMELEN OBP_MAXDRVNAME
45
46 /* Pseudo ACPI device HID for ACPI root object. */
47 #define ACPIDEV_HID_ROOTNEX "SOLA0001"
48 /* Pseudo ACPI device HID for ACPI virtual bus. */
49 #define ACPIDEV_HID_VIRTNEX "SOLA0002"
50 #define ACPIDEV_HID_SCOPE "SOLA0003"
51 #define ACPIDEV_HID_PROCESSOR "SOLA0004"
52
111 ACPIDEV_CLASS_ID_SCOPE = 2,
112 ACPIDEV_CLASS_ID_DEVICE = 3,
113 ACPIDEV_CLASS_ID_CONTAINER = 4,
114 ACPIDEV_CLASS_ID_CPU = 5,
115 ACPIDEV_CLASS_ID_MEMORY = 6,
116 ACPIDEV_CLASS_ID_PCI = 7,
117 ACPIDEV_CLASS_ID_PCIEX = 8,
118 ACPIDEV_CLASS_ID_MAX
119 } acpidev_class_id_t;
120
121 /* Flags for acpidev_options boot options. */
122 #define ACPIDEV_OUSER_NO_CPU 0x1
123 #define ACPIDEV_OUSER_NO_MEM 0x2
124 #define ACPIDEV_OUSER_NO_CONTAINER 0x4
125 #define ACPIDEV_OUSER_NO_PCI 0x8
126 #define ACPIDEV_OUSER_NO_CACHE 0x10000
127
128 #ifdef _KERNEL
129
130 /* Common ACPI object names. */
131 #define ACPIDEV_OBJECT_NAME_SB METHOD_NAME__SB_
132 #define ACPIDEV_OBJECT_NAME_PR "_PR_"
133
134 /* Common ACPI method names. */
135 #define ACPIDEV_METHOD_NAME_MAT "_MAT"
136 #define ACPIDEV_METHOD_NAME_EJ0 "_EJ0"
137 #define ACPIDEV_METHOD_NAME_EDL "_EDL"
138 #define ACPIDEV_METHOD_NAME_EJD "_EJD"
139 #define ACPIDEV_METHOD_NAME_OST "_OST"
140 #define ACPIDEV_METHOD_NAME_PXM "_PXM"
141 #define ACPIDEV_METHOD_NAME_SLI "_SLI"
142
143 /* Source event code for _OST. */
144 #define ACPI_OST_EVENT_EJECTING 0x103
145 #define ACPI_OST_EVENT_INSERTING 0x200
146
147 /* Status code for _OST. */
148 #define ACPI_OST_STA_SUCCESS 0x0
149
150 /* Non-specific failure. */
151 #define ACPI_OST_STA_FAILURE 0x1
|