diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-01-29 07:59:00 -0500 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-01-29 07:59:00 -0500 |
| commit | 8b4e2fa4ff72ba2c9f01af8def15d4c4eeeeed64 (patch) | |
| tree | a2ebfb0b6aebb2fe07821fe862a79709be3ebc17 /include/acpi | |
| parent | 64e94e7e0ffb20ee11a596aa04fcdeefb33e000d (diff) | |
| parent | e375325ce55eb841ccda54a4472cf3b0139ea5f2 (diff) | |
Merge branch 'acpi-lpss' into acpi-cleanup
The following commits depend on the 'acpi-lpss' material.
Diffstat (limited to 'include/acpi')
| -rw-r--r-- | include/acpi/acconfig.h | 25 | ||||
| -rw-r--r-- | include/acpi/acoutput.h | 157 | ||||
| -rw-r--r-- | include/acpi/acpiosxf.h | 11 | ||||
| -rw-r--r-- | include/acpi/acpixf.h | 66 | ||||
| -rw-r--r-- | include/acpi/acrestyp.h | 15 | ||||
| -rw-r--r-- | include/acpi/actbl.h | 7 | ||||
| -rw-r--r-- | include/acpi/actbl1.h | 6 | ||||
| -rw-r--r-- | include/acpi/actbl2.h | 23 | ||||
| -rw-r--r-- | include/acpi/actbl3.h | 32 | ||||
| -rw-r--r-- | include/acpi/actypes.h | 36 | ||||
| -rw-r--r-- | include/acpi/platform/acenv.h | 317 | ||||
| -rw-r--r-- | include/acpi/platform/acgcc.h | 4 | ||||
| -rw-r--r-- | include/acpi/platform/aclinux.h | 1 |
13 files changed, 463 insertions, 237 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 0943457e0fa5..101d5fef6b21 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h | |||
| @@ -138,7 +138,7 @@ | |||
| 138 | 138 | ||
| 139 | /* Maximum sleep allowed via Sleep() operator */ | 139 | /* Maximum sleep allowed via Sleep() operator */ |
| 140 | 140 | ||
| 141 | #define ACPI_MAX_SLEEP 2000 /* Two seconds */ | 141 | #define ACPI_MAX_SLEEP 2000 /* 2000 millisec == two seconds */ |
| 142 | 142 | ||
| 143 | /* Address Range lists are per-space_id (Memory and I/O only) */ | 143 | /* Address Range lists are per-space_id (Memory and I/O only) */ |
| 144 | 144 | ||
| @@ -150,11 +150,6 @@ | |||
| 150 | * | 150 | * |
| 151 | *****************************************************************************/ | 151 | *****************************************************************************/ |
| 152 | 152 | ||
| 153 | /* Number of distinct GPE register blocks and register width */ | ||
| 154 | |||
| 155 | #define ACPI_MAX_GPE_BLOCKS 2 | ||
| 156 | #define ACPI_GPE_REGISTER_WIDTH 8 | ||
| 157 | |||
| 158 | /* Method info (in WALK_STATE), containing local variables and argumetns */ | 153 | /* Method info (in WALK_STATE), containing local variables and argumetns */ |
| 159 | 154 | ||
| 160 | #define ACPI_METHOD_NUM_LOCALS 8 | 155 | #define ACPI_METHOD_NUM_LOCALS 8 |
| @@ -163,12 +158,6 @@ | |||
| 163 | #define ACPI_METHOD_NUM_ARGS 7 | 158 | #define ACPI_METHOD_NUM_ARGS 7 |
| 164 | #define ACPI_METHOD_MAX_ARG 6 | 159 | #define ACPI_METHOD_MAX_ARG 6 |
| 165 | 160 | ||
| 166 | /* Length of _HID, _UID, _CID, and UUID values */ | ||
| 167 | |||
| 168 | #define ACPI_DEVICE_ID_LENGTH 0x09 | ||
| 169 | #define ACPI_MAX_CID_LENGTH 48 | ||
| 170 | #define ACPI_UUID_LENGTH 16 | ||
| 171 | |||
| 172 | /* | 161 | /* |
| 173 | * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG | 162 | * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG |
| 174 | */ | 163 | */ |
| @@ -186,17 +175,6 @@ | |||
| 186 | */ | 175 | */ |
| 187 | #define ACPI_RESULTS_OBJ_NUM_MAX 255 | 176 | #define ACPI_RESULTS_OBJ_NUM_MAX 255 |
| 188 | 177 | ||
| 189 | /* Names within the namespace are 4 bytes long */ | ||
| 190 | |||
| 191 | #define ACPI_NAME_SIZE 4 | ||
| 192 | #define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */ | ||
| 193 | #define ACPI_PATH_SEPARATOR '.' | ||
| 194 | |||
| 195 | /* Sizes for ACPI table headers */ | ||
| 196 | |||
| 197 | #define ACPI_OEM_ID_SIZE 6 | ||
| 198 | #define ACPI_OEM_TABLE_ID_SIZE 8 | ||
| 199 | |||
| 200 | /* Constants used in searching for the RSDP in low memory */ | 178 | /* Constants used in searching for the RSDP in low memory */ |
| 201 | 179 | ||
| 202 | #define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */ | 180 | #define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */ |
| @@ -213,6 +191,7 @@ | |||
| 213 | /* Maximum space_ids for Operation Regions */ | 191 | /* Maximum space_ids for Operation Regions */ |
| 214 | 192 | ||
| 215 | #define ACPI_MAX_ADDRESS_SPACE 255 | 193 | #define ACPI_MAX_ADDRESS_SPACE 255 |
| 194 | #define ACPI_NUM_DEFAULT_SPACES 4 | ||
| 216 | 195 | ||
| 217 | /* Array sizes. Used for range checking also */ | 196 | /* Array sizes. Used for range checking also */ |
| 218 | 197 | ||
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h index 2457ac849655..b48cb3459778 100644 --- a/include/acpi/acoutput.h +++ b/include/acpi/acoutput.h | |||
| @@ -72,6 +72,7 @@ | |||
| 72 | #define ACPI_EXAMPLE 0x00004000 | 72 | #define ACPI_EXAMPLE 0x00004000 |
| 73 | #define ACPI_DRIVER 0x00008000 | 73 | #define ACPI_DRIVER 0x00008000 |
| 74 | #define DT_COMPILER 0x00010000 | 74 | #define DT_COMPILER 0x00010000 |
| 75 | #define ASL_PREPROCESSOR 0x00020000 | ||
| 75 | 76 | ||
| 76 | #define ACPI_ALL_COMPONENTS 0x0001FFFF | 77 | #define ACPI_ALL_COMPONENTS 0x0001FFFF |
| 77 | #define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS) | 78 | #define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS) |
| @@ -262,18 +263,140 @@ | |||
| 262 | * Common parameters used for debug output functions: | 263 | * Common parameters used for debug output functions: |
| 263 | * line number, function name, module(file) name, component ID | 264 | * line number, function name, module(file) name, component ID |
| 264 | */ | 265 | */ |
| 265 | #define ACPI_DEBUG_PARAMETERS __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT | 266 | #define ACPI_DEBUG_PARAMETERS \ |
| 267 | __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT | ||
| 268 | |||
| 269 | /* Check if debug output is currently dynamically enabled */ | ||
| 270 | |||
| 271 | #define ACPI_IS_DEBUG_ENABLED(level, component) \ | ||
| 272 | ((level & acpi_dbg_level) && (component & acpi_dbg_layer)) | ||
| 266 | 273 | ||
| 267 | /* | 274 | /* |
| 268 | * Master debug print macros | 275 | * Master debug print macros |
| 269 | * Print message if and only if: | 276 | * Print message if and only if: |
| 270 | * 1) Debug print for the current component is enabled | 277 | * 1) Debug print for the current component is enabled |
| 271 | * 2) Debug error level or trace level for the print statement is enabled | 278 | * 2) Debug error level or trace level for the print statement is enabled |
| 279 | * | ||
| 280 | * November 2012: Moved the runtime check for whether to actually emit the | ||
| 281 | * debug message outside of the print function itself. This improves overall | ||
| 282 | * performance at a relatively small code cost. Implementation involves the | ||
| 283 | * use of variadic macros supported by C99. | ||
| 284 | * | ||
| 285 | * Note: the ACPI_DO_WHILE0 macro is used to prevent some compilers from | ||
| 286 | * complaining about these constructs. On other compilers the do...while | ||
| 287 | * adds some extra code, so this feature is optional. | ||
| 272 | */ | 288 | */ |
| 273 | #define ACPI_DEBUG_PRINT(plist) acpi_debug_print plist | 289 | #ifdef ACPI_USE_DO_WHILE_0 |
| 274 | #define ACPI_DEBUG_PRINT_RAW(plist) acpi_debug_print_raw plist | 290 | #define ACPI_DO_WHILE0(a) do a while(0) |
| 275 | |||
| 276 | #else | 291 | #else |
| 292 | #define ACPI_DO_WHILE0(a) a | ||
| 293 | #endif | ||
| 294 | |||
| 295 | /* DEBUG_PRINT functions */ | ||
| 296 | |||
| 297 | #define ACPI_DEBUG_PRINT(plist) ACPI_ACTUAL_DEBUG plist | ||
| 298 | #define ACPI_DEBUG_PRINT_RAW(plist) ACPI_ACTUAL_DEBUG_RAW plist | ||
| 299 | |||
| 300 | /* Helper macros for DEBUG_PRINT */ | ||
| 301 | |||
| 302 | #define ACPI_DO_DEBUG_PRINT(function, level, line, filename, modulename, component, ...) \ | ||
| 303 | ACPI_DO_WHILE0 ({ \ | ||
| 304 | if (ACPI_IS_DEBUG_ENABLED (level, component)) \ | ||
| 305 | { \ | ||
| 306 | function (level, line, filename, modulename, component, __VA_ARGS__); \ | ||
| 307 | } \ | ||
| 308 | }) | ||
| 309 | |||
| 310 | #define ACPI_ACTUAL_DEBUG(level, line, filename, modulename, component, ...) \ | ||
| 311 | ACPI_DO_DEBUG_PRINT (acpi_debug_print, level, line, \ | ||
| 312 | filename, modulename, component, __VA_ARGS__) | ||
| 313 | |||
| 314 | #define ACPI_ACTUAL_DEBUG_RAW(level, line, filename, modulename, component, ...) \ | ||
| 315 | ACPI_DO_DEBUG_PRINT (acpi_debug_print_raw, level, line, \ | ||
| 316 | filename, modulename, component, __VA_ARGS__) | ||
| 317 | |||
| 318 | /* | ||
| 319 | * Function entry tracing | ||
| 320 | * | ||
| 321 | * The name of the function is emitted as a local variable that is | ||
| 322 | * intended to be used by both the entry trace and the exit trace. | ||
| 323 | */ | ||
| 324 | |||
| 325 | /* Helper macro */ | ||
| 326 | |||
| 327 | #define ACPI_TRACE_ENTRY(name, function, cast, param) \ | ||
| 328 | ACPI_FUNCTION_NAME (name) \ | ||
| 329 | function (ACPI_DEBUG_PARAMETERS, cast (param)) | ||
| 330 | |||
| 331 | /* The actual entry trace macros */ | ||
| 332 | |||
| 333 | #define ACPI_FUNCTION_TRACE(name) \ | ||
| 334 | ACPI_FUNCTION_NAME(name) \ | ||
| 335 | acpi_ut_trace (ACPI_DEBUG_PARAMETERS) | ||
| 336 | |||
| 337 | #define ACPI_FUNCTION_TRACE_PTR(name, pointer) \ | ||
| 338 | ACPI_TRACE_ENTRY (name, acpi_ut_trace_ptr, (void *), pointer) | ||
| 339 | |||
| 340 | #define ACPI_FUNCTION_TRACE_U32(name, value) \ | ||
| 341 | ACPI_TRACE_ENTRY (name, acpi_ut_trace_u32, (u32), value) | ||
| 342 | |||
| 343 | #define ACPI_FUNCTION_TRACE_STR(name, string) \ | ||
| 344 | ACPI_TRACE_ENTRY (name, acpi_ut_trace_str, (char *), string) | ||
| 345 | |||
| 346 | #define ACPI_FUNCTION_ENTRY() \ | ||
| 347 | acpi_ut_track_stack_ptr() | ||
| 348 | |||
| 349 | /* | ||
| 350 | * Function exit tracing | ||
| 351 | * | ||
| 352 | * These macros include a return statement. This is usually considered | ||
| 353 | * bad form, but having a separate exit macro before the actual return | ||
| 354 | * is very ugly and difficult to maintain. | ||
| 355 | * | ||
| 356 | * One of the FUNCTION_TRACE macros above must be used in conjunction | ||
| 357 | * with these macros so that "_AcpiFunctionName" is defined. | ||
| 358 | */ | ||
| 359 | |||
| 360 | /* Exit trace helper macro */ | ||
| 361 | |||
| 362 | #define ACPI_TRACE_EXIT(function, cast, param) \ | ||
| 363 | ACPI_DO_WHILE0 ({ \ | ||
| 364 | function (ACPI_DEBUG_PARAMETERS, cast (param)); \ | ||
| 365 | return ((param)); \ | ||
| 366 | }) | ||
| 367 | |||
| 368 | /* The actual exit macros */ | ||
| 369 | |||
| 370 | #define return_VOID \ | ||
| 371 | ACPI_DO_WHILE0 ({ \ | ||
| 372 | acpi_ut_exit (ACPI_DEBUG_PARAMETERS); \ | ||
| 373 | return; \ | ||
| 374 | }) | ||
| 375 | |||
| 376 | #define return_ACPI_STATUS(status) \ | ||
| 377 | ACPI_TRACE_EXIT (acpi_ut_status_exit, (acpi_status), status) | ||
| 378 | |||
| 379 | #define return_PTR(pointer) \ | ||
| 380 | ACPI_TRACE_EXIT (acpi_ut_ptr_exit, (u8 *), pointer) | ||
| 381 | |||
| 382 | #define return_VALUE(value) \ | ||
| 383 | ACPI_TRACE_EXIT (acpi_ut_value_exit, (u64), value) | ||
| 384 | |||
| 385 | /* Conditional execution */ | ||
| 386 | |||
| 387 | #define ACPI_DEBUG_EXEC(a) a | ||
| 388 | #define ACPI_DEBUG_ONLY_MEMBERS(a) a; | ||
| 389 | #define _VERBOSE_STRUCTURES | ||
| 390 | |||
| 391 | /* Various object display routines for debug */ | ||
| 392 | |||
| 393 | #define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a), 0) | ||
| 394 | #define ACPI_DUMP_OPERANDS(a, b ,c) acpi_ex_dump_operands(a, b, c) | ||
| 395 | #define ACPI_DUMP_ENTRY(a, b) acpi_ns_dump_entry (a, b) | ||
| 396 | #define ACPI_DUMP_PATHNAME(a, b, c, d) acpi_ns_dump_pathname(a, b, c, d) | ||
| 397 | #define ACPI_DUMP_BUFFER(a, b) acpi_ut_debug_dump_buffer((u8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT) | ||
| 398 | |||
| 399 | #else /* ACPI_DEBUG_OUTPUT */ | ||
| 277 | /* | 400 | /* |
| 278 | * This is the non-debug case -- make everything go away, | 401 | * This is the non-debug case -- make everything go away, |
| 279 | * leaving no executable debug code! | 402 | * leaving no executable debug code! |
| @@ -281,6 +404,32 @@ | |||
| 281 | #define ACPI_FUNCTION_NAME(a) | 404 | #define ACPI_FUNCTION_NAME(a) |
| 282 | #define ACPI_DEBUG_PRINT(pl) | 405 | #define ACPI_DEBUG_PRINT(pl) |
| 283 | #define ACPI_DEBUG_PRINT_RAW(pl) | 406 | #define ACPI_DEBUG_PRINT_RAW(pl) |
| 407 | #define ACPI_DEBUG_EXEC(a) | ||
| 408 | #define ACPI_DEBUG_ONLY_MEMBERS(a) | ||
| 409 | #define ACPI_FUNCTION_TRACE(a) | ||
| 410 | #define ACPI_FUNCTION_TRACE_PTR(a, b) | ||
| 411 | #define ACPI_FUNCTION_TRACE_U32(a, b) | ||
| 412 | #define ACPI_FUNCTION_TRACE_STR(a, b) | ||
| 413 | #define ACPI_FUNCTION_EXIT | ||
| 414 | #define ACPI_FUNCTION_STATUS_EXIT(s) | ||
| 415 | #define ACPI_FUNCTION_VALUE_EXIT(s) | ||
| 416 | #define ACPI_FUNCTION_ENTRY() | ||
| 417 | #define ACPI_DUMP_STACK_ENTRY(a) | ||
| 418 | #define ACPI_DUMP_OPERANDS(a, b, c) | ||
| 419 | #define ACPI_DUMP_ENTRY(a, b) | ||
| 420 | #define ACPI_DUMP_TABLES(a, b) | ||
| 421 | #define ACPI_DUMP_PATHNAME(a, b, c, d) | ||
| 422 | #define ACPI_DUMP_BUFFER(a, b) | ||
| 423 | #define ACPI_DEBUG_PRINT(pl) | ||
| 424 | #define ACPI_DEBUG_PRINT_RAW(pl) | ||
| 425 | #define ACPI_IS_DEBUG_ENABLED(level, component) 0 | ||
| 426 | |||
| 427 | /* Return macros must have a return statement at the minimum */ | ||
| 428 | |||
| 429 | #define return_VOID return | ||
| 430 | #define return_ACPI_STATUS(s) return(s) | ||
| 431 | #define return_VALUE(s) return(s) | ||
| 432 | #define return_PTR(s) return(s) | ||
| 284 | 433 | ||
| 285 | #endif /* ACPI_DEBUG_OUTPUT */ | 434 | #endif /* ACPI_DEBUG_OUTPUT */ |
| 286 | 435 | ||
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 43152742b46f..dfcedc6da9ac 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
| @@ -102,10 +102,8 @@ acpi_os_physical_table_override(struct acpi_table_header *existing_table, | |||
| 102 | /* | 102 | /* |
| 103 | * Spinlock primitives | 103 | * Spinlock primitives |
| 104 | */ | 104 | */ |
| 105 | |||
| 106 | #ifndef acpi_os_create_lock | 105 | #ifndef acpi_os_create_lock |
| 107 | acpi_status | 106 | acpi_status acpi_os_create_lock(acpi_spinlock * out_handle); |
| 108 | acpi_os_create_lock(acpi_spinlock *out_handle); | ||
| 109 | #endif | 107 | #endif |
| 110 | 108 | ||
| 111 | void acpi_os_delete_lock(acpi_spinlock handle); | 109 | void acpi_os_delete_lock(acpi_spinlock handle); |
| @@ -148,6 +146,8 @@ void acpi_os_release_mutex(acpi_mutex handle); | |||
| 148 | */ | 146 | */ |
| 149 | void *acpi_os_allocate(acpi_size size); | 147 | void *acpi_os_allocate(acpi_size size); |
| 150 | 148 | ||
| 149 | void acpi_os_free(void *memory); | ||
| 150 | |||
| 151 | void __iomem *acpi_os_map_memory(acpi_physical_address where, | 151 | void __iomem *acpi_os_map_memory(acpi_physical_address where, |
| 152 | acpi_size length); | 152 | acpi_size length); |
| 153 | 153 | ||
| @@ -180,12 +180,13 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object); | |||
| 180 | * Interrupt handlers | 180 | * Interrupt handlers |
| 181 | */ | 181 | */ |
| 182 | acpi_status | 182 | acpi_status |
| 183 | acpi_os_install_interrupt_handler(u32 gsi, | 183 | acpi_os_install_interrupt_handler(u32 interrupt_number, |
| 184 | acpi_osd_handler service_routine, | 184 | acpi_osd_handler service_routine, |
| 185 | void *context); | 185 | void *context); |
| 186 | 186 | ||
| 187 | acpi_status | 187 | acpi_status |
| 188 | acpi_os_remove_interrupt_handler(u32 gsi, acpi_osd_handler service_routine); | 188 | acpi_os_remove_interrupt_handler(u32 interrupt_number, |
| 189 | acpi_osd_handler service_routine); | ||
| 189 | 190 | ||
| 190 | void acpi_os_gpe_count(u32 gpe_number); | 191 | void acpi_os_gpe_count(u32 gpe_number); |
| 191 | void acpi_os_fixed_event_count(u32 fixed_event_number); | 192 | void acpi_os_fixed_event_count(u32 fixed_event_number); |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 3d88395d4d6f..d8b2ea673fc6 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 0x20121018 | 49 | #define ACPI_CA_VERSION 0x20121220 |
| 50 | 50 | ||
| 51 | #include <acpi/acconfig.h> | 51 | #include <acpi/acconfig.h> |
| 52 | #include <acpi/actypes.h> | 52 | #include <acpi/actypes.h> |
| @@ -56,11 +56,20 @@ | |||
| 56 | extern u8 acpi_gbl_permanent_mmap; | 56 | extern u8 acpi_gbl_permanent_mmap; |
| 57 | 57 | ||
| 58 | /* | 58 | /* |
| 59 | * Globals that are publicly available, allowing for | 59 | * Globals that are publically available |
| 60 | * run time configuration | ||
| 61 | */ | 60 | */ |
| 61 | extern u32 acpi_current_gpe_count; | ||
| 62 | extern struct acpi_table_fadt acpi_gbl_FADT; | ||
| 63 | extern u8 acpi_gbl_system_awake_and_running; | ||
| 64 | extern u8 acpi_gbl_reduced_hardware; /* ACPI 5.0 */ | ||
| 65 | |||
| 66 | /* Runtime configuration of debug print levels */ | ||
| 67 | |||
| 62 | extern u32 acpi_dbg_level; | 68 | extern u32 acpi_dbg_level; |
| 63 | extern u32 acpi_dbg_layer; | 69 | extern u32 acpi_dbg_layer; |
| 70 | |||
| 71 | /* ACPICA runtime options */ | ||
| 72 | |||
| 64 | extern u8 acpi_gbl_enable_interpreter_slack; | 73 | extern u8 acpi_gbl_enable_interpreter_slack; |
| 65 | extern u8 acpi_gbl_all_methods_serialized; | 74 | extern u8 acpi_gbl_all_methods_serialized; |
| 66 | extern u8 acpi_gbl_create_osi_method; | 75 | extern u8 acpi_gbl_create_osi_method; |
| @@ -99,14 +108,9 @@ extern u8 acpi_gbl_disable_auto_repair; | |||
| 99 | 108 | ||
| 100 | #endif /* !ACPI_REDUCED_HARDWARE */ | 109 | #endif /* !ACPI_REDUCED_HARDWARE */ |
| 101 | 110 | ||
| 102 | extern u32 acpi_current_gpe_count; | ||
| 103 | extern struct acpi_table_fadt acpi_gbl_FADT; | ||
| 104 | extern u8 acpi_gbl_system_awake_and_running; | ||
| 105 | extern u8 acpi_gbl_reduced_hardware; /* ACPI 5.0 */ | ||
| 106 | |||
| 107 | extern u32 acpi_rsdt_forced; | 111 | extern u32 acpi_rsdt_forced; |
| 108 | /* | 112 | /* |
| 109 | * Global interfaces | 113 | * Initialization |
| 110 | */ | 114 | */ |
| 111 | acpi_status | 115 | acpi_status |
| 112 | acpi_initialize_tables(struct acpi_table_desc *initial_storage, | 116 | acpi_initialize_tables(struct acpi_table_desc *initial_storage, |
| @@ -120,13 +124,15 @@ acpi_status acpi_initialize_objects(u32 flags); | |||
| 120 | 124 | ||
| 121 | acpi_status acpi_terminate(void); | 125 | acpi_status acpi_terminate(void); |
| 122 | 126 | ||
| 127 | /* | ||
| 128 | * Miscellaneous global interfaces | ||
| 129 | */ | ||
| 130 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void)) | ||
| 131 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void)) | ||
| 123 | #ifdef ACPI_FUTURE_USAGE | 132 | #ifdef ACPI_FUTURE_USAGE |
| 124 | acpi_status acpi_subsystem_status(void); | 133 | acpi_status acpi_subsystem_status(void); |
| 125 | #endif | 134 | #endif |
| 126 | 135 | ||
| 127 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void)) | ||
| 128 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void)) | ||
| 129 | |||
| 130 | #ifdef ACPI_FUTURE_USAGE | 136 | #ifdef ACPI_FUTURE_USAGE |
| 131 | acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer); | 137 | acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer); |
| 132 | #endif | 138 | #endif |
| @@ -191,9 +197,9 @@ acpi_status | |||
| 191 | acpi_get_table_by_index(u32 table_index, struct acpi_table_header **out_table); | 197 | acpi_get_table_by_index(u32 table_index, struct acpi_table_header **out_table); |
| 192 | 198 | ||
| 193 | acpi_status | 199 | acpi_status |
| 194 | acpi_install_table_handler(acpi_tbl_handler handler, void *context); | 200 | acpi_install_table_handler(acpi_table_handler handler, void *context); |
| 195 | 201 | ||
| 196 | acpi_status acpi_remove_table_handler(acpi_tbl_handler handler); | 202 | acpi_status acpi_remove_table_handler(acpi_table_handler handler); |
| 197 | 203 | ||
| 198 | /* | 204 | /* |
| 199 | * Namespace and name interfaces | 205 | * Namespace and name interfaces |
| @@ -438,6 +444,11 @@ acpi_get_event_resources(acpi_handle device_handle, | |||
| 438 | struct acpi_buffer *ret_buffer); | 444 | struct acpi_buffer *ret_buffer); |
| 439 | 445 | ||
| 440 | acpi_status | 446 | acpi_status |
| 447 | acpi_walk_resource_buffer(struct acpi_buffer *buffer, | ||
| 448 | acpi_walk_resource_callback user_function, | ||
| 449 | void *context); | ||
| 450 | |||
| 451 | acpi_status | ||
| 441 | acpi_walk_resources(acpi_handle device, | 452 | acpi_walk_resources(acpi_handle device, |
| 442 | char *name, | 453 | char *name, |
| 443 | acpi_walk_resource_callback user_function, void *context); | 454 | acpi_walk_resource_callback user_function, void *context); |
| @@ -462,6 +473,10 @@ acpi_buffer_to_resource(u8 *aml_buffer, | |||
| 462 | */ | 473 | */ |
| 463 | acpi_status acpi_reset(void); | 474 | acpi_status acpi_reset(void); |
| 464 | 475 | ||
| 476 | acpi_status acpi_read(u64 *value, struct acpi_generic_address *reg); | ||
| 477 | |||
| 478 | acpi_status acpi_write(u64 value, struct acpi_generic_address *reg); | ||
| 479 | |||
| 465 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 480 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 466 | acpi_read_bit_register(u32 register_id, | 481 | acpi_read_bit_register(u32 register_id, |
| 467 | u32 *return_value)) | 482 | u32 *return_value)) |
| @@ -470,20 +485,6 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | |||
| 470 | acpi_write_bit_register(u32 register_id, | 485 | acpi_write_bit_register(u32 register_id, |
| 471 | u32 value)) | 486 | u32 value)) |
| 472 | 487 | ||
| 473 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | ||
| 474 | acpi_set_firmware_waking_vector(u32 | ||
| 475 | physical_address)) | ||
| 476 | |||
| 477 | #if ACPI_MACHINE_WIDTH == 64 | ||
| 478 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | ||
| 479 | acpi_set_firmware_waking_vector64(u64 | ||
| 480 | physical_address)) | ||
| 481 | #endif | ||
| 482 | |||
| 483 | acpi_status acpi_read(u64 *value, struct acpi_generic_address *reg); | ||
| 484 | |||
| 485 | acpi_status acpi_write(u64 value, struct acpi_generic_address *reg); | ||
| 486 | |||
| 487 | /* | 488 | /* |
| 488 | * Sleep/Wake interfaces | 489 | * Sleep/Wake interfaces |
| 489 | */ | 490 | */ |
| @@ -500,6 +501,15 @@ acpi_status acpi_leave_sleep_state_prep(u8 sleep_state); | |||
| 500 | 501 | ||
| 501 | acpi_status acpi_leave_sleep_state(u8 sleep_state); | 502 | acpi_status acpi_leave_sleep_state(u8 sleep_state); |
| 502 | 503 | ||
| 504 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | ||
| 505 | acpi_set_firmware_waking_vector(u32 | ||
| 506 | physical_address)) | ||
| 507 | |||
| 508 | #if ACPI_MACHINE_WIDTH == 64 | ||
| 509 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | ||
| 510 | acpi_set_firmware_waking_vector64(u64 | ||
| 511 | physical_address)) | ||
| 512 | #endif | ||
| 503 | /* | 513 | /* |
| 504 | * ACPI Timer interfaces | 514 | * ACPI Timer interfaces |
| 505 | */ | 515 | */ |
diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h index 40349ae65464..b58c3cb6dc16 100644 --- a/include/acpi/acrestyp.h +++ b/include/acpi/acrestyp.h | |||
| @@ -102,8 +102,11 @@ typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (6 | |||
| 102 | 102 | ||
| 103 | #define ACPI_EXCLUSIVE (u8) 0x00 | 103 | #define ACPI_EXCLUSIVE (u8) 0x00 |
| 104 | #define ACPI_SHARED (u8) 0x01 | 104 | #define ACPI_SHARED (u8) 0x01 |
| 105 | #define ACPI_EXCLUSIVE_AND_WAKE (u8) 0x02 | 105 | |
| 106 | #define ACPI_SHARED_AND_WAKE (u8) 0x03 | 106 | /* Wake */ |
| 107 | |||
| 108 | #define ACPI_NOT_WAKE_CAPABLE (u8) 0x00 | ||
| 109 | #define ACPI_WAKE_CAPABLE (u8) 0x01 | ||
| 107 | 110 | ||
| 108 | /* | 111 | /* |
| 109 | * DMA Attributes | 112 | * DMA Attributes |
| @@ -171,6 +174,7 @@ struct acpi_resource_irq { | |||
| 171 | u8 triggering; | 174 | u8 triggering; |
| 172 | u8 polarity; | 175 | u8 polarity; |
| 173 | u8 sharable; | 176 | u8 sharable; |
| 177 | u8 wake_capable; | ||
| 174 | u8 interrupt_count; | 178 | u8 interrupt_count; |
| 175 | u8 interrupts[1]; | 179 | u8 interrupts[1]; |
| 176 | }; | 180 | }; |
| @@ -346,6 +350,7 @@ struct acpi_resource_extended_irq { | |||
| 346 | u8 triggering; | 350 | u8 triggering; |
| 347 | u8 polarity; | 351 | u8 polarity; |
| 348 | u8 sharable; | 352 | u8 sharable; |
| 353 | u8 wake_capable; | ||
| 349 | u8 interrupt_count; | 354 | u8 interrupt_count; |
| 350 | struct acpi_resource_source resource_source; | 355 | struct acpi_resource_source resource_source; |
| 351 | u32 interrupts[1]; | 356 | u32 interrupts[1]; |
| @@ -365,6 +370,7 @@ struct acpi_resource_gpio { | |||
| 365 | u8 producer_consumer; /* For values, see Producer/Consumer above */ | 370 | u8 producer_consumer; /* For values, see Producer/Consumer above */ |
| 366 | u8 pin_config; | 371 | u8 pin_config; |
| 367 | u8 sharable; /* For values, see Interrupt Attributes above */ | 372 | u8 sharable; /* For values, see Interrupt Attributes above */ |
| 373 | u8 wake_capable; /* For values, see Interrupt Attributes above */ | ||
| 368 | u8 io_restriction; | 374 | u8 io_restriction; |
| 369 | u8 triggering; /* For values, see Interrupt Attributes above */ | 375 | u8 triggering; /* For values, see Interrupt Attributes above */ |
| 370 | u8 polarity; /* For values, see Interrupt Attributes above */ | 376 | u8 polarity; /* For values, see Interrupt Attributes above */ |
| @@ -591,7 +597,10 @@ struct acpi_resource { | |||
| 591 | #define ACPI_RS_SIZE_MIN (u32) ACPI_ROUND_UP_TO_NATIVE_WORD (12) | 597 | #define ACPI_RS_SIZE_MIN (u32) ACPI_ROUND_UP_TO_NATIVE_WORD (12) |
| 592 | #define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type)) | 598 | #define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type)) |
| 593 | 599 | ||
| 594 | #define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) | 600 | /* Macro for walking resource templates with multiple descriptors */ |
| 601 | |||
| 602 | #define ACPI_NEXT_RESOURCE(res) \ | ||
| 603 | ACPI_ADD_PTR (struct acpi_resource, (res), (res)->length) | ||
| 595 | 604 | ||
| 596 | struct acpi_pci_routing_table { | 605 | struct acpi_pci_routing_table { |
| 597 | u32 length; | 606 | u32 length; |
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index 4f94b1d812d5..ee050e86d17c 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h | |||
| @@ -326,8 +326,6 @@ enum acpi_preferred_pm_profiles { | |||
| 326 | 326 | ||
| 327 | #pragma pack() | 327 | #pragma pack() |
| 328 | 328 | ||
| 329 | #define ACPI_FADT_OFFSET(f) (u16) ACPI_OFFSET (struct acpi_table_fadt, f) | ||
| 330 | |||
| 331 | /* | 329 | /* |
| 332 | * Internal table-related structures | 330 | * Internal table-related structures |
| 333 | */ | 331 | */ |
| @@ -359,11 +357,14 @@ struct acpi_table_desc { | |||
| 359 | /* | 357 | /* |
| 360 | * Get the remaining ACPI tables | 358 | * Get the remaining ACPI tables |
| 361 | */ | 359 | */ |
| 362 | |||
| 363 | #include <acpi/actbl1.h> | 360 | #include <acpi/actbl1.h> |
| 364 | #include <acpi/actbl2.h> | 361 | #include <acpi/actbl2.h> |
| 365 | #include <acpi/actbl3.h> | 362 | #include <acpi/actbl3.h> |
| 366 | 363 | ||
| 364 | /* Macros used to generate offsets to specific table fields */ | ||
| 365 | |||
| 366 | #define ACPI_FADT_OFFSET(f) (u16) ACPI_OFFSET (struct acpi_table_fadt, f) | ||
| 367 | |||
| 367 | /* | 368 | /* |
| 368 | * Sizes of the various flavors of FADT. We need to look closely | 369 | * Sizes of the various flavors of FADT. We need to look closely |
| 369 | * at the FADT length because the version number essentially tells | 370 | * at the FADT length because the version number essentially tells |
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index 280fc45b59dd..61f04c0dd5cb 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h | |||
| @@ -768,7 +768,7 @@ struct acpi_madt_interrupt_source { | |||
| 768 | 768 | ||
| 769 | struct acpi_madt_local_x2apic { | 769 | struct acpi_madt_local_x2apic { |
| 770 | struct acpi_subtable_header header; | 770 | struct acpi_subtable_header header; |
| 771 | u16 reserved; /* Reserved - must be zero */ | 771 | u16 reserved; /* reserved - must be zero */ |
| 772 | u32 local_apic_id; /* Processor x2APIC ID */ | 772 | u32 local_apic_id; /* Processor x2APIC ID */ |
| 773 | u32 lapic_flags; | 773 | u32 lapic_flags; |
| 774 | u32 uid; /* ACPI processor UID */ | 774 | u32 uid; /* ACPI processor UID */ |
| @@ -781,14 +781,14 @@ struct acpi_madt_local_x2apic_nmi { | |||
| 781 | u16 inti_flags; | 781 | u16 inti_flags; |
| 782 | u32 uid; /* ACPI processor UID */ | 782 | u32 uid; /* ACPI processor UID */ |
| 783 | u8 lint; /* LINTn to which NMI is connected */ | 783 | u8 lint; /* LINTn to which NMI is connected */ |
| 784 | u8 reserved[3]; | 784 | u8 reserved[3]; /* reserved - must be zero */ |
| 785 | }; | 785 | }; |
| 786 | 786 | ||
| 787 | /* 11: Generic Interrupt (ACPI 5.0) */ | 787 | /* 11: Generic Interrupt (ACPI 5.0) */ |
| 788 | 788 | ||
| 789 | struct acpi_madt_generic_interrupt { | 789 | struct acpi_madt_generic_interrupt { |
| 790 | struct acpi_subtable_header header; | 790 | struct acpi_subtable_header header; |
| 791 | u16 reserved; /* Reserved - must be zero */ | 791 | u16 reserved; /* reserved - must be zero */ |
| 792 | u32 gic_id; | 792 | u32 gic_id; |
| 793 | u32 uid; | 793 | u32 uid; |
| 794 | u32 flags; | 794 | u32 flags; |
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index 1b2b356486d1..ef9dae12bd83 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h | |||
| @@ -261,9 +261,28 @@ struct acpi_csrt_group { | |||
| 261 | u16 subdevice_id; | 261 | u16 subdevice_id; |
| 262 | u16 revision; | 262 | u16 revision; |
| 263 | u16 reserved; | 263 | u16 reserved; |
| 264 | u32 info_length; | 264 | u32 shared_info_length; |
| 265 | 265 | ||
| 266 | /* Shared data (length = info_length) immediately follows */ | 266 | /* Shared data immediately follows (Length = shared_info_length) */ |
| 267 | }; | ||
| 268 | |||
| 269 | /* Shared Info subtable */ | ||
| 270 | |||
| 271 | struct acpi_csrt_shared_info { | ||
| 272 | u16 major_version; | ||
| 273 | u16 minor_version; | ||
| 274 | u32 mmio_base_low; | ||
| 275 | u32 mmio_base_high; | ||
| 276 | u32 gsi_interrupt; | ||
| 277 | u8 interrupt_polarity; | ||
| 278 | u8 interrupt_mode; | ||
| 279 | u8 num_channels; | ||
| 280 | u8 dma_address_width; | ||
| 281 | u16 base_request_line; | ||
| 282 | u16 num_handshake_signals; | ||
| 283 | u32 max_block_size; | ||
| 284 | |||
| 285 | /* Resource descriptors immediately follow (Length = Group length - shared_info_length) */ | ||
| 267 | }; | 286 | }; |
| 268 | 287 | ||
| 269 | /* Resource Descriptor subtable */ | 288 | /* Resource Descriptor subtable */ |
diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h index 6585141e4b97..c4aae227d253 100644 --- a/include/acpi/actbl3.h +++ b/include/acpi/actbl3.h | |||
| @@ -68,13 +68,13 @@ | |||
| 68 | #define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */ | 68 | #define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */ |
| 69 | #define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */ | 69 | #define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */ |
| 70 | #define ACPI_SIG_RASF "RASF" /* RAS Feature table */ | 70 | #define ACPI_SIG_RASF "RASF" /* RAS Feature table */ |
| 71 | #define ACPI_SIG_TPM2 "TPM2" /* Trusted Platform Module 2.0 H/W interface table */ | ||
| 71 | 72 | ||
| 72 | #define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */ | 73 | #define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */ |
| 73 | #define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */ | 74 | #define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */ |
| 74 | 75 | ||
| 75 | /* Reserved table signatures */ | 76 | /* Reserved table signatures */ |
| 76 | 77 | ||
| 77 | #define ACPI_SIG_CSRT "CSRT" /* Core System Resources Table */ | ||
| 78 | #define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table */ | 78 | #define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table */ |
| 79 | #define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */ | 79 | #define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */ |
| 80 | #define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */ | 80 | #define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */ |
| @@ -550,6 +550,36 @@ enum acpi_rasf_status { | |||
| 550 | #define ACPI_RASF_ERROR (1<<2) | 550 | #define ACPI_RASF_ERROR (1<<2) |
| 551 | #define ACPI_RASF_STATUS (0x1F<<3) | 551 | #define ACPI_RASF_STATUS (0x1F<<3) |
| 552 | 552 | ||
| 553 | /******************************************************************************* | ||
| 554 | * | ||
| 555 | * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table | ||
| 556 | * Version 3 | ||
| 557 | * | ||
| 558 | * Conforms to "TPM 2.0 Hardware Interface Table (TPM2)" 29 November 2011 | ||
| 559 | * | ||
| 560 | ******************************************************************************/ | ||
| 561 | |||
| 562 | struct acpi_table_tpm2 { | ||
| 563 | struct acpi_table_header header; /* Common ACPI table header */ | ||
| 564 | u32 flags; | ||
| 565 | u64 control_address; | ||
| 566 | u32 start_method; | ||
| 567 | }; | ||
| 568 | |||
| 569 | /* Control area structure (not part of table, pointed to by control_address) */ | ||
| 570 | |||
| 571 | struct acpi_tpm2_control { | ||
| 572 | u32 reserved; | ||
| 573 | u32 error; | ||
| 574 | u32 cancel; | ||
| 575 | u32 start; | ||
| 576 | u64 interrupt_control; | ||
| 577 | u32 command_size; | ||
| 578 | u64 command_address; | ||
| 579 | u32 response_size; | ||
| 580 | u64 response_address; | ||
| 581 | }; | ||
| 582 | |||
| 553 | /* Reset to default packing */ | 583 | /* Reset to default packing */ |
| 554 | 584 | ||
| 555 | #pragma pack() | 585 | #pragma pack() |
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 4f43f1fba132..3d4e09c60e2b 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
| @@ -341,7 +341,7 @@ typedef u32 acpi_physical_address; | |||
| 341 | 341 | ||
| 342 | /* PM Timer ticks per second (HZ) */ | 342 | /* PM Timer ticks per second (HZ) */ |
| 343 | 343 | ||
| 344 | #define PM_TIMER_FREQUENCY 3579545 | 344 | #define ACPI_PM_TIMER_FREQUENCY 3579545 |
| 345 | 345 | ||
| 346 | /******************************************************************************* | 346 | /******************************************************************************* |
| 347 | * | 347 | * |
| @@ -373,6 +373,21 @@ typedef u32 acpi_name; /* 4-byte ACPI name */ | |||
| 373 | typedef char *acpi_string; /* Null terminated ASCII string */ | 373 | typedef char *acpi_string; /* Null terminated ASCII string */ |
| 374 | typedef void *acpi_handle; /* Actually a ptr to a NS Node */ | 374 | typedef void *acpi_handle; /* Actually a ptr to a NS Node */ |
| 375 | 375 | ||
| 376 | /* Time constants for timer calculations */ | ||
| 377 | |||
| 378 | #define ACPI_MSEC_PER_SEC 1000L | ||
| 379 | |||
| 380 | #define ACPI_USEC_PER_MSEC 1000L | ||
| 381 | #define ACPI_USEC_PER_SEC 1000000L | ||
| 382 | |||
| 383 | #define ACPI_100NSEC_PER_USEC 10L | ||
| 384 | #define ACPI_100NSEC_PER_MSEC 10000L | ||
| 385 | #define ACPI_100NSEC_PER_SEC 10000000L | ||
| 386 | |||
| 387 | #define ACPI_NSEC_PER_USEC 1000L | ||
| 388 | #define ACPI_NSEC_PER_MSEC 1000000L | ||
| 389 | #define ACPI_NSEC_PER_SEC 1000000000L | ||
| 390 | |||
| 376 | /* Owner IDs are used to track namespace nodes for selective deletion */ | 391 | /* Owner IDs are used to track namespace nodes for selective deletion */ |
| 377 | 392 | ||
| 378 | typedef u8 acpi_owner_id; | 393 | typedef u8 acpi_owner_id; |
| @@ -390,10 +405,6 @@ typedef u8 acpi_owner_id; | |||
| 390 | #define ACPI_MAX16_DECIMAL_DIGITS 5 | 405 | #define ACPI_MAX16_DECIMAL_DIGITS 5 |
| 391 | #define ACPI_MAX8_DECIMAL_DIGITS 3 | 406 | #define ACPI_MAX8_DECIMAL_DIGITS 3 |
| 392 | 407 | ||
| 393 | /* PM Timer ticks per second (HZ) */ | ||
| 394 | |||
| 395 | #define PM_TIMER_FREQUENCY 3579545 | ||
| 396 | |||
| 397 | /* | 408 | /* |
| 398 | * Constants with special meanings | 409 | * Constants with special meanings |
| 399 | */ | 410 | */ |
| @@ -474,6 +485,7 @@ typedef u64 acpi_integer; | |||
| 474 | */ | 485 | */ |
| 475 | #define ACPI_FULL_INITIALIZATION 0x00 | 486 | #define ACPI_FULL_INITIALIZATION 0x00 |
| 476 | #define ACPI_NO_ADDRESS_SPACE_INIT 0x01 | 487 | #define ACPI_NO_ADDRESS_SPACE_INIT 0x01 |
| 488 | #define ACPI_NO_HARDWARE_INIT 0x02 | ||
| 477 | #define ACPI_NO_EVENT_INIT 0x04 | 489 | #define ACPI_NO_EVENT_INIT 0x04 |
| 478 | #define ACPI_NO_HANDLER_INIT 0x08 | 490 | #define ACPI_NO_HANDLER_INIT 0x08 |
| 479 | #define ACPI_NO_ACPI_ENABLE 0x10 | 491 | #define ACPI_NO_ACPI_ENABLE 0x10 |
| @@ -595,7 +607,7 @@ typedef u32 acpi_object_type; | |||
| 595 | 607 | ||
| 596 | /* | 608 | /* |
| 597 | * These are special object types that never appear in | 609 | * These are special object types that never appear in |
| 598 | * a Namespace node, only in a union acpi_operand_object | 610 | * a Namespace node, only in an object of union acpi_operand_object |
| 599 | */ | 611 | */ |
| 600 | #define ACPI_TYPE_LOCAL_EXTRA 0x1C | 612 | #define ACPI_TYPE_LOCAL_EXTRA 0x1C |
| 601 | #define ACPI_TYPE_LOCAL_DATA 0x1D | 613 | #define ACPI_TYPE_LOCAL_DATA 0x1D |
| @@ -662,7 +674,7 @@ typedef u32 acpi_event_status; | |||
| 662 | #define ACPI_GPE_MAX 0xFF | 674 | #define ACPI_GPE_MAX 0xFF |
| 663 | #define ACPI_NUM_GPE 256 | 675 | #define ACPI_NUM_GPE 256 |
| 664 | 676 | ||
| 665 | /* Actions for acpi_set_gpe_wake_mask, acpi_hw_low_set_gpe */ | 677 | /* Actions for acpi_set_gpe, acpi_gpe_wakeup, acpi_hw_low_set_gpe */ |
| 666 | 678 | ||
| 667 | #define ACPI_GPE_ENABLE 0 | 679 | #define ACPI_GPE_ENABLE 0 |
| 668 | #define ACPI_GPE_DISABLE 1 | 680 | #define ACPI_GPE_DISABLE 1 |
| @@ -880,6 +892,10 @@ struct acpi_buffer { | |||
| 880 | void *pointer; /* pointer to buffer */ | 892 | void *pointer; /* pointer to buffer */ |
| 881 | }; | 893 | }; |
| 882 | 894 | ||
| 895 | /* Free a buffer created in an struct acpi_buffer via ACPI_ALLOCATE_LOCAL_BUFFER */ | ||
| 896 | |||
| 897 | #define ACPI_FREE_BUFFER(b) ACPI_FREE(b.pointer) | ||
| 898 | |||
| 883 | /* | 899 | /* |
| 884 | * name_type for acpi_get_name | 900 | * name_type for acpi_get_name |
| 885 | */ | 901 | */ |
| @@ -968,7 +984,11 @@ acpi_status(*acpi_exception_handler) (acpi_status aml_status, | |||
| 968 | /* Table Event handler (Load, load_table, etc.) and types */ | 984 | /* Table Event handler (Load, load_table, etc.) and types */ |
| 969 | 985 | ||
| 970 | typedef | 986 | typedef |
| 971 | acpi_status(*acpi_tbl_handler) (u32 event, void *table, void *context); | 987 | acpi_status(*acpi_table_handler) (u32 event, void *table, void *context); |
| 988 | |||
| 989 | #define ACPI_TABLE_LOAD 0x0 | ||
| 990 | #define ACPI_TABLE_UNLOAD 0x1 | ||
| 991 | #define ACPI_NUM_TABLE_EVENTS 2 | ||
| 972 | 992 | ||
| 973 | /* Address Spaces (For Operation Regions) */ | 993 | /* Address Spaces (For Operation Regions) */ |
| 974 | 994 | ||
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index 89cee88dd2a5..a74afaf1b80c 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /****************************************************************************** | 1 | /****************************************************************************** |
| 2 | * | 2 | * |
| 3 | * Name: acenv.h - Generation environment specific items | 3 | * Name: acenv.h - Host and compiler configuration |
| 4 | * | 4 | * |
| 5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
| 6 | 6 | ||
| @@ -44,6 +44,12 @@ | |||
| 44 | #ifndef __ACENV_H__ | 44 | #ifndef __ACENV_H__ |
| 45 | #define __ACENV_H__ | 45 | #define __ACENV_H__ |
| 46 | 46 | ||
| 47 | /* | ||
| 48 | * Environment configuration. The purpose of this file is to interface ACPICA | ||
| 49 | * to the local environment. This includes compiler-specific, OS-specific, | ||
| 50 | * and machine-specific configuration. | ||
| 51 | */ | ||
| 52 | |||
| 47 | /* Types for ACPI_MUTEX_TYPE */ | 53 | /* Types for ACPI_MUTEX_TYPE */ |
| 48 | 54 | ||
| 49 | #define ACPI_BINARY_SEMAPHORE 0 | 55 | #define ACPI_BINARY_SEMAPHORE 0 |
| @@ -60,139 +66,170 @@ | |||
| 60 | * | 66 | * |
| 61 | *****************************************************************************/ | 67 | *****************************************************************************/ |
| 62 | 68 | ||
| 63 | #ifdef ACPI_LIBRARY | 69 | /* iASL configuration */ |
| 64 | /* | ||
| 65 | * Note: The non-debug version of the acpi_library does not contain any | ||
| 66 | * debug support, for minimal size. The debug version uses ACPI_FULL_DEBUG | ||
| 67 | */ | ||
| 68 | #define ACPI_USE_LOCAL_CACHE | ||
| 69 | #endif | ||
| 70 | 70 | ||
| 71 | #ifdef ACPI_ASL_COMPILER | 71 | #ifdef ACPI_ASL_COMPILER |
| 72 | #define ACPI_DEBUG_OUTPUT | ||
| 73 | #define ACPI_APPLICATION | 72 | #define ACPI_APPLICATION |
| 74 | #define ACPI_DISASSEMBLER | 73 | #define ACPI_DISASSEMBLER |
| 74 | #define ACPI_DEBUG_OUTPUT | ||
| 75 | #define ACPI_CONSTANT_EVAL_ONLY | 75 | #define ACPI_CONSTANT_EVAL_ONLY |
| 76 | #define ACPI_LARGE_NAMESPACE_NODE | 76 | #define ACPI_LARGE_NAMESPACE_NODE |
| 77 | #define ACPI_DATA_TABLE_DISASSEMBLY | 77 | #define ACPI_DATA_TABLE_DISASSEMBLY |
| 78 | #define ACPI_SINGLE_THREADED | ||
| 78 | #endif | 79 | #endif |
| 79 | 80 | ||
| 81 | /* acpi_exec configuration. Multithreaded with full AML debugger */ | ||
| 82 | |||
| 80 | #ifdef ACPI_EXEC_APP | 83 | #ifdef ACPI_EXEC_APP |
| 81 | #undef DEBUGGER_THREADING | ||
| 82 | #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED | ||
| 83 | #define ACPI_FULL_DEBUG | ||
| 84 | #define ACPI_APPLICATION | 84 | #define ACPI_APPLICATION |
| 85 | #define ACPI_DEBUGGER | 85 | #define ACPI_FULL_DEBUG |
| 86 | #define ACPI_MUTEX_DEBUG | 86 | #define ACPI_MUTEX_DEBUG |
| 87 | #define ACPI_DBG_TRACK_ALLOCATIONS | 87 | #define ACPI_DBG_TRACK_ALLOCATIONS |
| 88 | #endif | 88 | #endif |
| 89 | 89 | ||
| 90 | /* acpi_names configuration. Single threaded with debugger output enabled. */ | ||
| 91 | |||
| 92 | #ifdef ACPI_NAMES_APP | ||
| 93 | #define ACPI_DEBUGGER | ||
| 94 | #define ACPI_APPLICATION | ||
| 95 | #define ACPI_SINGLE_THREADED | ||
| 96 | #endif | ||
| 97 | |||
| 98 | /* | ||
| 99 | * acpi_bin/acpi_help/acpi_src configuration. All single threaded, with | ||
| 100 | * no debug output. | ||
| 101 | */ | ||
| 102 | #if (defined ACPI_BIN_APP) || \ | ||
| 103 | (defined ACPI_SRC_APP) || \ | ||
| 104 | (defined ACPI_XTRACT_APP) | ||
| 105 | #define ACPI_APPLICATION | ||
| 106 | #define ACPI_SINGLE_THREADED | ||
| 107 | #endif | ||
| 108 | |||
| 109 | #ifdef ACPI_HELP_APP | ||
| 110 | #define ACPI_APPLICATION | ||
| 111 | #define ACPI_SINGLE_THREADED | ||
| 112 | #define ACPI_NO_ERROR_MESSAGES | ||
| 113 | #endif | ||
| 114 | |||
| 115 | /* Linkable ACPICA library */ | ||
| 116 | |||
| 117 | #ifdef ACPI_LIBRARY | ||
| 118 | #define ACPI_USE_LOCAL_CACHE | ||
| 119 | #define ACPI_FUTURE_USAGE | ||
| 120 | #endif | ||
| 121 | |||
| 122 | /* Common for all ACPICA applications */ | ||
| 123 | |||
| 90 | #ifdef ACPI_APPLICATION | 124 | #ifdef ACPI_APPLICATION |
| 91 | #define ACPI_USE_SYSTEM_CLIBRARY | 125 | #define ACPI_USE_SYSTEM_CLIBRARY |
| 92 | #define ACPI_USE_LOCAL_CACHE | 126 | #define ACPI_USE_LOCAL_CACHE |
| 93 | #endif | 127 | #endif |
| 94 | 128 | ||
| 129 | /* Common debug support */ | ||
| 130 | |||
| 95 | #ifdef ACPI_FULL_DEBUG | 131 | #ifdef ACPI_FULL_DEBUG |
| 96 | #define ACPI_DEBUGGER | 132 | #define ACPI_DEBUGGER |
| 97 | #define ACPI_DEBUG_OUTPUT | 133 | #define ACPI_DEBUG_OUTPUT |
| 98 | #define ACPI_DISASSEMBLER | 134 | #define ACPI_DISASSEMBLER |
| 99 | #endif | 135 | #endif |
| 100 | 136 | ||
| 101 | /* | ||
| 102 | * Environment configuration. The purpose of this file is to interface to the | ||
| 103 | * local generation environment. | ||
| 104 | * | ||
| 105 | * 1) ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library. | ||
| 106 | * Otherwise, local versions of string/memory functions will be used. | ||
| 107 | * 2) ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and | ||
| 108 | * the standard header files may be used. | ||
| 109 | * | ||
| 110 | * The ACPI subsystem only uses low level C library functions that do not call | ||
| 111 | * operating system services and may therefore be inlined in the code. | ||
| 112 | * | ||
| 113 | * It may be necessary to tailor these include files to the target | ||
| 114 | * generation environment. | ||
| 115 | * | ||
| 116 | * | ||
| 117 | * Functions and constants used from each header: | ||
| 118 | * | ||
| 119 | * string.h: memcpy | ||
| 120 | * memset | ||
| 121 | * strcat | ||
| 122 | * strcmp | ||
| 123 | * strcpy | ||
| 124 | * strlen | ||
| 125 | * strncmp | ||
| 126 | * strncat | ||
| 127 | * strncpy | ||
| 128 | * | ||
| 129 | * stdlib.h: strtoul | ||
| 130 | * | ||
| 131 | * stdarg.h: va_list | ||
| 132 | * va_arg | ||
| 133 | * va_start | ||
| 134 | * va_end | ||
| 135 | * | ||
| 136 | */ | ||
| 137 | 137 | ||
| 138 | /*! [Begin] no source code translation */ | 138 | /*! [Begin] no source code translation */ |
| 139 | 139 | ||
| 140 | /****************************************************************************** | ||
| 141 | * | ||
| 142 | * Host configuration files. The compiler configuration files are included | ||
| 143 | * by the host files. | ||
| 144 | * | ||
| 145 | *****************************************************************************/ | ||
| 146 | |||
| 140 | #if defined(_LINUX) || defined(__linux__) | 147 | #if defined(_LINUX) || defined(__linux__) |
| 141 | #include <acpi/platform/aclinux.h> | 148 | #include <acpi/platform/aclinux.h> |
| 142 | 149 | ||
| 143 | #elif defined(_AED_EFI) | ||
| 144 | #include "acefi.h" | ||
| 145 | |||
| 146 | #elif defined(WIN32) | ||
| 147 | #include "acwin.h" | ||
| 148 | |||
| 149 | #elif defined(WIN64) | ||
| 150 | #include "acwin64.h" | ||
| 151 | |||
| 152 | #elif defined(MSDOS) /* Must appear after WIN32 and WIN64 check */ | ||
| 153 | #include "acdos16.h" | ||
| 154 | |||
| 155 | #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) | 150 | #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) |
| 156 | #include "acfreebsd.h" | 151 | #include "acfreebsd.h" |
| 157 | 152 | ||
| 158 | #elif defined(__NetBSD__) | 153 | #elif defined(__NetBSD__) |
| 159 | #include "acnetbsd.h" | 154 | #include "acnetbsd.h" |
| 160 | 155 | ||
| 156 | #elif defined(__sun) | ||
| 157 | #include "acsolaris.h" | ||
| 158 | |||
| 161 | #elif defined(MODESTO) | 159 | #elif defined(MODESTO) |
| 162 | #include "acmodesto.h" | 160 | #include "acmodesto.h" |
| 163 | 161 | ||
| 164 | #elif defined(NETWARE) | 162 | #elif defined(NETWARE) |
| 165 | #include "acnetware.h" | 163 | #include "acnetware.h" |
| 166 | 164 | ||
| 167 | #elif defined(__sun) | 165 | #elif defined(_CYGWIN) |
| 168 | #include "acsolaris.h" | 166 | #include "accygwin.h" |
| 169 | 167 | ||
| 170 | #else | 168 | #elif defined(WIN32) |
| 169 | #include "acwin.h" | ||
| 170 | |||
| 171 | #elif defined(WIN64) | ||
| 172 | #include "acwin64.h" | ||
| 171 | 173 | ||
| 172 | /* All other environments */ | 174 | #elif defined(_WRS_LIB_BUILD) |
| 175 | #include "acvxworks.h" | ||
| 173 | 176 | ||
| 174 | #define ACPI_USE_STANDARD_HEADERS | 177 | #elif defined(__OS2__) |
| 178 | #include "acos2.h" | ||
| 175 | 179 | ||
| 176 | #define COMPILER_DEPENDENT_INT64 long long | 180 | #elif defined(_AED_EFI) |
| 177 | #define COMPILER_DEPENDENT_UINT64 unsigned long long | 181 | #include "acefi.h" |
| 182 | |||
| 183 | #elif defined(__HAIKU__) | ||
| 184 | #include "achaiku.h" | ||
| 178 | 185 | ||
| 186 | #else | ||
| 187 | |||
| 188 | /* Unknown environment */ | ||
| 189 | |||
| 190 | #error Unknown target environment | ||
| 179 | #endif | 191 | #endif |
| 180 | 192 | ||
| 181 | /*! [End] no source code translation !*/ | 193 | /*! [End] no source code translation !*/ |
| 182 | 194 | ||
| 183 | /****************************************************************************** | 195 | /****************************************************************************** |
| 184 | * | 196 | * |
| 185 | * Miscellaneous configuration | 197 | * Setup defaults for the required symbols that were not defined in one of |
| 198 | * the host/compiler files above. | ||
| 186 | * | 199 | * |
| 187 | *****************************************************************************/ | 200 | *****************************************************************************/ |
| 188 | 201 | ||
| 189 | /* | 202 | /* 64-bit data types */ |
| 190 | * Are mutexes supported by the host? default is no, use binary semaphores. | 203 | |
| 191 | */ | 204 | #ifndef COMPILER_DEPENDENT_INT64 |
| 205 | #define COMPILER_DEPENDENT_INT64 long long | ||
| 206 | #endif | ||
| 207 | |||
| 208 | #ifndef COMPILER_DEPENDENT_UINT64 | ||
| 209 | #define COMPILER_DEPENDENT_UINT64 unsigned long long | ||
| 210 | #endif | ||
| 211 | |||
| 212 | /* Type of mutex supported by host. Default is binary semaphores. */ | ||
| 192 | #ifndef ACPI_MUTEX_TYPE | 213 | #ifndef ACPI_MUTEX_TYPE |
| 193 | #define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE | 214 | #define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE |
| 194 | #endif | 215 | #endif |
| 195 | 216 | ||
| 217 | /* Global Lock acquire/release */ | ||
| 218 | |||
| 219 | #ifndef ACPI_ACQUIRE_GLOBAL_LOCK | ||
| 220 | #define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acquired) acquired = 1 | ||
| 221 | #endif | ||
| 222 | |||
| 223 | #ifndef ACPI_RELEASE_GLOBAL_LOCK | ||
| 224 | #define ACPI_RELEASE_GLOBAL_LOCK(Glptr, pending) pending = 0 | ||
| 225 | #endif | ||
| 226 | |||
| 227 | /* Flush CPU cache - used when going to sleep. Wbinvd or similar. */ | ||
| 228 | |||
| 229 | #ifndef ACPI_FLUSH_CPU_CACHE | ||
| 230 | #define ACPI_FLUSH_CPU_CACHE() | ||
| 231 | #endif | ||
| 232 | |||
| 196 | /* "inline" keywords - configurable since inline is not standardized */ | 233 | /* "inline" keywords - configurable since inline is not standardized */ |
| 197 | 234 | ||
| 198 | #ifndef ACPI_INLINE | 235 | #ifndef ACPI_INLINE |
| @@ -200,6 +237,30 @@ | |||
| 200 | #endif | 237 | #endif |
| 201 | 238 | ||
| 202 | /* | 239 | /* |
| 240 | * Configurable calling conventions: | ||
| 241 | * | ||
| 242 | * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) | ||
| 243 | * ACPI_EXTERNAL_XFACE - External ACPI interfaces | ||
| 244 | * ACPI_INTERNAL_XFACE - Internal ACPI interfaces | ||
| 245 | * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces | ||
| 246 | */ | ||
| 247 | #ifndef ACPI_SYSTEM_XFACE | ||
| 248 | #define ACPI_SYSTEM_XFACE | ||
| 249 | #endif | ||
| 250 | |||
| 251 | #ifndef ACPI_EXTERNAL_XFACE | ||
| 252 | #define ACPI_EXTERNAL_XFACE | ||
| 253 | #endif | ||
| 254 | |||
| 255 | #ifndef ACPI_INTERNAL_XFACE | ||
| 256 | #define ACPI_INTERNAL_XFACE | ||
| 257 | #endif | ||
| 258 | |||
| 259 | #ifndef ACPI_INTERNAL_VAR_XFACE | ||
| 260 | #define ACPI_INTERNAL_VAR_XFACE | ||
| 261 | #endif | ||
| 262 | |||
| 263 | /* | ||
| 203 | * Debugger threading model | 264 | * Debugger threading model |
| 204 | * Use single threaded if the entire subsystem is contained in an application | 265 | * Use single threaded if the entire subsystem is contained in an application |
| 205 | * Use multiple threaded when the subsystem is running in the kernel. | 266 | * Use multiple threaded when the subsystem is running in the kernel. |
| @@ -222,17 +283,26 @@ | |||
| 222 | * | 283 | * |
| 223 | *****************************************************************************/ | 284 | *****************************************************************************/ |
| 224 | 285 | ||
| 225 | #define ACPI_IS_ASCII(c) ((c) < 0x80) | ||
| 226 | |||
| 227 | #ifdef ACPI_USE_SYSTEM_CLIBRARY | ||
| 228 | /* | 286 | /* |
| 229 | * Use the standard C library headers. | 287 | * ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library. |
| 230 | * We want to keep these to a minimum. | 288 | * Otherwise, local versions of string/memory functions will be used. |
| 289 | * ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and | ||
| 290 | * the standard header files may be used. | ||
| 291 | * | ||
| 292 | * The ACPICA subsystem only uses low level C library functions that do not call | ||
| 293 | * operating system services and may therefore be inlined in the code. | ||
| 294 | * | ||
| 295 | * It may be necessary to tailor these include files to the target | ||
| 296 | * generation environment. | ||
| 231 | */ | 297 | */ |
| 298 | #ifdef ACPI_USE_SYSTEM_CLIBRARY | ||
| 299 | |||
| 300 | /* Use the standard C library headers. We want to keep these to a minimum. */ | ||
| 301 | |||
| 232 | #ifdef ACPI_USE_STANDARD_HEADERS | 302 | #ifdef ACPI_USE_STANDARD_HEADERS |
| 233 | /* | 303 | |
| 234 | * Use the standard headers from the standard locations | 304 | /* Use the standard headers from the standard locations */ |
| 235 | */ | 305 | |
| 236 | #include <stdarg.h> | 306 | #include <stdarg.h> |
| 237 | #include <stdlib.h> | 307 | #include <stdlib.h> |
| 238 | #include <string.h> | 308 | #include <string.h> |
| @@ -240,9 +310,8 @@ | |||
| 240 | 310 | ||
| 241 | #endif /* ACPI_USE_STANDARD_HEADERS */ | 311 | #endif /* ACPI_USE_STANDARD_HEADERS */ |
| 242 | 312 | ||
| 243 | /* | 313 | /* We will be linking to the standard Clib functions */ |
| 244 | * We will be linking to the standard Clib functions | 314 | |
| 245 | */ | ||
| 246 | #define ACPI_STRSTR(s1,s2) strstr((s1), (s2)) | 315 | #define ACPI_STRSTR(s1,s2) strstr((s1), (s2)) |
| 247 | #define ACPI_STRCHR(s1,c) strchr((s1), (c)) | 316 | #define ACPI_STRCHR(s1,c) strchr((s1), (c)) |
| 248 | #define ACPI_STRLEN(s) (acpi_size) strlen((s)) | 317 | #define ACPI_STRLEN(s) (acpi_size) strlen((s)) |
| @@ -274,13 +343,12 @@ | |||
| 274 | * | 343 | * |
| 275 | *****************************************************************************/ | 344 | *****************************************************************************/ |
| 276 | 345 | ||
| 277 | /* | 346 | /* |
| 278 | * Use local definitions of C library macros and functions | 347 | * Use local definitions of C library macros and functions. These function |
| 279 | * NOTE: The function implementations may not be as efficient | 348 | * implementations may not be as efficient as an inline or assembly code |
| 280 | * as an inline or assembly code implementation provided by a | 349 | * implementation provided by a native C library, but they are functionally |
| 281 | * native C library. | 350 | * equivalent. |
| 282 | */ | 351 | */ |
| 283 | |||
| 284 | #ifndef va_arg | 352 | #ifndef va_arg |
| 285 | 353 | ||
| 286 | #ifndef _VALIST | 354 | #ifndef _VALIST |
| @@ -288,22 +356,22 @@ | |||
| 288 | typedef char *va_list; | 356 | typedef char *va_list; |
| 289 | #endif /* _VALIST */ | 357 | #endif /* _VALIST */ |
| 290 | 358 | ||
| 291 | /* | 359 | /* Storage alignment properties */ |
| 292 | * Storage alignment properties | 360 | |
| 293 | */ | ||
| 294 | #define _AUPBND (sizeof (acpi_native_int) - 1) | 361 | #define _AUPBND (sizeof (acpi_native_int) - 1) |
| 295 | #define _ADNBND (sizeof (acpi_native_int) - 1) | 362 | #define _ADNBND (sizeof (acpi_native_int) - 1) |
| 296 | 363 | ||
| 297 | /* | 364 | /* Variable argument list macro definitions */ |
| 298 | * Variable argument list macro definitions | 365 | |
| 299 | */ | ||
| 300 | #define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd))) | 366 | #define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd))) |
| 301 | #define va_arg(ap, T) (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND)))) | 367 | #define va_arg(ap, T) (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND)))) |
| 302 | #define va_end(ap) (void) 0 | 368 | #define va_end(ap) (ap = (va_list) NULL) |
| 303 | #define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND)))) | 369 | #define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND)))) |
| 304 | 370 | ||
| 305 | #endif /* va_arg */ | 371 | #endif /* va_arg */ |
| 306 | 372 | ||
| 373 | /* Use the local (ACPICA) definitions of the clib functions */ | ||
| 374 | |||
| 307 | #define ACPI_STRSTR(s1,s2) acpi_ut_strstr ((s1), (s2)) | 375 | #define ACPI_STRSTR(s1,s2) acpi_ut_strstr ((s1), (s2)) |
| 308 | #define ACPI_STRCHR(s1,c) acpi_ut_strchr ((s1), (c)) | 376 | #define ACPI_STRCHR(s1,c) acpi_ut_strchr ((s1), (c)) |
| 309 | #define ACPI_STRLEN(s) (acpi_size) acpi_ut_strlen ((s)) | 377 | #define ACPI_STRLEN(s) (acpi_size) acpi_ut_strlen ((s)) |
| @@ -322,59 +390,4 @@ typedef char *va_list; | |||
| 322 | 390 | ||
| 323 | #endif /* ACPI_USE_SYSTEM_CLIBRARY */ | 391 | #endif /* ACPI_USE_SYSTEM_CLIBRARY */ |
| 324 | 392 | ||
| 325 | /****************************************************************************** | ||
| 326 | * | ||
| 327 | * Assembly code macros | ||
| 328 | * | ||
| 329 | *****************************************************************************/ | ||
| 330 | |||
| 331 | /* | ||
| 332 | * Handle platform- and compiler-specific assembly language differences. | ||
| 333 | * These should already have been defined by the platform includes above. | ||
| 334 | * | ||
| 335 | * Notes: | ||
| 336 | * 1) Interrupt 3 is used to break into a debugger | ||
| 337 | * 2) Interrupts are turned off during ACPI register setup | ||
| 338 | */ | ||
| 339 | |||
| 340 | /* Unrecognized compiler, use defaults */ | ||
| 341 | |||
| 342 | #ifndef ACPI_ASM_MACROS | ||
| 343 | |||
| 344 | /* | ||
| 345 | * Calling conventions: | ||
| 346 | * | ||
| 347 | * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) | ||
| 348 | * ACPI_EXTERNAL_XFACE - External ACPI interfaces | ||
| 349 | * ACPI_INTERNAL_XFACE - Internal ACPI interfaces | ||
| 350 | * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces | ||
| 351 | */ | ||
| 352 | #define ACPI_SYSTEM_XFACE | ||
| 353 | #define ACPI_EXTERNAL_XFACE | ||
| 354 | #define ACPI_INTERNAL_XFACE | ||
| 355 | #define ACPI_INTERNAL_VAR_XFACE | ||
| 356 | |||
| 357 | #define ACPI_ASM_MACROS | ||
| 358 | #define BREAKPOINT3 | ||
| 359 | #define ACPI_DISABLE_IRQS() | ||
| 360 | #define ACPI_ENABLE_IRQS() | ||
| 361 | #define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acq) | ||
| 362 | #define ACPI_RELEASE_GLOBAL_LOCK(Glptr, acq) | ||
| 363 | |||
| 364 | #endif /* ACPI_ASM_MACROS */ | ||
| 365 | |||
| 366 | #ifdef ACPI_APPLICATION | ||
| 367 | |||
| 368 | /* Don't want software interrupts within a ring3 application */ | ||
| 369 | |||
| 370 | #undef BREAKPOINT3 | ||
| 371 | #define BREAKPOINT3 | ||
| 372 | #endif | ||
| 373 | |||
| 374 | /****************************************************************************** | ||
| 375 | * | ||
| 376 | * Compiler-specific information is contained in the compiler-specific | ||
| 377 | * headers. | ||
| 378 | * | ||
| 379 | *****************************************************************************/ | ||
| 380 | #endif /* __ACENV_H__ */ | 393 | #endif /* __ACENV_H__ */ |
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h index 72553b0c9f33..7433ad10d2a8 100644 --- a/include/acpi/platform/acgcc.h +++ b/include/acpi/platform/acgcc.h | |||
| @@ -64,8 +64,4 @@ | |||
| 64 | */ | 64 | */ |
| 65 | #define ACPI_UNUSED_VAR __attribute__ ((unused)) | 65 | #define ACPI_UNUSED_VAR __attribute__ ((unused)) |
| 66 | 66 | ||
| 67 | #ifdef _ANSI | ||
| 68 | #define inline | ||
| 69 | #endif | ||
| 70 | |||
| 71 | #endif /* __ACGCC_H__ */ | 67 | #endif /* __ACGCC_H__ */ |
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 85d5d8f38452..33d05b06c6ef 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h | |||
| @@ -108,7 +108,6 @@ | |||
| 108 | 108 | ||
| 109 | #include <acpi/platform/acgcc.h> | 109 | #include <acpi/platform/acgcc.h> |
| 110 | 110 | ||
| 111 | |||
| 112 | #ifdef __KERNEL__ | 111 | #ifdef __KERNEL__ |
| 113 | #include <acpi/actypes.h> | 112 | #include <acpi/actypes.h> |
| 114 | /* | 113 | /* |
