aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2008-09-26 23:08:41 -0400
committerLen Brown <len.brown@intel.com>2008-10-22 23:14:45 -0400
commit1044f1f65b7df2aae979e397904c4985eeb99ba2 (patch)
tree8feb6f2db4f36b75d8c7126d51a7b35e57e13194 /drivers/acpi/utilities
parent2425a0967f29b196fad5d4f726c9502679284656 (diff)
ACPICA: Cleanup for internal Reference Object
Fix some sloppiness in the Reference object. No longer use AML opcodes to differentiate the types, introduce new reference Class. Cleanup the debug output code. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/utilities')
-rw-r--r--drivers/acpi/utilities/utcopy.c29
-rw-r--r--drivers/acpi/utilities/utdelete.c5
-rw-r--r--drivers/acpi/utilities/utglobal.c35
-rw-r--r--drivers/acpi/utilities/utobject.c9
4 files changed, 42 insertions, 36 deletions
diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c
index 53499ac90988..5b2f7c27b705 100644
--- a/drivers/acpi/utilities/utcopy.c
+++ b/drivers/acpi/utilities/utcopy.c
@@ -42,7 +42,6 @@
42 */ 42 */
43 43
44#include <acpi/acpi.h> 44#include <acpi/acpi.h>
45#include <acpi/amlcode.h>
46#include <acpi/acnamesp.h> 45#include <acpi/acnamesp.h>
47 46
48 47
@@ -176,20 +175,24 @@ acpi_ut_copy_isimple_to_esimple(union acpi_operand_object *internal_object,
176 175
177 /* This is an object reference. */ 176 /* This is an object reference. */
178 177
179 switch (internal_object->reference.opcode) { 178 switch (internal_object->reference.class) {
180 case AML_INT_NAMEPATH_OP: 179 case ACPI_REFCLASS_NAME:
181
182 /* For namepath, return the object handle ("reference") */
183
184 default:
185
186 /* We are referring to the namespace node */
187 180
181 /*
182 * For namepath, return the object handle ("reference")
183 * We are referring to the namespace node
184 */
188 external_object->reference.handle = 185 external_object->reference.handle =
189 internal_object->reference.node; 186 internal_object->reference.node;
190 external_object->reference.actual_type = 187 external_object->reference.actual_type =
191 acpi_ns_get_type(internal_object->reference.node); 188 acpi_ns_get_type(internal_object->reference.node);
192 break; 189 break;
190
191 default:
192
193 /* All other reference types are unsupported */
194
195 return_ACPI_STATUS(AE_TYPE);
193 } 196 }
194 break; 197 break;
195 198
@@ -533,7 +536,7 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
533 536
534 /* TBD: should validate incoming handle */ 537 /* TBD: should validate incoming handle */
535 538
536 internal_object->reference.opcode = AML_INT_NAMEPATH_OP; 539 internal_object->reference.class = ACPI_REFCLASS_NAME;
537 internal_object->reference.node = 540 internal_object->reference.node =
538 external_object->reference.handle; 541 external_object->reference.handle;
539 break; 542 break;
@@ -743,11 +746,11 @@ acpi_ut_copy_simple_object(union acpi_operand_object *source_desc,
743 * We copied the reference object, so we now must add a reference 746 * We copied the reference object, so we now must add a reference
744 * to the object pointed to by the reference 747 * to the object pointed to by the reference
745 * 748 *
746 * DDBHandle reference (from Load/load_table is a special reference, 749 * DDBHandle reference (from Load/load_table) is a special reference,
747 * it's Reference.Object is the table index, so does not need to 750 * it does not have a Reference.Object, so does not need to
748 * increase the reference count 751 * increase the reference count
749 */ 752 */
750 if (source_desc->reference.opcode == AML_LOAD_OP) { 753 if (source_desc->reference.class == ACPI_REFCLASS_TABLE) {
751 break; 754 break;
752 } 755 }
753 756
diff --git a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c
index 42609d3a8aa9..5c219758c226 100644
--- a/drivers/acpi/utilities/utdelete.c
+++ b/drivers/acpi/utilities/utdelete.c
@@ -45,7 +45,6 @@
45#include <acpi/acinterp.h> 45#include <acpi/acinterp.h>
46#include <acpi/acnamesp.h> 46#include <acpi/acnamesp.h>
47#include <acpi/acevents.h> 47#include <acpi/acevents.h>
48#include <acpi/amlcode.h>
49 48
50#define _COMPONENT ACPI_UTILITIES 49#define _COMPONENT ACPI_UTILITIES
51ACPI_MODULE_NAME("utdelete") 50ACPI_MODULE_NAME("utdelete")
@@ -548,8 +547,8 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
548 * reference must track changes to the ref count of the index or 547 * reference must track changes to the ref count of the index or
549 * target object. 548 * target object.
550 */ 549 */
551 if ((object->reference.opcode == AML_INDEX_OP) || 550 if ((object->reference.class == ACPI_REFCLASS_INDEX) ||
552 (object->reference.opcode == AML_INT_NAMEPATH_OP)) { 551 (object->reference.class == ACPI_REFCLASS_NAME)) {
553 next_object = object->reference.object; 552 next_object = object->reference.object;
554 } 553 }
555 break; 554 break;
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
index bcace577183b..0b1e493a8374 100644
--- a/drivers/acpi/utilities/utglobal.c
+++ b/drivers/acpi/utilities/utglobal.c
@@ -45,7 +45,6 @@
45 45
46#include <acpi/acpi.h> 46#include <acpi/acpi.h>
47#include <acpi/acnamesp.h> 47#include <acpi/acnamesp.h>
48#include <acpi/amlcode.h>
49 48
50ACPI_EXPORT_SYMBOL(acpi_gbl_FADT) 49ACPI_EXPORT_SYMBOL(acpi_gbl_FADT)
51#define _COMPONENT ACPI_UTILITIES 50#define _COMPONENT ACPI_UTILITIES
@@ -590,25 +589,31 @@ char *acpi_ut_get_descriptor_name(void *object)
590 589
591/* Printable names of reference object sub-types */ 590/* Printable names of reference object sub-types */
592 591
592static const char *acpi_gbl_ref_class_names[] = {
593 /* 00 */ "Local",
594 /* 01 */ "Argument",
595 /* 02 */ "RefOf",
596 /* 03 */ "Index",
597 /* 04 */ "DdbHandle",
598 /* 05 */ "Named Object",
599 /* 06 */ "Debug"
600};
601
593const char *acpi_ut_get_reference_name(union acpi_operand_object *object) 602const char *acpi_ut_get_reference_name(union acpi_operand_object *object)
594{ 603{
604 if (!object)
605 return "NULL Object";
595 606
596 switch (object->reference.opcode) { 607 if (ACPI_GET_DESCRIPTOR_TYPE(object) != ACPI_DESC_TYPE_OPERAND)
597 case AML_INT_NAMEPATH_OP: 608 return "Not an Operand object";
598 return "Name";
599 609
600 case AML_LOAD_OP: 610 if (object->common.type != ACPI_TYPE_LOCAL_REFERENCE)
601 return "DDB-Handle"; 611 return "Not a Reference object";
602 612
603 case AML_REF_OF_OP: 613 if (object->reference.class > ACPI_REFCLASS_MAX)
604 return "RefOf"; 614 return "Unknown Reference class";
605 615
606 case AML_INDEX_OP: 616 return acpi_gbl_ref_class_names[object->reference.class];
607 return "Index";
608
609 default:
610 return "Unknown";
611 }
612} 617}
613 618
614#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 619#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
@@ -812,4 +817,4 @@ acpi_status acpi_ut_init_globals(void)
812} 817}
813 818
814ACPI_EXPORT_SYMBOL(acpi_dbg_level) 819ACPI_EXPORT_SYMBOL(acpi_dbg_level)
815 ACPI_EXPORT_SYMBOL(acpi_dbg_layer) 820ACPI_EXPORT_SYMBOL(acpi_dbg_layer)
diff --git a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c
index 924d05af94d2..c354e7a42bcd 100644
--- a/drivers/acpi/utilities/utobject.c
+++ b/drivers/acpi/utilities/utobject.c
@@ -43,7 +43,6 @@
43 43
44#include <acpi/acpi.h> 44#include <acpi/acpi.h>
45#include <acpi/acnamesp.h> 45#include <acpi/acnamesp.h>
46#include <acpi/amlcode.h>
47 46
48#define _COMPONENT ACPI_UTILITIES 47#define _COMPONENT ACPI_UTILITIES
49ACPI_MODULE_NAME("utobject") 48ACPI_MODULE_NAME("utobject")
@@ -478,8 +477,8 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
478 477
479 case ACPI_TYPE_LOCAL_REFERENCE: 478 case ACPI_TYPE_LOCAL_REFERENCE:
480 479
481 switch (internal_object->reference.opcode) { 480 switch (internal_object->reference.class) {
482 case AML_INT_NAMEPATH_OP: 481 case ACPI_REFCLASS_NAME:
483 482
484 /* 483 /*
485 * Get the actual length of the full pathname to this object. 484 * Get the actual length of the full pathname to this object.
@@ -504,9 +503,9 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
504 */ 503 */
505 ACPI_ERROR((AE_INFO, 504 ACPI_ERROR((AE_INFO,
506 "Cannot convert to external object - " 505 "Cannot convert to external object - "
507 "unsupported Reference type [%s] %X in object %p", 506 "unsupported Reference Class [%s] %X in object %p",
508 acpi_ut_get_reference_name(internal_object), 507 acpi_ut_get_reference_name(internal_object),
509 internal_object->reference.opcode, 508 internal_object->reference.class,
510 internal_object)); 509 internal_object));
511 status = AE_TYPE; 510 status = AE_TYPE;
512 break; 511 break;