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

Commit 5d2a2207 authored by Len Brown's avatar Len Brown
Browse files

/home/lenb/src/to-akpm branch 'acpi-2.6.12'

parents 1c5ad845 bd6dbdf3
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -33,3 +33,6 @@ The result of the execution of this aml method is
attached to /proc/acpi/hotkey/poll_method, which is dnyamically
created.  Please use command "cat /proc/acpi/hotkey/polling_method" 
to retrieve it.

Note: Use cmdline "acpi_specific_hotkey" to enable legacy platform
specific drivers.
+8 −18
Original line number Diff line number Diff line
@@ -86,20 +86,20 @@ acpi_ds_init_one_object (
	void                            *context,
	void                            **return_value)
{
	struct acpi_init_walk_info      *info = (struct acpi_init_walk_info *) context;
	struct acpi_namespace_node      *node = (struct acpi_namespace_node *) obj_handle;
	acpi_object_type                type;
	acpi_status                     status;
	struct acpi_init_walk_info      *info = (struct acpi_init_walk_info *) context;


	ACPI_FUNCTION_NAME ("ds_init_one_object");


	/*
	 * We are only interested in objects owned by the table that
	 * We are only interested in NS nodes owned by the table that
	 * was just loaded
	 */
	if (((struct acpi_namespace_node *) obj_handle)->owner_id !=
			info->table_desc->table_id) {
	if (node->owner_id != info->table_desc->owner_id) {
		return (AE_OK);
	}

@@ -126,8 +126,6 @@ acpi_ds_init_one_object (

	case ACPI_TYPE_METHOD:

		info->method_count++;

		/*
		 * Print a dot for each method unless we are going to print
		 * the entire pathname
@@ -143,7 +141,7 @@ acpi_ds_init_one_object (
		 * on a per-table basis. Currently, we just use a global for the width.
		 */
		if (info->table_desc->pointer->revision == 1) {
			((struct acpi_namespace_node *) obj_handle)->flags |= ANOBJ_DATA_WIDTH_32;
			node->flags |= ANOBJ_DATA_WIDTH_32;
		}

		/*
@@ -153,22 +151,14 @@ acpi_ds_init_one_object (
		status = acpi_ds_parse_method (obj_handle);
		if (ACPI_FAILURE (status)) {
			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
				"Method %p [%4.4s] - parse failure, %s\n",
				"\n+Method %p [%4.4s] - parse failure, %s\n",
				obj_handle, acpi_ut_get_node_name (obj_handle),
				acpi_format_exception (status)));

			/* This parse failed, but we will continue parsing more methods */

			break;
		}

		/*
		 * Delete the parse tree.  We simply re-parse the method
		 * for every execution since there isn't much overhead
		 */
		acpi_ns_delete_namespace_subtree (obj_handle);
		acpi_ns_delete_namespace_by_owner (
			((struct acpi_namespace_node *) obj_handle)->object->method.owning_id);
		info->method_count++;
		break;


@@ -237,7 +227,7 @@ acpi_ds_initialize_objects (

	ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
		"\nTable [%4.4s](id %4.4X) - %hd Objects with %hd Devices %hd Methods %hd Regions\n",
		table_desc->pointer->signature, table_desc->table_id, info.object_count,
		table_desc->pointer->signature, table_desc->owner_id, info.object_count,
		info.device_count, info.method_count, info.op_region_count));

	ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+42 −25
Original line number Diff line number Diff line
@@ -58,12 +58,11 @@
 *
 * FUNCTION:    acpi_ds_parse_method
 *
 * PARAMETERS:  obj_handle      - Method node
 * PARAMETERS:  Node        - Method node
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Call the parser and parse the AML that is associated with the
 *              method.
 * DESCRIPTION: Parse the AML that is associated with the method.
 *
 * MUTEX:       Assumes parser is locked
 *
@@ -71,31 +70,28 @@

acpi_status
acpi_ds_parse_method (
	acpi_handle                     obj_handle)
	struct acpi_namespace_node      *node)
{
	acpi_status                     status;
	union acpi_operand_object       *obj_desc;
	union acpi_parse_object         *op;
	struct acpi_namespace_node      *node;
	acpi_owner_id                   owner_id;
	struct acpi_walk_state          *walk_state;


	ACPI_FUNCTION_TRACE_PTR ("ds_parse_method", obj_handle);
	ACPI_FUNCTION_TRACE_PTR ("ds_parse_method", node);


	/* Parameter Validation */

	if (!obj_handle) {
	if (!node) {
		return_ACPI_STATUS (AE_NULL_ENTRY);
	}

	ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Parsing [%4.4s] **** named_obj=%p\n",
		acpi_ut_get_node_name (obj_handle), obj_handle));
		acpi_ut_get_node_name (node), node));

	/* Extract the method object from the method Node */

	node = (struct acpi_namespace_node *) obj_handle;
	obj_desc = acpi_ns_get_attached_object (node);
	if (!obj_desc) {
		return_ACPI_STATUS (AE_NULL_OBJECT);
@@ -132,14 +128,18 @@ acpi_ds_parse_method (
	 * objects (such as Operation Regions) can be created during the
	 * first pass parse.
	 */
	owner_id = acpi_ut_allocate_owner_id (ACPI_OWNER_TYPE_METHOD);
	obj_desc->method.owning_id = owner_id;
	status = acpi_ut_allocate_owner_id (&obj_desc->method.owner_id);
	if (ACPI_FAILURE (status)) {
		goto cleanup;
	}

	/* Create and initialize a new walk state */

	walk_state = acpi_ds_create_walk_state (owner_id, NULL, NULL, NULL);
	walk_state = acpi_ds_create_walk_state (
			  obj_desc->method.owner_id, NULL, NULL, NULL);
	if (!walk_state) {
		return_ACPI_STATUS (AE_NO_MEMORY);
		status = AE_NO_MEMORY;
		goto cleanup2;
	}

	status = acpi_ds_init_aml_walk (walk_state, op, node,
@@ -147,7 +147,7 @@ acpi_ds_parse_method (
			  obj_desc->method.aml_length, NULL, 1);
	if (ACPI_FAILURE (status)) {
		acpi_ds_delete_walk_state (walk_state);
		return_ACPI_STATUS (status);
		goto cleanup2;
	}

	/*
@@ -161,13 +161,25 @@ acpi_ds_parse_method (
	 */
	status = acpi_ps_parse_aml (walk_state);
	if (ACPI_FAILURE (status)) {
		return_ACPI_STATUS (status);
		goto cleanup2;
	}

	ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
		"**** [%4.4s] Parsed **** named_obj=%p Op=%p\n",
		acpi_ut_get_node_name (obj_handle), obj_handle, op));
		acpi_ut_get_node_name (node), node, op));

	/*
	 * Delete the parse tree. We simply re-parse the method for every
	 * execution since there isn't much overhead (compared to keeping lots
	 * of parse trees around)
	 */
	acpi_ns_delete_namespace_subtree (node);
	acpi_ns_delete_namespace_by_owner (obj_desc->method.owner_id);

cleanup2:
	acpi_ut_release_owner_id (&obj_desc->method.owner_id);

cleanup:
	acpi_ps_delete_parse_tree (op);
	return_ACPI_STATUS (status);
}
@@ -263,7 +275,7 @@ acpi_ds_call_control_method (
{
	acpi_status                     status;
	struct acpi_namespace_node      *method_node;
	struct acpi_walk_state          *next_walk_state;
	struct acpi_walk_state          *next_walk_state = NULL;
	union acpi_operand_object       *obj_desc;
	struct acpi_parameter_info      info;
	u32                             i;
@@ -287,20 +299,23 @@ acpi_ds_call_control_method (
		return_ACPI_STATUS (AE_NULL_OBJECT);
	}

	obj_desc->method.owning_id = acpi_ut_allocate_owner_id (ACPI_OWNER_TYPE_METHOD);
	status = acpi_ut_allocate_owner_id (&obj_desc->method.owner_id);
	if (ACPI_FAILURE (status)) {
		return_ACPI_STATUS (status);
	}

	/* Init for new method, wait on concurrency semaphore */

	status = acpi_ds_begin_method_execution (method_node, obj_desc,
			  this_walk_state->method_node);
	if (ACPI_FAILURE (status)) {
		return_ACPI_STATUS (status);
		goto cleanup;
	}

	if (!(obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY)) {
		/* 1) Parse: Create a new walk state for the preempting walk */

		next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id,
		next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owner_id,
				  op, obj_desc, NULL);
		if (!next_walk_state) {
			return_ACPI_STATUS (AE_NO_MEMORY);
@@ -330,7 +345,7 @@ acpi_ds_call_control_method (

	/* 2) Execute: Create a new state for the preempting walk */

	next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id,
	next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owner_id,
			  NULL, obj_desc, thread);
	if (!next_walk_state) {
		status = AE_NO_MEMORY;
@@ -381,6 +396,7 @@ acpi_ds_call_control_method (
	/* On error, we must delete the new walk state */

cleanup:
	acpi_ut_release_owner_id (&obj_desc->method.owner_id);
	if (next_walk_state && (next_walk_state->method_desc)) {
		/* Decrement the thread count on the method parse tree */

@@ -552,8 +568,7 @@ acpi_ds_terminate_control_method (
		 */
		if ((walk_state->method_desc->method.concurrency == 1) &&
			(!walk_state->method_desc->method.semaphore)) {
			status = acpi_os_create_semaphore (1,
					 1,
			status = acpi_os_create_semaphore (1, 1,
					 &walk_state->method_desc->method.semaphore);
		}

@@ -582,8 +597,10 @@ acpi_ds_terminate_control_method (
		 * Delete any namespace entries created anywhere else within
		 * the namespace
		 */
		acpi_ns_delete_namespace_by_owner (walk_state->method_desc->method.owning_id);
		acpi_ns_delete_namespace_by_owner (walk_state->method_desc->method.owner_id);
		status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
		acpi_ut_release_owner_id (&walk_state->method_desc->method.owner_id);

		if (ACPI_FAILURE (status)) {
			return_ACPI_STATUS (status);
		}
+2 −13
Original line number Diff line number Diff line
@@ -632,23 +632,12 @@ acpi_ds_store_object_to_local (
		 * Weird, but true.
		 */
		if (opcode == AML_ARG_OP) {
			/*
			 * Make sure that the object is the correct type.  This may be
			 * overkill, butit is here because references were NS nodes in
			 *  the past.  Now they are operand objects of type Reference.
			 */
			if (ACPI_GET_DESCRIPTOR_TYPE (current_obj_desc) != ACPI_DESC_TYPE_OPERAND) {
				ACPI_REPORT_ERROR ((
					"Invalid descriptor type while storing to method arg: [%s]\n",
					acpi_ut_get_descriptor_name (current_obj_desc)));
				return_ACPI_STATUS (AE_AML_INTERNAL);
			}

			/*
			 * If we have a valid reference object that came from ref_of(),
			 * do the indirect store
			 */
			if ((current_obj_desc->common.type == ACPI_TYPE_LOCAL_REFERENCE) &&
			if ((ACPI_GET_DESCRIPTOR_TYPE (current_obj_desc) == ACPI_DESC_TYPE_OPERAND) &&
				(current_obj_desc->common.type == ACPI_TYPE_LOCAL_REFERENCE) &&
				(current_obj_desc->reference.opcode == AML_REF_OF_OP)) {
				ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
						"Arg (%p) is an obj_ref(Node), storing in node %p\n",
+3 −0
Original line number Diff line number Diff line
@@ -547,6 +547,9 @@ acpi_ds_init_object_from_op (
		case AML_TYPE_LITERAL:

			obj_desc->integer.value = op->common.value.integer;
#ifndef ACPI_NO_METHOD_EXECUTION
			acpi_ex_truncate_for32bit_table (obj_desc);
#endif
			break;


Loading