diff options
author | Bob Moore <robert.moore@intel.com> | 2015-04-12 23:50:32 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-04-14 08:51:54 -0400 |
commit | 56a3d5e755e889d1543cb90a3ebaed513cadb727 (patch) | |
tree | 31e887143e802bbd19740ebea1d57cb9757ad4a9 /drivers/acpi | |
parent | 2e7cc46a0f30bc3b749e371ab0afd29b774ae898 (diff) |
ACPICA: Add infrastructure for External() opcode.
ACPICA commit d115fe2ffdab449d6107d58580c5afd0a81d65fe
This change adds the basic low-level infrastructure for the External
AML opcode. The interpreter will simply ignore this op, as the op
is intended for use by the disassembler only.
Note that External() opcode is useful for disassembler, interpreter
can simply ignore it and still return exceptions for unknown control
methods so the kernel part only includes the grammar definition of
External() opcode in order to ignore it but doesn't interpret it.
Link: https://github.com/acpica/acpica/commit/d115fe2f
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>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/acpica/aclocal.h | 2 | ||||
-rw-r--r-- | drivers/acpi/acpica/acopcode.h | 2 | ||||
-rw-r--r-- | drivers/acpi/acpica/amlcode.h | 1 | ||||
-rw-r--r-- | drivers/acpi/acpica/dsutils.c | 11 | ||||
-rw-r--r-- | drivers/acpi/acpica/exoparg3.c | 13 | ||||
-rw-r--r-- | drivers/acpi/acpica/psopcode.c | 8 | ||||
-rw-r--r-- | drivers/acpi/acpica/psopinfo.c | 2 |
7 files changed, 35 insertions, 4 deletions
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h index 7add32e5d8c5..87b27521fcac 100644 --- a/drivers/acpi/acpica/aclocal.h +++ b/drivers/acpi/acpica/aclocal.h | |||
@@ -53,7 +53,7 @@ typedef u32 acpi_mutex_handle; | |||
53 | 53 | ||
54 | /* Total number of aml opcodes defined */ | 54 | /* Total number of aml opcodes defined */ |
55 | 55 | ||
56 | #define AML_NUM_OPCODES 0x81 | 56 | #define AML_NUM_OPCODES 0x82 |
57 | 57 | ||
58 | /* Forward declarations */ | 58 | /* Forward declarations */ |
59 | 59 | ||
diff --git a/drivers/acpi/acpica/acopcode.h b/drivers/acpi/acpica/acopcode.h index a5f17de45ac6..fd85ad05a24a 100644 --- a/drivers/acpi/acpica/acopcode.h +++ b/drivers/acpi/acpica/acopcode.h | |||
@@ -111,6 +111,7 @@ | |||
111 | #define ARGP_DWORD_OP ARGP_LIST1 (ARGP_DWORDDATA) | 111 | #define ARGP_DWORD_OP ARGP_LIST1 (ARGP_DWORDDATA) |
112 | #define ARGP_ELSE_OP ARGP_LIST2 (ARGP_PKGLENGTH, ARGP_TERMLIST) | 112 | #define ARGP_ELSE_OP ARGP_LIST2 (ARGP_PKGLENGTH, ARGP_TERMLIST) |
113 | #define ARGP_EVENT_OP ARGP_LIST1 (ARGP_NAME) | 113 | #define ARGP_EVENT_OP ARGP_LIST1 (ARGP_NAME) |
114 | #define ARGP_EXTERNAL_OP ARGP_LIST3 (ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_BYTEDATA) | ||
114 | #define ARGP_FATAL_OP ARGP_LIST3 (ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_TERMARG) | 115 | #define ARGP_FATAL_OP ARGP_LIST3 (ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_TERMARG) |
115 | #define ARGP_FIELD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_FIELDLIST) | 116 | #define ARGP_FIELD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_FIELDLIST) |
116 | #define ARGP_FIND_SET_LEFT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET) | 117 | #define ARGP_FIND_SET_LEFT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET) |
@@ -243,6 +244,7 @@ | |||
243 | #define ARGI_DWORD_OP ARGI_INVALID_OPCODE | 244 | #define ARGI_DWORD_OP ARGI_INVALID_OPCODE |
244 | #define ARGI_ELSE_OP ARGI_INVALID_OPCODE | 245 | #define ARGI_ELSE_OP ARGI_INVALID_OPCODE |
245 | #define ARGI_EVENT_OP ARGI_INVALID_OPCODE | 246 | #define ARGI_EVENT_OP ARGI_INVALID_OPCODE |
247 | #define ARGI_EXTERNAL_OP ARGI_LIST3 (ARGI_STRING, ARGI_INTEGER, ARGI_INTEGER) | ||
246 | #define ARGI_FATAL_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER) | 248 | #define ARGI_FATAL_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER) |
247 | #define ARGI_FIELD_OP ARGI_INVALID_OPCODE | 249 | #define ARGI_FIELD_OP ARGI_INVALID_OPCODE |
248 | #define ARGI_FIND_SET_LEFT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF) | 250 | #define ARGI_FIND_SET_LEFT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF) |
diff --git a/drivers/acpi/acpica/amlcode.h b/drivers/acpi/acpica/amlcode.h index 3a95068fc119..2c47b2533144 100644 --- a/drivers/acpi/acpica/amlcode.h +++ b/drivers/acpi/acpica/amlcode.h | |||
@@ -65,6 +65,7 @@ | |||
65 | #define AML_PACKAGE_OP (u16) 0x12 | 65 | #define AML_PACKAGE_OP (u16) 0x12 |
66 | #define AML_VAR_PACKAGE_OP (u16) 0x13 /* ACPI 2.0 */ | 66 | #define AML_VAR_PACKAGE_OP (u16) 0x13 /* ACPI 2.0 */ |
67 | #define AML_METHOD_OP (u16) 0x14 | 67 | #define AML_METHOD_OP (u16) 0x14 |
68 | #define AML_EXTERNAL_OP (u16) 0x15 /* ACPI 6.0 */ | ||
68 | #define AML_DUAL_NAME_PREFIX (u16) 0x2e | 69 | #define AML_DUAL_NAME_PREFIX (u16) 0x2e |
69 | #define AML_MULTI_NAME_PREFIX_OP (u16) 0x2f | 70 | #define AML_MULTI_NAME_PREFIX_OP (u16) 0x2f |
70 | #define AML_NAME_CHAR_SUBSEQ (u16) 0x30 | 71 | #define AML_NAME_CHAR_SUBSEQ (u16) 0x30 |
diff --git a/drivers/acpi/acpica/dsutils.c b/drivers/acpi/acpica/dsutils.c index e5ff89bcb3f5..deeddd6d2f05 100644 --- a/drivers/acpi/acpica/dsutils.c +++ b/drivers/acpi/acpica/dsutils.c | |||
@@ -564,6 +564,17 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state, | |||
564 | acpi_operand_object, | 564 | acpi_operand_object, |
565 | acpi_gbl_root_node); | 565 | acpi_gbl_root_node); |
566 | status = AE_OK; | 566 | status = AE_OK; |
567 | } else if (parent_op->common.aml_opcode == | ||
568 | AML_EXTERNAL_OP) { | ||
569 | |||
570 | /* TBD: May only be temporary */ | ||
571 | |||
572 | obj_desc = | ||
573 | acpi_ut_create_string_object((acpi_size) name_length); | ||
574 | |||
575 | ACPI_STRNCPY(obj_desc->string.pointer, | ||
576 | name_string, name_length); | ||
577 | status = AE_OK; | ||
567 | } else { | 578 | } else { |
568 | /* | 579 | /* |
569 | * We just plain didn't find it -- which is a | 580 | * We just plain didn't find it -- which is a |
diff --git a/drivers/acpi/acpica/exoparg3.c b/drivers/acpi/acpica/exoparg3.c index b813fed95e56..1c64a988cbee 100644 --- a/drivers/acpi/acpica/exoparg3.c +++ b/drivers/acpi/acpica/exoparg3.c | |||
@@ -114,7 +114,18 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state) | |||
114 | /* Might return while OS is shutting down, just continue */ | 114 | /* Might return while OS is shutting down, just continue */ |
115 | 115 | ||
116 | ACPI_FREE(fatal); | 116 | ACPI_FREE(fatal); |
117 | break; | 117 | goto cleanup; |
118 | |||
119 | case AML_EXTERNAL_OP: | ||
120 | /* | ||
121 | * If the interpreter sees this opcode, just ignore it. The External | ||
122 | * op is intended for use by disassemblers in order to properly | ||
123 | * disassemble control method invocations. The opcode or group of | ||
124 | * opcodes should be surrounded by an "if (0)" clause to ensure that | ||
125 | * AML interpreters never see the opcode. | ||
126 | */ | ||
127 | status = AE_OK; | ||
128 | goto cleanup; | ||
118 | 129 | ||
119 | default: | 130 | default: |
120 | 131 | ||
diff --git a/drivers/acpi/acpica/psopcode.c b/drivers/acpi/acpica/psopcode.c index 1af4a405e351..ed90fddf2487 100644 --- a/drivers/acpi/acpica/psopcode.c +++ b/drivers/acpi/acpica/psopcode.c | |||
@@ -646,7 +646,13 @@ const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = { | |||
646 | AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS), | 646 | AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS), |
647 | /* 80 */ ACPI_OP("-ExtAccessField-", ARGP_CONNECTFIELD_OP, | 647 | /* 80 */ ACPI_OP("-ExtAccessField-", ARGP_CONNECTFIELD_OP, |
648 | ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY, | 648 | ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY, |
649 | AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0) | 649 | AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0), |
650 | |||
651 | /* ACPI 6.0 opcodes */ | ||
652 | |||
653 | /* 81 */ ACPI_OP("External", ARGP_EXTERNAL_OP, ARGI_EXTERNAL_OP, | ||
654 | ACPI_TYPE_ANY, AML_CLASS_EXECUTE, /* ? */ | ||
655 | AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R) | ||
650 | 656 | ||
651 | /*! [End] no source code translation !*/ | 657 | /*! [End] no source code translation !*/ |
652 | }; | 658 | }; |
diff --git a/drivers/acpi/acpica/psopinfo.c b/drivers/acpi/acpica/psopinfo.c index e18e7c47f482..20e1a35169fc 100644 --- a/drivers/acpi/acpica/psopinfo.c +++ b/drivers/acpi/acpica/psopinfo.c | |||
@@ -210,7 +210,7 @@ const u8 acpi_gbl_short_op_index[256] = { | |||
210 | /* 8 9 A B C D E F */ | 210 | /* 8 9 A B C D E F */ |
211 | /* 0x00 */ 0x00, 0x01, _UNK, _UNK, _UNK, _UNK, 0x02, _UNK, | 211 | /* 0x00 */ 0x00, 0x01, _UNK, _UNK, _UNK, _UNK, 0x02, _UNK, |
212 | /* 0x08 */ 0x03, _UNK, 0x04, 0x05, 0x06, 0x07, 0x6E, _UNK, | 212 | /* 0x08 */ 0x03, _UNK, 0x04, 0x05, 0x06, 0x07, 0x6E, _UNK, |
213 | /* 0x10 */ 0x08, 0x09, 0x0a, 0x6F, 0x0b, _UNK, _UNK, _UNK, | 213 | /* 0x10 */ 0x08, 0x09, 0x0a, 0x6F, 0x0b, 0x81, _UNK, _UNK, |
214 | /* 0x18 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, | 214 | /* 0x18 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, |
215 | /* 0x20 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, | 215 | /* 0x20 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, |
216 | /* 0x28 */ _UNK, _UNK, _UNK, _UNK, _UNK, 0x63, _PFX, _PFX, | 216 | /* 0x28 */ _UNK, _UNK, _UNK, _UNK, _UNK, 0x63, _PFX, _PFX, |