예제 #1
0
파일: nseval.c 프로젝트: TitaniumBoy/lin
acpi_status
acpi_ns_execute_control_method (
	acpi_namespace_node     *method_node,
	acpi_operand_object     **params,
	acpi_operand_object     **return_obj_desc)
{
	acpi_status             status;
	acpi_operand_object     *obj_desc;


	FUNCTION_TRACE ("Ns_execute_control_method");


	/* Verify that there is a method associated with this object */

	obj_desc = acpi_ns_get_attached_object (method_node);
	if (!obj_desc) {
		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No attached method object\n"));

		acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
		return_ACPI_STATUS (AE_NULL_OBJECT);
	}


	ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Control method at Offset %p Length %x]\n",
		obj_desc->method.aml_start + 1, obj_desc->method.aml_length - 1));

	DUMP_PATHNAME (method_node, "Ns_execute_control_method: Executing",
		ACPI_LV_NAMES, _COMPONENT);

	ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "At offset %p\n",
			obj_desc->method.aml_start + 1));


	/*
	 * Unlock the namespace before execution.  This allows namespace access
	 * via the external Acpi* interfaces while a method is being executed.
	 * However, any namespace deletion must acquire both the namespace and
	 * interpreter locks to ensure that no thread is using the portion of the
	 * namespace that is being deleted.
	 */
	acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);

	/*
	 * Execute the method via the interpreter.  The interpreter is locked
	 * here before calling into the AML parser
	 */
	status = acpi_ex_enter_interpreter ();
	if (ACPI_FAILURE (status)) {
		return_ACPI_STATUS (status);
	}

	status = acpi_psx_execute (method_node, params, return_obj_desc);
	acpi_ex_exit_interpreter ();

	return_ACPI_STATUS (status);
}
예제 #2
0
파일: amxface.c 프로젝트: ahenroid/linux-pm
ACPI_STATUS
acpi_aml_execute_method (
	ACPI_NAMESPACE_NODE     *method_node,
	ACPI_OPERAND_OBJECT     **params,
	ACPI_OPERAND_OBJECT     **return_obj_desc)
{
	ACPI_STATUS             status;


	/*
	 * The point here is to lock the interpreter and call the low
	 * level execute.
	 */

	acpi_aml_enter_interpreter ();

	status = acpi_psx_execute (method_node, params, return_obj_desc);

	acpi_aml_exit_interpreter ();

	return (status);
}