forked from Minki/linux
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>
This commit is contained in:
parent
7a5bb99645
commit
cd0b224824
@ -677,9 +677,8 @@ acpi_bus_extract_wakeup_device_power_package(struct acpi_device *device,
|
|||||||
device->wakeup.resources.count = package->package.count - 2;
|
device->wakeup.resources.count = package->package.count - 2;
|
||||||
for (i = 0; i < device->wakeup.resources.count; i++) {
|
for (i = 0; i < device->wakeup.resources.count; i++) {
|
||||||
element = &(package->package.elements[i + 2]);
|
element = &(package->package.elements[i + 2]);
|
||||||
if (element->type != ACPI_TYPE_ANY) {
|
if (element->type != ACPI_TYPE_LOCAL_REFERENCE)
|
||||||
return AE_BAD_DATA;
|
return AE_BAD_DATA;
|
||||||
}
|
|
||||||
|
|
||||||
device->wakeup.resources.handles[i] = element->reference.handle;
|
device->wakeup.resources.handles[i] = element->reference.handle;
|
||||||
}
|
}
|
||||||
|
@ -43,6 +43,8 @@
|
|||||||
|
|
||||||
#include <acpi/acpi.h>
|
#include <acpi/acpi.h>
|
||||||
#include <acpi/amlcode.h>
|
#include <acpi/amlcode.h>
|
||||||
|
#include <acpi/acnamesp.h>
|
||||||
|
|
||||||
|
|
||||||
#define _COMPONENT ACPI_UTILITIES
|
#define _COMPONENT ACPI_UTILITIES
|
||||||
ACPI_MODULE_NAME("utcopy")
|
ACPI_MODULE_NAME("utcopy")
|
||||||
@ -172,22 +174,21 @@ acpi_ut_copy_isimple_to_esimple(union acpi_operand_object *internal_object,
|
|||||||
|
|
||||||
case ACPI_TYPE_LOCAL_REFERENCE:
|
case ACPI_TYPE_LOCAL_REFERENCE:
|
||||||
|
|
||||||
/*
|
/* This is an object reference. */
|
||||||
* This is an object reference. Attempt to dereference it.
|
|
||||||
*/
|
|
||||||
switch (internal_object->reference.opcode) {
|
switch (internal_object->reference.opcode) {
|
||||||
case AML_INT_NAMEPATH_OP:
|
case AML_INT_NAMEPATH_OP:
|
||||||
|
|
||||||
/* For namepath, return the object handle ("reference") */
|
/* For namepath, return the object handle ("reference") */
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/*
|
|
||||||
* Use the object type of "Any" to indicate a reference
|
/* We are referring to the namespace node */
|
||||||
* to object containing a handle to an ACPI named object.
|
|
||||||
*/
|
|
||||||
external_object->type = ACPI_TYPE_ANY;
|
|
||||||
external_object->reference.handle =
|
external_object->reference.handle =
|
||||||
internal_object->reference.node;
|
internal_object->reference.node;
|
||||||
|
external_object->reference.actual_type =
|
||||||
|
acpi_ns_get_type(internal_object->reference.node);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -460,6 +461,7 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
|
|||||||
case ACPI_TYPE_STRING:
|
case ACPI_TYPE_STRING:
|
||||||
case ACPI_TYPE_BUFFER:
|
case ACPI_TYPE_BUFFER:
|
||||||
case ACPI_TYPE_INTEGER:
|
case ACPI_TYPE_INTEGER:
|
||||||
|
case ACPI_TYPE_LOCAL_REFERENCE:
|
||||||
|
|
||||||
internal_object = acpi_ut_create_internal_object((u8)
|
internal_object = acpi_ut_create_internal_object((u8)
|
||||||
external_object->
|
external_object->
|
||||||
@ -469,6 +471,11 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ACPI_TYPE_ANY: /* This is the case for a NULL object */
|
||||||
|
|
||||||
|
*ret_internal_object = NULL;
|
||||||
|
return_ACPI_STATUS(AE_OK);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/* All other types are not supported */
|
/* All other types are not supported */
|
||||||
|
|
||||||
@ -522,6 +529,15 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
|
|||||||
internal_object->integer.value = external_object->integer.value;
|
internal_object->integer.value = external_object->integer.value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ACPI_TYPE_LOCAL_REFERENCE:
|
||||||
|
|
||||||
|
/* TBD: should validate incoming handle */
|
||||||
|
|
||||||
|
internal_object->reference.opcode = AML_INT_NAMEPATH_OP;
|
||||||
|
internal_object->reference.node =
|
||||||
|
external_object->reference.handle;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/* Other types can't get here */
|
/* Other types can't get here */
|
||||||
break;
|
break;
|
||||||
|
@ -398,7 +398,7 @@ acpi_evaluate_reference(acpi_handle handle,
|
|||||||
|
|
||||||
element = &(package->package.elements[i]);
|
element = &(package->package.elements[i]);
|
||||||
|
|
||||||
if (element->type != ACPI_TYPE_ANY) {
|
if (element->type != ACPI_TYPE_LOCAL_REFERENCE) {
|
||||||
status = AE_BAD_DATA;
|
status = AE_BAD_DATA;
|
||||||
printk(KERN_ERR PREFIX
|
printk(KERN_ERR PREFIX
|
||||||
"Expecting a [Reference] package element, found type %X\n",
|
"Expecting a [Reference] package element, found type %X\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user