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/executer/exmisc.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/executer/exmisc.c')
-rw-r--r-- | drivers/acpi/executer/exmisc.c | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/drivers/acpi/executer/exmisc.c b/drivers/acpi/executer/exmisc.c index 5ad34566738..48c18d29222 100644 --- a/drivers/acpi/executer/exmisc.c +++ b/drivers/acpi/executer/exmisc.c @@ -98,8 +98,8 @@ acpi_ex_get_object_reference(union acpi_operand_object *obj_desc, default: - ACPI_REPORT_ERROR(("Unknown Reference opcode %X\n", - obj_desc->reference.opcode)); + ACPI_ERROR((AE_INFO, "Unknown Reference opcode %X", + obj_desc->reference.opcode)); return_ACPI_STATUS(AE_AML_INTERNAL); } break; @@ -114,8 +114,8 @@ acpi_ex_get_object_reference(union acpi_operand_object *obj_desc, default: - ACPI_REPORT_ERROR(("Invalid descriptor type %X\n", - ACPI_GET_DESCRIPTOR_TYPE(obj_desc))); + ACPI_ERROR((AE_INFO, "Invalid descriptor type %X", + ACPI_GET_DESCRIPTOR_TYPE(obj_desc))); return_ACPI_STATUS(AE_TYPE); } @@ -166,15 +166,18 @@ acpi_ex_concat_template(union acpi_operand_object *operand0, u8 *end_tag; acpi_size length0; acpi_size length1; + acpi_size new_length; ACPI_FUNCTION_TRACE("ex_concat_template"); /* * Find the end_tag descriptor in each resource template. - * Note: returned pointers point TO the end_tag, not past it. - * - * Compute the length of each resource template + * Note1: returned pointers point TO the end_tag, not past it. + * Note2: zero-length buffers are allowed; treated like one end_tag */ + + /* Get the length of the first resource template */ + status = acpi_ut_get_resource_end_tag(operand0, &end_tag); if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); @@ -182,19 +185,22 @@ acpi_ex_concat_template(union acpi_operand_object *operand0, length0 = ACPI_PTR_DIFF(end_tag, operand0->buffer.pointer); + /* Get the length of the second resource template */ + status = acpi_ut_get_resource_end_tag(operand1, &end_tag); if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); } - /* Include the end_tag in the second template length */ + length1 = ACPI_PTR_DIFF(end_tag, operand1->buffer.pointer); + + /* Combine both lengths, minimum size will be 2 for end_tag */ - length1 = ACPI_PTR_DIFF(end_tag, operand1->buffer.pointer) + - sizeof(struct aml_resource_end_tag); + new_length = length0 + length1 + sizeof(struct aml_resource_end_tag); - /* Create a new buffer object for the result */ + /* Create a new buffer object for the result (with one end_tag) */ - return_desc = acpi_ut_create_buffer_object(length0 + length1); + return_desc = acpi_ut_create_buffer_object(new_length); if (!return_desc) { return_ACPI_STATUS(AE_NO_MEMORY); } @@ -207,9 +213,10 @@ acpi_ex_concat_template(union acpi_operand_object *operand0, ACPI_MEMCPY(new_buf, operand0->buffer.pointer, length0); ACPI_MEMCPY(new_buf + length0, operand1->buffer.pointer, length1); - /* Set the end_tag checksum to zero, means "ignore checksum" */ + /* Insert end_tag and set the checksum to zero, means "ignore checksum" */ - new_buf[return_desc->buffer.length - 1] = 0; + new_buf[new_length - 1] = 0; + new_buf[new_length - 2] = ACPI_RESOURCE_NAME_END_TAG | 1; /* Return the completed resource template */ @@ -268,8 +275,8 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0, break; default: - ACPI_REPORT_ERROR(("Invalid object type: %X\n", - ACPI_GET_OBJECT_TYPE(operand0))); + ACPI_ERROR((AE_INFO, "Invalid object type: %X", + ACPI_GET_OBJECT_TYPE(operand0))); status = AE_AML_INTERNAL; } @@ -370,8 +377,8 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0, /* Invalid object type, should not happen here */ - ACPI_REPORT_ERROR(("Invalid object type: %X\n", - ACPI_GET_OBJECT_TYPE(operand0))); + ACPI_ERROR((AE_INFO, "Invalid object type: %X", + ACPI_GET_OBJECT_TYPE(operand0))); status = AE_AML_INTERNAL; goto cleanup; } |