diff options
author | Bob Moore <robert.moore@intel.com> | 2006-01-27 16:43:00 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-01-31 03:25:09 -0500 |
commit | b8e4d89357fc434618a59c1047cac72641191805 (patch) | |
tree | ac97fcc6fdc277c682365900663872c96f2420bd /include/acpi/acmacros.h | |
parent | 292dd876ee765c478b27c93cc51e93a558ed58bf (diff) |
[ACPI] ACPICA 20060127
Implemented support in the Resource Manager to allow
unresolved namestring references within resource package
objects for the _PRT method. This support is in addition
to the previously implemented unresolved reference
support within the AML parser. If the interpreter slack
mode is enabled (true on Linux unless acpi=strict),
these unresolved references will be passed through
to the caller as a NULL package entry.
http://bugzilla.kernel.org/show_bug.cgi?id=5741
Implemented and deployed new macros and functions for
error and warning messages across the subsystem. These
macros are simpler and generate less code than their
predecessors. The new macros ACPI_ERROR, ACPI_EXCEPTION,
ACPI_WARNING, and ACPI_INFO replace the ACPI_REPORT_*
macros.
Implemented the acpi_cpu_flags type to simplify host OS
integration of the Acquire/Release Lock OSL interfaces.
Suggested by Steven Rostedt and Andrew Morton.
Fixed a problem where Alias ASL operators are sometimes
not correctly resolved. causing AE_AML_INTERNAL
http://bugzilla.kernel.org/show_bug.cgi?id=5189
http://bugzilla.kernel.org/show_bug.cgi?id=5674
Fixed several problems with the implementation of the
ConcatenateResTemplate ASL operator. As per the ACPI
specification, zero length buffers are now treated as a
single EndTag. One-length buffers always cause a fatal
exception. Non-zero length buffers that do not end with
a full 2-byte EndTag cause a fatal exception.
Fixed a possible structure overwrite in the
AcpiGetObjectInfo external interface. (With assistance
from Thomas Renninger)
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/acpi/acmacros.h')
-rw-r--r-- | include/acpi/acmacros.h | 87 |
1 files changed, 32 insertions, 55 deletions
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index 49ba151766de..f2be2a881730 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h | |||
@@ -341,8 +341,12 @@ | |||
341 | /* | 341 | /* |
342 | * Rounding macros (Power of two boundaries only) | 342 | * Rounding macros (Power of two boundaries only) |
343 | */ | 343 | */ |
344 | #define ACPI_ROUND_DOWN(value,boundary) (((acpi_native_uint)(value)) & (~(((acpi_native_uint) boundary)-1))) | 344 | #define ACPI_ROUND_DOWN(value,boundary) (((acpi_native_uint)(value)) & \ |
345 | #define ACPI_ROUND_UP(value,boundary) ((((acpi_native_uint)(value)) + (((acpi_native_uint) boundary)-1)) & (~(((acpi_native_uint) boundary)-1))) | 345 | (~(((acpi_native_uint) boundary)-1))) |
346 | |||
347 | #define ACPI_ROUND_UP(value,boundary) ((((acpi_native_uint)(value)) + \ | ||
348 | (((acpi_native_uint) boundary)-1)) & \ | ||
349 | (~(((acpi_native_uint) boundary)-1))) | ||
346 | 350 | ||
347 | #define ACPI_ROUND_DOWN_TO_32_BITS(a) ACPI_ROUND_DOWN(a,4) | 351 | #define ACPI_ROUND_DOWN_TO_32_BITS(a) ACPI_ROUND_DOWN(a,4) |
348 | #define ACPI_ROUND_DOWN_TO_64_BITS(a) ACPI_ROUND_DOWN(a,8) | 352 | #define ACPI_ROUND_DOWN_TO_64_BITS(a) ACPI_ROUND_DOWN(a,8) |
@@ -379,10 +383,11 @@ | |||
379 | 383 | ||
380 | /* Generate a UUID */ | 384 | /* Generate a UUID */ |
381 | 385 | ||
382 | #define ACPI_INIT_UUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) (a) & 0xFF, ((a) >> 8) & 0xFF, ((a) >> 16) & 0xFF, ((a) >> 24) & 0xFF, \ | 386 | #define ACPI_INIT_UUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \ |
383 | (b) & 0xFF, ((b) >> 8) & 0xFF, \ | 387 | (a) & 0xFF, ((a) >> 8) & 0xFF, ((a) >> 16) & 0xFF, ((a) >> 24) & 0xFF, \ |
384 | (c) & 0xFF, ((c) >> 8) & 0xFF, \ | 388 | (b) & 0xFF, ((b) >> 8) & 0xFF, \ |
385 | (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) | 389 | (c) & 0xFF, ((c) >> 8) & 0xFF, \ |
390 | (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) | ||
386 | 391 | ||
387 | /* | 392 | /* |
388 | * An struct acpi_namespace_node * can appear in some contexts, | 393 | * An struct acpi_namespace_node * can appear in some contexts, |
@@ -442,13 +447,12 @@ | |||
442 | #define GET_CURRENT_ARG_TYPE(list) (list & ((u32) 0x1F)) | 447 | #define GET_CURRENT_ARG_TYPE(list) (list & ((u32) 0x1F)) |
443 | #define INCREMENT_ARG_LIST(list) (list >>= ((u32) ARG_TYPE_WIDTH)) | 448 | #define INCREMENT_ARG_LIST(list) (list >>= ((u32) ARG_TYPE_WIDTH)) |
444 | 449 | ||
450 | #if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES) | ||
445 | /* | 451 | /* |
446 | * Module name is include in both debug and non-debug versions primarily for | 452 | * Module name is include in both debug and non-debug versions primarily for |
447 | * error messages. The __FILE__ macro is not very useful for this, because it | 453 | * error messages. The __FILE__ macro is not very useful for this, because it |
448 | * often includes the entire pathname to the module | 454 | * often includes the entire pathname to the module |
449 | */ | 455 | */ |
450 | #if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES) | ||
451 | |||
452 | #define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_acpi_module_name = name; | 456 | #define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_acpi_module_name = name; |
453 | #else | 457 | #else |
454 | #define ACPI_MODULE_NAME(name) | 458 | #define ACPI_MODULE_NAME(name) |
@@ -458,45 +462,31 @@ | |||
458 | * Ascii error messages can be configured out | 462 | * Ascii error messages can be configured out |
459 | */ | 463 | */ |
460 | #ifndef ACPI_NO_ERROR_MESSAGES | 464 | #ifndef ACPI_NO_ERROR_MESSAGES |
461 | 465 | #define AE_INFO _acpi_module_name, __LINE__ | |
462 | #define ACPI_PARAM_LIST(pl) pl | ||
463 | #define ACPI_LOCATION_INFO _acpi_module_name, __LINE__ | ||
464 | 466 | ||
465 | /* | 467 | /* |
466 | * Error reporting. Callers module and line number are inserted automatically | 468 | * Error reporting. Callers module and line number are inserted by AE_INFO, |
467 | * These macros are used for both the debug and non-debug versions of the code | 469 | * the plist contains a set of parens to allow variable-length lists. |
470 | * These macros are used for both the debug and non-debug versions of the code. | ||
468 | */ | 471 | */ |
469 | #define ACPI_REPORT_INFO(fp) {acpi_ut_report_info (ACPI_LOCATION_INFO); \ | 472 | #define ACPI_INFO(plist) acpi_ut_info plist |
470 | acpi_os_printf ACPI_PARAM_LIST (fp);} | 473 | #define ACPI_WARNING(plist) acpi_ut_warning plist |
471 | #define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error (ACPI_LOCATION_INFO); \ | 474 | #define ACPI_EXCEPTION(plist) acpi_ut_exception plist |
472 | acpi_os_printf ACPI_PARAM_LIST (fp);} | 475 | #define ACPI_ERROR(plist) acpi_ut_error plist |
473 | #define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning (ACPI_LOCATION_INFO); \ | 476 | #define ACPI_ERROR_NAMESPACE(s,e) acpi_ns_report_error (AE_INFO, s, e); |
474 | acpi_os_printf ACPI_PARAM_LIST (fp);} | 477 | #define ACPI_ERROR_METHOD(s,n,p,e) acpi_ns_report_method_error (AE_INFO, s, n, p, e); |
475 | #define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error (ACPI_LOCATION_INFO, \ | ||
476 | s, e); | ||
477 | #define ACPI_REPORT_MTERROR(s,n,p,e) acpi_ns_report_method_error (ACPI_LOCATION_INFO, \ | ||
478 | s, n, p, e); | ||
479 | |||
480 | /* Error reporting. These versions pass thru the module and lineno */ | ||
481 | 478 | ||
482 | #define _ACPI_REPORT_INFO(a,b,fp) {acpi_ut_report_info (a,b); \ | ||
483 | acpi_os_printf ACPI_PARAM_LIST (fp);} | ||
484 | #define _ACPI_REPORT_ERROR(a,b,fp) {acpi_ut_report_error (a,b); \ | ||
485 | acpi_os_printf ACPI_PARAM_LIST (fp);} | ||
486 | #define _ACPI_REPORT_WARNING(a,b,fp) {acpi_ut_report_warning (a,b); \ | ||
487 | acpi_os_printf ACPI_PARAM_LIST (fp);} | ||
488 | #else | 479 | #else |
489 | 480 | ||
490 | /* No error messages */ | 481 | /* No error messages */ |
491 | 482 | ||
492 | #define ACPI_REPORT_INFO(fp) | 483 | #define ACPI_INFO(plist) |
493 | #define ACPI_REPORT_ERROR(fp) | 484 | #define ACPI_WARNING(plist) |
494 | #define ACPI_REPORT_WARNING(fp) | 485 | #define ACPI_EXCEPTION(plist) |
495 | #define ACPI_REPORT_NSERROR(s,e) | 486 | #define ACPI_ERROR(plist) |
496 | #define ACPI_REPORT_MTERROR(s,n,p,e) | 487 | #define ACPI_ERROR_NAMESPACE(s,e) |
497 | #define _ACPI_REPORT_INFO(a,b,c,fp) | 488 | #define ACPI_ERROR_METHOD(s,n,p,e) |
498 | #define _ACPI_REPORT_ERROR(a,b,c,fp) | 489 | |
499 | #define _ACPI_REPORT_WARNING(a,b,c,fp) | ||
500 | #endif | 490 | #endif |
501 | 491 | ||
502 | /* | 492 | /* |
@@ -538,7 +528,7 @@ | |||
538 | #endif | 528 | #endif |
539 | 529 | ||
540 | #define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ | 530 | #define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ |
541 | acpi_ut_trace(ACPI_DEBUG_PARAMETERS) | 531 | acpi_ut_trace(ACPI_DEBUG_PARAMETERS) |
542 | #define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ | 532 | #define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ |
543 | acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b) | 533 | acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b) |
544 | #define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \ | 534 | #define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \ |
@@ -632,18 +622,6 @@ | |||
632 | #define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d) | 622 | #define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d) |
633 | #define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a) | 623 | #define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a) |
634 | #define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT) | 624 | #define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT) |
635 | #define ACPI_BREAK_MSG(a) acpi_os_signal (ACPI_SIGNAL_BREAKPOINT,(a)) | ||
636 | |||
637 | /* | ||
638 | * Generate INT3 on ACPI_ERROR (Debug only!) | ||
639 | */ | ||
640 | #define ACPI_ERROR_BREAK | ||
641 | #ifdef ACPI_ERROR_BREAK | ||
642 | #define ACPI_BREAK_ON_ERROR(lvl) if ((lvl)&ACPI_ERROR) \ | ||
643 | acpi_os_signal(ACPI_SIGNAL_BREAKPOINT,"Fatal error encountered\n") | ||
644 | #else | ||
645 | #define ACPI_BREAK_ON_ERROR(lvl) | ||
646 | #endif | ||
647 | 625 | ||
648 | /* | 626 | /* |
649 | * Master debug print macros | 627 | * Master debug print macros |
@@ -651,8 +629,8 @@ | |||
651 | * 1) Debug print for the current component is enabled | 629 | * 1) Debug print for the current component is enabled |
652 | * 2) Debug error level or trace level for the print statement is enabled | 630 | * 2) Debug error level or trace level for the print statement is enabled |
653 | */ | 631 | */ |
654 | #define ACPI_DEBUG_PRINT(pl) acpi_ut_debug_print ACPI_PARAM_LIST(pl) | 632 | #define ACPI_DEBUG_PRINT(plist) acpi_ut_debug_print plist |
655 | #define ACPI_DEBUG_PRINT_RAW(pl) acpi_ut_debug_print_raw ACPI_PARAM_LIST(pl) | 633 | #define ACPI_DEBUG_PRINT_RAW(plist) acpi_ut_debug_print_raw plist |
656 | 634 | ||
657 | #else | 635 | #else |
658 | /* | 636 | /* |
@@ -681,7 +659,6 @@ | |||
681 | #define ACPI_DUMP_BUFFER(a,b) | 659 | #define ACPI_DUMP_BUFFER(a,b) |
682 | #define ACPI_DEBUG_PRINT(pl) | 660 | #define ACPI_DEBUG_PRINT(pl) |
683 | #define ACPI_DEBUG_PRINT_RAW(pl) | 661 | #define ACPI_DEBUG_PRINT_RAW(pl) |
684 | #define ACPI_BREAK_MSG(a) | ||
685 | 662 | ||
686 | #define return_VOID return | 663 | #define return_VOID return |
687 | #define return_ACPI_STATUS(s) return(s) | 664 | #define return_ACPI_STATUS(s) return(s) |