diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-05-27 12:11:38 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-05-27 12:11:38 -0400 |
commit | c9b77a4070a60762aee048e3c353d72fb990f940 (patch) | |
tree | 7820cae684404d2bd26814a327f0e2809724dd33 /include/acpi | |
parent | 85dbd5801f62b66e2aa7826aaefcaebead44c8a6 (diff) | |
parent | bc381eebd4b246d6cc29d97ab34d2c54ecc40a87 (diff) |
Merge back earlier ACPICA material.
Conflicts:
drivers/acpi/acpica/acglobal.h
Diffstat (limited to 'include/acpi')
-rw-r--r-- | include/acpi/acnames.h | 1 | ||||
-rw-r--r-- | include/acpi/acpixf.h | 831 | ||||
-rw-r--r-- | include/acpi/actbl.h | 11 | ||||
-rw-r--r-- | include/acpi/actbl1.h | 4 | ||||
-rw-r--r-- | include/acpi/actbl2.h | 71 | ||||
-rw-r--r-- | include/acpi/actypes.h | 21 | ||||
-rw-r--r-- | include/acpi/platform/acgcc.h | 11 | ||||
-rw-r--r-- | include/acpi/platform/aclinux.h | 36 |
8 files changed, 700 insertions, 286 deletions
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h index 3dd6e838dc30..f0e713fadb1f 100644 --- a/include/acpi/acnames.h +++ b/include/acpi/acnames.h | |||
@@ -55,6 +55,7 @@ | |||
55 | #define METHOD_NAME__HID "_HID" | 55 | #define METHOD_NAME__HID "_HID" |
56 | #define METHOD_NAME__INI "_INI" | 56 | #define METHOD_NAME__INI "_INI" |
57 | #define METHOD_NAME__PLD "_PLD" | 57 | #define METHOD_NAME__PLD "_PLD" |
58 | #define METHOD_NAME__PRP "_PRP" | ||
58 | #define METHOD_NAME__PRS "_PRS" | 59 | #define METHOD_NAME__PRS "_PRS" |
59 | #define METHOD_NAME__PRT "_PRT" | 60 | #define METHOD_NAME__PRT "_PRT" |
60 | #define METHOD_NAME__PRW "_PRW" | 61 | #define METHOD_NAME__PRW "_PRW" |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 44f5e9749601..b5f7132f431f 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -46,7 +46,7 @@ | |||
46 | 46 | ||
47 | /* Current ACPICA subsystem version in YYYYMMDD format */ | 47 | /* Current ACPICA subsystem version in YYYYMMDD format */ |
48 | 48 | ||
49 | #define ACPI_CA_VERSION 0x20140214 | 49 | #define ACPI_CA_VERSION 0x20140424 |
50 | 50 | ||
51 | #include <acpi/acconfig.h> | 51 | #include <acpi/acconfig.h> |
52 | #include <acpi/actypes.h> | 52 | #include <acpi/actypes.h> |
@@ -55,233 +55,469 @@ | |||
55 | 55 | ||
56 | extern u8 acpi_gbl_permanent_mmap; | 56 | extern u8 acpi_gbl_permanent_mmap; |
57 | 57 | ||
58 | /***************************************************************************** | ||
59 | * | ||
60 | * Macros used for ACPICA globals and configuration | ||
61 | * | ||
62 | ****************************************************************************/ | ||
63 | |||
58 | /* | 64 | /* |
59 | * Globals that are publically available | 65 | * Ensure that global variables are defined and initialized only once. |
66 | * | ||
67 | * The use of these macros allows for a single list of globals (here) | ||
68 | * in order to simplify maintenance of the code. | ||
60 | */ | 69 | */ |
61 | extern u32 acpi_current_gpe_count; | 70 | #ifdef DEFINE_ACPI_GLOBALS |
62 | extern struct acpi_table_fadt acpi_gbl_FADT; | 71 | #define ACPI_GLOBAL(type,name) \ |
63 | extern u8 acpi_gbl_system_awake_and_running; | 72 | extern type name; \ |
64 | extern u8 acpi_gbl_reduced_hardware; /* ACPI 5.0 */ | 73 | type name |
65 | extern u8 acpi_gbl_osi_data; | ||
66 | 74 | ||
67 | /* Runtime configuration of debug print levels */ | 75 | #define ACPI_INIT_GLOBAL(type,name,value) \ |
76 | type name=value | ||
68 | 77 | ||
69 | extern u32 acpi_dbg_level; | 78 | #else |
70 | extern u32 acpi_dbg_layer; | 79 | #ifndef ACPI_GLOBAL |
71 | 80 | #define ACPI_GLOBAL(type,name) \ | |
72 | /* ACPICA runtime options */ | 81 | extern type name |
82 | #endif | ||
73 | 83 | ||
74 | extern u8 acpi_gbl_auto_serialize_methods; | 84 | #ifndef ACPI_INIT_GLOBAL |
75 | extern u8 acpi_gbl_copy_dsdt_locally; | 85 | #define ACPI_INIT_GLOBAL(type,name,value) \ |
76 | extern u8 acpi_gbl_create_osi_method; | 86 | extern type name |
77 | extern u8 acpi_gbl_disable_auto_repair; | 87 | #endif |
78 | extern u8 acpi_gbl_disable_ssdt_table_load; | 88 | #endif |
79 | extern u8 acpi_gbl_do_not_use_xsdt; | ||
80 | extern u8 acpi_gbl_enable_aml_debug_object; | ||
81 | extern u8 acpi_gbl_enable_interpreter_slack; | ||
82 | extern u32 acpi_gbl_trace_flags; | ||
83 | extern acpi_name acpi_gbl_trace_method_name; | ||
84 | extern u8 acpi_gbl_truncate_io_addresses; | ||
85 | extern u8 acpi_gbl_use32_bit_fadt_addresses; | ||
86 | extern u8 acpi_gbl_use_default_register_widths; | ||
87 | 89 | ||
88 | /* | 90 | /* |
89 | * Hardware-reduced prototypes. All interfaces that use these macros will | 91 | * These macros configure the various ACPICA interfaces. They are |
90 | * be configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag | 92 | * useful for generating stub inline functions for features that are |
91 | * is set to TRUE. | 93 | * configured out of the current kernel or ACPICA application. |
92 | */ | 94 | */ |
93 | #if (!ACPI_REDUCED_HARDWARE) | 95 | #ifndef ACPI_EXTERNAL_RETURN_STATUS |
94 | #define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \ | 96 | #define ACPI_EXTERNAL_RETURN_STATUS(prototype) \ |
95 | prototype; | 97 | prototype; |
98 | #endif | ||
96 | 99 | ||
97 | #define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \ | 100 | #ifndef ACPI_EXTERNAL_RETURN_OK |
101 | #define ACPI_EXTERNAL_RETURN_OK(prototype) \ | ||
98 | prototype; | 102 | prototype; |
103 | #endif | ||
99 | 104 | ||
100 | #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \ | 105 | #ifndef ACPI_EXTERNAL_RETURN_VOID |
106 | #define ACPI_EXTERNAL_RETURN_VOID(prototype) \ | ||
101 | prototype; | 107 | prototype; |
108 | #endif | ||
102 | 109 | ||
103 | #else | 110 | #ifndef ACPI_EXTERNAL_RETURN_UINT32 |
104 | #define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \ | 111 | #define ACPI_EXTERNAL_RETURN_UINT32(prototype) \ |
105 | static ACPI_INLINE prototype {return(AE_NOT_CONFIGURED);} | 112 | prototype; |
106 | 113 | #endif | |
107 | #define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \ | ||
108 | static ACPI_INLINE prototype {return(AE_OK);} | ||
109 | 114 | ||
110 | #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \ | 115 | #ifndef ACPI_EXTERNAL_RETURN_PTR |
111 | static ACPI_INLINE prototype {return;} | 116 | #define ACPI_EXTERNAL_RETURN_PTR(prototype) \ |
117 | prototype; | ||
118 | #endif | ||
112 | 119 | ||
113 | #endif /* !ACPI_REDUCED_HARDWARE */ | 120 | /***************************************************************************** |
121 | * | ||
122 | * Public globals and runtime configuration options | ||
123 | * | ||
124 | ****************************************************************************/ | ||
114 | 125 | ||
115 | /* | 126 | /* |
116 | * Initialization | 127 | * Enable "slack mode" of the AML interpreter? Default is FALSE, and the |
128 | * interpreter strictly follows the ACPI specification. Setting to TRUE | ||
129 | * allows the interpreter to ignore certain errors and/or bad AML constructs. | ||
130 | * | ||
131 | * Currently, these features are enabled by this flag: | ||
132 | * | ||
133 | * 1) Allow "implicit return" of last value in a control method | ||
134 | * 2) Allow access beyond the end of an operation region | ||
135 | * 3) Allow access to uninitialized locals/args (auto-init to integer 0) | ||
136 | * 4) Allow ANY object type to be a source operand for the Store() operator | ||
137 | * 5) Allow unresolved references (invalid target name) in package objects | ||
138 | * 6) Enable warning messages for behavior that is not ACPI spec compliant | ||
117 | */ | 139 | */ |
118 | acpi_status __init | 140 | ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_interpreter_slack, FALSE); |
119 | acpi_initialize_tables(struct acpi_table_desc *initial_storage, | ||
120 | u32 initial_table_count, u8 allow_resize); | ||
121 | |||
122 | acpi_status __init acpi_initialize_subsystem(void); | ||
123 | |||
124 | acpi_status __init acpi_enable_subsystem(u32 flags); | ||
125 | 141 | ||
126 | acpi_status __init acpi_initialize_objects(u32 flags); | 142 | /* |
127 | 143 | * Automatically serialize all methods that create named objects? Default | |
128 | acpi_status __init acpi_terminate(void); | 144 | * is TRUE, meaning that all non_serialized methods are scanned once at |
145 | * table load time to determine those that create named objects. Methods | ||
146 | * that create named objects are marked Serialized in order to prevent | ||
147 | * possible run-time problems if they are entered by more than one thread. | ||
148 | */ | ||
149 | ACPI_INIT_GLOBAL(u8, acpi_gbl_auto_serialize_methods, TRUE); | ||
129 | 150 | ||
130 | /* | 151 | /* |
131 | * Miscellaneous global interfaces | 152 | * Create the predefined _OSI method in the namespace? Default is TRUE |
153 | * because ACPICA is fully compatible with other ACPI implementations. | ||
154 | * Changing this will revert ACPICA (and machine ASL) to pre-OSI behavior. | ||
132 | */ | 155 | */ |
133 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void)) | 156 | ACPI_INIT_GLOBAL(u8, acpi_gbl_create_osi_method, TRUE); |
134 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void)) | ||
135 | #ifdef ACPI_FUTURE_USAGE | ||
136 | acpi_status acpi_subsystem_status(void); | ||
137 | #endif | ||
138 | 157 | ||
139 | #ifdef ACPI_FUTURE_USAGE | 158 | /* |
140 | acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer); | 159 | * Optionally use default values for the ACPI register widths. Set this to |
141 | #endif | 160 | * TRUE to use the defaults, if an FADT contains incorrect widths/lengths. |
161 | */ | ||
162 | ACPI_INIT_GLOBAL(u8, acpi_gbl_use_default_register_widths, TRUE); | ||
142 | 163 | ||
143 | acpi_status acpi_get_statistics(struct acpi_statistics *stats); | 164 | /* |
165 | * Optionally enable output from the AML Debug Object. | ||
166 | */ | ||
167 | ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_aml_debug_object, FALSE); | ||
144 | 168 | ||
145 | const char *acpi_format_exception(acpi_status exception); | 169 | /* |
170 | * Optionally copy the entire DSDT to local memory (instead of simply | ||
171 | * mapping it.) There are some BIOSs that corrupt or replace the original | ||
172 | * DSDT, creating the need for this option. Default is FALSE, do not copy | ||
173 | * the DSDT. | ||
174 | */ | ||
175 | ACPI_INIT_GLOBAL(u8, acpi_gbl_copy_dsdt_locally, FALSE); | ||
146 | 176 | ||
147 | acpi_status acpi_purge_cached_objects(void); | 177 | /* |
178 | * Optionally ignore an XSDT if present and use the RSDT instead. | ||
179 | * Although the ACPI specification requires that an XSDT be used instead | ||
180 | * of the RSDT, the XSDT has been found to be corrupt or ill-formed on | ||
181 | * some machines. Default behavior is to use the XSDT if present. | ||
182 | */ | ||
183 | ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt, FALSE); | ||
148 | 184 | ||
149 | acpi_status acpi_install_interface(acpi_string interface_name); | 185 | /* |
186 | * Optionally use 32-bit FADT addresses if and when there is a conflict | ||
187 | * (address mismatch) between the 32-bit and 64-bit versions of the | ||
188 | * address. Although ACPICA adheres to the ACPI specification which | ||
189 | * requires the use of the corresponding 64-bit address if it is non-zero, | ||
190 | * some machines have been found to have a corrupted non-zero 64-bit | ||
191 | * address. Default is TRUE, favor the 32-bit addresses. | ||
192 | */ | ||
193 | ACPI_INIT_GLOBAL(u8, acpi_gbl_use32_bit_fadt_addresses, TRUE); | ||
150 | 194 | ||
151 | acpi_status acpi_remove_interface(acpi_string interface_name); | 195 | /* |
196 | * Optionally truncate I/O addresses to 16 bits. Provides compatibility | ||
197 | * with other ACPI implementations. NOTE: During ACPICA initialization, | ||
198 | * this value is set to TRUE if any Windows OSI strings have been | ||
199 | * requested by the BIOS. | ||
200 | */ | ||
201 | ACPI_INIT_GLOBAL(u8, acpi_gbl_truncate_io_addresses, FALSE); | ||
152 | 202 | ||
153 | acpi_status acpi_update_interfaces(u8 action); | 203 | /* |
204 | * Disable runtime checking and repair of values returned by control methods. | ||
205 | * Use only if the repair is causing a problem on a particular machine. | ||
206 | */ | ||
207 | ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_auto_repair, FALSE); | ||
154 | 208 | ||
155 | u32 | 209 | /* |
156 | acpi_check_address_range(acpi_adr_space_type space_id, | 210 | * Optionally do not install any SSDTs from the RSDT/XSDT during initialization. |
157 | acpi_physical_address address, | 211 | * This can be useful for debugging ACPI problems on some machines. |
158 | acpi_size length, u8 warn); | 212 | */ |
213 | ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_ssdt_table_install, FALSE); | ||
159 | 214 | ||
160 | acpi_status | 215 | /* |
161 | acpi_decode_pld_buffer(u8 *in_buffer, | 216 | * We keep track of the latest version of Windows that has been requested by |
162 | acpi_size length, struct acpi_pld_info **return_buffer); | 217 | * the BIOS. ACPI 5.0. |
218 | */ | ||
219 | ACPI_INIT_GLOBAL(u8, acpi_gbl_osi_data, 0); | ||
163 | 220 | ||
164 | /* | 221 | /* |
165 | * ACPI table load/unload interfaces | 222 | * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning |
223 | * that the ACPI hardware is no longer required. A flag in the FADT indicates | ||
224 | * a reduced HW machine, and that flag is duplicated here for convenience. | ||
166 | */ | 225 | */ |
167 | acpi_status acpi_load_table(struct acpi_table_header *table); | 226 | ACPI_INIT_GLOBAL(u8, acpi_gbl_reduced_hardware, FALSE); |
168 | 227 | ||
169 | acpi_status acpi_unload_parent_table(acpi_handle object); | 228 | /* |
229 | * This mechanism is used to trace a specified AML method. The method is | ||
230 | * traced each time it is executed. | ||
231 | */ | ||
232 | ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_flags, 0); | ||
233 | ACPI_INIT_GLOBAL(acpi_name, acpi_gbl_trace_method_name, 0); | ||
170 | 234 | ||
171 | acpi_status __init acpi_load_tables(void); | 235 | /* |
236 | * Runtime configuration of debug output control masks. We want the debug | ||
237 | * switches statically initialized so they are already set when the debugger | ||
238 | * is entered. | ||
239 | */ | ||
240 | ACPI_INIT_GLOBAL(u32, acpi_dbg_level, ACPI_DEBUG_DEFAULT); | ||
241 | ACPI_INIT_GLOBAL(u32, acpi_dbg_layer, 0); | ||
172 | 242 | ||
173 | /* | 243 | /* |
174 | * ACPI table manipulation interfaces | 244 | * Other miscellaneous globals |
175 | */ | 245 | */ |
176 | acpi_status __init acpi_reallocate_root_table(void); | 246 | ACPI_GLOBAL(struct acpi_table_fadt, acpi_gbl_FADT); |
247 | ACPI_GLOBAL(u32, acpi_current_gpe_count); | ||
248 | ACPI_GLOBAL(u8, acpi_gbl_system_awake_and_running); | ||
177 | 249 | ||
178 | acpi_status __init acpi_find_root_pointer(acpi_size *rsdp_address); | 250 | /***************************************************************************** |
251 | * | ||
252 | * ACPICA public interface configuration. | ||
253 | * | ||
254 | * Interfaces that are configured out of the ACPICA build are replaced | ||
255 | * by inlined stubs by default. | ||
256 | * | ||
257 | ****************************************************************************/ | ||
179 | 258 | ||
180 | acpi_status acpi_unload_table_id(acpi_owner_id id); | 259 | /* |
260 | * Hardware-reduced prototypes (default: Not hardware reduced). | ||
261 | * | ||
262 | * All ACPICA hardware-related interfaces that use these macros will be | ||
263 | * configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag | ||
264 | * is set to TRUE. | ||
265 | * | ||
266 | * Note: This static build option for reduced hardware is intended to | ||
267 | * reduce ACPICA code size if desired or necessary. However, even if this | ||
268 | * option is not specified, the runtime behavior of ACPICA is dependent | ||
269 | * on the actual FADT reduced hardware flag (HW_REDUCED_ACPI). If set, | ||
270 | * the flag will enable similar behavior -- ACPICA will not attempt | ||
271 | * to access any ACPI-relate hardware (SCI, GPEs, Fixed Events, etc.) | ||
272 | */ | ||
273 | #if (!ACPI_REDUCED_HARDWARE) | ||
274 | #define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \ | ||
275 | ACPI_EXTERNAL_RETURN_STATUS(prototype) | ||
181 | 276 | ||
182 | acpi_status | 277 | #define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \ |
183 | acpi_get_table_header(acpi_string signature, | 278 | ACPI_EXTERNAL_RETURN_OK(prototype) |
184 | u32 instance, struct acpi_table_header *out_table_header); | ||
185 | 279 | ||
186 | acpi_status | 280 | #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \ |
187 | acpi_get_table_with_size(acpi_string signature, | 281 | ACPI_EXTERNAL_RETURN_VOID(prototype) |
188 | u32 instance, struct acpi_table_header **out_table, | ||
189 | acpi_size *tbl_size); | ||
190 | 282 | ||
191 | acpi_status | 283 | #else |
192 | acpi_get_table(acpi_string signature, | 284 | #define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \ |
193 | u32 instance, struct acpi_table_header **out_table); | 285 | static ACPI_INLINE prototype {return(AE_NOT_CONFIGURED);} |
194 | 286 | ||
195 | acpi_status | 287 | #define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \ |
196 | acpi_get_table_by_index(u32 table_index, struct acpi_table_header **out_table); | 288 | static ACPI_INLINE prototype {return(AE_OK);} |
197 | 289 | ||
198 | acpi_status | 290 | #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \ |
199 | acpi_install_table_handler(acpi_table_handler handler, void *context); | 291 | static ACPI_INLINE prototype {return;} |
200 | 292 | ||
201 | acpi_status acpi_remove_table_handler(acpi_table_handler handler); | 293 | #endif /* !ACPI_REDUCED_HARDWARE */ |
202 | 294 | ||
203 | /* | 295 | /* |
204 | * Namespace and name interfaces | 296 | * Error message prototypes (default: error messages enabled). |
297 | * | ||
298 | * All interfaces related to error and warning messages | ||
299 | * will be configured out of the ACPICA build if the | ||
300 | * ACPI_NO_ERROR_MESSAGE flag is defined. | ||
205 | */ | 301 | */ |
206 | acpi_status | 302 | #ifndef ACPI_NO_ERROR_MESSAGES |
207 | acpi_walk_namespace(acpi_object_type type, | 303 | #define ACPI_MSG_DEPENDENT_RETURN_VOID(prototype) \ |
208 | acpi_handle start_object, | 304 | prototype; |
209 | u32 max_depth, | ||
210 | acpi_walk_callback descending_callback, | ||
211 | acpi_walk_callback ascending_callback, | ||
212 | void *context, void **return_value); | ||
213 | 305 | ||
214 | acpi_status | 306 | #else |
215 | acpi_get_devices(const char *HID, | 307 | #define ACPI_MSG_DEPENDENT_RETURN_VOID(prototype) \ |
216 | acpi_walk_callback user_function, | 308 | static ACPI_INLINE prototype {return;} |
217 | void *context, void **return_value); | ||
218 | 309 | ||
219 | acpi_status | 310 | #endif /* ACPI_NO_ERROR_MESSAGES */ |
220 | acpi_get_name(acpi_handle object, | ||
221 | u32 name_type, struct acpi_buffer *ret_path_ptr); | ||
222 | 311 | ||
223 | acpi_status | 312 | /* |
224 | acpi_get_handle(acpi_handle parent, | 313 | * Debugging output prototypes (default: no debug output). |
225 | acpi_string pathname, acpi_handle * ret_handle); | 314 | * |
315 | * All interfaces related to debug output messages | ||
316 | * will be configured out of the ACPICA build unless the | ||
317 | * ACPI_DEBUG_OUTPUT flag is defined. | ||
318 | */ | ||
319 | #ifdef ACPI_DEBUG_OUTPUT | ||
320 | #define ACPI_DBG_DEPENDENT_RETURN_VOID(prototype) \ | ||
321 | prototype; | ||
226 | 322 | ||
227 | acpi_status | 323 | #else |
228 | acpi_attach_data(acpi_handle object, acpi_object_handler handler, void *data); | 324 | #define ACPI_DBG_DEPENDENT_RETURN_VOID(prototype) \ |
325 | static ACPI_INLINE prototype {return;} | ||
229 | 326 | ||
230 | acpi_status acpi_detach_data(acpi_handle object, acpi_object_handler handler); | 327 | #endif /* ACPI_DEBUG_OUTPUT */ |
231 | 328 | ||
232 | acpi_status | 329 | /***************************************************************************** |
233 | acpi_get_data_full(acpi_handle object, acpi_object_handler handler, void **data, | 330 | * |
234 | void (*callback)(void *)); | 331 | * ACPICA public interface prototypes |
332 | * | ||
333 | ****************************************************************************/ | ||
235 | 334 | ||
236 | acpi_status | 335 | /* |
237 | acpi_get_data(acpi_handle object, acpi_object_handler handler, void **data); | 336 | * Initialization |
337 | */ | ||
338 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init | ||
339 | acpi_initialize_tables(struct acpi_table_desc | ||
340 | *initial_storage, | ||
341 | u32 initial_table_count, | ||
342 | u8 allow_resize)) | ||
343 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_initialize_subsystem(void)) | ||
238 | 344 | ||
239 | acpi_status | 345 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_enable_subsystem(u32 flags)) |
240 | acpi_debug_trace(char *name, u32 debug_level, u32 debug_layer, u32 flags); | 346 | |
347 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init | ||
348 | acpi_initialize_objects(u32 flags)) | ||
349 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_terminate(void)) | ||
241 | 350 | ||
242 | /* | 351 | /* |
243 | * Object manipulation and enumeration | 352 | * Miscellaneous global interfaces |
244 | */ | 353 | */ |
245 | acpi_status | 354 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void)) |
246 | acpi_evaluate_object(acpi_handle object, | 355 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void)) |
247 | acpi_string pathname, | 356 | #ifdef ACPI_FUTURE_USAGE |
248 | struct acpi_object_list *parameter_objects, | 357 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_subsystem_status(void)) |
249 | struct acpi_buffer *return_object_buffer); | 358 | #endif |
250 | 359 | ||
251 | acpi_status | 360 | #ifdef ACPI_FUTURE_USAGE |
252 | acpi_evaluate_object_typed(acpi_handle object, | 361 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
253 | acpi_string pathname, | 362 | acpi_get_system_info(struct acpi_buffer |
254 | struct acpi_object_list *external_params, | 363 | *ret_buffer)) |
255 | struct acpi_buffer *return_buffer, | 364 | #endif |
256 | acpi_object_type return_type); | 365 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
366 | acpi_get_statistics(struct acpi_statistics *stats)) | ||
367 | ACPI_EXTERNAL_RETURN_PTR(const char | ||
368 | *acpi_format_exception(acpi_status exception)) | ||
369 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_purge_cached_objects(void)) | ||
370 | |||
371 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
372 | acpi_install_interface(acpi_string interface_name)) | ||
373 | |||
374 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
375 | acpi_remove_interface(acpi_string interface_name)) | ||
376 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_update_interfaces(u8 action)) | ||
377 | |||
378 | ACPI_EXTERNAL_RETURN_UINT32(u32 | ||
379 | acpi_check_address_range(acpi_adr_space_type | ||
380 | space_id, | ||
381 | acpi_physical_address | ||
382 | address, acpi_size length, | ||
383 | u8 warn)) | ||
384 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
385 | acpi_decode_pld_buffer(u8 *in_buffer, | ||
386 | acpi_size length, | ||
387 | struct acpi_pld_info | ||
388 | **return_buffer)) | ||
257 | 389 | ||
258 | acpi_status | 390 | /* |
259 | acpi_get_object_info(acpi_handle object, | 391 | * ACPI table load/unload interfaces |
260 | struct acpi_device_info **return_buffer); | 392 | */ |
393 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init | ||
394 | acpi_install_table(acpi_physical_address address, | ||
395 | u8 physical)) | ||
261 | 396 | ||
262 | acpi_status acpi_install_method(u8 *buffer); | 397 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
398 | acpi_load_table(struct acpi_table_header *table)) | ||
263 | 399 | ||
264 | acpi_status | 400 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
265 | acpi_get_next_object(acpi_object_type type, | 401 | acpi_unload_parent_table(acpi_handle object)) |
266 | acpi_handle parent, | 402 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_load_tables(void)) |
267 | acpi_handle child, acpi_handle * out_handle); | ||
268 | 403 | ||
269 | acpi_status acpi_get_type(acpi_handle object, acpi_object_type * out_type); | 404 | /* |
405 | * ACPI table manipulation interfaces | ||
406 | */ | ||
407 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_reallocate_root_table(void)) | ||
408 | |||
409 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init | ||
410 | acpi_find_root_pointer(acpi_size * rsdp_address)) | ||
411 | |||
412 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
413 | acpi_get_table_header(acpi_string signature, | ||
414 | u32 instance, | ||
415 | struct acpi_table_header | ||
416 | *out_table_header)) | ||
417 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
418 | acpi_get_table(acpi_string signature, u32 instance, | ||
419 | struct acpi_table_header | ||
420 | **out_table)) | ||
421 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
422 | acpi_get_table_by_index(u32 table_index, | ||
423 | struct acpi_table_header | ||
424 | **out_table)) | ||
425 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
426 | acpi_install_table_handler(acpi_table_handler | ||
427 | handler, void *context)) | ||
428 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
429 | acpi_remove_table_handler(acpi_table_handler | ||
430 | handler)) | ||
270 | 431 | ||
271 | acpi_status acpi_get_id(acpi_handle object, acpi_owner_id * out_type); | 432 | /* |
433 | * Namespace and name interfaces | ||
434 | */ | ||
435 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
436 | acpi_walk_namespace(acpi_object_type type, | ||
437 | acpi_handle start_object, | ||
438 | u32 max_depth, | ||
439 | acpi_walk_callback | ||
440 | descending_callback, | ||
441 | acpi_walk_callback | ||
442 | ascending_callback, | ||
443 | void *context, | ||
444 | void **return_value)) | ||
445 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
446 | acpi_get_devices(const char *HID, | ||
447 | acpi_walk_callback user_function, | ||
448 | void *context, | ||
449 | void **return_value)) | ||
450 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
451 | acpi_get_name(acpi_handle object, u32 name_type, | ||
452 | struct acpi_buffer *ret_path_ptr)) | ||
453 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
454 | acpi_get_handle(acpi_handle parent, | ||
455 | acpi_string pathname, | ||
456 | acpi_handle * ret_handle)) | ||
457 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
458 | acpi_attach_data(acpi_handle object, | ||
459 | acpi_object_handler handler, | ||
460 | void *data)) | ||
461 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
462 | acpi_detach_data(acpi_handle object, | ||
463 | acpi_object_handler handler)) | ||
464 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
465 | acpi_get_data(acpi_handle object, | ||
466 | acpi_object_handler handler, | ||
467 | void **data)) | ||
468 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
469 | acpi_debug_trace(char *name, u32 debug_level, | ||
470 | u32 debug_layer, u32 flags)) | ||
272 | 471 | ||
273 | acpi_status acpi_get_parent(acpi_handle object, acpi_handle * out_handle); | 472 | /* |
473 | * Object manipulation and enumeration | ||
474 | */ | ||
475 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
476 | acpi_evaluate_object(acpi_handle object, | ||
477 | acpi_string pathname, | ||
478 | struct acpi_object_list | ||
479 | *parameter_objects, | ||
480 | struct acpi_buffer | ||
481 | *return_object_buffer)) | ||
482 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
483 | acpi_evaluate_object_typed(acpi_handle object, | ||
484 | acpi_string pathname, | ||
485 | struct acpi_object_list | ||
486 | *external_params, | ||
487 | struct acpi_buffer | ||
488 | *return_buffer, | ||
489 | acpi_object_type | ||
490 | return_type)) | ||
491 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
492 | acpi_get_object_info(acpi_handle object, | ||
493 | struct acpi_device_info | ||
494 | **return_buffer)) | ||
495 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_install_method(u8 *buffer)) | ||
496 | |||
497 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
498 | acpi_get_next_object(acpi_object_type type, | ||
499 | acpi_handle parent, | ||
500 | acpi_handle child, | ||
501 | acpi_handle * out_handle)) | ||
502 | |||
503 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
504 | acpi_get_type(acpi_handle object, | ||
505 | acpi_object_type * out_type)) | ||
506 | |||
507 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
508 | acpi_get_parent(acpi_handle object, | ||
509 | acpi_handle * out_handle)) | ||
274 | 510 | ||
275 | /* | 511 | /* |
276 | * Handler interfaces | 512 | * Handler interfaces |
277 | */ | 513 | */ |
278 | acpi_status | 514 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
279 | acpi_install_initialization_handler(acpi_init_handler handler, u32 function); | 515 | acpi_install_initialization_handler |
280 | 516 | (acpi_init_handler handler, u32 function)) | |
281 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 517 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
282 | acpi_install_sci_handler(acpi_sci_handler | 518 | acpi_install_sci_handler(acpi_sci_handler |
283 | address, | 519 | address, |
284 | void *context)) | 520 | void *context)) |
285 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 521 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
286 | acpi_remove_sci_handler(acpi_sci_handler | 522 | acpi_remove_sci_handler(acpi_sci_handler |
287 | address)) | 523 | address)) |
@@ -313,30 +549,42 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | |||
313 | u32 gpe_number, | 549 | u32 gpe_number, |
314 | acpi_gpe_handler | 550 | acpi_gpe_handler |
315 | address)) | 551 | address)) |
316 | acpi_status acpi_install_notify_handler(acpi_handle device, u32 handler_type, | 552 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
317 | acpi_notify_handler handler, | 553 | acpi_install_notify_handler(acpi_handle device, |
318 | void *context); | 554 | u32 handler_type, |
319 | 555 | acpi_notify_handler | |
320 | acpi_status | 556 | handler, |
321 | acpi_remove_notify_handler(acpi_handle device, | 557 | void *context)) |
322 | u32 handler_type, acpi_notify_handler handler); | 558 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
323 | 559 | acpi_remove_notify_handler(acpi_handle device, | |
324 | acpi_status | 560 | u32 handler_type, |
325 | acpi_install_address_space_handler(acpi_handle device, | 561 | acpi_notify_handler |
326 | acpi_adr_space_type space_id, | 562 | handler)) |
327 | acpi_adr_space_handler handler, | 563 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
328 | acpi_adr_space_setup setup, void *context); | 564 | acpi_install_address_space_handler(acpi_handle |
329 | 565 | device, | |
330 | acpi_status | 566 | acpi_adr_space_type |
331 | acpi_remove_address_space_handler(acpi_handle device, | 567 | space_id, |
332 | acpi_adr_space_type space_id, | 568 | acpi_adr_space_handler |
333 | acpi_adr_space_handler handler); | 569 | handler, |
334 | 570 | acpi_adr_space_setup | |
571 | setup, | ||
572 | void *context)) | ||
573 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
574 | acpi_remove_address_space_handler(acpi_handle | ||
575 | device, | ||
576 | acpi_adr_space_type | ||
577 | space_id, | ||
578 | acpi_adr_space_handler | ||
579 | handler)) | ||
335 | #ifdef ACPI_FUTURE_USAGE | 580 | #ifdef ACPI_FUTURE_USAGE |
336 | acpi_status acpi_install_exception_handler(acpi_exception_handler handler); | 581 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
582 | acpi_install_exception_handler | ||
583 | (acpi_exception_handler handler)) | ||
337 | #endif | 584 | #endif |
338 | 585 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | |
339 | acpi_status acpi_install_interface_handler(acpi_interface_handler handler); | 586 | acpi_install_interface_handler |
587 | (acpi_interface_handler handler)) | ||
340 | 588 | ||
341 | /* | 589 | /* |
342 | * Global Lock interfaces | 590 | * Global Lock interfaces |
@@ -351,10 +599,14 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | |||
351 | /* | 599 | /* |
352 | * Interfaces to AML mutex objects | 600 | * Interfaces to AML mutex objects |
353 | */ | 601 | */ |
354 | acpi_status | 602 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
355 | acpi_acquire_mutex(acpi_handle handle, acpi_string pathname, u16 timeout); | 603 | acpi_acquire_mutex(acpi_handle handle, |
604 | acpi_string pathname, | ||
605 | u16 timeout)) | ||
356 | 606 | ||
357 | acpi_status acpi_release_mutex(acpi_handle handle, acpi_string pathname); | 607 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
608 | acpi_release_mutex(acpi_handle handle, | ||
609 | acpi_string pathname)) | ||
358 | 610 | ||
359 | /* | 611 | /* |
360 | * Fixed Event interfaces | 612 | * Fixed Event interfaces |
@@ -434,57 +686,69 @@ typedef | |||
434 | acpi_status(*acpi_walk_resource_callback) (struct acpi_resource * resource, | 686 | acpi_status(*acpi_walk_resource_callback) (struct acpi_resource * resource, |
435 | void *context); | 687 | void *context); |
436 | 688 | ||
437 | acpi_status | 689 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
438 | acpi_get_vendor_resource(acpi_handle device, | 690 | acpi_get_vendor_resource(acpi_handle device, |
439 | char *name, | 691 | char *name, |
440 | struct acpi_vendor_uuid *uuid, | 692 | struct acpi_vendor_uuid |
441 | struct acpi_buffer *ret_buffer); | 693 | *uuid, |
442 | 694 | struct acpi_buffer | |
443 | acpi_status | 695 | *ret_buffer)) |
444 | acpi_get_current_resources(acpi_handle device, struct acpi_buffer *ret_buffer); | 696 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
445 | 697 | acpi_get_current_resources(acpi_handle device, | |
698 | struct acpi_buffer | ||
699 | *ret_buffer)) | ||
446 | #ifdef ACPI_FUTURE_USAGE | 700 | #ifdef ACPI_FUTURE_USAGE |
447 | acpi_status | 701 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
448 | acpi_get_possible_resources(acpi_handle device, struct acpi_buffer *ret_buffer); | 702 | acpi_get_possible_resources(acpi_handle device, |
703 | struct acpi_buffer | ||
704 | *ret_buffer)) | ||
449 | #endif | 705 | #endif |
450 | 706 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | |
451 | acpi_status | 707 | acpi_get_event_resources(acpi_handle device_handle, |
452 | acpi_get_event_resources(acpi_handle device_handle, | 708 | struct acpi_buffer |
453 | struct acpi_buffer *ret_buffer); | 709 | *ret_buffer)) |
454 | 710 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | |
455 | acpi_status | 711 | acpi_walk_resource_buffer(struct acpi_buffer |
456 | acpi_walk_resource_buffer(struct acpi_buffer *buffer, | 712 | *buffer, |
457 | acpi_walk_resource_callback user_function, | 713 | acpi_walk_resource_callback |
458 | void *context); | 714 | user_function, |
459 | 715 | void *context)) | |
460 | acpi_status | 716 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
461 | acpi_walk_resources(acpi_handle device, | 717 | acpi_walk_resources(acpi_handle device, char *name, |
462 | char *name, | 718 | acpi_walk_resource_callback |
463 | acpi_walk_resource_callback user_function, void *context); | 719 | user_function, void *context)) |
464 | 720 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | |
465 | acpi_status | 721 | acpi_set_current_resources(acpi_handle device, |
466 | acpi_set_current_resources(acpi_handle device, struct acpi_buffer *in_buffer); | 722 | struct acpi_buffer |
467 | 723 | *in_buffer)) | |
468 | acpi_status | 724 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
469 | acpi_get_irq_routing_table(acpi_handle device, struct acpi_buffer *ret_buffer); | 725 | acpi_get_irq_routing_table(acpi_handle device, |
470 | 726 | struct acpi_buffer | |
471 | acpi_status | 727 | *ret_buffer)) |
472 | acpi_resource_to_address64(struct acpi_resource *resource, | 728 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
473 | struct acpi_resource_address64 *out); | 729 | acpi_resource_to_address64(struct acpi_resource |
474 | 730 | *resource, | |
475 | acpi_status | 731 | struct |
476 | acpi_buffer_to_resource(u8 *aml_buffer, | 732 | acpi_resource_address64 |
477 | u16 aml_buffer_length, | 733 | *out)) |
478 | struct acpi_resource **resource_ptr); | 734 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
735 | acpi_buffer_to_resource(u8 *aml_buffer, | ||
736 | u16 aml_buffer_length, | ||
737 | struct acpi_resource | ||
738 | **resource_ptr)) | ||
479 | 739 | ||
480 | /* | 740 | /* |
481 | * Hardware (ACPI device) interfaces | 741 | * Hardware (ACPI device) interfaces |
482 | */ | 742 | */ |
483 | acpi_status acpi_reset(void); | 743 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_reset(void)) |
484 | 744 | ||
485 | acpi_status acpi_read(u64 *value, struct acpi_generic_address *reg); | 745 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
746 | acpi_read(u64 *value, | ||
747 | struct acpi_generic_address *reg)) | ||
486 | 748 | ||
487 | acpi_status acpi_write(u64 value, struct acpi_generic_address *reg); | 749 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
750 | acpi_write(u64 value, | ||
751 | struct acpi_generic_address *reg)) | ||
488 | 752 | ||
489 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 753 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
490 | acpi_read_bit_register(u32 register_id, | 754 | acpi_read_bit_register(u32 register_id, |
@@ -497,18 +761,20 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | |||
497 | /* | 761 | /* |
498 | * Sleep/Wake interfaces | 762 | * Sleep/Wake interfaces |
499 | */ | 763 | */ |
500 | acpi_status | 764 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
501 | acpi_get_sleep_type_data(u8 sleep_state, u8 *slp_typ_a, u8 *slp_typ_b); | 765 | acpi_get_sleep_type_data(u8 sleep_state, |
502 | 766 | u8 *slp_typ_a, | |
503 | acpi_status acpi_enter_sleep_state_prep(u8 sleep_state); | 767 | u8 *slp_typ_b)) |
504 | 768 | ||
505 | acpi_status acpi_enter_sleep_state(u8 sleep_state); | 769 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
770 | acpi_enter_sleep_state_prep(u8 sleep_state)) | ||
771 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_enter_sleep_state(u8 sleep_state)) | ||
506 | 772 | ||
507 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enter_sleep_state_s4bios(void)) | 773 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enter_sleep_state_s4bios(void)) |
508 | 774 | ||
509 | acpi_status acpi_leave_sleep_state_prep(u8 sleep_state); | 775 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
510 | 776 | acpi_leave_sleep_state_prep(u8 sleep_state)) | |
511 | acpi_status acpi_leave_sleep_state(u8 sleep_state); | 777 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_leave_sleep_state(u8 sleep_state)) |
512 | 778 | ||
513 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 779 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
514 | acpi_set_firmware_waking_vector(u32 | 780 | acpi_set_firmware_waking_vector(u32 |
@@ -535,53 +801,72 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | |||
535 | /* | 801 | /* |
536 | * Error/Warning output | 802 | * Error/Warning output |
537 | */ | 803 | */ |
538 | ACPI_PRINTF_LIKE(3) | 804 | ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) |
539 | void ACPI_INTERNAL_VAR_XFACE | 805 | void ACPI_INTERNAL_VAR_XFACE |
540 | acpi_error(const char *module_name, u32 line_number, const char *format, ...); | 806 | acpi_error(const char *module_name, |
541 | 807 | u32 line_number, | |
542 | ACPI_PRINTF_LIKE(4) | 808 | const char *format, ...)) |
543 | void ACPI_INTERNAL_VAR_XFACE | 809 | ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(4) |
544 | acpi_exception(const char *module_name, | 810 | void ACPI_INTERNAL_VAR_XFACE |
545 | u32 line_number, acpi_status status, const char *format, ...); | 811 | acpi_exception(const char *module_name, |
546 | 812 | u32 line_number, | |
547 | ACPI_PRINTF_LIKE(3) | 813 | acpi_status status, |
548 | void ACPI_INTERNAL_VAR_XFACE | 814 | const char *format, ...)) |
549 | acpi_warning(const char *module_name, u32 line_number, const char *format, ...); | 815 | ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) |
550 | 816 | void ACPI_INTERNAL_VAR_XFACE | |
551 | ACPI_PRINTF_LIKE(3) | 817 | acpi_warning(const char *module_name, |
552 | void ACPI_INTERNAL_VAR_XFACE | 818 | u32 line_number, |
553 | acpi_info(const char *module_name, u32 line_number, const char *format, ...); | 819 | const char *format, ...)) |
554 | 820 | ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) | |
555 | ACPI_PRINTF_LIKE(3) | 821 | void ACPI_INTERNAL_VAR_XFACE |
556 | void ACPI_INTERNAL_VAR_XFACE | 822 | acpi_info(const char *module_name, |
557 | acpi_bios_error(const char *module_name, | 823 | u32 line_number, |
558 | u32 line_number, const char *format, ...); | 824 | const char *format, ...)) |
559 | 825 | ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) | |
560 | ACPI_PRINTF_LIKE(3) | 826 | void ACPI_INTERNAL_VAR_XFACE |
561 | void ACPI_INTERNAL_VAR_XFACE | 827 | acpi_bios_error(const char *module_name, |
562 | acpi_bios_warning(const char *module_name, | 828 | u32 line_number, |
563 | u32 line_number, const char *format, ...); | 829 | const char *format, ...)) |
830 | ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) | ||
831 | void ACPI_INTERNAL_VAR_XFACE | ||
832 | acpi_bios_warning(const char *module_name, | ||
833 | u32 line_number, | ||
834 | const char *format, ...)) | ||
564 | 835 | ||
565 | /* | 836 | /* |
566 | * Debug output | 837 | * Debug output |
567 | */ | 838 | */ |
568 | #ifdef ACPI_DEBUG_OUTPUT | 839 | ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6) |
840 | void ACPI_INTERNAL_VAR_XFACE | ||
841 | acpi_debug_print(u32 requested_debug_level, | ||
842 | u32 line_number, | ||
843 | const char *function_name, | ||
844 | const char *module_name, | ||
845 | u32 component_id, | ||
846 | const char *format, ...)) | ||
847 | ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6) | ||
848 | void ACPI_INTERNAL_VAR_XFACE | ||
849 | acpi_debug_print_raw(u32 requested_debug_level, | ||
850 | u32 line_number, | ||
851 | const char *function_name, | ||
852 | const char *module_name, | ||
853 | u32 component_id, | ||
854 | const char *format, ...)) | ||
569 | 855 | ||
570 | ACPI_PRINTF_LIKE(6) | 856 | /* |
571 | void ACPI_INTERNAL_VAR_XFACE | 857 | * Divergences |
572 | acpi_debug_print(u32 requested_debug_level, | 858 | */ |
573 | u32 line_number, | 859 | acpi_status acpi_get_id(acpi_handle object, acpi_owner_id * out_type); |
574 | const char *function_name, | 860 | |
575 | const char *module_name, | 861 | acpi_status acpi_unload_table_id(acpi_owner_id id); |
576 | u32 component_id, const char *format, ...); | 862 | |
577 | 863 | acpi_status | |
578 | ACPI_PRINTF_LIKE(6) | 864 | acpi_get_table_with_size(acpi_string signature, |
579 | void ACPI_INTERNAL_VAR_XFACE | 865 | u32 instance, struct acpi_table_header **out_table, |
580 | acpi_debug_print_raw(u32 requested_debug_level, | 866 | acpi_size *tbl_size); |
581 | u32 line_number, | 867 | |
582 | const char *function_name, | 868 | acpi_status |
583 | const char *module_name, | 869 | acpi_get_data_full(acpi_handle object, acpi_object_handler handler, void **data, |
584 | u32 component_id, const char *format, ...); | 870 | void (*callback)(void *)); |
585 | #endif | ||
586 | 871 | ||
587 | #endif /* __ACXFACE_H__ */ | 872 | #endif /* __ACXFACE_H__ */ |
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index 3b30e36b53b5..1cc7ef13c01a 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h | |||
@@ -367,12 +367,11 @@ struct acpi_table_desc { | |||
367 | 367 | ||
368 | /* Masks for Flags field above */ | 368 | /* Masks for Flags field above */ |
369 | 369 | ||
370 | #define ACPI_TABLE_ORIGIN_UNKNOWN (0) | 370 | #define ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL (0) /* Virtual address, external maintained */ |
371 | #define ACPI_TABLE_ORIGIN_MAPPED (1) | 371 | #define ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL (1) /* Physical address, internally mapped */ |
372 | #define ACPI_TABLE_ORIGIN_ALLOCATED (2) | 372 | #define ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL (2) /* Virtual address, internallly allocated */ |
373 | #define ACPI_TABLE_ORIGIN_OVERRIDE (4) | 373 | #define ACPI_TABLE_ORIGIN_MASK (3) |
374 | #define ACPI_TABLE_ORIGIN_MASK (7) | 374 | #define ACPI_TABLE_IS_LOADED (8) |
375 | #define ACPI_TABLE_IS_LOADED (8) | ||
376 | 375 | ||
377 | /* | 376 | /* |
378 | * Get the remaining ACPI tables | 377 | * Get the remaining ACPI tables |
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index 212c65de75df..4ad7da805180 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h | |||
@@ -675,7 +675,7 @@ enum acpi_madt_type { | |||
675 | }; | 675 | }; |
676 | 676 | ||
677 | /* | 677 | /* |
678 | * MADT Sub-tables, correspond to Type in struct acpi_subtable_header | 678 | * MADT Subtables, correspond to Type in struct acpi_subtable_header |
679 | */ | 679 | */ |
680 | 680 | ||
681 | /* 0: Processor Local APIC */ | 681 | /* 0: Processor Local APIC */ |
@@ -918,7 +918,7 @@ enum acpi_srat_type { | |||
918 | }; | 918 | }; |
919 | 919 | ||
920 | /* | 920 | /* |
921 | * SRAT Sub-tables, correspond to Type in struct acpi_subtable_header | 921 | * SRAT Subtables, correspond to Type in struct acpi_subtable_header |
922 | */ | 922 | */ |
923 | 923 | ||
924 | /* 0: Processor Local APIC/SAPIC Affinity */ | 924 | /* 0: Processor Local APIC/SAPIC Affinity */ |
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index c8adad9c6b6a..860e5c883eb3 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h | |||
@@ -70,6 +70,7 @@ | |||
70 | #define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */ | 70 | #define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */ |
71 | #define ACPI_SIG_IBFT "IBFT" /* iSCSI Boot Firmware Table */ | 71 | #define ACPI_SIG_IBFT "IBFT" /* iSCSI Boot Firmware Table */ |
72 | #define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */ | 72 | #define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */ |
73 | #define ACPI_SIG_LPIT "LPIT" /* Low Power Idle Table */ | ||
73 | #define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */ | 74 | #define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */ |
74 | #define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */ | 75 | #define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */ |
75 | #define ACPI_SIG_MTMR "MTMR" /* MID Timer table */ | 76 | #define ACPI_SIG_MTMR "MTMR" /* MID Timer table */ |
@@ -456,7 +457,7 @@ struct acpi_dmar_pci_path { | |||
456 | }; | 457 | }; |
457 | 458 | ||
458 | /* | 459 | /* |
459 | * DMAR Sub-tables, correspond to Type in struct acpi_dmar_header | 460 | * DMAR Subtables, correspond to Type in struct acpi_dmar_header |
460 | */ | 461 | */ |
461 | 462 | ||
462 | /* 0: Hardware Unit Definition */ | 463 | /* 0: Hardware Unit Definition */ |
@@ -820,7 +821,71 @@ struct acpi_ivrs_memory { | |||
820 | 821 | ||
821 | /******************************************************************************* | 822 | /******************************************************************************* |
822 | * | 823 | * |
823 | * MCFG - PCI Memory Mapped Configuration table and sub-table | 824 | * LPIT - Low Power Idle Table |
825 | * | ||
826 | * Conforms to "ACPI Low Power Idle Table (LPIT) and _LPD Proposal (DRAFT)" | ||
827 | * | ||
828 | ******************************************************************************/ | ||
829 | |||
830 | struct acpi_table_lpit { | ||
831 | struct acpi_table_header header; /* Common ACPI table header */ | ||
832 | }; | ||
833 | |||
834 | /* LPIT subtable header */ | ||
835 | |||
836 | struct acpi_lpit_header { | ||
837 | u32 type; /* Subtable type */ | ||
838 | u32 length; /* Subtable length */ | ||
839 | u16 unique_id; | ||
840 | u16 reserved; | ||
841 | u32 flags; | ||
842 | }; | ||
843 | |||
844 | /* Values for subtable Type above */ | ||
845 | |||
846 | enum acpi_lpit_type { | ||
847 | ACPI_LPIT_TYPE_NATIVE_CSTATE = 0x00, | ||
848 | ACPI_LPIT_TYPE_SIMPLE_IO = 0x01 | ||
849 | }; | ||
850 | |||
851 | /* Masks for Flags field above */ | ||
852 | |||
853 | #define ACPI_LPIT_STATE_DISABLED (1) | ||
854 | #define ACPI_LPIT_NO_COUNTER (1<<1) | ||
855 | |||
856 | /* | ||
857 | * LPIT subtables, correspond to Type in struct acpi_lpit_header | ||
858 | */ | ||
859 | |||
860 | /* 0x00: Native C-state instruction based LPI structure */ | ||
861 | |||
862 | struct acpi_lpit_native { | ||
863 | struct acpi_lpit_header header; | ||
864 | struct acpi_generic_address entry_trigger; | ||
865 | u32 residency; | ||
866 | u32 latency; | ||
867 | struct acpi_generic_address residency_counter; | ||
868 | u64 counter_frequency; | ||
869 | }; | ||
870 | |||
871 | /* 0x01: Simple I/O based LPI structure */ | ||
872 | |||
873 | struct acpi_lpit_io { | ||
874 | struct acpi_lpit_header header; | ||
875 | struct acpi_generic_address entry_trigger; | ||
876 | u32 trigger_action; | ||
877 | u64 trigger_value; | ||
878 | u64 trigger_mask; | ||
879 | struct acpi_generic_address minimum_idle_state; | ||
880 | u32 residency; | ||
881 | u32 latency; | ||
882 | struct acpi_generic_address residency_counter; | ||
883 | u64 counter_frequency; | ||
884 | }; | ||
885 | |||
886 | /******************************************************************************* | ||
887 | * | ||
888 | * MCFG - PCI Memory Mapped Configuration table and subtable | ||
824 | * Version 1 | 889 | * Version 1 |
825 | * | 890 | * |
826 | * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005 | 891 | * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005 |
@@ -923,7 +988,7 @@ enum acpi_slic_type { | |||
923 | }; | 988 | }; |
924 | 989 | ||
925 | /* | 990 | /* |
926 | * SLIC Sub-tables, correspond to Type in struct acpi_slic_header | 991 | * SLIC Subtables, correspond to Type in struct acpi_slic_header |
927 | */ | 992 | */ |
928 | 993 | ||
929 | /* 0: Public Key Structure */ | 994 | /* 0: Public Key Structure */ |
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index e76356574374..19b26bb69a70 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
@@ -329,6 +329,15 @@ typedef u32 acpi_physical_address; | |||
329 | * | 329 | * |
330 | ******************************************************************************/ | 330 | ******************************************************************************/ |
331 | 331 | ||
332 | #ifdef ACPI_NO_MEM_ALLOCATIONS | ||
333 | |||
334 | #define ACPI_ALLOCATE(a) NULL | ||
335 | #define ACPI_ALLOCATE_ZEROED(a) NULL | ||
336 | #define ACPI_FREE(a) | ||
337 | #define ACPI_MEM_TRACKING(a) | ||
338 | |||
339 | #else /* ACPI_NO_MEM_ALLOCATIONS */ | ||
340 | |||
332 | #ifdef ACPI_DBG_TRACK_ALLOCATIONS | 341 | #ifdef ACPI_DBG_TRACK_ALLOCATIONS |
333 | /* | 342 | /* |
334 | * Memory allocation tracking (used by acpi_exec to detect memory leaks) | 343 | * Memory allocation tracking (used by acpi_exec to detect memory leaks) |
@@ -350,6 +359,8 @@ typedef u32 acpi_physical_address; | |||
350 | 359 | ||
351 | #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ | 360 | #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ |
352 | 361 | ||
362 | #endif /* ACPI_NO_MEM_ALLOCATIONS */ | ||
363 | |||
353 | /****************************************************************************** | 364 | /****************************************************************************** |
354 | * | 365 | * |
355 | * ACPI Specification constants (Do not change unless the specification changes) | 366 | * ACPI Specification constants (Do not change unless the specification changes) |
@@ -928,9 +939,19 @@ struct acpi_object_list { | |||
928 | * Miscellaneous common Data Structures used by the interfaces | 939 | * Miscellaneous common Data Structures used by the interfaces |
929 | */ | 940 | */ |
930 | #define ACPI_NO_BUFFER 0 | 941 | #define ACPI_NO_BUFFER 0 |
942 | |||
943 | #ifdef ACPI_NO_MEM_ALLOCATIONS | ||
944 | |||
945 | #define ACPI_ALLOCATE_BUFFER (acpi_size) (0) | ||
946 | #define ACPI_ALLOCATE_LOCAL_BUFFER (acpi_size) (0) | ||
947 | |||
948 | #else /* ACPI_NO_MEM_ALLOCATIONS */ | ||
949 | |||
931 | #define ACPI_ALLOCATE_BUFFER (acpi_size) (-1) /* Let ACPICA allocate buffer */ | 950 | #define ACPI_ALLOCATE_BUFFER (acpi_size) (-1) /* Let ACPICA allocate buffer */ |
932 | #define ACPI_ALLOCATE_LOCAL_BUFFER (acpi_size) (-2) /* For internal use only (enables tracking) */ | 951 | #define ACPI_ALLOCATE_LOCAL_BUFFER (acpi_size) (-2) /* For internal use only (enables tracking) */ |
933 | 952 | ||
953 | #endif /* ACPI_NO_MEM_ALLOCATIONS */ | ||
954 | |||
934 | struct acpi_buffer { | 955 | struct acpi_buffer { |
935 | acpi_size length; /* Length in bytes of the buffer */ | 956 | acpi_size length; /* Length in bytes of the buffer */ |
936 | void *pointer; /* pointer to buffer */ | 957 | void *pointer; /* pointer to buffer */ |
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h index a476b9118b49..384875da3713 100644 --- a/include/acpi/platform/acgcc.h +++ b/include/acpi/platform/acgcc.h | |||
@@ -64,4 +64,15 @@ | |||
64 | */ | 64 | */ |
65 | #define ACPI_UNUSED_VAR __attribute__ ((unused)) | 65 | #define ACPI_UNUSED_VAR __attribute__ ((unused)) |
66 | 66 | ||
67 | /* | ||
68 | * Some versions of gcc implement strchr() with a buggy macro. So, | ||
69 | * undef it here. Prevents error messages of this form (usually from the | ||
70 | * file getopt.c): | ||
71 | * | ||
72 | * error: logical '&&' with non-zero constant will always evaluate as true | ||
73 | */ | ||
74 | #ifdef strchr | ||
75 | #undef strchr | ||
76 | #endif | ||
77 | |||
67 | #endif /* __ACGCC_H__ */ | 78 | #endif /* __ACGCC_H__ */ |
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 93c55ed7c53d..4c2f9e78001c 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h | |||
@@ -73,6 +73,37 @@ | |||
73 | #endif | 73 | #endif |
74 | #include <asm/acpi.h> | 74 | #include <asm/acpi.h> |
75 | 75 | ||
76 | #ifndef CONFIG_ACPI | ||
77 | |||
78 | /* External globals for __KERNEL__, stubs is needed */ | ||
79 | |||
80 | #define ACPI_GLOBAL(t,a) | ||
81 | #define ACPI_INIT_GLOBAL(t,a,b) | ||
82 | |||
83 | /* Generating stubs for configurable ACPICA macros */ | ||
84 | |||
85 | #define ACPI_NO_MEM_ALLOCATIONS | ||
86 | |||
87 | /* Generating stubs for configurable ACPICA functions */ | ||
88 | |||
89 | #define ACPI_NO_ERROR_MESSAGES | ||
90 | #undef ACPI_DEBUG_OUTPUT | ||
91 | |||
92 | /* External interface for __KERNEL__, stub is needed */ | ||
93 | |||
94 | #define ACPI_EXTERNAL_RETURN_STATUS(prototype) \ | ||
95 | static ACPI_INLINE prototype {return(AE_NOT_CONFIGURED);} | ||
96 | #define ACPI_EXTERNAL_RETURN_OK(prototype) \ | ||
97 | static ACPI_INLINE prototype {return(AE_OK);} | ||
98 | #define ACPI_EXTERNAL_RETURN_VOID(prototype) \ | ||
99 | static ACPI_INLINE prototype {return;} | ||
100 | #define ACPI_EXTERNAL_RETURN_UINT32(prototype) \ | ||
101 | static ACPI_INLINE prototype {return(0);} | ||
102 | #define ACPI_EXTERNAL_RETURN_PTR(prototype) \ | ||
103 | static ACPI_INLINE prototype {return(NULL);} | ||
104 | |||
105 | #endif /* CONFIG_ACPI */ | ||
106 | |||
76 | /* Host-dependent types and defines for in-kernel ACPICA */ | 107 | /* Host-dependent types and defines for in-kernel ACPICA */ |
77 | 108 | ||
78 | #define ACPI_MACHINE_WIDTH BITS_PER_LONG | 109 | #define ACPI_MACHINE_WIDTH BITS_PER_LONG |
@@ -91,7 +122,7 @@ | |||
91 | #include <ctype.h> | 122 | #include <ctype.h> |
92 | #include <unistd.h> | 123 | #include <unistd.h> |
93 | 124 | ||
94 | /* Disable kernel specific declarators */ | 125 | /* Define/disable kernel-specific declarators */ |
95 | 126 | ||
96 | #ifndef __init | 127 | #ifndef __init |
97 | #define __init | 128 | #define __init |
@@ -106,7 +137,8 @@ | |||
106 | #define ACPI_FLUSH_CPU_CACHE() | 137 | #define ACPI_FLUSH_CPU_CACHE() |
107 | #define ACPI_CAST_PTHREAD_T(pthread) ((acpi_thread_id) (pthread)) | 138 | #define ACPI_CAST_PTHREAD_T(pthread) ((acpi_thread_id) (pthread)) |
108 | 139 | ||
109 | #if defined(__ia64__) || defined(__x86_64__) || defined(__aarch64__) | 140 | #if defined(__ia64__) || defined(__x86_64__) ||\ |
141 | defined(__aarch64__) || defined(__PPC64__) | ||
110 | #define ACPI_MACHINE_WIDTH 64 | 142 | #define ACPI_MACHINE_WIDTH 64 |
111 | #define COMPILER_DEPENDENT_INT64 long | 143 | #define COMPILER_DEPENDENT_INT64 long |
112 | #define COMPILER_DEPENDENT_UINT64 unsigned long | 144 | #define COMPILER_DEPENDENT_UINT64 unsigned long |