mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
Merge branch 'acpica'
* acpica: ACPICA: Update version to 20181213 ACPICA: change coding style to match ACPICA, no functional change ACPICA: Debug output: Add option to display method/object evaluation ACPICA: disassembler: disassemble OEMx tables as AML ACPICA: Add "Windows 2018.2" string in the _OSI support ACPICA: Expressions in package elements are not supported ACPICA: Update buffer-to-string conversions ACPICA: add comments, no functional change ACPICA: Remove defines that use deprecated flag ACPICA: Add "Windows 2018" string in the _OSI support ACPICA: Update version to 20181031 ACPICA: iASL: Enhance error detection ACPICA: iASL: adding definition and disassembly for TPM2 revision 3 ACPICA: Use %d for signed int print formatting instead of %u ACPICA: Debugger: refactor to fix unused variable warning
This commit is contained in:
commit
1027fb0fb9
33 changed files with 285 additions and 117 deletions
|
|
@ -172,11 +172,7 @@ ACPI_GLOBAL(u8, acpi_gbl_disable_mem_tracking);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
|
||||
#define NUM_PREDEFINED_NAMES 10
|
||||
#else
|
||||
#define NUM_PREDEFINED_NAMES 9
|
||||
#endif
|
||||
|
||||
ACPI_GLOBAL(struct acpi_namespace_node, acpi_gbl_root_node_struct);
|
||||
ACPI_GLOBAL(struct acpi_namespace_node *, acpi_gbl_root_node);
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#define ACPI_NS_TEMPORARY 0x0040
|
||||
#define ACPI_NS_OVERRIDE_IF_FOUND 0x0080
|
||||
#define ACPI_NS_EARLY_INIT 0x0100
|
||||
#define ACPI_NS_PREFIX_MUST_EXIST 0x0200
|
||||
|
||||
/* Flags for acpi_ns_walk_namespace */
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,8 @@ struct acpi_walk_state {
|
|||
struct acpi_parse_state parser_state; /* Current state of parser */
|
||||
u32 prev_arg_types;
|
||||
u32 arg_count; /* push for fixed or var args */
|
||||
u16 method_nesting_depth;
|
||||
u8 method_is_nested;
|
||||
|
||||
struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */
|
||||
struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */
|
||||
|
|
@ -74,7 +76,8 @@ struct acpi_walk_state {
|
|||
struct acpi_namespace_node *method_call_node; /* Called method Node */
|
||||
union acpi_parse_object *method_call_op; /* method_call Op if running a method */
|
||||
union acpi_operand_object *method_desc; /* Method descriptor if running a method */
|
||||
struct acpi_namespace_node *method_node; /* Method node if running a method. */
|
||||
struct acpi_namespace_node *method_node; /* Method node if running a method */
|
||||
char *method_pathname; /* Full pathname of running method */
|
||||
union acpi_parse_object *op; /* Current parser op */
|
||||
const struct acpi_opcode_info *op_info; /* Info on current opcode */
|
||||
union acpi_parse_object *origin; /* Start of walk [Obsolete] */
|
||||
|
|
|
|||
|
|
@ -24,6 +24,13 @@ acpi_db_start_command(struct acpi_walk_state *walk_state,
|
|||
void acpi_db_method_end(struct acpi_walk_state *walk_state);
|
||||
#endif
|
||||
|
||||
#ifdef ACPI_DISASSEMBLER
|
||||
static union acpi_parse_object *acpi_db_get_display_op(struct acpi_walk_state
|
||||
*walk_state,
|
||||
union acpi_parse_object
|
||||
*op);
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_db_start_command
|
||||
|
|
@ -113,6 +120,70 @@ void acpi_db_signal_break_point(struct acpi_walk_state *walk_state)
|
|||
acpi_os_printf("**break** Executed AML BreakPoint opcode\n");
|
||||
}
|
||||
|
||||
#ifdef ACPI_DISASSEMBLER
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_db_get_display_op
|
||||
*
|
||||
* PARAMETERS: walk_state - Current walk
|
||||
* op - Current executing op (from aml interpreter)
|
||||
*
|
||||
* RETURN: Opcode to display
|
||||
*
|
||||
* DESCRIPTION: Find the opcode to display during single stepping
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static union acpi_parse_object *acpi_db_get_display_op(struct acpi_walk_state
|
||||
*walk_state,
|
||||
union acpi_parse_object
|
||||
*op)
|
||||
{
|
||||
union acpi_parse_object *display_op;
|
||||
union acpi_parse_object *parent_op;
|
||||
|
||||
display_op = op;
|
||||
parent_op = op->common.parent;
|
||||
if (parent_op) {
|
||||
if ((walk_state->control_state) &&
|
||||
(walk_state->control_state->common.state ==
|
||||
ACPI_CONTROL_PREDICATE_EXECUTING)) {
|
||||
/*
|
||||
* We are executing the predicate of an IF or WHILE statement
|
||||
* Search upwards for the containing IF or WHILE so that the
|
||||
* entire predicate can be displayed.
|
||||
*/
|
||||
while (parent_op) {
|
||||
if ((parent_op->common.aml_opcode == AML_IF_OP)
|
||||
|| (parent_op->common.aml_opcode ==
|
||||
AML_WHILE_OP)) {
|
||||
display_op = parent_op;
|
||||
break;
|
||||
}
|
||||
parent_op = parent_op->common.parent;
|
||||
}
|
||||
} else {
|
||||
while (parent_op) {
|
||||
if ((parent_op->common.aml_opcode == AML_IF_OP)
|
||||
|| (parent_op->common.aml_opcode ==
|
||||
AML_ELSE_OP)
|
||||
|| (parent_op->common.aml_opcode ==
|
||||
AML_SCOPE_OP)
|
||||
|| (parent_op->common.aml_opcode ==
|
||||
AML_METHOD_OP)
|
||||
|| (parent_op->common.aml_opcode ==
|
||||
AML_WHILE_OP)) {
|
||||
break;
|
||||
}
|
||||
display_op = parent_op;
|
||||
parent_op = parent_op->common.parent;
|
||||
}
|
||||
}
|
||||
}
|
||||
return display_op;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_db_single_step
|
||||
|
|
@ -134,8 +205,6 @@ acpi_db_single_step(struct acpi_walk_state *walk_state,
|
|||
union acpi_parse_object *next;
|
||||
acpi_status status = AE_OK;
|
||||
u32 original_debug_level;
|
||||
union acpi_parse_object *display_op;
|
||||
union acpi_parse_object *parent_op;
|
||||
u32 aml_offset;
|
||||
|
||||
ACPI_FUNCTION_ENTRY();
|
||||
|
|
@ -222,51 +291,12 @@ acpi_db_single_step(struct acpi_walk_state *walk_state,
|
|||
next = op->common.next;
|
||||
op->common.next = NULL;
|
||||
|
||||
display_op = op;
|
||||
parent_op = op->common.parent;
|
||||
if (parent_op) {
|
||||
if ((walk_state->control_state) &&
|
||||
(walk_state->control_state->common.state ==
|
||||
ACPI_CONTROL_PREDICATE_EXECUTING)) {
|
||||
/*
|
||||
* We are executing the predicate of an IF or WHILE statement
|
||||
* Search upwards for the containing IF or WHILE so that the
|
||||
* entire predicate can be displayed.
|
||||
*/
|
||||
while (parent_op) {
|
||||
if ((parent_op->common.aml_opcode ==
|
||||
AML_IF_OP)
|
||||
|| (parent_op->common.aml_opcode ==
|
||||
AML_WHILE_OP)) {
|
||||
display_op = parent_op;
|
||||
break;
|
||||
}
|
||||
parent_op = parent_op->common.parent;
|
||||
}
|
||||
} else {
|
||||
while (parent_op) {
|
||||
if ((parent_op->common.aml_opcode ==
|
||||
AML_IF_OP)
|
||||
|| (parent_op->common.aml_opcode ==
|
||||
AML_ELSE_OP)
|
||||
|| (parent_op->common.aml_opcode ==
|
||||
AML_SCOPE_OP)
|
||||
|| (parent_op->common.aml_opcode ==
|
||||
AML_METHOD_OP)
|
||||
|| (parent_op->common.aml_opcode ==
|
||||
AML_WHILE_OP)) {
|
||||
break;
|
||||
}
|
||||
display_op = parent_op;
|
||||
parent_op = parent_op->common.parent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Now we can disassemble and display it */
|
||||
|
||||
#ifdef ACPI_DISASSEMBLER
|
||||
acpi_dm_disassemble(walk_state, display_op, ACPI_UINT32_MAX);
|
||||
acpi_dm_disassemble(walk_state,
|
||||
acpi_db_get_display_op(walk_state, op),
|
||||
ACPI_UINT32_MAX);
|
||||
#else
|
||||
/*
|
||||
* The AML Disassembler is not configured - at least we can
|
||||
|
|
|
|||
|
|
@ -532,6 +532,9 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
|
|||
goto cleanup;
|
||||
}
|
||||
|
||||
next_walk_state->method_nesting_depth =
|
||||
this_walk_state->method_nesting_depth + 1;
|
||||
|
||||
/*
|
||||
* Delete the operands on the previous walkstate operand stack
|
||||
* (they were copied to new objects)
|
||||
|
|
@ -549,6 +552,17 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
|
|||
"**** Begin nested execution of [%4.4s] **** WalkState=%p\n",
|
||||
method_node->name.ascii, next_walk_state));
|
||||
|
||||
this_walk_state->method_pathname =
|
||||
acpi_ns_get_normalized_pathname(method_node, TRUE);
|
||||
this_walk_state->method_is_nested = TRUE;
|
||||
|
||||
/* Optional object evaluation log */
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW((ACPI_DB_EVALUATION,
|
||||
"%-26s: %*s%s\n", " Nested method call",
|
||||
next_walk_state->method_nesting_depth * 3, " ",
|
||||
&this_walk_state->method_pathname[1]));
|
||||
|
||||
/* Invoke an internal method if necessary */
|
||||
|
||||
if (obj_desc->method.info_flags & ACPI_METHOD_INTERNAL_ONLY) {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
#define _COMPONENT ACPI_DISPATCHER
|
||||
ACPI_MODULE_NAME("dsobject")
|
||||
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ds_build_internal_object
|
||||
|
|
@ -299,8 +298,6 @@ acpi_ds_create_node(struct acpi_walk_state *walk_state,
|
|||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
#endif /* ACPI_NO_METHOD_EXECUTION */
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ds_init_object_from_op
|
||||
|
|
@ -404,9 +401,7 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
|
|||
|
||||
/* Truncate value if we are executing from a 32-bit ACPI table */
|
||||
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
(void)acpi_ex_truncate_for32bit_table(obj_desc);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case AML_REVISION_OP:
|
||||
|
|
@ -428,7 +423,6 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
|
|||
|
||||
obj_desc->integer.value = op->common.value.integer;
|
||||
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
if (acpi_ex_truncate_for32bit_table(obj_desc)) {
|
||||
|
||||
/* Warn if we found a 64-bit constant in a 32-bit table */
|
||||
|
|
@ -439,7 +433,6 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
|
|||
value.integer),
|
||||
(u32)obj_desc->integer.value));
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
@ -477,7 +470,6 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
|
|||
((u32)opcode) - AML_FIRST_LOCAL_OP;
|
||||
obj_desc->reference.class = ACPI_REFCLASS_LOCAL;
|
||||
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
status =
|
||||
acpi_ds_method_data_get_node(ACPI_REFCLASS_LOCAL,
|
||||
obj_desc->reference.
|
||||
|
|
@ -487,7 +479,6 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
|
|||
acpi_namespace_node,
|
||||
&obj_desc->reference.
|
||||
object));
|
||||
#endif
|
||||
break;
|
||||
|
||||
case AML_TYPE_METHOD_ARGUMENT:
|
||||
|
|
@ -498,7 +489,6 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
|
|||
((u32)opcode) - AML_FIRST_ARG_OP;
|
||||
obj_desc->reference.class = ACPI_REFCLASS_ARG;
|
||||
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
status = acpi_ds_method_data_get_node(ACPI_REFCLASS_ARG,
|
||||
obj_desc->
|
||||
reference.value,
|
||||
|
|
@ -509,7 +499,6 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
|
|||
&obj_desc->
|
||||
reference.
|
||||
object));
|
||||
#endif
|
||||
break;
|
||||
|
||||
default: /* Object name or Debug object */
|
||||
|
|
|
|||
|
|
@ -152,6 +152,32 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
|
|||
*/
|
||||
for (i = 0; arg && (i < element_count); i++) {
|
||||
if (arg->common.aml_opcode == AML_INT_RETURN_VALUE_OP) {
|
||||
if (!arg->common.node) {
|
||||
/*
|
||||
* This is the case where an expression has returned a value.
|
||||
* The use of expressions (term_args) within individual
|
||||
* package elements is not supported by the AML interpreter,
|
||||
* even though the ASL grammar supports it. Example:
|
||||
*
|
||||
* Name (INT1, 0x1234)
|
||||
*
|
||||
* Name (PKG3, Package () {
|
||||
* Add (INT1, 0xAAAA0000)
|
||||
* })
|
||||
*
|
||||
* 1) No known AML interpreter supports this type of construct
|
||||
* 2) This fixes a fault if the construct is encountered
|
||||
*/
|
||||
ACPI_EXCEPTION((AE_INFO, AE_SUPPORT,
|
||||
"Expressions within package elements are not supported"));
|
||||
|
||||
/* Cleanup the return object, it is not needed */
|
||||
|
||||
acpi_ut_remove_reference(walk_state->results->
|
||||
results.obj_desc[0]);
|
||||
return_ACPI_STATUS(AE_SUPPORT);
|
||||
}
|
||||
|
||||
if (arg->common.node->type == ACPI_TYPE_METHOD) {
|
||||
/*
|
||||
* A method reference "looks" to the parser to be a method
|
||||
|
|
|
|||
|
|
@ -57,7 +57,6 @@ void acpi_ds_clear_implicit_return(struct acpi_walk_state *walk_state)
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ds_do_implicit_return
|
||||
|
|
@ -401,7 +400,6 @@ void acpi_ds_clear_operands(struct acpi_walk_state *walk_state)
|
|||
walk_state->num_operands = 0;
|
||||
return_VOID;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
|
|
|
|||
|
|
@ -73,12 +73,10 @@ acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number)
|
|||
|
||||
/* Execution pass */
|
||||
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
walk_state->parse_flags |= ACPI_PARSE_EXECUTE |
|
||||
ACPI_PARSE_DELETE_TREE;
|
||||
walk_state->descending_callback = acpi_ds_exec_begin_op;
|
||||
walk_state->ascending_callback = acpi_ds_exec_end_op;
|
||||
#endif
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
@ -364,7 +362,7 @@ acpi_ds_load1_begin_op(struct acpi_walk_state *walk_state,
|
|||
|
||||
/* Initialize the op */
|
||||
|
||||
#if (defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY))
|
||||
#ifdef ACPI_CONSTANT_EVAL_ONLY
|
||||
op->named.path = path;
|
||||
#endif
|
||||
|
||||
|
|
@ -422,7 +420,6 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state)
|
|||
|
||||
object_type = walk_state->op_info->object_type;
|
||||
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
if (walk_state->op_info->flags & AML_FIELD) {
|
||||
/*
|
||||
* If we are executing a method, do not create any namespace objects
|
||||
|
|
@ -466,7 +463,6 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (op->common.aml_opcode == AML_NAME_OP) {
|
||||
|
||||
|
|
|
|||
|
|
@ -296,6 +296,14 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
|
|||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* For name creation opcodes, the full namepath prefix must
|
||||
* exist, except for the final (new) nameseg.
|
||||
*/
|
||||
if (walk_state->op_info->flags & AML_NAMED) {
|
||||
flags |= ACPI_NS_PREFIX_MUST_EXIST;
|
||||
}
|
||||
|
||||
/* Add new entry or lookup existing entry */
|
||||
|
||||
status =
|
||||
|
|
@ -363,10 +371,8 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
|
|||
struct acpi_namespace_node *node;
|
||||
union acpi_parse_object *arg;
|
||||
struct acpi_namespace_node *new_node;
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
u32 i;
|
||||
u8 region_space;
|
||||
#endif
|
||||
|
||||
ACPI_FUNCTION_TRACE(ds_load2_end_op);
|
||||
|
||||
|
|
@ -453,7 +459,6 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
|
|||
arg = op->common.value.arg;
|
||||
|
||||
switch (walk_state->op_info->type) {
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
|
||||
case AML_TYPE_CREATE_FIELD:
|
||||
/*
|
||||
|
|
@ -550,12 +555,10 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
|
|||
}
|
||||
|
||||
break;
|
||||
#endif /* ACPI_NO_METHOD_EXECUTION */
|
||||
|
||||
case AML_TYPE_NAMED_COMPLEX:
|
||||
|
||||
switch (op->common.aml_opcode) {
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
case AML_REGION_OP:
|
||||
case AML_DATA_REGION_OP:
|
||||
|
||||
|
|
@ -643,8 +646,6 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
|
|||
}
|
||||
break;
|
||||
|
||||
#endif /* ACPI_NO_METHOD_EXECUTION */
|
||||
|
||||
default:
|
||||
|
||||
/* All NAMED_COMPLEX opcodes must be handled above */
|
||||
|
|
|
|||
|
|
@ -530,7 +530,7 @@ struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id,
|
|||
|
||||
/* Init the method args/local */
|
||||
|
||||
#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY))
|
||||
#ifndef ACPI_CONSTANT_EVAL_ONLY
|
||||
acpi_ds_method_data_init(walk_state);
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -323,7 +323,7 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 data_width)
|
|||
|
||||
/* hex_length: 2 ascii hex chars per data byte */
|
||||
|
||||
hex_length = ACPI_MUL_2(data_width);
|
||||
hex_length = (data_width * 2);
|
||||
for (i = 0, j = (hex_length - 1); i < hex_length; i++, j--) {
|
||||
|
||||
/* Get one hex digit, most significant digits first */
|
||||
|
|
@ -364,7 +364,8 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 data_width)
|
|||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Convert an ACPI Object to a string
|
||||
* DESCRIPTION: Convert an ACPI Object to a string. Supports both implicit
|
||||
* and explicit conversions and related rules.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
|
@ -393,9 +394,11 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc,
|
|||
|
||||
switch (type) {
|
||||
case ACPI_EXPLICIT_CONVERT_DECIMAL:
|
||||
|
||||
/* Make room for maximum decimal number */
|
||||
|
||||
/*
|
||||
* From to_decimal_string, integer source.
|
||||
*
|
||||
* Make room for the maximum decimal number size
|
||||
*/
|
||||
string_length = ACPI_MAX_DECIMAL_DIGITS;
|
||||
base = 10;
|
||||
break;
|
||||
|
|
@ -440,8 +443,10 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc,
|
|||
switch (type) {
|
||||
case ACPI_EXPLICIT_CONVERT_DECIMAL: /* Used by to_decimal_string */
|
||||
/*
|
||||
* From ACPI: "If Data is a buffer, it is converted to a string of
|
||||
* decimal values separated by commas."
|
||||
* Explicit conversion from the to_decimal_string ASL operator.
|
||||
*
|
||||
* From ACPI: "If the input is a buffer, it is converted to a
|
||||
* a string of decimal values separated by commas."
|
||||
*/
|
||||
base = 10;
|
||||
|
||||
|
|
@ -462,20 +467,29 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc,
|
|||
|
||||
case ACPI_IMPLICIT_CONVERT_HEX:
|
||||
/*
|
||||
* Implicit buffer-to-string conversion
|
||||
*
|
||||
* From the ACPI spec:
|
||||
*"The entire contents of the buffer are converted to a string of
|
||||
* "The entire contents of the buffer are converted to a string of
|
||||
* two-character hexadecimal numbers, each separated by a space."
|
||||
*
|
||||
* Each hex number is prefixed with 0x (11/2018)
|
||||
*/
|
||||
separator = ' ';
|
||||
string_length = (obj_desc->buffer.length * 3);
|
||||
string_length = (obj_desc->buffer.length * 5);
|
||||
break;
|
||||
|
||||
case ACPI_EXPLICIT_CONVERT_HEX: /* Used by to_hex_string */
|
||||
case ACPI_EXPLICIT_CONVERT_HEX:
|
||||
/*
|
||||
* Explicit conversion from the to_hex_string ASL operator.
|
||||
*
|
||||
* From ACPI: "If Data is a buffer, it is converted to a string of
|
||||
* hexadecimal values separated by commas."
|
||||
*
|
||||
* Each hex number is prefixed with 0x (11/2018)
|
||||
*/
|
||||
string_length = (obj_desc->buffer.length * 3);
|
||||
separator = ',';
|
||||
string_length = (obj_desc->buffer.length * 5);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
@ -504,10 +518,21 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc,
|
|||
* (separated by commas or spaces)
|
||||
*/
|
||||
for (i = 0; i < obj_desc->buffer.length; i++) {
|
||||
if (base == 16) {
|
||||
|
||||
/* Emit 0x prefix for explict/implicit hex conversion */
|
||||
|
||||
*new_buf++ = '0';
|
||||
*new_buf++ = 'x';
|
||||
}
|
||||
|
||||
new_buf += acpi_ex_convert_to_ascii((u64) obj_desc->
|
||||
buffer.pointer[i],
|
||||
base, new_buf, 1);
|
||||
*new_buf++ = separator; /* each separated by a comma or space */
|
||||
|
||||
/* Each digit is separated by either a comma or space */
|
||||
|
||||
*new_buf++ = separator;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
|
||||
#define _COMPONENT ACPI_EXECUTER
|
||||
ACPI_MODULE_NAME("excreate")
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ex_create_alias
|
||||
|
|
@ -390,7 +389,6 @@ acpi_status acpi_ex_create_power_resource(struct acpi_walk_state *walk_state)
|
|||
acpi_ut_remove_reference(obj_desc);
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
|
|
|
|||
|
|
@ -287,9 +287,9 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
|
|||
* NOTE: A length of zero is ok, and will create a zero-length, null
|
||||
* terminated string.
|
||||
*/
|
||||
while ((length < operand[0]->buffer.length) &&
|
||||
(length < operand[1]->integer.value) &&
|
||||
(operand[0]->buffer.pointer[length])) {
|
||||
while ((length < operand[0]->buffer.length) && /* Length of input buffer */
|
||||
(length < operand[1]->integer.value) && /* Length operand */
|
||||
(operand[0]->buffer.pointer[length])) { /* Null terminator */
|
||||
length++;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -244,6 +244,7 @@ acpi_ex_write_serial_bus(union acpi_operand_object *source_desc,
|
|||
{
|
||||
acpi_status status;
|
||||
u32 buffer_length;
|
||||
u32 data_length;
|
||||
void *buffer;
|
||||
union acpi_operand_object *buffer_desc;
|
||||
u32 function;
|
||||
|
|
@ -324,8 +325,9 @@ acpi_ex_write_serial_bus(union acpi_operand_object *source_desc,
|
|||
/* Copy the input buffer data to the transfer buffer */
|
||||
|
||||
buffer = buffer_desc->buffer.pointer;
|
||||
memcpy(buffer, source_desc->buffer.pointer,
|
||||
min(buffer_length, source_desc->buffer.length));
|
||||
data_length = (buffer_length < source_desc->buffer.length ?
|
||||
buffer_length : source_desc->buffer.length);
|
||||
memcpy(buffer, source_desc->buffer.pointer, data_length);
|
||||
|
||||
/* Lock entire transaction if requested */
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ ACPI_MODULE_NAME("exutils")
|
|||
/* Local prototypes */
|
||||
static u32 acpi_ex_digits_needed(u64 value, u32 base);
|
||||
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ex_enter_interpreter
|
||||
|
|
@ -409,5 +408,3 @@ u8 acpi_is_valid_space_id(u8 space_id)
|
|||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -267,6 +267,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
|
|||
acpi_object_type this_search_type;
|
||||
u32 search_parent_flag = ACPI_NS_SEARCH_PARENT;
|
||||
u32 local_flags;
|
||||
acpi_interpreter_mode local_interpreter_mode;
|
||||
|
||||
ACPI_FUNCTION_TRACE(ns_lookup);
|
||||
|
||||
|
|
@ -506,6 +507,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
|
|||
*/
|
||||
this_search_type = ACPI_TYPE_ANY;
|
||||
current_node = this_node;
|
||||
|
||||
while (num_segments && current_node) {
|
||||
num_segments--;
|
||||
if (!num_segments) {
|
||||
|
|
@ -536,6 +538,16 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
|
|||
}
|
||||
}
|
||||
|
||||
/* Handle opcodes that create a new name_seg via a full name_path */
|
||||
|
||||
local_interpreter_mode = interpreter_mode;
|
||||
if ((flags & ACPI_NS_PREFIX_MUST_EXIST) && (num_segments > 0)) {
|
||||
|
||||
/* Every element of the path must exist (except for the final name_seg) */
|
||||
|
||||
local_interpreter_mode = ACPI_IMODE_EXECUTE;
|
||||
}
|
||||
|
||||
/* Extract one ACPI name from the front of the pathname */
|
||||
|
||||
ACPI_MOVE_32_TO_32(&simple_name, path);
|
||||
|
|
@ -544,12 +556,19 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
|
|||
|
||||
status =
|
||||
acpi_ns_search_and_enter(simple_name, walk_state,
|
||||
current_node, interpreter_mode,
|
||||
current_node,
|
||||
local_interpreter_mode,
|
||||
this_search_type, local_flags,
|
||||
&this_node);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
if (status == AE_NOT_FOUND) {
|
||||
|
||||
#if !defined ACPI_ASL_COMPILER /* Note: iASL reports this error by itself, not needed here */
|
||||
if (flags & ACPI_NS_PREFIX_MUST_EXIST) {
|
||||
acpi_os_printf(ACPI_MSG_BIOS_ERROR
|
||||
"Object does not exist: %4.4s\n",
|
||||
&simple_name);
|
||||
}
|
||||
#endif
|
||||
/* Name not found in ACPI namespace */
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
|
||||
|
|
|
|||
|
|
@ -104,6 +104,13 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info)
|
|||
return_ACPI_STATUS(AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Optional object evaluation log */
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW((ACPI_DB_EVALUATION,
|
||||
"%-26s: %s (%s)\n", " Enter evaluation",
|
||||
&info->full_pathname[1],
|
||||
acpi_ut_get_type_name(info->node->type)));
|
||||
|
||||
/* Count the number of arguments being passed in */
|
||||
|
||||
info->param_count = 0;
|
||||
|
|
@ -289,6 +296,12 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info)
|
|||
info->relative_pathname));
|
||||
|
||||
cleanup:
|
||||
/* Optional object evaluation log */
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW((ACPI_DB_EVALUATION,
|
||||
"%-26s: %s\n", " Exit evaluation",
|
||||
&info->full_pathname[1]));
|
||||
|
||||
/*
|
||||
* Namespace was unlocked by the handling acpi_ns* function, so we
|
||||
* just free the pathname and return
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ acpi_status acpi_ns_unload_namespace(acpi_handle handle);
|
|||
static acpi_status acpi_ns_delete_subtree(acpi_handle start_handle);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ns_load_table
|
||||
|
|
@ -297,4 +296,3 @@ acpi_status acpi_ns_unload_namespace(acpi_handle handle)
|
|||
return_ACPI_STATUS(status);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -107,8 +107,20 @@ acpi_ns_execute_table(u32 table_index, struct acpi_namespace_node *start_node)
|
|||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Optional object evaluation log */
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW((ACPI_DB_EVALUATION,
|
||||
"%-26s: (Definition Block level)\n",
|
||||
"Module-level evaluation"));
|
||||
|
||||
status = acpi_ps_execute_table(info);
|
||||
|
||||
/* Optional object evaluation log */
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW((ACPI_DB_EVALUATION,
|
||||
"%-26s: (Definition Block level)\n",
|
||||
"Module-level complete"));
|
||||
|
||||
cleanup:
|
||||
if (info) {
|
||||
ACPI_FREE(info->full_pathname);
|
||||
|
|
|
|||
|
|
@ -428,7 +428,7 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
|
|||
parser_state = &walk_state->parser_state;
|
||||
walk_state->arg_types = 0;
|
||||
|
||||
#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY))
|
||||
#ifndef ACPI_CONSTANT_EVAL_ONLY
|
||||
|
||||
if (walk_state->walk_type & ACPI_WALK_METHOD_RESTART) {
|
||||
|
||||
|
|
@ -508,7 +508,8 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
|
|||
*/
|
||||
if ((walk_state->
|
||||
parse_flags & ACPI_PARSE_MODULE_LEVEL)
|
||||
&& status == AE_ALREADY_EXISTS) {
|
||||
&& ((status == AE_ALREADY_EXISTS)
|
||||
|| (status == AE_NOT_FOUND))) {
|
||||
status = AE_OK;
|
||||
}
|
||||
if (status == AE_CTRL_PARSE_CONTINUE) {
|
||||
|
|
@ -537,10 +538,7 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
|
|||
* the scope op because the parse failure indicates that
|
||||
* the device may not exist.
|
||||
*/
|
||||
ACPI_ERROR((AE_INFO,
|
||||
"Skip parsing opcode %s",
|
||||
acpi_ps_get_opcode_name
|
||||
(walk_state->opcode)));
|
||||
ACPI_INFO(("Skipping parse of AML opcode: %s (0x%4.4X)", acpi_ps_get_opcode_name(walk_state->opcode), walk_state->opcode));
|
||||
|
||||
/*
|
||||
* Determine the opcode length before skipping the opcode.
|
||||
|
|
|
|||
|
|
@ -600,8 +600,7 @@ acpi_ps_complete_op(struct acpi_walk_state *walk_state,
|
|||
* because there could be correct AML beyond the parts that caused
|
||||
* the runtime error.
|
||||
*/
|
||||
ACPI_ERROR((AE_INFO,
|
||||
"Ignore error and continue table load"));
|
||||
ACPI_INFO(("Ignoring error and continuing table load"));
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
return_ACPI_STATUS(status);
|
||||
|
|
|
|||
|
|
@ -479,6 +479,21 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
|
|||
"Completed one call to walk loop, %s State=%p\n",
|
||||
acpi_format_exception(status), walk_state));
|
||||
|
||||
if (walk_state->method_pathname && walk_state->method_is_nested) {
|
||||
|
||||
/* Optional object evaluation log */
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW((ACPI_DB_EVALUATION,
|
||||
"%-26s: %*s%s\n",
|
||||
" Exit nested method",
|
||||
(walk_state->
|
||||
method_nesting_depth + 1) * 3,
|
||||
" ",
|
||||
&walk_state->method_pathname[1]));
|
||||
|
||||
ACPI_FREE(walk_state->method_pathname);
|
||||
walk_state->method_is_nested = FALSE;
|
||||
}
|
||||
if (status == AE_CTRL_TRANSFER) {
|
||||
/*
|
||||
* A method call was detected.
|
||||
|
|
|
|||
|
|
@ -147,6 +147,9 @@ acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info)
|
|||
goto cleanup;
|
||||
}
|
||||
|
||||
walk_state->method_pathname = info->full_pathname;
|
||||
walk_state->method_is_nested = FALSE;
|
||||
|
||||
if (info->obj_desc->method.info_flags & ACPI_METHOD_MODULE_LEVEL) {
|
||||
walk_state->parse_flags |= ACPI_PARSE_MODULE_LEVEL;
|
||||
}
|
||||
|
|
@ -267,6 +270,9 @@ acpi_status acpi_ps_execute_table(struct acpi_evaluate_info *info)
|
|||
goto cleanup;
|
||||
}
|
||||
|
||||
walk_state->method_pathname = info->full_pathname;
|
||||
walk_state->method_is_nested = FALSE;
|
||||
|
||||
if (info->obj_desc->method.info_flags & ACPI_METHOD_MODULE_LEVEL) {
|
||||
walk_state->parse_flags |= ACPI_PARSE_MODULE_LEVEL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,10 +83,7 @@ const struct acpi_predefined_names acpi_gbl_pre_defined_names[] = {
|
|||
{"_REV", ACPI_TYPE_INTEGER, ACPI_CAST_PTR(char, 2)},
|
||||
{"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME},
|
||||
{"_GL_", ACPI_TYPE_MUTEX, ACPI_CAST_PTR(char, 1)},
|
||||
|
||||
#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
|
||||
{"_OSI", ACPI_TYPE_METHOD, ACPI_CAST_PTR(char, 1)},
|
||||
#endif
|
||||
|
||||
/* Table terminator */
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,8 @@ u8 acpi_ut_is_aml_table(struct acpi_table_header *table)
|
|||
if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_DSDT) ||
|
||||
ACPI_COMPARE_NAME(table->signature, ACPI_SIG_PSDT) ||
|
||||
ACPI_COMPARE_NAME(table->signature, ACPI_SIG_SSDT) ||
|
||||
ACPI_COMPARE_NAME(table->signature, ACPI_SIG_OSDT)) {
|
||||
ACPI_COMPARE_NAME(table->signature, ACPI_SIG_OSDT) ||
|
||||
ACPI_IS_OEM_SIG(table->signature)) {
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,6 +70,8 @@ static struct acpi_interface_info acpi_default_supported_interfaces[] = {
|
|||
{"Windows 2016", NULL, 0, ACPI_OSI_WIN_10_RS1}, /* Windows 10 version 1607 - Added 12/2017 */
|
||||
{"Windows 2017", NULL, 0, ACPI_OSI_WIN_10_RS2}, /* Windows 10 version 1703 - Added 12/2017 */
|
||||
{"Windows 2017.2", NULL, 0, ACPI_OSI_WIN_10_RS3}, /* Windows 10 version 1709 - Added 02/2018 */
|
||||
{"Windows 2018", NULL, 0, ACPI_OSI_WIN_10_RS4}, /* Windows 10 version 1803 - Added 11/2018 */
|
||||
{"Windows 2018.2", NULL, 0, ACPI_OSI_WIN_10_RS5}, /* Windows 10 version 1809 - Added 11/2018 */
|
||||
|
||||
/* Feature Group Strings */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue