^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: exoparg3 - AML execution - opcodes with 3 arguments
^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 "acparser.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include "amlcode.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("exoparg3")
^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) * Naming convention for AML interpreter execution routines.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * The routines that begin execution of AML opcodes are named with a common
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) * convention based upon the number of arguments, the number of target operands,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) * and whether or not a value is returned:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) * AcpiExOpcode_xA_yT_zR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) * Where:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) * xA - ARGUMENTS: The number of arguments (input operands) that are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) * required for this opcode type (1 through 6 args).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) * yT - TARGETS: The number of targets (output operands) that are required
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) * for this opcode type (0, 1, or 2 targets).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) * zR - RETURN VALUE: Indicates whether this opcode type returns a value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) * as the function return (0 or 1).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) * The AcpiExOpcode* functions are called via the Dispatcher component with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) * fully resolved operands.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) !*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) * FUNCTION: acpi_ex_opcode_3A_0T_0R
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) * PARAMETERS: walk_state - Current walk state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) * RETURN: Status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) * DESCRIPTION: Execute Triadic operator (3 operands)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) union acpi_operand_object **operand = &walk_state->operands[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) struct acpi_signal_fatal_info *fatal;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) acpi_status status = AE_OK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) ACPI_FUNCTION_TRACE_STR(ex_opcode_3A_0T_0R,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) acpi_ps_get_opcode_name(walk_state->opcode));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) switch (walk_state->opcode) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) case AML_FATAL_OP: /* Fatal (fatal_type fatal_code fatal_arg) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) ACPI_DEBUG_PRINT((ACPI_DB_INFO,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) "FatalOp: Type %X Code %X Arg %X "
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) (u32)operand[0]->integer.value,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) (u32)operand[1]->integer.value,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) (u32)operand[2]->integer.value));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) fatal = ACPI_ALLOCATE(sizeof(struct acpi_signal_fatal_info));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) if (fatal) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) fatal->type = (u32) operand[0]->integer.value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) fatal->code = (u32) operand[1]->integer.value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) fatal->argument = (u32) operand[2]->integer.value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) /* Always signal the OS! */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) status = acpi_os_signal(ACPI_SIGNAL_FATAL, fatal);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) /* Might return while OS is shutting down, just continue */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) ACPI_FREE(fatal);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) goto cleanup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) case AML_EXTERNAL_OP:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) * If the interpreter sees this opcode, just ignore it. The External
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) * op is intended for use by disassemblers in order to properly
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) * disassemble control method invocations. The opcode or group of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) * opcodes should be surrounded by an "if (0)" clause to ensure that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) * AML interpreters never see the opcode. Thus, something is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) * wrong if an external opcode ever gets here.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) ACPI_ERROR((AE_INFO, "Executed External Op"));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) status = AE_OK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) goto cleanup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) walk_state->opcode));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) status = AE_AML_BAD_OPCODE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) goto cleanup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) cleanup:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) return_ACPI_STATUS(status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) * FUNCTION: acpi_ex_opcode_3A_1T_1R
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) * PARAMETERS: walk_state - Current walk state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) * RETURN: Status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) * DESCRIPTION: Execute Triadic operator (3 operands)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) union acpi_operand_object **operand = &walk_state->operands[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) union acpi_operand_object *return_desc = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) char *buffer = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) acpi_status status = AE_OK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) u64 index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) acpi_size length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) ACPI_FUNCTION_TRACE_STR(ex_opcode_3A_1T_1R,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) acpi_ps_get_opcode_name(walk_state->opcode));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) switch (walk_state->opcode) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) case AML_MID_OP: /* Mid (Source[0], Index[1], Length[2], Result[3]) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) * Create the return object. The Source operand is guaranteed to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) * either a String or a Buffer, so just use its type.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) return_desc = acpi_ut_create_internal_object((operand[0])->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) common.type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) if (!return_desc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) status = AE_NO_MEMORY;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) goto cleanup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) /* Get the Integer values from the objects */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) index = operand[1]->integer.value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) length = (acpi_size)operand[2]->integer.value;
^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) * If the index is beyond the length of the String/Buffer, or if the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) * requested length is zero, return a zero-length String/Buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) if (index >= operand[0]->string.length) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) length = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) /* Truncate request if larger than the actual String/Buffer */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) else if ((index + length) > operand[0]->string.length) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) length =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) (acpi_size)operand[0]->string.length -
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) (acpi_size)index;
^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) /* Strings always have a sub-pointer, not so for buffers */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) switch ((operand[0])->common.type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) case ACPI_TYPE_STRING:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) /* Always allocate a new buffer for the String */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) buffer = ACPI_ALLOCATE_ZEROED((acpi_size)length + 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) if (!buffer) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) status = AE_NO_MEMORY;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) goto cleanup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) case ACPI_TYPE_BUFFER:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) /* If the requested length is zero, don't allocate a buffer */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) if (length > 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) /* Allocate a new buffer for the Buffer */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) buffer = ACPI_ALLOCATE_ZEROED(length);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) if (!buffer) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) status = AE_NO_MEMORY;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) goto cleanup;
^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) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) default: /* Should not happen */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) status = AE_AML_OPERAND_TYPE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) goto cleanup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) if (buffer) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) /* We have a buffer, copy the portion requested */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) memcpy(buffer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) operand[0]->string.pointer + index, length);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) /* Set the length of the new String/Buffer */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) return_desc->string.pointer = buffer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) return_desc->string.length = (u32) length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) /* Mark buffer initialized */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) return_desc->buffer.flags |= AOPOBJ_DATA_VALID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) walk_state->opcode));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) status = AE_AML_BAD_OPCODE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) goto cleanup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) /* Store the result in the target */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) status = acpi_ex_store(return_desc, operand[3], walk_state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) cleanup:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) /* Delete return object on error */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) if (ACPI_FAILURE(status) || walk_state->result_obj) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) acpi_ut_remove_reference(return_desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) walk_state->result_obj = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) } else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) /* Set the return object and exit */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) walk_state->result_obj = return_desc;
^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) return_ACPI_STATUS(status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) }