Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56a3d5e7 authored by Bob Moore's avatar Bob Moore Committed by Rafael J. Wysocki
Browse files

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: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 2e7cc46a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ typedef u32 acpi_mutex_handle;

/* Total number of aml opcodes defined */

#define AML_NUM_OPCODES                 0x81
#define AML_NUM_OPCODES                 0x82

/* Forward declarations */

+2 −0
Original line number Diff line number Diff line
@@ -111,6 +111,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)
@@ -243,6 +244,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)
+1 −0
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@
#define AML_PACKAGE_OP              (u16) 0x12
#define AML_VAR_PACKAGE_OP          (u16) 0x13	/* ACPI 2.0 */
#define AML_METHOD_OP               (u16) 0x14
#define AML_EXTERNAL_OP             (u16) 0x15	/* ACPI 6.0 */
#define AML_DUAL_NAME_PREFIX        (u16) 0x2e
#define AML_MULTI_NAME_PREFIX_OP    (u16) 0x2f
#define AML_NAME_CHAR_SUBSEQ        (u16) 0x30
+11 −0
Original line number Diff line number Diff line
@@ -564,6 +564,17 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
								 acpi_operand_object,
								 acpi_gbl_root_node);
					status = AE_OK;
				} else if (parent_op->common.aml_opcode ==
					   AML_EXTERNAL_OP) {

					/* TBD: May only be temporary */

					obj_desc =
					    acpi_ut_create_string_object((acpi_size) name_length);

					ACPI_STRNCPY(obj_desc->string.pointer,
						     name_string, name_length);
					status = AE_OK;
				} else {
					/*
					 * We just plain didn't find it -- which is a
+12 −1
Original line number Diff line number Diff line
@@ -114,7 +114,18 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
		/* 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:

Loading