diff --git a/source/compiler/aslmap.c b/source/compiler/aslmap.c index 5aed2b0592..cb6a9418ee 100644 --- a/source/compiler/aslmap.c +++ b/source/compiler/aslmap.c @@ -294,7 +294,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* EXTENDEDIO */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* EXTENDEDMEMORY */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* EXTENDEDSPACE */ OP_TABLE_ENTRY (AML_RAW_DATA_QWORD, 0, 0, ACPI_BTYPE_INTEGER), -/* EXTERNAL */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), +/* EXTERNAL */ OP_TABLE_ENTRY (AML_EXTERNAL_OP, 0, 0, 0), /* FATAL */ OP_TABLE_ENTRY (AML_FATAL_OP, 0, 0, 0), /* FIELD */ OP_TABLE_ENTRY (AML_FIELD_OP, 0, NODE_AML_PACKAGE, 0), /* FINDSETLEFTBIT */ OP_TABLE_ENTRY (AML_FIND_SET_LEFT_BIT_OP, 0, 0, ACPI_BTYPE_INTEGER), diff --git a/source/components/dispatcher/dsutils.c b/source/components/dispatcher/dsutils.c index b98fc9ac38..0269916a6c 100644 --- a/source/components/dispatcher/dsutils.c +++ b/source/components/dispatcher/dsutils.c @@ -671,6 +671,15 @@ AcpiDsCreateOperand ( ACPI_OPERAND_OBJECT, AcpiGbl_RootNode); Status = AE_OK; } + else if (ParentOp->Common.AmlOpcode == AML_EXTERNAL_OP) + { + /* TBD: May only be temporary */ + + ObjDesc = AcpiUtCreateStringObject ((ACPI_SIZE) NameLength); + + ACPI_STRNCPY (ObjDesc->String.Pointer, NameString, NameLength); + Status = AE_OK; + } else { /* diff --git a/source/components/executer/exoparg3.c b/source/components/executer/exoparg3.c index 507720fbeb..b0928afbad 100644 --- a/source/components/executer/exoparg3.c +++ b/source/components/executer/exoparg3.c @@ -198,7 +198,18 @@ AcpiExOpcode_3A_0T_0R ( /* Might return while OS is shutting down, just continue */ ACPI_FREE (Fatal); - break; + goto Cleanup; + + case AML_EXTERNAL_OP: + /* + * If the interpreter sees this opcode, just ignore it. The External + * op is intended for use by disassemblers in order to properly + * disassemble control method invocations. The opcode or group of + * opcodes should be surrounded by an "if (0)" clause to ensure that + * AML interpreters never see the opcode. + */ + Status = AE_OK; + goto Cleanup; default: diff --git a/source/components/parser/psopcode.c b/source/components/parser/psopcode.c index 1f949162e3..41181c61b0 100644 --- a/source/components/parser/psopcode.c +++ b/source/components/parser/psopcode.c @@ -405,7 +405,11 @@ const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES] = /* ACPI 5.0 opcodes */ /* 7F */ ACPI_OP ("-ConnectField-", ARGP_CONNECTFIELD_OP, ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS), -/* 80 */ ACPI_OP ("-ExtAccessField-", ARGP_CONNECTFIELD_OP, ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0) +/* 80 */ ACPI_OP ("-ExtAccessField-", ARGP_CONNECTFIELD_OP, ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0), + +/* ACPI 6.0 opcodes */ + +/* 81 */ ACPI_OP ("External", ARGP_EXTERNAL_OP, ARGI_EXTERNAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE,/* ? */ AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R) /*! [End] no source code translation !*/ }; diff --git a/source/components/parser/psopinfo.c b/source/components/parser/psopinfo.c index a059b742c6..e0fbd89a4b 100644 --- a/source/components/parser/psopinfo.c +++ b/source/components/parser/psopinfo.c @@ -298,7 +298,7 @@ const UINT8 AcpiGbl_ShortOpIndex[256] = /* 8 9 A B C D E F */ /* 0x00 */ 0x00, 0x01, _UNK, _UNK, _UNK, _UNK, 0x02, _UNK, /* 0x08 */ 0x03, _UNK, 0x04, 0x05, 0x06, 0x07, 0x6E, _UNK, -/* 0x10 */ 0x08, 0x09, 0x0a, 0x6F, 0x0b, _UNK, _UNK, _UNK, +/* 0x10 */ 0x08, 0x09, 0x0a, 0x6F, 0x0b, 0x81, _UNK, _UNK, /* 0x18 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, /* 0x20 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, /* 0x28 */ _UNK, _UNK, _UNK, _UNK, _UNK, 0x63, _PFX, _PFX, diff --git a/source/include/aclocal.h b/source/include/aclocal.h index 96f292b8a9..9e0d08de17 100644 --- a/source/include/aclocal.h +++ b/source/include/aclocal.h @@ -126,7 +126,7 @@ typedef UINT32 ACPI_MUTEX_HANDLE; /* Total number of aml opcodes defined */ -#define AML_NUM_OPCODES 0x81 +#define AML_NUM_OPCODES 0x82 /* Forward declarations */ diff --git a/source/include/acopcode.h b/source/include/acopcode.h index 45423f3111..133e1347d0 100644 --- a/source/include/acopcode.h +++ b/source/include/acopcode.h @@ -184,6 +184,7 @@ #define ARGP_DWORD_OP ARGP_LIST1 (ARGP_DWORDDATA) #define ARGP_ELSE_OP ARGP_LIST2 (ARGP_PKGLENGTH, ARGP_TERMLIST) #define ARGP_EVENT_OP ARGP_LIST1 (ARGP_NAME) +#define ARGP_EXTERNAL_OP ARGP_LIST3 (ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_BYTEDATA) #define ARGP_FATAL_OP ARGP_LIST3 (ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_TERMARG) #define ARGP_FIELD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_FIELDLIST) #define ARGP_FIND_SET_LEFT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET) @@ -317,6 +318,7 @@ #define ARGI_DWORD_OP ARGI_INVALID_OPCODE #define ARGI_ELSE_OP ARGI_INVALID_OPCODE #define ARGI_EVENT_OP ARGI_INVALID_OPCODE +#define ARGI_EXTERNAL_OP ARGI_LIST3 (ARGI_STRING, ARGI_INTEGER, ARGI_INTEGER) #define ARGI_FATAL_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER) #define ARGI_FIELD_OP ARGI_INVALID_OPCODE #define ARGI_FIND_SET_LEFT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF) diff --git a/source/include/amlcode.h b/source/include/amlcode.h index 2a5dc97cf8..aa0f62218e 100644 --- a/source/include/amlcode.h +++ b/source/include/amlcode.h @@ -137,6 +137,7 @@ #define AML_PACKAGE_OP (UINT16) 0x12 #define AML_VAR_PACKAGE_OP (UINT16) 0x13 /* ACPI 2.0 */ #define AML_METHOD_OP (UINT16) 0x14 +#define AML_EXTERNAL_OP (UINT16) 0x15 /* ACPI 6.0 */ #define AML_DUAL_NAME_PREFIX (UINT16) 0x2e #define AML_MULTI_NAME_PREFIX_OP (UINT16) 0x2f #define AML_NAME_CHAR_SUBSEQ (UINT16) 0x30