Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * Module Name: excreate - Named object creation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * Copyright (C) 2000 - 2020, Intel Corp.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  *****************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <acpi/acpi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include "accommon.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include "acinterp.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include "amlcode.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include "acnamesp.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #define _COMPONENT          ACPI_EXECUTER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) ACPI_MODULE_NAME("excreate")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20)  * FUNCTION:    acpi_ex_create_alias
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)  * PARAMETERS:  walk_state           - Current state, contains operands
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)  * RETURN:      Status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)  * DESCRIPTION: Create a new named alias
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 	struct acpi_namespace_node *target_node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	struct acpi_namespace_node *alias_node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	acpi_status status = AE_OK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 	ACPI_FUNCTION_TRACE(ex_create_alias);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	/* Get the source/alias operands (both namespace nodes) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	alias_node = (struct acpi_namespace_node *)walk_state->operands[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	target_node = (struct acpi_namespace_node *)walk_state->operands[1];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	if ((target_node->type == ACPI_TYPE_LOCAL_ALIAS) ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 	    (target_node->type == ACPI_TYPE_LOCAL_METHOD_ALIAS)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 		/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 		 * Dereference an existing alias so that we don't create a chain
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 		 * of aliases. With this code, we guarantee that an alias is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 		 * always exactly one level of indirection away from the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 		 * actual aliased name.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 		 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 		target_node =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 		    ACPI_CAST_PTR(struct acpi_namespace_node,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 				  target_node->object);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	/* Ensure that the target node is valid */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	if (!target_node) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 		return_ACPI_STATUS(AE_NULL_OBJECT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	/* Construct the alias object (a namespace node) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	switch (target_node->type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 	case ACPI_TYPE_METHOD:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 		/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 		 * Control method aliases need to be differentiated with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 		 * a special type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 		 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 		alias_node->type = ACPI_TYPE_LOCAL_METHOD_ALIAS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 		/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 		 * All other object types.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 		 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 		 * The new alias has the type ALIAS and points to the original
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 		 * NS node, not the object itself.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 		 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 		alias_node->type = ACPI_TYPE_LOCAL_ALIAS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 		alias_node->object =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 		    ACPI_CAST_PTR(union acpi_operand_object, target_node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	/* Since both operands are Nodes, we don't need to delete them */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	alias_node->object =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	    ACPI_CAST_PTR(union acpi_operand_object, target_node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	return_ACPI_STATUS(status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94)  * FUNCTION:    acpi_ex_create_event
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96)  * PARAMETERS:  walk_state          - Current state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98)  * RETURN:      Status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)  * DESCRIPTION: Create a new event object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) acpi_status acpi_ex_create_event(struct acpi_walk_state *walk_state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	acpi_status status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	union acpi_operand_object *obj_desc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	ACPI_FUNCTION_TRACE(ex_create_event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_EVENT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	if (!obj_desc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 		status = AE_NO_MEMORY;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 		goto cleanup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	 * Create the actual OS semaphore, with zero initial units -- meaning
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	 * that the event is created in an unsignalled state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	status = acpi_os_create_semaphore(ACPI_NO_UNIT_LIMIT, 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 					  &obj_desc->event.os_semaphore);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	if (ACPI_FAILURE(status)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 		goto cleanup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	/* Attach object to the Node */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	status = acpi_ns_attach_object((struct acpi_namespace_node *)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 				       walk_state->operands[0], obj_desc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 				       ACPI_TYPE_EVENT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) cleanup:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	 * Remove local reference to the object (on error, will cause deletion
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	 * of both object and semaphore if present.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	acpi_ut_remove_reference(obj_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	return_ACPI_STATUS(status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)  * FUNCTION:    acpi_ex_create_mutex
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)  * PARAMETERS:  walk_state          - Current state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)  * RETURN:      Status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)  * DESCRIPTION: Create a new mutex object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152)  *              Mutex (Name[0], sync_level[1])
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) acpi_status acpi_ex_create_mutex(struct acpi_walk_state *walk_state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	acpi_status status = AE_OK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	union acpi_operand_object *obj_desc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	ACPI_FUNCTION_TRACE_PTR(ex_create_mutex, ACPI_WALK_OPERANDS);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	/* Create the new mutex object */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_MUTEX);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	if (!obj_desc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 		status = AE_NO_MEMORY;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 		goto cleanup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	/* Create the actual OS Mutex */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	status = acpi_os_create_mutex(&obj_desc->mutex.os_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	if (ACPI_FAILURE(status)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 		goto cleanup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	/* Init object and attach to NS node */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	obj_desc->mutex.sync_level = (u8)walk_state->operands[1]->integer.value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	obj_desc->mutex.node =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	    (struct acpi_namespace_node *)walk_state->operands[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	status =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	    acpi_ns_attach_object(obj_desc->mutex.node, obj_desc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 				  ACPI_TYPE_MUTEX);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) cleanup:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	 * Remove local reference to the object (on error, will cause deletion
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	 * of both object and semaphore if present.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	acpi_ut_remove_reference(obj_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	return_ACPI_STATUS(status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199)  * FUNCTION:    acpi_ex_create_region
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)  * PARAMETERS:  aml_start           - Pointer to the region declaration AML
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202)  *              aml_length          - Max length of the declaration AML
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)  *              space_id            - Address space ID for the region
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204)  *              walk_state          - Current state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206)  * RETURN:      Status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208)  * DESCRIPTION: Create a new operation region object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) acpi_ex_create_region(u8 * aml_start,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 		      u32 aml_length,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 		      u8 space_id, struct acpi_walk_state *walk_state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	acpi_status status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	union acpi_operand_object *obj_desc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	struct acpi_namespace_node *node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	union acpi_operand_object *region_obj2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 	ACPI_FUNCTION_TRACE(ex_create_region);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	/* Get the Namespace Node */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	node = walk_state->op->common.node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	 * If the region object is already attached to this node,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 	 * just return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 	if (acpi_ns_get_attached_object(node)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 		return_ACPI_STATUS(AE_OK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 	 * Space ID must be one of the predefined IDs, or in the user-defined
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 	 * range
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 	if (!acpi_is_valid_space_id(space_id)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 		/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 		 * Print an error message, but continue. We don't want to abort
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 		 * a table load for this exception. Instead, if the region is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 		 * actually used at runtime, abort the executing method.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 		 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 		ACPI_ERROR((AE_INFO,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 			    "Invalid/unknown Address Space ID: 0x%2.2X",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 			    space_id));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 	ACPI_DEBUG_PRINT((ACPI_DB_LOAD, "Region Type - %s (0x%X)\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 			  acpi_ut_get_region_name(space_id), space_id));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 	/* Create the region descriptor */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 	obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_REGION);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 	if (!obj_desc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 		status = AE_NO_MEMORY;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 		goto cleanup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 	 * Remember location in AML stream of address & length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 	 * operands since they need to be evaluated at run time.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 	region_obj2 = acpi_ns_get_secondary_object(obj_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 	region_obj2->extra.aml_start = aml_start;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 	region_obj2->extra.aml_length = aml_length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 	region_obj2->extra.method_REG = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 	if (walk_state->scope_info) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 		region_obj2->extra.scope_node =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 		    walk_state->scope_info->scope.node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 	} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 		region_obj2->extra.scope_node = node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 	/* Init the region from the operands */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 	obj_desc->region.space_id = space_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 	obj_desc->region.address = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) 	obj_desc->region.length = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 	obj_desc->region.node = node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) 	obj_desc->region.handler = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 	obj_desc->common.flags &=
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 	    ~(AOPOBJ_SETUP_COMPLETE | AOPOBJ_REG_CONNECTED |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 	      AOPOBJ_OBJECT_INITIALIZED);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 	/* Install the new region object in the parent Node */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) 	status = acpi_ns_attach_object(node, obj_desc, ACPI_TYPE_REGION);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) cleanup:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) 	/* Remove local reference to the object */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) 	acpi_ut_remove_reference(obj_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) 	return_ACPI_STATUS(status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302)  * FUNCTION:    acpi_ex_create_processor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304)  * PARAMETERS:  walk_state          - Current state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306)  * RETURN:      Status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308)  * DESCRIPTION: Create a new processor object and populate the fields
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310)  *              Processor (Name[0], cpu_ID[1], pblock_addr[2], pblock_length[3])
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) acpi_status acpi_ex_create_processor(struct acpi_walk_state *walk_state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 	union acpi_operand_object **operand = &walk_state->operands[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) 	union acpi_operand_object *obj_desc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) 	acpi_status status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) 	ACPI_FUNCTION_TRACE_PTR(ex_create_processor, walk_state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) 	/* Create the processor object */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) 	obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_PROCESSOR);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) 	if (!obj_desc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) 		return_ACPI_STATUS(AE_NO_MEMORY);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) 	/* Initialize the processor object from the operands */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) 	obj_desc->processor.proc_id = (u8) operand[1]->integer.value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 	obj_desc->processor.length = (u8) operand[3]->integer.value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) 	obj_desc->processor.address =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) 	    (acpi_io_address)operand[2]->integer.value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) 	/* Install the processor object in the parent Node */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) 	status = acpi_ns_attach_object((struct acpi_namespace_node *)operand[0],
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) 				       obj_desc, ACPI_TYPE_PROCESSOR);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) 	/* Remove local reference to the object */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 	acpi_ut_remove_reference(obj_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) 	return_ACPI_STATUS(status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349)  * FUNCTION:    acpi_ex_create_power_resource
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351)  * PARAMETERS:  walk_state          - Current state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353)  * RETURN:      Status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355)  * DESCRIPTION: Create a new power_resource object and populate the fields
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357)  *              power_resource (Name[0], system_level[1], resource_order[2])
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) acpi_status acpi_ex_create_power_resource(struct acpi_walk_state *walk_state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) 	union acpi_operand_object **operand = &walk_state->operands[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) 	acpi_status status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) 	union acpi_operand_object *obj_desc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) 	ACPI_FUNCTION_TRACE_PTR(ex_create_power_resource, walk_state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) 	/* Create the power resource object */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) 	obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_POWER);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) 	if (!obj_desc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) 		return_ACPI_STATUS(AE_NO_MEMORY);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) 	/* Initialize the power object from the operands */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) 	obj_desc->power_resource.system_level = (u8) operand[1]->integer.value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) 	obj_desc->power_resource.resource_order =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) 	    (u16) operand[2]->integer.value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) 	/* Install the  power resource object in the parent Node */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) 	status = acpi_ns_attach_object((struct acpi_namespace_node *)operand[0],
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) 				       obj_desc, ACPI_TYPE_POWER);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) 	/* Remove local reference to the object */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) 	acpi_ut_remove_reference(obj_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) 	return_ACPI_STATUS(status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395)  * FUNCTION:    acpi_ex_create_method
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397)  * PARAMETERS:  aml_start       - First byte of the method's AML
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398)  *              aml_length      - AML byte count for this method
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399)  *              walk_state      - Current state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401)  * RETURN:      Status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403)  * DESCRIPTION: Create a new method object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) acpi_ex_create_method(u8 * aml_start,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) 		      u32 aml_length, struct acpi_walk_state *walk_state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) 	union acpi_operand_object **operand = &walk_state->operands[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) 	union acpi_operand_object *obj_desc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) 	acpi_status status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) 	u8 method_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) 	ACPI_FUNCTION_TRACE_PTR(ex_create_method, walk_state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) 	/* Create a new method object */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) 	obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_METHOD);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) 	if (!obj_desc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) 		status = AE_NO_MEMORY;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) 		goto exit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) 	/* Save the method's AML pointer and length  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) 	obj_desc->method.aml_start = aml_start;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) 	obj_desc->method.aml_length = aml_length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) 	obj_desc->method.node = operand[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) 	 * Disassemble the method flags. Split off the arg_count, Serialized
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) 	 * flag, and sync_level for efficiency.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) 	method_flags = (u8)operand[1]->integer.value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) 	obj_desc->method.param_count = (u8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) 	    (method_flags & AML_METHOD_ARG_COUNT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) 	 * Get the sync_level. If method is serialized, a mutex will be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) 	 * created for this method when it is parsed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) 	if (method_flags & AML_METHOD_SERIALIZED) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) 		obj_desc->method.info_flags = ACPI_METHOD_SERIALIZED;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) 		/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) 		 * ACPI 1.0: sync_level = 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) 		 * ACPI 2.0: sync_level = sync_level in method declaration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) 		 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) 		obj_desc->method.sync_level = (u8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) 		    ((method_flags & AML_METHOD_SYNC_LEVEL) >> 4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) 	/* Attach the new object to the method Node */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) 	status = acpi_ns_attach_object((struct acpi_namespace_node *)operand[0],
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) 				       obj_desc, ACPI_TYPE_METHOD);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) 	/* Remove local reference to the object */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) 	acpi_ut_remove_reference(obj_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) exit:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) 	/* Remove a reference to the operand */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) 	acpi_ut_remove_reference(operand[1]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) 	return_ACPI_STATUS(status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) }