diff options
author | Bob Moore <robert.moore@intel.com> | 2008-04-10 11:06:43 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-04-22 19:08:51 -0400 |
commit | cd0b2248241f4146152fb04a6bf4bccb6ce0478a (patch) | |
tree | 072ccaed2ccaa225c6012356c280788fbf2afe16 | |
parent | 7a5bb9964512c5313af19310c6a3002ec54f7336 (diff) |
ACPICA: Fixes for external Reference Objects
All Reference Objects returned via the AcpiEvaluteObject interface
are now marked as type "REFERENCE" instead of "ANY". The type ANY
is now reservered for NULL objects - either NULL package elements
or unresolved named references.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r-- | drivers/acpi/scan.c | 3 | ||||
-rw-r--r-- | drivers/acpi/utilities/utcopy.c | 32 | ||||
-rw-r--r-- | drivers/acpi/utils.c | 2 |
3 files changed, 26 insertions, 11 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index e6ce262b5d44..464ee6ea8c61 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -677,9 +677,8 @@ acpi_bus_extract_wakeup_device_power_package(struct acpi_device *device, | |||
677 | device->wakeup.resources.count = package->package.count - 2; | 677 | device->wakeup.resources.count = package->package.count - 2; |
678 | for (i = 0; i < device->wakeup.resources.count; i++) { | 678 | for (i = 0; i < device->wakeup.resources.count; i++) { |
679 | element = &(package->package.elements[i + 2]); | 679 | element = &(package->package.elements[i + 2]); |
680 | if (element->type != ACPI_TYPE_ANY) { | 680 | if (element->type != ACPI_TYPE_LOCAL_REFERENCE) |
681 | return AE_BAD_DATA; | 681 | return AE_BAD_DATA; |
682 | } | ||
683 | 682 | ||
684 | device->wakeup.resources.handles[i] = element->reference.handle; | 683 | device->wakeup.resources.handles[i] = element->reference.handle; |
685 | } | 684 | } |
diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c index 4e9a62b34aef..2a57c2c2c782 100644 --- a/drivers/acpi/utilities/utcopy.c +++ b/drivers/acpi/utilities/utcopy.c | |||
@@ -43,6 +43,8 @@ | |||
43 | 43 | ||
44 | #include <acpi/acpi.h> | 44 | #include <acpi/acpi.h> |
45 | #include <acpi/amlcode.h> | 45 | #include <acpi/amlcode.h> |
46 | #include <acpi/acnamesp.h> | ||
47 | |||
46 | 48 | ||
47 | #define _COMPONENT ACPI_UTILITIES | 49 | #define _COMPONENT ACPI_UTILITIES |
48 | ACPI_MODULE_NAME("utcopy") | 50 | ACPI_MODULE_NAME("utcopy") |
@@ -172,22 +174,21 @@ acpi_ut_copy_isimple_to_esimple(union acpi_operand_object *internal_object, | |||
172 | 174 | ||
173 | case ACPI_TYPE_LOCAL_REFERENCE: | 175 | case ACPI_TYPE_LOCAL_REFERENCE: |
174 | 176 | ||
175 | /* | 177 | /* This is an object reference. */ |
176 | * This is an object reference. Attempt to dereference it. | 178 | |
177 | */ | ||
178 | switch (internal_object->reference.opcode) { | 179 | switch (internal_object->reference.opcode) { |
179 | case AML_INT_NAMEPATH_OP: | 180 | case AML_INT_NAMEPATH_OP: |
180 | 181 | ||
181 | /* For namepath, return the object handle ("reference") */ | 182 | /* For namepath, return the object handle ("reference") */ |
182 | 183 | ||
183 | default: | 184 | default: |
184 | /* | 185 | |
185 | * Use the object type of "Any" to indicate a reference | 186 | /* We are referring to the namespace node */ |
186 | * to object containing a handle to an ACPI named object. | 187 | |
187 | */ | ||
188 | external_object->type = ACPI_TYPE_ANY; | ||
189 | external_object->reference.handle = | 188 | external_object->reference.handle = |
190 | internal_object->reference.node; | 189 | internal_object->reference.node; |
190 | external_object->reference.actual_type = | ||
191 | acpi_ns_get_type(internal_object->reference.node); | ||
191 | break; | 192 | break; |
192 | } | 193 | } |
193 | break; | 194 | break; |
@@ -460,6 +461,7 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object, | |||
460 | case ACPI_TYPE_STRING: | 461 | case ACPI_TYPE_STRING: |
461 | case ACPI_TYPE_BUFFER: | 462 | case ACPI_TYPE_BUFFER: |
462 | case ACPI_TYPE_INTEGER: | 463 | case ACPI_TYPE_INTEGER: |
464 | case ACPI_TYPE_LOCAL_REFERENCE: | ||
463 | 465 | ||
464 | internal_object = acpi_ut_create_internal_object((u8) | 466 | internal_object = acpi_ut_create_internal_object((u8) |
465 | external_object-> | 467 | external_object-> |
@@ -469,6 +471,11 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object, | |||
469 | } | 471 | } |
470 | break; | 472 | break; |
471 | 473 | ||
474 | case ACPI_TYPE_ANY: /* This is the case for a NULL object */ | ||
475 | |||
476 | *ret_internal_object = NULL; | ||
477 | return_ACPI_STATUS(AE_OK); | ||
478 | |||
472 | default: | 479 | default: |
473 | /* All other types are not supported */ | 480 | /* All other types are not supported */ |
474 | 481 | ||
@@ -522,6 +529,15 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object, | |||
522 | internal_object->integer.value = external_object->integer.value; | 529 | internal_object->integer.value = external_object->integer.value; |
523 | break; | 530 | break; |
524 | 531 | ||
532 | case ACPI_TYPE_LOCAL_REFERENCE: | ||
533 | |||
534 | /* TBD: should validate incoming handle */ | ||
535 | |||
536 | internal_object->reference.opcode = AML_INT_NAMEPATH_OP; | ||
537 | internal_object->reference.node = | ||
538 | external_object->reference.handle; | ||
539 | break; | ||
540 | |||
525 | default: | 541 | default: |
526 | /* Other types can't get here */ | 542 | /* Other types can't get here */ |
527 | break; | 543 | break; |
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index 44ea60cf21c0..100926143818 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c | |||
@@ -398,7 +398,7 @@ acpi_evaluate_reference(acpi_handle handle, | |||
398 | 398 | ||
399 | element = &(package->package.elements[i]); | 399 | element = &(package->package.elements[i]); |
400 | 400 | ||
401 | if (element->type != ACPI_TYPE_ANY) { | 401 | if (element->type != ACPI_TYPE_LOCAL_REFERENCE) { |
402 | status = AE_BAD_DATA; | 402 | status = AE_BAD_DATA; |
403 | printk(KERN_ERR PREFIX | 403 | printk(KERN_ERR PREFIX |
404 | "Expecting a [Reference] package element, found type %X\n", | 404 | "Expecting a [Reference] package element, found type %X\n", |