ACPICA: Add function to decode reference obj types to strings
authorBob Moore <robert.moore@intel.com>
Mon, 4 Aug 2008 02:40:09 +0000 (10:40 +0800)
committerLen Brown <len.brown@intel.com>
Thu, 23 Oct 2008 03:14:39 +0000 (23:14 -0400)
Created for improved error messages.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/utilities/utglobal.c
include/acpi/acutils.h

index 248eefc369f8cbd49a954c03893ef6a5ae9dc0a9..bcace577183bc7a616adfc3704d3fbec6d7da498 100644 (file)
@@ -45,6 +45,7 @@
 
 #include <acpi/acpi.h>
 #include <acpi/acnamesp.h>
+#include <acpi/amlcode.h>
 
 ACPI_EXPORT_SYMBOL(acpi_gbl_FADT)
 #define _COMPONENT          ACPI_UTILITIES
@@ -575,6 +576,41 @@ char *acpi_ut_get_descriptor_name(void *object)
 
 }
 
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ut_get_reference_name
+ *
+ * PARAMETERS:  Object               - An ACPI reference object
+ *
+ * RETURN:      Pointer to a string
+ *
+ * DESCRIPTION: Decode a reference object sub-type to a string.
+ *
+ ******************************************************************************/
+
+/* Printable names of reference object sub-types */
+
+const char *acpi_ut_get_reference_name(union acpi_operand_object *object)
+{
+
+       switch (object->reference.opcode) {
+       case AML_INT_NAMEPATH_OP:
+               return "Name";
+
+       case AML_LOAD_OP:
+               return "DDB-Handle";
+
+       case AML_REF_OF_OP:
+               return "RefOf";
+
+       case AML_INDEX_OP:
+               return "Index";
+
+       default:
+               return "Unknown";
+       }
+}
+
 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
 /*
  * Strings and procedures used for debug only
index 10ce81406f9caf0fd2bde30f74a41d7de19529bd..d8307b2987e371b706ac7e0c96359606fb5cd900 100644 (file)
@@ -126,6 +126,8 @@ char *acpi_ut_get_node_name(void *object);
 
 char *acpi_ut_get_descriptor_name(void *object);
 
+const char *acpi_ut_get_reference_name(union acpi_operand_object *object);
+
 char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc);
 
 char *acpi_ut_get_region_name(u8 space_id);