Commit eb174ad0 authored by Andy Grover's avatar Andy Grover

ACPI: Misc interpreter improvements

parent 074a30db
......@@ -313,7 +313,6 @@ acpi_ex_load_op (
break;
case ACPI_TYPE_BUFFER_FIELD:
case ACPI_TYPE_LOCAL_REGION_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
......
......@@ -345,13 +345,6 @@ acpi_ex_resolve_operands (
type_needed = ACPI_TYPE_EVENT;
break;
case ARGI_REGION:
/* Need an operand of type ACPI_TYPE_REGION */
type_needed = ACPI_TYPE_REGION;
break;
case ARGI_PACKAGE: /* Package */
/* Need an operand of type ACPI_TYPE_PACKAGE */
......@@ -458,6 +451,37 @@ acpi_ex_resolve_operands (
goto next_operand;
case ARGI_BUFFER_OR_STRING:
/* Need an operand of type STRING or BUFFER */
switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
case ACPI_TYPE_STRING:
case ACPI_TYPE_BUFFER:
/* Valid operand */
break;
case ACPI_TYPE_INTEGER:
/* Highest priority conversion is to type Buffer */
status = acpi_ex_convert_to_buffer (obj_desc, stack_ptr, walk_state);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
break;
default:
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Needed [Integer/String/Buffer], found [%s] %p\n",
acpi_ut_get_object_type_name (obj_desc), obj_desc));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
goto next_operand;
case ARGI_DATAOBJECT:
/*
* ARGI_DATAOBJECT is only used by the size_of operator.
......@@ -477,7 +501,7 @@ acpi_ex_resolve_operands (
default:
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Needed [Buf/Str/Pkg], found [%s] %p\n",
"Needed [Buffer/String/Package/Reference], found [%s] %p\n",
acpi_ut_get_object_type_name (obj_desc), obj_desc));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
......@@ -499,7 +523,30 @@ acpi_ex_resolve_operands (
default:
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Needed [Buf/Str/Pkg], found [%s] %p\n",
"Needed [Buffer/String/Package], found [%s] %p\n",
acpi_ut_get_object_type_name (obj_desc), obj_desc));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
goto next_operand;
case ARGI_REGION_OR_FIELD:
/* Need an operand of type ACPI_TYPE_REGION or a FIELD in a region */
switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
case ACPI_TYPE_REGION:
case ACPI_TYPE_LOCAL_REGION_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
/* Valid operand */
break;
default:
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Needed [Region/region_field], found [%s] %p\n",
acpi_ut_get_object_type_name (obj_desc), obj_desc));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
......
......@@ -258,7 +258,7 @@
#define ARGI_LLESSEQUAL_OP ARGI_INVALID_OPCODE
#define ARGI_LNOT_OP ARGI_LIST1 (ARGI_INTEGER)
#define ARGI_LNOTEQUAL_OP ARGI_INVALID_OPCODE
#define ARGI_LOAD_OP ARGI_LIST2 (ARGI_REGION, ARGI_TARGETREF)
#define ARGI_LOAD_OP ARGI_LIST2 (ARGI_REGION_OR_FIELD,ARGI_TARGETREF)
#define ARGI_LOAD_TABLE_OP ARGI_LIST6 (ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_ANYTYPE)
#define ARGI_LOCAL0 ARG_NONE
#define ARGI_LOCAL1 ARG_NONE
......@@ -272,7 +272,7 @@
#define ARGI_MATCH_OP ARGI_LIST6 (ARGI_PACKAGE, ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER)
#define ARGI_METHOD_OP ARGI_INVALID_OPCODE
#define ARGI_METHODCALL_OP ARGI_INVALID_OPCODE
#define ARGI_MID_OP ARGI_LIST4 (ARGI_BUFFERSTRING,ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_MID_OP ARGI_LIST4 (ARGI_BUFFER_OR_STRING,ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_MOD_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_MULTIPLY_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_MUTEX_OP ARGI_INVALID_OPCODE
......
......@@ -358,14 +358,16 @@ struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVE
const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] =
{
"system_memory",
"system_iO",
/*! [Begin] no source code translation (keep these ASL Keywords as-is) */
"SystemMemory",
"SystemIO",
"PCI_Config",
"embedded_control",
"EmbeddedControl",
"SMBus",
"CMOS",
"PCIBARTarget",
"data_table",
"DataTable"
/*! [End] no source code translation !*/
};
......@@ -381,7 +383,7 @@ acpi_ut_get_region_name (
else if (space_id >= ACPI_NUM_PREDEFINED_REGIONS)
{
return ("invalid_space_iD");
return ("invalid_space_id");
}
return ((char *) acpi_gbl_region_types[space_id]);
......
......@@ -192,6 +192,7 @@
* Argument types for the AML Parser
* Each field in the arg_types u32 is 5 bits, allowing for a maximum of 6 arguments.
* There can be up to 31 unique argument types
* Zero is reserved as end-of-list indicator
*/
#define ARGP_BYTEDATA 0x01
......@@ -218,38 +219,47 @@
* Each field in the arg_types u32 is 5 bits, allowing for a maximum of 6 arguments.
* There can be up to 31 unique argument types (0 is end-of-arg-list indicator)
*
* Note: If and when 5 bits becomes insufficient, it would probably be best
* Note1: These values are completely independent from the ACPI_TYPEs
* i.e., ARGI_INTEGER != ACPI_TYPE_INTEGER
*
* Note2: If and when 5 bits becomes insufficient, it would probably be best
* to convert to a 6-byte array of argument types, allowing 8 bits per argument.
*/
/* "Standard" ACPI types are 1-15 (0x0F) */
#define ARGI_INTEGER ACPI_TYPE_INTEGER /* 1 */
#define ARGI_STRING ACPI_TYPE_STRING /* 2 */
#define ARGI_BUFFER ACPI_TYPE_BUFFER /* 3 */
#define ARGI_PACKAGE ACPI_TYPE_PACKAGE /* 4 */
#define ARGI_EVENT ACPI_TYPE_EVENT
#define ARGI_MUTEX ACPI_TYPE_MUTEX
#define ARGI_REGION ACPI_TYPE_REGION
#define ARGI_DDBHANDLE ACPI_TYPE_DDB_HANDLE
/* Custom types are 0x10 through 0x1F */
#define ARGI_IF 0x10
#define ARGI_ANYOBJECT 0x11
#define ARGI_ANYTYPE 0x12
#define ARGI_COMPUTEDATA 0x13 /* Buffer, String, or Integer */
#define ARGI_DATAOBJECT 0x14 /* Buffer, String, package or reference to a Node - Used only by size_of operator*/
#define ARGI_COMPLEXOBJ 0x15 /* Buffer, String, or package (Used by INDEX op only) */
#define ARGI_INTEGER_REF 0x16
#define ARGI_OBJECT_REF 0x17
#define ARGI_DEVICE_REF 0x18
#define ARGI_REFERENCE 0x19
#define ARGI_TARGETREF 0x1A /* Target, subject to implicit conversion */
#define ARGI_FIXED_TARGET 0x1B /* Target, no implicit conversion */
#define ARGI_SIMPLE_TARGET 0x1C /* Name, Local, Arg -- no implicit conversion */
#define ARGI_BUFFERSTRING 0x1D
#define ARGI_REF_OR_STRING 0x1E /* Reference or String (Used by DEREFOF op only) */
/* Single, simple types */
#define ARGI_ANYTYPE 0x01 /* Don't care */
#define ARGI_PACKAGE 0x02
#define ARGI_EVENT 0x03
#define ARGI_MUTEX 0x04
#define ARGI_DDBHANDLE 0x05
/* Interchangeable types (via implicit conversion) */
#define ARGI_INTEGER 0x06
#define ARGI_STRING 0x07
#define ARGI_BUFFER 0x08
#define ARGI_BUFFER_OR_STRING 0x09 /* Used by MID op only */
#define ARGI_COMPUTEDATA 0x0A /* Buffer, String, or Integer */
/* Reference objects */
#define ARGI_INTEGER_REF 0x0B
#define ARGI_OBJECT_REF 0x0C
#define ARGI_DEVICE_REF 0x0D
#define ARGI_REFERENCE 0x0E
#define ARGI_TARGETREF 0x0F /* Target, subject to implicit conversion */
#define ARGI_FIXED_TARGET 0x10 /* Target, no implicit conversion */
#define ARGI_SIMPLE_TARGET 0x11 /* Name, Local, Arg -- no implicit conversion */
/* Multiple/complex types */
#define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a Node - Used only by size_of operator*/
#define ARGI_COMPLEXOBJ 0x13 /* Buffer, String, or package (Used by INDEX op only) */
#define ARGI_REF_OR_STRING 0x14 /* Reference or String (Used by DEREFOF op only) */
#define ARGI_REGION_OR_FIELD 0x15 /* Used by LOAD op only */
/* Note: types above can expand to 0x1F maximum */
#define ARGI_INVALID_OPCODE 0xFFFFFFFF
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment