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 /drivers/acpi/utilities/utalloc.c | |
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 'drivers/acpi/utilities/utalloc.c')
-rw-r--r-- | drivers/acpi/utilities/utalloc.c | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/drivers/acpi/utilities/utalloc.c b/drivers/acpi/utilities/utalloc.c index 0efcbdf7e620..03b0044974c2 100644 --- a/drivers/acpi/utilities/utalloc.c +++ b/drivers/acpi/utilities/utalloc.c | |||
@@ -301,8 +301,8 @@ void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line) | |||
301 | /* Check for an inadvertent size of zero bytes */ | 301 | /* Check for an inadvertent size of zero bytes */ |
302 | 302 | ||
303 | if (!size) { | 303 | if (!size) { |
304 | _ACPI_REPORT_ERROR(module, line, | 304 | ACPI_ERROR((module, line, |
305 | ("ut_allocate: Attempt to allocate zero bytes, allocating 1 byte\n")); | 305 | "ut_allocate: Attempt to allocate zero bytes, allocating 1 byte")); |
306 | size = 1; | 306 | size = 1; |
307 | } | 307 | } |
308 | 308 | ||
@@ -310,9 +310,9 @@ void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line) | |||
310 | if (!allocation) { | 310 | if (!allocation) { |
311 | /* Report allocation error */ | 311 | /* Report allocation error */ |
312 | 312 | ||
313 | _ACPI_REPORT_ERROR(module, line, | 313 | ACPI_ERROR((module, line, |
314 | ("ut_allocate: Could not allocate size %X\n", | 314 | "ut_allocate: Could not allocate size %X", |
315 | (u32) size)); | 315 | (u32) size)); |
316 | 316 | ||
317 | return_PTR(NULL); | 317 | return_PTR(NULL); |
318 | } | 318 | } |
@@ -344,8 +344,8 @@ void *acpi_ut_callocate(acpi_size size, u32 component, char *module, u32 line) | |||
344 | /* Check for an inadvertent size of zero bytes */ | 344 | /* Check for an inadvertent size of zero bytes */ |
345 | 345 | ||
346 | if (!size) { | 346 | if (!size) { |
347 | _ACPI_REPORT_ERROR(module, line, | 347 | ACPI_ERROR((module, line, |
348 | ("ut_callocate: Attempt to allocate zero bytes, allocating 1 byte\n")); | 348 | "Attempt to allocate zero bytes, allocating 1 byte")); |
349 | size = 1; | 349 | size = 1; |
350 | } | 350 | } |
351 | 351 | ||
@@ -353,9 +353,8 @@ void *acpi_ut_callocate(acpi_size size, u32 component, char *module, u32 line) | |||
353 | if (!allocation) { | 353 | if (!allocation) { |
354 | /* Report allocation error */ | 354 | /* Report allocation error */ |
355 | 355 | ||
356 | _ACPI_REPORT_ERROR(module, line, | 356 | ACPI_ERROR((module, line, |
357 | ("ut_callocate: Could not allocate size %X\n", | 357 | "Could not allocate size %X", (u32) size)); |
358 | (u32) size)); | ||
359 | return_PTR(NULL); | 358 | return_PTR(NULL); |
360 | } | 359 | } |
361 | 360 | ||
@@ -480,9 +479,8 @@ void *acpi_ut_callocate_and_track(acpi_size size, | |||
480 | if (!allocation) { | 479 | if (!allocation) { |
481 | /* Report allocation error */ | 480 | /* Report allocation error */ |
482 | 481 | ||
483 | _ACPI_REPORT_ERROR(module, line, | 482 | ACPI_ERROR((module, line, |
484 | ("ut_callocate: Could not allocate size %X\n", | 483 | "Could not allocate size %X", (u32) size)); |
485 | (u32) size)); | ||
486 | return (NULL); | 484 | return (NULL); |
487 | } | 485 | } |
488 | 486 | ||
@@ -524,8 +522,7 @@ acpi_ut_free_and_track(void *allocation, u32 component, char *module, u32 line) | |||
524 | ACPI_FUNCTION_TRACE_PTR("ut_free", allocation); | 522 | ACPI_FUNCTION_TRACE_PTR("ut_free", allocation); |
525 | 523 | ||
526 | if (NULL == allocation) { | 524 | if (NULL == allocation) { |
527 | _ACPI_REPORT_ERROR(module, line, | 525 | ACPI_ERROR((module, line, "Attempt to delete a NULL address")); |
528 | ("acpi_ut_free: Attempt to delete a NULL address\n")); | ||
529 | 526 | ||
530 | return_VOID; | 527 | return_VOID; |
531 | } | 528 | } |
@@ -540,14 +537,11 @@ acpi_ut_free_and_track(void *allocation, u32 component, char *module, u32 line) | |||
540 | status = acpi_ut_remove_allocation(debug_block, | 537 | status = acpi_ut_remove_allocation(debug_block, |
541 | component, module, line); | 538 | component, module, line); |
542 | if (ACPI_FAILURE(status)) { | 539 | if (ACPI_FAILURE(status)) { |
543 | ACPI_REPORT_ERROR(("Could not free memory, %s\n", | 540 | ACPI_EXCEPTION((AE_INFO, status, "Could not free memory")); |
544 | acpi_format_exception(status))); | ||
545 | } | 541 | } |
546 | 542 | ||
547 | acpi_os_free(debug_block); | 543 | acpi_os_free(debug_block); |
548 | |||
549 | ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "%p freed\n", allocation)); | 544 | ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "%p freed\n", allocation)); |
550 | |||
551 | return_VOID; | 545 | return_VOID; |
552 | } | 546 | } |
553 | 547 | ||
@@ -624,10 +618,12 @@ acpi_ut_track_allocation(struct acpi_debug_mem_block *allocation, | |||
624 | */ | 618 | */ |
625 | element = acpi_ut_find_allocation(allocation); | 619 | element = acpi_ut_find_allocation(allocation); |
626 | if (element) { | 620 | if (element) { |
627 | ACPI_REPORT_ERROR(("ut_track_allocation: Allocation already present in list! (%p)\n", allocation)); | 621 | ACPI_ERROR((AE_INFO, |
622 | "ut_track_allocation: Allocation already present in list! (%p)", | ||
623 | allocation)); | ||
628 | 624 | ||
629 | ACPI_REPORT_ERROR(("Element %p Address %p\n", | 625 | ACPI_ERROR((AE_INFO, "Element %p Address %p", |
630 | element, allocation)); | 626 | element, allocation)); |
631 | 627 | ||
632 | goto unlock_and_exit; | 628 | goto unlock_and_exit; |
633 | } | 629 | } |
@@ -687,8 +683,8 @@ acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation, | |||
687 | if (NULL == mem_list->list_head) { | 683 | if (NULL == mem_list->list_head) { |
688 | /* No allocations! */ | 684 | /* No allocations! */ |
689 | 685 | ||
690 | _ACPI_REPORT_ERROR(module, line, | 686 | ACPI_ERROR((module, line, |
691 | ("ut_remove_allocation: Empty allocation list, nothing to free!\n")); | 687 | "Empty allocation list, nothing to free!")); |
692 | 688 | ||
693 | return_ACPI_STATUS(AE_OK); | 689 | return_ACPI_STATUS(AE_OK); |
694 | } | 690 | } |
@@ -863,10 +859,11 @@ void acpi_ut_dump_allocations(u32 component, char *module) | |||
863 | /* Print summary */ | 859 | /* Print summary */ |
864 | 860 | ||
865 | if (!num_outstanding) { | 861 | if (!num_outstanding) { |
866 | ACPI_REPORT_INFO(("No outstanding allocations\n")); | 862 | ACPI_INFO((AE_INFO, "No outstanding allocations")); |
867 | } else { | 863 | } else { |
868 | ACPI_REPORT_ERROR(("%d(%X) Outstanding allocations\n", | 864 | ACPI_ERROR((AE_INFO, |
869 | num_outstanding, num_outstanding)); | 865 | "%d(%X) Outstanding allocations", |
866 | num_outstanding, num_outstanding)); | ||
870 | } | 867 | } |
871 | 868 | ||
872 | return_VOID; | 869 | return_VOID; |