ACPICA: Utilities: Add new decode function for parser values
authorBob Moore <robert.moore@intel.com>
Wed, 30 Nov 2016 07:21:57 +0000 (15:21 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 9 Dec 2016 01:47:01 +0000 (02:47 +0100)
ACPICA commit 198fde8a061ac77357bcf1752e3c988fbe59f128

Implements a decode function for the ARGP_* parser info values
for all AML opcodes.

Link: https://github.com/acpica/acpica/commit/198fde8a
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpica/acutils.h
drivers/acpi/acpica/amlcode.h
drivers/acpi/acpica/utdecode.c

index 0a1b53c9ee0e04709d1a582b2e0713a870a10646..845afb180a7e94ca67a92d0d554bea820ff678a3 100644 (file)
@@ -232,6 +232,8 @@ const char *acpi_ut_get_region_name(u8 space_id);
 
 const char *acpi_ut_get_event_name(u32 event_id);
 
+const char *acpi_ut_get_argument_type_name(u32 arg_type);
+
 char acpi_ut_hex_to_ascii_char(u64 integer, u32 position);
 
 acpi_status acpi_ut_ascii_to_hex_byte(char *two_ascii_chars, u8 *return_byte);
index ceb4f7365f7f6c50ad76c8d405a2d698cc05e507..6bd8d4bcff6540b6bed02382f47136261d529ca2 100644 (file)
 #define ARGP_QWORDDATA              0x11
 #define ARGP_SIMPLENAME             0x12       /* name_string | local_term | arg_term */
 #define ARGP_NAME_OR_REF            0x13       /* For object_type only */
+#define ARGP_MAX                    0x13
 
 /*
  * Resolved argument types for the AML Interpreter
index 15728ad8356b18363411b278874db837b3fcd0e0..b3d8421cfb8079b1f3b78b71f43cc4d2bbb63402 100644 (file)
@@ -44,6 +44,7 @@
 #include <acpi/acpi.h>
 #include "accommon.h"
 #include "acnamesp.h"
+#include "amlcode.h"
 
 #define _COMPONENT          ACPI_UTILITIES
 ACPI_MODULE_NAME("utdecode")
@@ -532,6 +533,54 @@ const char *acpi_ut_get_notify_name(u32 notify_value, acpi_object_type type)
 
        return ("Hardware-Specific");
 }
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ut_get_argument_type_name
+ *
+ * PARAMETERS:  arg_type            - an ARGP_* parser argument type
+ *
+ * RETURN:      Decoded ARGP_* type
+ *
+ * DESCRIPTION: Decode an ARGP_* parser type, as defined in the amlcode.h file,
+ *              and used in the acopcode.h file. For example, ARGP_TERMARG.
+ *              Used for debug only.
+ *
+ ******************************************************************************/
+
+static const char *acpi_gbl_argument_type[20] = {
+       /* 00 */ "Unknown ARGP",
+       /* 01 */ "ByteData",
+       /* 02 */ "ByteList",
+       /* 03 */ "CharList",
+       /* 04 */ "DataObject",
+       /* 05 */ "DataObjectList",
+       /* 06 */ "DWordData",
+       /* 07 */ "FieldList",
+       /* 08 */ "Name",
+       /* 09 */ "NameString",
+       /* 0A */ "ObjectList",
+       /* 0B */ "PackageLength",
+       /* 0C */ "SuperName",
+       /* 0D */ "Target",
+       /* 0E */ "TermArg",
+       /* 0F */ "TermList",
+       /* 10 */ "WordData",
+       /* 11 */ "QWordData",
+       /* 12 */ "SimpleName",
+       /* 13 */ "NameOrRef"
+};
+
+const char *acpi_ut_get_argument_type_name(u32 arg_type)
+{
+
+       if (arg_type > ARGP_MAX) {
+               return ("Unknown ARGP");
+       }
+
+       return (acpi_gbl_argument_type[arg_type]);
+}
+
 #endif
 
 /*******************************************************************************