diff options
author | Bob Moore <robert.moore@intel.com> | 2008-08-03 22:40:09 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-10-22 23:14:39 -0400 |
commit | f02a99ac66748f8b62477c86f6df04d3ec6169fd (patch) | |
tree | ed52463cd238ded9acf88d93c6b4360209d44f14 | |
parent | d00d23651d17a2848f6923f3b1ec4efe19f5f2f1 (diff) |
ACPICA: Add function to decode reference obj types to strings
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>
-rw-r--r-- | drivers/acpi/utilities/utglobal.c | 36 | ||||
-rw-r--r-- | include/acpi/acutils.h | 2 |
2 files changed, 38 insertions, 0 deletions
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c index 248eefc369f8..bcace577183b 100644 --- a/drivers/acpi/utilities/utglobal.c +++ b/drivers/acpi/utilities/utglobal.c | |||
@@ -45,6 +45,7 @@ | |||
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> | ||
48 | 49 | ||
49 | ACPI_EXPORT_SYMBOL(acpi_gbl_FADT) | 50 | ACPI_EXPORT_SYMBOL(acpi_gbl_FADT) |
50 | #define _COMPONENT ACPI_UTILITIES | 51 | #define _COMPONENT ACPI_UTILITIES |
@@ -575,6 +576,41 @@ char *acpi_ut_get_descriptor_name(void *object) | |||
575 | 576 | ||
576 | } | 577 | } |
577 | 578 | ||
579 | /******************************************************************************* | ||
580 | * | ||
581 | * FUNCTION: acpi_ut_get_reference_name | ||
582 | * | ||
583 | * PARAMETERS: Object - An ACPI reference object | ||
584 | * | ||
585 | * RETURN: Pointer to a string | ||
586 | * | ||
587 | * DESCRIPTION: Decode a reference object sub-type to a string. | ||
588 | * | ||
589 | ******************************************************************************/ | ||
590 | |||
591 | /* Printable names of reference object sub-types */ | ||
592 | |||
593 | const char *acpi_ut_get_reference_name(union acpi_operand_object *object) | ||
594 | { | ||
595 | |||
596 | switch (object->reference.opcode) { | ||
597 | case AML_INT_NAMEPATH_OP: | ||
598 | return "Name"; | ||
599 | |||
600 | case AML_LOAD_OP: | ||
601 | return "DDB-Handle"; | ||
602 | |||
603 | case AML_REF_OF_OP: | ||
604 | return "RefOf"; | ||
605 | |||
606 | case AML_INDEX_OP: | ||
607 | return "Index"; | ||
608 | |||
609 | default: | ||
610 | return "Unknown"; | ||
611 | } | ||
612 | } | ||
613 | |||
578 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) | 614 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) |
579 | /* | 615 | /* |
580 | * Strings and procedures used for debug only | 616 | * Strings and procedures used for debug only |
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h index 10ce81406f9c..d8307b2987e3 100644 --- a/include/acpi/acutils.h +++ b/include/acpi/acutils.h | |||
@@ -126,6 +126,8 @@ char *acpi_ut_get_node_name(void *object); | |||
126 | 126 | ||
127 | char *acpi_ut_get_descriptor_name(void *object); | 127 | char *acpi_ut_get_descriptor_name(void *object); |
128 | 128 | ||
129 | const char *acpi_ut_get_reference_name(union acpi_operand_object *object); | ||
130 | |||
129 | char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc); | 131 | char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc); |
130 | 132 | ||
131 | char *acpi_ut_get_region_name(u8 space_id); | 133 | char *acpi_ut_get_region_name(u8 space_id); |