1 // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
2 /******************************************************************************
4 * Module Name: utglobal - Global variables for the ACPI subsystem
6 * Copyright (C) 2000 - 2018, Intel Corp.
8 *****************************************************************************/
10 #define EXPORT_ACPI_INTERFACES
11 #define DEFINE_ACPI_GLOBALS
13 #include <acpi/acpi.h>
16 #define _COMPONENT ACPI_UTILITIES
17 ACPI_MODULE_NAME("utglobal")
19 /*******************************************************************************
21 * Static global variable initialization.
23 ******************************************************************************/
24 /* Various state name strings */
25 const char *acpi_gbl_sleep_state_names
[ACPI_S_STATE_COUNT
] = {
34 const char *acpi_gbl_lowest_dstate_names
[ACPI_NUM_sx_w_METHODS
] = {
42 const char *acpi_gbl_highest_dstate_names
[ACPI_NUM_sx_d_METHODS
] = {
51 const char acpi_gbl_lower_hex_digits
[] = "0123456789abcdef";
52 const char acpi_gbl_upper_hex_digits
[] = "0123456789ABCDEF";
54 /*******************************************************************************
58 ******************************************************************************/
60 * Predefined ACPI Names (Built-in to the Interpreter)
63 * 1) _SB_ is defined to be a device to allow \_SB_._INI to be run
64 * during the initialization sequence.
65 * 2) _TZ_ is defined to be a thermal zone in order to allow ASL code to
66 * perform a Notify() operation on it. 09/2010: Changed to type Device.
67 * This still allows notifies, but does not confuse host code that
68 * searches for valid thermal_zone objects.
70 const struct acpi_predefined_names acpi_gbl_pre_defined_names
[] = {
71 {"_GPE", ACPI_TYPE_LOCAL_SCOPE
, NULL
},
72 {"_PR_", ACPI_TYPE_LOCAL_SCOPE
, NULL
},
73 {"_SB_", ACPI_TYPE_DEVICE
, NULL
},
74 {"_SI_", ACPI_TYPE_LOCAL_SCOPE
, NULL
},
75 {"_TZ_", ACPI_TYPE_DEVICE
, NULL
},
78 * The _REV object is in the process of being deprecated, because
79 * other ACPI implementations permanently return 2. Thus, it
80 * has little or no value. Return 2 for compatibility with
81 * other ACPI implementations.
83 {"_REV", ACPI_TYPE_INTEGER
, ACPI_CAST_PTR(char, 2)},
84 {"_OS_", ACPI_TYPE_STRING
, ACPI_OS_NAME
},
85 {"_GL_", ACPI_TYPE_MUTEX
, ACPI_CAST_PTR(char, 1)},
87 #if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
88 {"_OSI", ACPI_TYPE_METHOD
, ACPI_CAST_PTR(char, 1)},
91 /* Table terminator */
93 {NULL
, ACPI_TYPE_ANY
, NULL
}
96 #if (!ACPI_REDUCED_HARDWARE)
97 /******************************************************************************
99 * Event and Hardware globals
101 ******************************************************************************/
103 struct acpi_bit_register_info acpi_gbl_bit_register_info
[ACPI_NUM_BITREG
] = {
104 /* Name Parent Register Register Bit Position Register Bit Mask */
106 /* ACPI_BITREG_TIMER_STATUS */ {ACPI_REGISTER_PM1_STATUS
,
107 ACPI_BITPOSITION_TIMER_STATUS
,
108 ACPI_BITMASK_TIMER_STATUS
},
109 /* ACPI_BITREG_BUS_MASTER_STATUS */ {ACPI_REGISTER_PM1_STATUS
,
110 ACPI_BITPOSITION_BUS_MASTER_STATUS
,
111 ACPI_BITMASK_BUS_MASTER_STATUS
},
112 /* ACPI_BITREG_GLOBAL_LOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS
,
113 ACPI_BITPOSITION_GLOBAL_LOCK_STATUS
,
114 ACPI_BITMASK_GLOBAL_LOCK_STATUS
},
115 /* ACPI_BITREG_POWER_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS
,
116 ACPI_BITPOSITION_POWER_BUTTON_STATUS
,
117 ACPI_BITMASK_POWER_BUTTON_STATUS
},
118 /* ACPI_BITREG_SLEEP_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS
,
119 ACPI_BITPOSITION_SLEEP_BUTTON_STATUS
,
120 ACPI_BITMASK_SLEEP_BUTTON_STATUS
},
121 /* ACPI_BITREG_RT_CLOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS
,
122 ACPI_BITPOSITION_RT_CLOCK_STATUS
,
123 ACPI_BITMASK_RT_CLOCK_STATUS
},
124 /* ACPI_BITREG_WAKE_STATUS */ {ACPI_REGISTER_PM1_STATUS
,
125 ACPI_BITPOSITION_WAKE_STATUS
,
126 ACPI_BITMASK_WAKE_STATUS
},
127 /* ACPI_BITREG_PCIEXP_WAKE_STATUS */ {ACPI_REGISTER_PM1_STATUS
,
128 ACPI_BITPOSITION_PCIEXP_WAKE_STATUS
,
129 ACPI_BITMASK_PCIEXP_WAKE_STATUS
},
131 /* ACPI_BITREG_TIMER_ENABLE */ {ACPI_REGISTER_PM1_ENABLE
,
132 ACPI_BITPOSITION_TIMER_ENABLE
,
133 ACPI_BITMASK_TIMER_ENABLE
},
134 /* ACPI_BITREG_GLOBAL_LOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE
,
135 ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE
,
136 ACPI_BITMASK_GLOBAL_LOCK_ENABLE
},
137 /* ACPI_BITREG_POWER_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE
,
138 ACPI_BITPOSITION_POWER_BUTTON_ENABLE
,
139 ACPI_BITMASK_POWER_BUTTON_ENABLE
},
140 /* ACPI_BITREG_SLEEP_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE
,
141 ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE
,
142 ACPI_BITMASK_SLEEP_BUTTON_ENABLE
},
143 /* ACPI_BITREG_RT_CLOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE
,
144 ACPI_BITPOSITION_RT_CLOCK_ENABLE
,
145 ACPI_BITMASK_RT_CLOCK_ENABLE
},
146 /* ACPI_BITREG_PCIEXP_WAKE_DISABLE */ {ACPI_REGISTER_PM1_ENABLE
,
147 ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE
,
148 ACPI_BITMASK_PCIEXP_WAKE_DISABLE
},
150 /* ACPI_BITREG_SCI_ENABLE */ {ACPI_REGISTER_PM1_CONTROL
,
151 ACPI_BITPOSITION_SCI_ENABLE
,
152 ACPI_BITMASK_SCI_ENABLE
},
153 /* ACPI_BITREG_BUS_MASTER_RLD */ {ACPI_REGISTER_PM1_CONTROL
,
154 ACPI_BITPOSITION_BUS_MASTER_RLD
,
155 ACPI_BITMASK_BUS_MASTER_RLD
},
156 /* ACPI_BITREG_GLOBAL_LOCK_RELEASE */ {ACPI_REGISTER_PM1_CONTROL
,
157 ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE
,
158 ACPI_BITMASK_GLOBAL_LOCK_RELEASE
},
159 /* ACPI_BITREG_SLEEP_TYPE */ {ACPI_REGISTER_PM1_CONTROL
,
160 ACPI_BITPOSITION_SLEEP_TYPE
,
161 ACPI_BITMASK_SLEEP_TYPE
},
162 /* ACPI_BITREG_SLEEP_ENABLE */ {ACPI_REGISTER_PM1_CONTROL
,
163 ACPI_BITPOSITION_SLEEP_ENABLE
,
164 ACPI_BITMASK_SLEEP_ENABLE
},
166 /* ACPI_BITREG_ARB_DIS */ {ACPI_REGISTER_PM2_CONTROL
,
167 ACPI_BITPOSITION_ARB_DISABLE
,
168 ACPI_BITMASK_ARB_DISABLE
}
171 struct acpi_fixed_event_info acpi_gbl_fixed_event_info
[ACPI_NUM_FIXED_EVENTS
] = {
172 /* ACPI_EVENT_PMTIMER */ {ACPI_BITREG_TIMER_STATUS
,
173 ACPI_BITREG_TIMER_ENABLE
,
174 ACPI_BITMASK_TIMER_STATUS
,
175 ACPI_BITMASK_TIMER_ENABLE
},
176 /* ACPI_EVENT_GLOBAL */ {ACPI_BITREG_GLOBAL_LOCK_STATUS
,
177 ACPI_BITREG_GLOBAL_LOCK_ENABLE
,
178 ACPI_BITMASK_GLOBAL_LOCK_STATUS
,
179 ACPI_BITMASK_GLOBAL_LOCK_ENABLE
},
180 /* ACPI_EVENT_POWER_BUTTON */ {ACPI_BITREG_POWER_BUTTON_STATUS
,
181 ACPI_BITREG_POWER_BUTTON_ENABLE
,
182 ACPI_BITMASK_POWER_BUTTON_STATUS
,
183 ACPI_BITMASK_POWER_BUTTON_ENABLE
},
184 /* ACPI_EVENT_SLEEP_BUTTON */ {ACPI_BITREG_SLEEP_BUTTON_STATUS
,
185 ACPI_BITREG_SLEEP_BUTTON_ENABLE
,
186 ACPI_BITMASK_SLEEP_BUTTON_STATUS
,
187 ACPI_BITMASK_SLEEP_BUTTON_ENABLE
},
188 /* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS
,
189 ACPI_BITREG_RT_CLOCK_ENABLE
,
190 ACPI_BITMASK_RT_CLOCK_STATUS
,
191 ACPI_BITMASK_RT_CLOCK_ENABLE
},
193 #endif /* !ACPI_REDUCED_HARDWARE */
195 #if defined (ACPI_DISASSEMBLER) || defined (ACPI_ASL_COMPILER)
197 /* to_pld macro: compile/disassemble strings */
199 const char *acpi_gbl_pld_panel_list
[] = {
210 const char *acpi_gbl_pld_vertical_position_list
[] = {
217 const char *acpi_gbl_pld_horizontal_position_list
[] = {
224 const char *acpi_gbl_pld_shape_list
[] = {
229 "HORIZONTALRECTANGLE",
231 "HORIZONTALTRAPEZOID",
240 ACPI_EXPORT_SYMBOL(acpi_gbl_FADT
)
241 ACPI_EXPORT_SYMBOL(acpi_dbg_level
)
242 ACPI_EXPORT_SYMBOL(acpi_dbg_layer
)
243 ACPI_EXPORT_SYMBOL(acpi_gpe_count
)
244 ACPI_EXPORT_SYMBOL(acpi_current_gpe_count
)