diff options
Diffstat (limited to 'drivers/acpi/acpica/excreate.c')
| -rw-r--r-- | drivers/acpi/acpica/excreate.c | 60 | 
1 files changed, 33 insertions, 27 deletions
diff --git a/drivers/acpi/acpica/excreate.c b/drivers/acpi/acpica/excreate.c index 3c61b48c73f..95d23dabcfb 100644 --- a/drivers/acpi/acpica/excreate.c +++ b/drivers/acpi/acpica/excreate.c @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2010, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without @@ -78,7 +78,7 @@ acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state)  	    (target_node->type == ACPI_TYPE_LOCAL_METHOD_ALIAS)) {  		/*  		 * Dereference an existing alias so that we don't create a chain -		 * of aliases.  With this code, we guarantee that an alias is +		 * of aliases. With this code, we guarantee that an alias is  		 * always exactly one level of indirection away from the  		 * actual aliased name.  		 */ @@ -90,7 +90,7 @@ acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state)  	/*  	 * For objects that can never change (i.e., the NS node will  	 * permanently point to the same object), we can simply attach -	 * the object to the new NS node.  For other objects (such as +	 * the object to the new NS node. For other objects (such as  	 * Integers, buffers, etc.), we have to point the Alias node  	 * to the original Node.  	 */ @@ -103,7 +103,6 @@ acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state)  	case ACPI_TYPE_BUFFER:  	case ACPI_TYPE_PACKAGE:  	case ACPI_TYPE_BUFFER_FIELD: -  		/*  		 * These types open a new scope, so we need the NS node in order to access  		 * any children. @@ -113,7 +112,6 @@ acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state)  	case ACPI_TYPE_PROCESSOR:  	case ACPI_TYPE_THERMAL:  	case ACPI_TYPE_LOCAL_SCOPE: -  		/*  		 * The new alias has the type ALIAS and points to the original  		 * NS node, not the object itself. @@ -124,7 +122,6 @@ acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state)  		break;  	case ACPI_TYPE_METHOD: -  		/*  		 * Control method aliases need to be differentiated  		 */ @@ -139,7 +136,7 @@ acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state)  		/*  		 * The new alias assumes the type of the target, and it points -		 * to the same object.  The reference count of the object has an +		 * to the same object. The reference count of the object has an  		 * additional reference to prevent deletion out from under either the  		 * target node or the alias Node  		 */ @@ -196,7 +193,7 @@ acpi_status acpi_ex_create_event(struct acpi_walk_state *walk_state)  	    acpi_ns_attach_object((struct acpi_namespace_node *)walk_state->  				  operands[0], obj_desc, ACPI_TYPE_EVENT); -      cleanup: +cleanup:  	/*  	 * Remove local reference to the object (on error, will cause deletion  	 * of both object and semaphore if present.) @@ -243,8 +240,7 @@ acpi_status acpi_ex_create_mutex(struct acpi_walk_state *walk_state)  	/* Init object and attach to NS node */ -	obj_desc->mutex.sync_level = -	    (u8) walk_state->operands[1]->integer.value; +	obj_desc->mutex.sync_level = (u8)walk_state->operands[1]->integer.value;  	obj_desc->mutex.node =  	    (struct acpi_namespace_node *)walk_state->operands[0]; @@ -252,7 +248,7 @@ acpi_status acpi_ex_create_mutex(struct acpi_walk_state *walk_state)  	    acpi_ns_attach_object(obj_desc->mutex.node, obj_desc,  				  ACPI_TYPE_MUTEX); -      cleanup: +cleanup:  	/*  	 * Remove local reference to the object (on error, will cause deletion  	 * of both object and semaphore if present.) @@ -267,7 +263,7 @@ acpi_status acpi_ex_create_mutex(struct acpi_walk_state *walk_state)   *   * PARAMETERS:  aml_start           - Pointer to the region declaration AML   *              aml_length          - Max length of the declaration AML - *              region_space        - space_iD for the region + *              space_id            - Address space ID for the region   *              walk_state          - Current state   *   * RETURN:      Status @@ -279,7 +275,7 @@ acpi_status acpi_ex_create_mutex(struct acpi_walk_state *walk_state)  acpi_status  acpi_ex_create_region(u8 * aml_start,  		      u32 aml_length, -		      u8 region_space, struct acpi_walk_state *walk_state) +		      u8 space_id, struct acpi_walk_state *walk_state)  {  	acpi_status status;  	union acpi_operand_object *obj_desc; @@ -304,15 +300,19 @@ acpi_ex_create_region(u8 * aml_start,  	 * Space ID must be one of the predefined IDs, or in the user-defined  	 * range  	 */ -	if ((region_space >= ACPI_NUM_PREDEFINED_REGIONS) && -	    (region_space < ACPI_USER_REGION_BEGIN)) { -		ACPI_ERROR((AE_INFO, "Invalid AddressSpace type 0x%X", -			    region_space)); -		return_ACPI_STATUS(AE_AML_INVALID_SPACE_ID); +	if (!acpi_is_valid_space_id(space_id)) { +		/* +		 * Print an error message, but continue. We don't want to abort +		 * a table load for this exception. Instead, if the region is +		 * actually used at runtime, abort the executing method. +		 */ +		ACPI_ERROR((AE_INFO, +			    "Invalid/unknown Address Space ID: 0x%2.2X", +			    space_id));  	}  	ACPI_DEBUG_PRINT((ACPI_DB_LOAD, "Region Type - %s (0x%X)\n", -			  acpi_ut_get_region_name(region_space), region_space)); +			  acpi_ut_get_region_name(space_id), space_id));  	/* Create the region descriptor */ @@ -329,10 +329,16 @@ acpi_ex_create_region(u8 * aml_start,  	region_obj2 = obj_desc->common.next_object;  	region_obj2->extra.aml_start = aml_start;  	region_obj2->extra.aml_length = aml_length; +	if (walk_state->scope_info) { +		region_obj2->extra.scope_node = +		    walk_state->scope_info->scope.node; +	} else { +		region_obj2->extra.scope_node = node; +	}  	/* Init the region from the operands */ -	obj_desc->region.space_id = region_space; +	obj_desc->region.space_id = space_id;  	obj_desc->region.address = 0;  	obj_desc->region.length = 0;  	obj_desc->region.node = node; @@ -341,7 +347,7 @@ acpi_ex_create_region(u8 * aml_start,  	status = acpi_ns_attach_object(node, obj_desc, ACPI_TYPE_REGION); -      cleanup: +cleanup:  	/* Remove local reference to the object */ @@ -359,7 +365,7 @@ acpi_ex_create_region(u8 * aml_start,   *   * DESCRIPTION: Create a new processor object and populate the fields   * - *              Processor (Name[0], cpu_iD[1], pblock_addr[2], pblock_length[3]) + *              Processor (Name[0], cpu_ID[1], pblock_addr[2], pblock_length[3])   *   ******************************************************************************/ @@ -482,13 +488,11 @@ acpi_ex_create_method(u8 * aml_start,  	obj_desc->method.aml_length = aml_length;  	/* -	 * Disassemble the method flags. Split off the Arg Count -	 * for efficiency +	 * Disassemble the method flags. Split off the arg_count, Serialized +	 * flag, and sync_level for efficiency.  	 */  	method_flags = (u8) operand[1]->integer.value; -	obj_desc->method.method_flags = -	    (u8) (method_flags & ~AML_METHOD_ARG_COUNT);  	obj_desc->method.param_count =  	    (u8) (method_flags & AML_METHOD_ARG_COUNT); @@ -497,6 +501,8 @@ acpi_ex_create_method(u8 * aml_start,  	 * created for this method when it is parsed.  	 */  	if (method_flags & AML_METHOD_SERIALIZED) { +		obj_desc->method.info_flags = ACPI_METHOD_SERIALIZED; +  		/*  		 * ACPI 1.0: sync_level = 0  		 * ACPI 2.0: sync_level = sync_level in method declaration @@ -514,7 +520,7 @@ acpi_ex_create_method(u8 * aml_start,  	acpi_ut_remove_reference(obj_desc); -      exit: +exit:  	/* Remove a reference to the operand */  	acpi_ut_remove_reference(operand[1]);  | 
