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

Commit 4119532c authored by Bob Moore's avatar Bob Moore Committed by Len Brown
Browse files

ACPI: ACPICA 20060526

Restructured, flattened, and simplified the internal
interfaces for namespace object evaluation - resulting
in smaller code, less CPU stack use, and fewer
interfaces. (With assistance from Mikhail Kouzmich)

Fixed a problem with the CopyObject operator where the
first parameter was not typed correctly for the parser,
interpreter, compiler, and disassembler. Caused various
errors and unexpected behavior.

Fixed a problem where a ShiftLeft or ShiftRight of
more than 64 bits produced incorrect results with some
C compilers. Since the behavior of C compilers when
the shift value is larger than the datatype width is
apparently not well defined, the interpreter now detects
this condition and simply returns zero as expected in all
such cases. (BZ 395)

Fixed problem reports (Valery Podrezov) integrated: -
Update String-to-Integer conversion to match ACPI 3.0A spec
http://bugzilla.kernel.org/show_bug.cgi?id=5329
Allow interpreter to handle nested method declarations
http://bugzilla.kernel.org/show_bug.cgi?id=5361



Fixed problem reports (Fiodor Suietov) integrated: -
acpi_terminate() doesn't free debug memory allocation
list objects (BZ 355) - After Core Subsystem
shutdown, acpi_subsystem_status() returns AE_OK (BZ 356) -
acpi_os_unmap_memory() for RSDP can be invoked inconsistently
(BZ 357) - Resource Manager should return AE_TYPE for
non-device objects (BZ 358) - Incomplete cleanup branch
in AcpiNsEvaluateRelative (BZ 359) - Use acpi_os_free()
instead of ACPI_FREE in acpi_rs_set_srs_method_data (BZ 360)
- Incomplete cleanup branch in acpi_ps_parse_aml (BZ 361) -
Incomplete cleanup branch in acpi_ds_delete_walk_state (BZ 362)
- acpi_get_table_header returns AE_NO_ACPI_TABLES until DSDT
is loaded (BZ 365) - Status of the Global Initialization
Handler call not used (BZ 366) - Incorrect object parameter
to Global Initialization Handler (BZ 367)

Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent b8d35192
Loading
Loading
Loading
Loading
+16 −4
Original line number Diff line number Diff line
@@ -231,7 +231,7 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
	struct acpi_namespace_node *method_node;
	struct acpi_walk_state *next_walk_state = NULL;
	union acpi_operand_object *obj_desc;
	struct acpi_parameter_info info;
	struct acpi_evaluate_info *info;
	u32 i;

	ACPI_FUNCTION_TRACE_PTR(ds_call_control_method, this_walk_state);
@@ -319,12 +319,24 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
	 */
	this_walk_state->operands[this_walk_state->num_operands] = NULL;

	info.parameters = &this_walk_state->operands[0];
	info.parameter_type = ACPI_PARAM_ARGS;
	/*
	 * Allocate and initialize the evaluation information block
	 * TBD: this is somewhat inefficient, should change interface to
	 * ds_init_aml_walk. For now, keeps this struct off the CPU stack
	 */
	info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
	if (!info) {
		return_ACPI_STATUS(AE_NO_MEMORY);
	}

	info->parameters = &this_walk_state->operands[0];
	info->parameter_type = ACPI_PARAM_ARGS;

	status = acpi_ds_init_aml_walk(next_walk_state, NULL, method_node,
				       obj_desc->method.aml_start,
				       obj_desc->method.aml_length, &info, 3);
				       obj_desc->method.aml_length, info, 3);

	ACPI_FREE(info);
	if (ACPI_FAILURE(status)) {
		goto cleanup;
	}
+1 −1
Original line number Diff line number Diff line
@@ -295,7 +295,7 @@ acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state,

	case AML_CLASS_NAMED_OBJECT:

		if (walk_state->walk_type == ACPI_WALK_METHOD) {
		if (walk_state->walk_type & ACPI_WALK_METHOD) {
			/*
			 * Found a named object declaration during method execution;
			 * we must enter this object into the namespace.  The created
+4 −1
Original line number Diff line number Diff line
@@ -703,7 +703,7 @@ acpi_ds_init_aml_walk(struct acpi_walk_state *walk_state,
		      struct acpi_namespace_node *method_node,
		      u8 * aml_start,
		      u32 aml_length,
		      struct acpi_parameter_info *info, u8 pass_number)
		      struct acpi_evaluate_info *info, u8 pass_number)
{
	acpi_status status;
	struct acpi_parse_state *parser_state = &walk_state->parser_state;
@@ -825,9 +825,12 @@ void acpi_ds_delete_walk_state(struct acpi_walk_state *walk_state)
		return;
	}

	/* There should not be any open scopes */

	if (walk_state->parser_state.scope) {
		ACPI_ERROR((AE_INFO, "%p walk still has a scope list",
			    walk_state));
		acpi_ps_cleanup_scope(&walk_state->parser_state);
	}

	/* Always must free any linked control states */
+26 −13
Original line number Diff line number Diff line
@@ -489,8 +489,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
 * RETURN:      None
 *
 * DESCRIPTION: Perform the actual execution of a GPE control method. This
 *              function is called from an invocation of acpi_os_exece
 *              (and therefore does NOT execute at interrupt level) so that
 *              function is called from an invocation of acpi_os_execute and
 *              therefore does NOT execute at interrupt level - so that
 *              the control method itself is not executed in the context of
 *              an interrupt handler.
 *
@@ -502,7 +502,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
	u32 gpe_number = 0;
	acpi_status status;
	struct acpi_gpe_event_info local_gpe_event_info;
	struct acpi_parameter_info info;
	struct acpi_evaluate_info *info;

	ACPI_FUNCTION_TRACE(ev_asynch_execute_gpe_method);

@@ -540,16 +540,29 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
	 */
	if ((local_gpe_event_info.flags & ACPI_GPE_DISPATCH_MASK) ==
	    ACPI_GPE_DISPATCH_METHOD) {

		/* Allocate the evaluation information block */

		info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
		if (!info) {
			status = AE_NO_MEMORY;
		} else {
			/*
			 * Invoke the GPE Method (_Lxx, _Exx) i.e., evaluate the _Lxx/_Exx
			 * control method that corresponds to this GPE
			 */
		info.node = local_gpe_event_info.dispatch.method_node;
		info.parameters =
		    ACPI_CAST_PTR(union acpi_operand_object *, gpe_event_info);
		info.parameter_type = ACPI_PARAM_GPE;
			info->prefix_node =
			    local_gpe_event_info.dispatch.method_node;
			info->parameters =
			    ACPI_CAST_PTR(union acpi_operand_object *,
					  gpe_event_info);
			info->parameter_type = ACPI_PARAM_GPE;
			info->flags = ACPI_IGNORE_RETURN_VALUE;

			status = acpi_ns_evaluate(info);
			ACPI_FREE(info);
		}

		status = acpi_ns_evaluate_by_handle(&info);
		if (ACPI_FAILURE(status)) {
			ACPI_EXCEPTION((AE_INFO, status,
					"While evaluating method [%4.4s] for GPE[%2X]",
+11 −7
Original line number Diff line number Diff line
@@ -49,12 +49,13 @@
#define _COMPONENT          ACPI_EVENTS
ACPI_MODULE_NAME("evmisc")

/* Names for Notify() values, used for debug output */
#ifdef ACPI_DEBUG_OUTPUT
static const char *acpi_notify_value_names[] = {
	"Bus Check",
	"Device Check",
	"Device Wake",
	"Eject request",
	"Eject Request",
	"Device Check Light",
	"Frequency Mismatch",
	"Bus Mode Mismatch",
@@ -191,8 +192,9 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
		notify_info->notify.value = (u16) notify_value;
		notify_info->notify.handler_obj = handler_obj;

		status = acpi_os_execute(OSL_NOTIFY_HANDLER,
					 acpi_ev_notify_dispatch, notify_info);
		status =
		    acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_ev_notify_dispatch,
				    notify_info);
		if (ACPI_FAILURE(status)) {
			acpi_ut_delete_generic_state(notify_info);
		}
@@ -345,7 +347,8 @@ static u32 acpi_ev_global_lock_handler(void *context)

		/* Run the Global Lock thread which will signal all waiting threads */

		status = acpi_os_execute(OSL_GLOBAL_LOCK_HANDLER,
		status =
		    acpi_os_execute(OSL_GLOBAL_LOCK_HANDLER,
				    acpi_ev_global_lock_thread, context);
		if (ACPI_FAILURE(status)) {
			ACPI_EXCEPTION((AE_INFO, status,
@@ -462,7 +465,8 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout)
	 * Acquire the global lock semaphore first.
	 * Since this wait will block, we must release the interpreter
	 */
	status = acpi_ex_system_wait_semaphore(acpi_gbl_global_lock_semaphore,
	status =
	    acpi_ex_system_wait_semaphore(acpi_gbl_global_lock_semaphore,
					  timeout);
	return_ACPI_STATUS(status);
}
Loading