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

Commit 1027fb0f authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

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
parents 28586a51 3b15e830
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -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);
+1 −0
Original line number Diff line number Diff line
@@ -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 */

+4 −1
Original line number Diff line number Diff line
@@ -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] */
+74 −44
Original line number Diff line number Diff line
@@ -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
+14 −0
Original line number Diff line number Diff line
@@ -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) {
Loading