exoparg1.c revision 1.1.1.2.4.2 1 1.1.1.2.4.2 rmind
2 1.1.1.2.4.2 rmind /******************************************************************************
3 1.1.1.2.4.2 rmind *
4 1.1.1.2.4.2 rmind * Module Name: exoparg1 - AML execution - opcodes with 1 argument
5 1.1.1.2.4.2 rmind *
6 1.1.1.2.4.2 rmind *****************************************************************************/
7 1.1.1.2.4.2 rmind
8 1.1.1.2.4.2 rmind /*
9 1.1.1.2.4.2 rmind * Copyright (C) 2000 - 2011, Intel Corp.
10 1.1.1.2.4.2 rmind * All rights reserved.
11 1.1.1.2.4.2 rmind *
12 1.1.1.2.4.2 rmind * Redistribution and use in source and binary forms, with or without
13 1.1.1.2.4.2 rmind * modification, are permitted provided that the following conditions
14 1.1.1.2.4.2 rmind * are met:
15 1.1.1.2.4.2 rmind * 1. Redistributions of source code must retain the above copyright
16 1.1.1.2.4.2 rmind * notice, this list of conditions, and the following disclaimer,
17 1.1.1.2.4.2 rmind * without modification.
18 1.1.1.2.4.2 rmind * 2. Redistributions in binary form must reproduce at minimum a disclaimer
19 1.1.1.2.4.2 rmind * substantially similar to the "NO WARRANTY" disclaimer below
20 1.1.1.2.4.2 rmind * ("Disclaimer") and any redistribution must be conditioned upon
21 1.1.1.2.4.2 rmind * including a substantially similar Disclaimer requirement for further
22 1.1.1.2.4.2 rmind * binary redistribution.
23 1.1.1.2.4.2 rmind * 3. Neither the names of the above-listed copyright holders nor the names
24 1.1.1.2.4.2 rmind * of any contributors may be used to endorse or promote products derived
25 1.1.1.2.4.2 rmind * from this software without specific prior written permission.
26 1.1.1.2.4.2 rmind *
27 1.1.1.2.4.2 rmind * Alternatively, this software may be distributed under the terms of the
28 1.1.1.2.4.2 rmind * GNU General Public License ("GPL") version 2 as published by the Free
29 1.1.1.2.4.2 rmind * Software Foundation.
30 1.1.1.2.4.2 rmind *
31 1.1.1.2.4.2 rmind * NO WARRANTY
32 1.1.1.2.4.2 rmind * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33 1.1.1.2.4.2 rmind * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34 1.1.1.2.4.2 rmind * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
35 1.1.1.2.4.2 rmind * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36 1.1.1.2.4.2 rmind * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37 1.1.1.2.4.2 rmind * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38 1.1.1.2.4.2 rmind * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 1.1.1.2.4.2 rmind * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
40 1.1.1.2.4.2 rmind * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
41 1.1.1.2.4.2 rmind * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
42 1.1.1.2.4.2 rmind * POSSIBILITY OF SUCH DAMAGES.
43 1.1.1.2.4.2 rmind */
44 1.1.1.2.4.2 rmind
45 1.1.1.2.4.2 rmind #define __EXOPARG1_C__
46 1.1.1.2.4.2 rmind
47 1.1.1.2.4.2 rmind #include "acpi.h"
48 1.1.1.2.4.2 rmind #include "accommon.h"
49 1.1.1.2.4.2 rmind #include "acparser.h"
50 1.1.1.2.4.2 rmind #include "acdispat.h"
51 1.1.1.2.4.2 rmind #include "acinterp.h"
52 1.1.1.2.4.2 rmind #include "amlcode.h"
53 1.1.1.2.4.2 rmind #include "acnamesp.h"
54 1.1.1.2.4.2 rmind
55 1.1.1.2.4.2 rmind
56 1.1.1.2.4.2 rmind #define _COMPONENT ACPI_EXECUTER
57 1.1.1.2.4.2 rmind ACPI_MODULE_NAME ("exoparg1")
58 1.1.1.2.4.2 rmind
59 1.1.1.2.4.2 rmind
60 1.1.1.2.4.2 rmind /*!
61 1.1.1.2.4.2 rmind * Naming convention for AML interpreter execution routines.
62 1.1.1.2.4.2 rmind *
63 1.1.1.2.4.2 rmind * The routines that begin execution of AML opcodes are named with a common
64 1.1.1.2.4.2 rmind * convention based upon the number of arguments, the number of target operands,
65 1.1.1.2.4.2 rmind * and whether or not a value is returned:
66 1.1.1.2.4.2 rmind *
67 1.1.1.2.4.2 rmind * AcpiExOpcode_xA_yT_zR
68 1.1.1.2.4.2 rmind *
69 1.1.1.2.4.2 rmind * Where:
70 1.1.1.2.4.2 rmind *
71 1.1.1.2.4.2 rmind * xA - ARGUMENTS: The number of arguments (input operands) that are
72 1.1.1.2.4.2 rmind * required for this opcode type (0 through 6 args).
73 1.1.1.2.4.2 rmind * yT - TARGETS: The number of targets (output operands) that are required
74 1.1.1.2.4.2 rmind * for this opcode type (0, 1, or 2 targets).
75 1.1.1.2.4.2 rmind * zR - RETURN VALUE: Indicates whether this opcode type returns a value
76 1.1.1.2.4.2 rmind * as the function return (0 or 1).
77 1.1.1.2.4.2 rmind *
78 1.1.1.2.4.2 rmind * The AcpiExOpcode* functions are called via the Dispatcher component with
79 1.1.1.2.4.2 rmind * fully resolved operands.
80 1.1.1.2.4.2 rmind !*/
81 1.1.1.2.4.2 rmind
82 1.1.1.2.4.2 rmind /*******************************************************************************
83 1.1.1.2.4.2 rmind *
84 1.1.1.2.4.2 rmind * FUNCTION: AcpiExOpcode_0A_0T_1R
85 1.1.1.2.4.2 rmind *
86 1.1.1.2.4.2 rmind * PARAMETERS: WalkState - Current state (contains AML opcode)
87 1.1.1.2.4.2 rmind *
88 1.1.1.2.4.2 rmind * RETURN: Status
89 1.1.1.2.4.2 rmind *
90 1.1.1.2.4.2 rmind * DESCRIPTION: Execute operator with no operands, one return value
91 1.1.1.2.4.2 rmind *
92 1.1.1.2.4.2 rmind ******************************************************************************/
93 1.1.1.2.4.2 rmind
94 1.1.1.2.4.2 rmind ACPI_STATUS
95 1.1.1.2.4.2 rmind AcpiExOpcode_0A_0T_1R (
96 1.1.1.2.4.2 rmind ACPI_WALK_STATE *WalkState)
97 1.1.1.2.4.2 rmind {
98 1.1.1.2.4.2 rmind ACPI_STATUS Status = AE_OK;
99 1.1.1.2.4.2 rmind ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
100 1.1.1.2.4.2 rmind
101 1.1.1.2.4.2 rmind
102 1.1.1.2.4.2 rmind ACPI_FUNCTION_TRACE_STR (ExOpcode_0A_0T_1R,
103 1.1.1.2.4.2 rmind AcpiPsGetOpcodeName (WalkState->Opcode));
104 1.1.1.2.4.2 rmind
105 1.1.1.2.4.2 rmind
106 1.1.1.2.4.2 rmind /* Examine the AML opcode */
107 1.1.1.2.4.2 rmind
108 1.1.1.2.4.2 rmind switch (WalkState->Opcode)
109 1.1.1.2.4.2 rmind {
110 1.1.1.2.4.2 rmind case AML_TIMER_OP: /* Timer () */
111 1.1.1.2.4.2 rmind
112 1.1.1.2.4.2 rmind /* Create a return object of type Integer */
113 1.1.1.2.4.2 rmind
114 1.1.1.2.4.2 rmind ReturnDesc = AcpiUtCreateIntegerObject (AcpiOsGetTimer ());
115 1.1.1.2.4.2 rmind if (!ReturnDesc)
116 1.1.1.2.4.2 rmind {
117 1.1.1.2.4.2 rmind Status = AE_NO_MEMORY;
118 1.1.1.2.4.2 rmind goto Cleanup;
119 1.1.1.2.4.2 rmind }
120 1.1.1.2.4.2 rmind break;
121 1.1.1.2.4.2 rmind
122 1.1.1.2.4.2 rmind default: /* Unknown opcode */
123 1.1.1.2.4.2 rmind
124 1.1.1.2.4.2 rmind ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
125 1.1.1.2.4.2 rmind WalkState->Opcode));
126 1.1.1.2.4.2 rmind Status = AE_AML_BAD_OPCODE;
127 1.1.1.2.4.2 rmind break;
128 1.1.1.2.4.2 rmind }
129 1.1.1.2.4.2 rmind
130 1.1.1.2.4.2 rmind Cleanup:
131 1.1.1.2.4.2 rmind
132 1.1.1.2.4.2 rmind /* Delete return object on error */
133 1.1.1.2.4.2 rmind
134 1.1.1.2.4.2 rmind if ((ACPI_FAILURE (Status)) || WalkState->ResultObj)
135 1.1.1.2.4.2 rmind {
136 1.1.1.2.4.2 rmind AcpiUtRemoveReference (ReturnDesc);
137 1.1.1.2.4.2 rmind WalkState->ResultObj = NULL;
138 1.1.1.2.4.2 rmind }
139 1.1.1.2.4.2 rmind else
140 1.1.1.2.4.2 rmind {
141 1.1.1.2.4.2 rmind /* Save the return value */
142 1.1.1.2.4.2 rmind
143 1.1.1.2.4.2 rmind WalkState->ResultObj = ReturnDesc;
144 1.1.1.2.4.2 rmind }
145 1.1.1.2.4.2 rmind
146 1.1.1.2.4.2 rmind return_ACPI_STATUS (Status);
147 1.1.1.2.4.2 rmind }
148 1.1.1.2.4.2 rmind
149 1.1.1.2.4.2 rmind
150 1.1.1.2.4.2 rmind /*******************************************************************************
151 1.1.1.2.4.2 rmind *
152 1.1.1.2.4.2 rmind * FUNCTION: AcpiExOpcode_1A_0T_0R
153 1.1.1.2.4.2 rmind *
154 1.1.1.2.4.2 rmind * PARAMETERS: WalkState - Current state (contains AML opcode)
155 1.1.1.2.4.2 rmind *
156 1.1.1.2.4.2 rmind * RETURN: Status
157 1.1.1.2.4.2 rmind *
158 1.1.1.2.4.2 rmind * DESCRIPTION: Execute Type 1 monadic operator with numeric operand on
159 1.1.1.2.4.2 rmind * object stack
160 1.1.1.2.4.2 rmind *
161 1.1.1.2.4.2 rmind ******************************************************************************/
162 1.1.1.2.4.2 rmind
163 1.1.1.2.4.2 rmind ACPI_STATUS
164 1.1.1.2.4.2 rmind AcpiExOpcode_1A_0T_0R (
165 1.1.1.2.4.2 rmind ACPI_WALK_STATE *WalkState)
166 1.1.1.2.4.2 rmind {
167 1.1.1.2.4.2 rmind ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
168 1.1.1.2.4.2 rmind ACPI_STATUS Status = AE_OK;
169 1.1.1.2.4.2 rmind
170 1.1.1.2.4.2 rmind
171 1.1.1.2.4.2 rmind ACPI_FUNCTION_TRACE_STR (ExOpcode_1A_0T_0R,
172 1.1.1.2.4.2 rmind AcpiPsGetOpcodeName (WalkState->Opcode));
173 1.1.1.2.4.2 rmind
174 1.1.1.2.4.2 rmind
175 1.1.1.2.4.2 rmind /* Examine the AML opcode */
176 1.1.1.2.4.2 rmind
177 1.1.1.2.4.2 rmind switch (WalkState->Opcode)
178 1.1.1.2.4.2 rmind {
179 1.1.1.2.4.2 rmind case AML_RELEASE_OP: /* Release (MutexObject) */
180 1.1.1.2.4.2 rmind
181 1.1.1.2.4.2 rmind Status = AcpiExReleaseMutex (Operand[0], WalkState);
182 1.1.1.2.4.2 rmind break;
183 1.1.1.2.4.2 rmind
184 1.1.1.2.4.2 rmind
185 1.1.1.2.4.2 rmind case AML_RESET_OP: /* Reset (EventObject) */
186 1.1.1.2.4.2 rmind
187 1.1.1.2.4.2 rmind Status = AcpiExSystemResetEvent (Operand[0]);
188 1.1.1.2.4.2 rmind break;
189 1.1.1.2.4.2 rmind
190 1.1.1.2.4.2 rmind
191 1.1.1.2.4.2 rmind case AML_SIGNAL_OP: /* Signal (EventObject) */
192 1.1.1.2.4.2 rmind
193 1.1.1.2.4.2 rmind Status = AcpiExSystemSignalEvent (Operand[0]);
194 1.1.1.2.4.2 rmind break;
195 1.1.1.2.4.2 rmind
196 1.1.1.2.4.2 rmind
197 1.1.1.2.4.2 rmind case AML_SLEEP_OP: /* Sleep (MsecTime) */
198 1.1.1.2.4.2 rmind
199 1.1.1.2.4.2 rmind Status = AcpiExSystemDoSleep (Operand[0]->Integer.Value);
200 1.1.1.2.4.2 rmind break;
201 1.1.1.2.4.2 rmind
202 1.1.1.2.4.2 rmind
203 1.1.1.2.4.2 rmind case AML_STALL_OP: /* Stall (UsecTime) */
204 1.1.1.2.4.2 rmind
205 1.1.1.2.4.2 rmind Status = AcpiExSystemDoStall ((UINT32) Operand[0]->Integer.Value);
206 1.1.1.2.4.2 rmind break;
207 1.1.1.2.4.2 rmind
208 1.1.1.2.4.2 rmind
209 1.1.1.2.4.2 rmind case AML_UNLOAD_OP: /* Unload (Handle) */
210 1.1.1.2.4.2 rmind
211 1.1.1.2.4.2 rmind Status = AcpiExUnloadTable (Operand[0]);
212 1.1.1.2.4.2 rmind break;
213 1.1.1.2.4.2 rmind
214 1.1.1.2.4.2 rmind
215 1.1.1.2.4.2 rmind default: /* Unknown opcode */
216 1.1.1.2.4.2 rmind
217 1.1.1.2.4.2 rmind ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
218 1.1.1.2.4.2 rmind WalkState->Opcode));
219 1.1.1.2.4.2 rmind Status = AE_AML_BAD_OPCODE;
220 1.1.1.2.4.2 rmind break;
221 1.1.1.2.4.2 rmind }
222 1.1.1.2.4.2 rmind
223 1.1.1.2.4.2 rmind return_ACPI_STATUS (Status);
224 1.1.1.2.4.2 rmind }
225 1.1.1.2.4.2 rmind
226 1.1.1.2.4.2 rmind
227 1.1.1.2.4.2 rmind /*******************************************************************************
228 1.1.1.2.4.2 rmind *
229 1.1.1.2.4.2 rmind * FUNCTION: AcpiExOpcode_1A_1T_0R
230 1.1.1.2.4.2 rmind *
231 1.1.1.2.4.2 rmind * PARAMETERS: WalkState - Current state (contains AML opcode)
232 1.1.1.2.4.2 rmind *
233 1.1.1.2.4.2 rmind * RETURN: Status
234 1.1.1.2.4.2 rmind *
235 1.1.1.2.4.2 rmind * DESCRIPTION: Execute opcode with one argument, one target, and no
236 1.1.1.2.4.2 rmind * return value.
237 1.1.1.2.4.2 rmind *
238 1.1.1.2.4.2 rmind ******************************************************************************/
239 1.1.1.2.4.2 rmind
240 1.1.1.2.4.2 rmind ACPI_STATUS
241 1.1.1.2.4.2 rmind AcpiExOpcode_1A_1T_0R (
242 1.1.1.2.4.2 rmind ACPI_WALK_STATE *WalkState)
243 1.1.1.2.4.2 rmind {
244 1.1.1.2.4.2 rmind ACPI_STATUS Status = AE_OK;
245 1.1.1.2.4.2 rmind ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
246 1.1.1.2.4.2 rmind
247 1.1.1.2.4.2 rmind
248 1.1.1.2.4.2 rmind ACPI_FUNCTION_TRACE_STR (ExOpcode_1A_1T_0R,
249 1.1.1.2.4.2 rmind AcpiPsGetOpcodeName (WalkState->Opcode));
250 1.1.1.2.4.2 rmind
251 1.1.1.2.4.2 rmind
252 1.1.1.2.4.2 rmind /* Examine the AML opcode */
253 1.1.1.2.4.2 rmind
254 1.1.1.2.4.2 rmind switch (WalkState->Opcode)
255 1.1.1.2.4.2 rmind {
256 1.1.1.2.4.2 rmind case AML_LOAD_OP:
257 1.1.1.2.4.2 rmind
258 1.1.1.2.4.2 rmind Status = AcpiExLoadOp (Operand[0], Operand[1], WalkState);
259 1.1.1.2.4.2 rmind break;
260 1.1.1.2.4.2 rmind
261 1.1.1.2.4.2 rmind default: /* Unknown opcode */
262 1.1.1.2.4.2 rmind
263 1.1.1.2.4.2 rmind ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
264 1.1.1.2.4.2 rmind WalkState->Opcode));
265 1.1.1.2.4.2 rmind Status = AE_AML_BAD_OPCODE;
266 1.1.1.2.4.2 rmind goto Cleanup;
267 1.1.1.2.4.2 rmind }
268 1.1.1.2.4.2 rmind
269 1.1.1.2.4.2 rmind
270 1.1.1.2.4.2 rmind Cleanup:
271 1.1.1.2.4.2 rmind
272 1.1.1.2.4.2 rmind return_ACPI_STATUS (Status);
273 1.1.1.2.4.2 rmind }
274 1.1.1.2.4.2 rmind
275 1.1.1.2.4.2 rmind
276 1.1.1.2.4.2 rmind /*******************************************************************************
277 1.1.1.2.4.2 rmind *
278 1.1.1.2.4.2 rmind * FUNCTION: AcpiExOpcode_1A_1T_1R
279 1.1.1.2.4.2 rmind *
280 1.1.1.2.4.2 rmind * PARAMETERS: WalkState - Current state (contains AML opcode)
281 1.1.1.2.4.2 rmind *
282 1.1.1.2.4.2 rmind * RETURN: Status
283 1.1.1.2.4.2 rmind *
284 1.1.1.2.4.2 rmind * DESCRIPTION: Execute opcode with one argument, one target, and a
285 1.1.1.2.4.2 rmind * return value.
286 1.1.1.2.4.2 rmind *
287 1.1.1.2.4.2 rmind ******************************************************************************/
288 1.1.1.2.4.2 rmind
289 1.1.1.2.4.2 rmind ACPI_STATUS
290 1.1.1.2.4.2 rmind AcpiExOpcode_1A_1T_1R (
291 1.1.1.2.4.2 rmind ACPI_WALK_STATE *WalkState)
292 1.1.1.2.4.2 rmind {
293 1.1.1.2.4.2 rmind ACPI_STATUS Status = AE_OK;
294 1.1.1.2.4.2 rmind ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
295 1.1.1.2.4.2 rmind ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
296 1.1.1.2.4.2 rmind ACPI_OPERAND_OBJECT *ReturnDesc2 = NULL;
297 1.1.1.2.4.2 rmind UINT32 Temp32;
298 1.1.1.2.4.2 rmind UINT32 i;
299 1.1.1.2.4.2 rmind UINT64 PowerOfTen;
300 1.1.1.2.4.2 rmind UINT64 Digit;
301 1.1.1.2.4.2 rmind
302 1.1.1.2.4.2 rmind
303 1.1.1.2.4.2 rmind ACPI_FUNCTION_TRACE_STR (ExOpcode_1A_1T_1R,
304 1.1.1.2.4.2 rmind AcpiPsGetOpcodeName (WalkState->Opcode));
305 1.1.1.2.4.2 rmind
306 1.1.1.2.4.2 rmind
307 1.1.1.2.4.2 rmind /* Examine the AML opcode */
308 1.1.1.2.4.2 rmind
309 1.1.1.2.4.2 rmind switch (WalkState->Opcode)
310 1.1.1.2.4.2 rmind {
311 1.1.1.2.4.2 rmind case AML_BIT_NOT_OP:
312 1.1.1.2.4.2 rmind case AML_FIND_SET_LEFT_BIT_OP:
313 1.1.1.2.4.2 rmind case AML_FIND_SET_RIGHT_BIT_OP:
314 1.1.1.2.4.2 rmind case AML_FROM_BCD_OP:
315 1.1.1.2.4.2 rmind case AML_TO_BCD_OP:
316 1.1.1.2.4.2 rmind case AML_COND_REF_OF_OP:
317 1.1.1.2.4.2 rmind
318 1.1.1.2.4.2 rmind /* Create a return object of type Integer for these opcodes */
319 1.1.1.2.4.2 rmind
320 1.1.1.2.4.2 rmind ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
321 1.1.1.2.4.2 rmind if (!ReturnDesc)
322 1.1.1.2.4.2 rmind {
323 1.1.1.2.4.2 rmind Status = AE_NO_MEMORY;
324 1.1.1.2.4.2 rmind goto Cleanup;
325 1.1.1.2.4.2 rmind }
326 1.1.1.2.4.2 rmind
327 1.1.1.2.4.2 rmind switch (WalkState->Opcode)
328 1.1.1.2.4.2 rmind {
329 1.1.1.2.4.2 rmind case AML_BIT_NOT_OP: /* Not (Operand, Result) */
330 1.1.1.2.4.2 rmind
331 1.1.1.2.4.2 rmind ReturnDesc->Integer.Value = ~Operand[0]->Integer.Value;
332 1.1.1.2.4.2 rmind break;
333 1.1.1.2.4.2 rmind
334 1.1.1.2.4.2 rmind
335 1.1.1.2.4.2 rmind case AML_FIND_SET_LEFT_BIT_OP: /* FindSetLeftBit (Operand, Result) */
336 1.1.1.2.4.2 rmind
337 1.1.1.2.4.2 rmind ReturnDesc->Integer.Value = Operand[0]->Integer.Value;
338 1.1.1.2.4.2 rmind
339 1.1.1.2.4.2 rmind /*
340 1.1.1.2.4.2 rmind * Acpi specification describes Integer type as a little
341 1.1.1.2.4.2 rmind * endian unsigned value, so this boundary condition is valid.
342 1.1.1.2.4.2 rmind */
343 1.1.1.2.4.2 rmind for (Temp32 = 0; ReturnDesc->Integer.Value &&
344 1.1.1.2.4.2 rmind Temp32 < ACPI_INTEGER_BIT_SIZE; ++Temp32)
345 1.1.1.2.4.2 rmind {
346 1.1.1.2.4.2 rmind ReturnDesc->Integer.Value >>= 1;
347 1.1.1.2.4.2 rmind }
348 1.1.1.2.4.2 rmind
349 1.1.1.2.4.2 rmind ReturnDesc->Integer.Value = Temp32;
350 1.1.1.2.4.2 rmind break;
351 1.1.1.2.4.2 rmind
352 1.1.1.2.4.2 rmind
353 1.1.1.2.4.2 rmind case AML_FIND_SET_RIGHT_BIT_OP: /* FindSetRightBit (Operand, Result) */
354 1.1.1.2.4.2 rmind
355 1.1.1.2.4.2 rmind ReturnDesc->Integer.Value = Operand[0]->Integer.Value;
356 1.1.1.2.4.2 rmind
357 1.1.1.2.4.2 rmind /*
358 1.1.1.2.4.2 rmind * The Acpi specification describes Integer type as a little
359 1.1.1.2.4.2 rmind * endian unsigned value, so this boundary condition is valid.
360 1.1.1.2.4.2 rmind */
361 1.1.1.2.4.2 rmind for (Temp32 = 0; ReturnDesc->Integer.Value &&
362 1.1.1.2.4.2 rmind Temp32 < ACPI_INTEGER_BIT_SIZE; ++Temp32)
363 1.1.1.2.4.2 rmind {
364 1.1.1.2.4.2 rmind ReturnDesc->Integer.Value <<= 1;
365 1.1.1.2.4.2 rmind }
366 1.1.1.2.4.2 rmind
367 1.1.1.2.4.2 rmind /* Since the bit position is one-based, subtract from 33 (65) */
368 1.1.1.2.4.2 rmind
369 1.1.1.2.4.2 rmind ReturnDesc->Integer.Value =
370 1.1.1.2.4.2 rmind Temp32 == 0 ? 0 : (ACPI_INTEGER_BIT_SIZE + 1) - Temp32;
371 1.1.1.2.4.2 rmind break;
372 1.1.1.2.4.2 rmind
373 1.1.1.2.4.2 rmind
374 1.1.1.2.4.2 rmind case AML_FROM_BCD_OP: /* FromBcd (BCDValue, Result) */
375 1.1.1.2.4.2 rmind
376 1.1.1.2.4.2 rmind /*
377 1.1.1.2.4.2 rmind * The 64-bit ACPI integer can hold 16 4-bit BCD characters
378 1.1.1.2.4.2 rmind * (if table is 32-bit, integer can hold 8 BCD characters)
379 1.1.1.2.4.2 rmind * Convert each 4-bit BCD value
380 1.1.1.2.4.2 rmind */
381 1.1.1.2.4.2 rmind PowerOfTen = 1;
382 1.1.1.2.4.2 rmind ReturnDesc->Integer.Value = 0;
383 1.1.1.2.4.2 rmind Digit = Operand[0]->Integer.Value;
384 1.1.1.2.4.2 rmind
385 1.1.1.2.4.2 rmind /* Convert each BCD digit (each is one nybble wide) */
386 1.1.1.2.4.2 rmind
387 1.1.1.2.4.2 rmind for (i = 0; (i < AcpiGbl_IntegerNybbleWidth) && (Digit > 0); i++)
388 1.1.1.2.4.2 rmind {
389 1.1.1.2.4.2 rmind /* Get the least significant 4-bit BCD digit */
390 1.1.1.2.4.2 rmind
391 1.1.1.2.4.2 rmind Temp32 = ((UINT32) Digit) & 0xF;
392 1.1.1.2.4.2 rmind
393 1.1.1.2.4.2 rmind /* Check the range of the digit */
394 1.1.1.2.4.2 rmind
395 1.1.1.2.4.2 rmind if (Temp32 > 9)
396 1.1.1.2.4.2 rmind {
397 1.1.1.2.4.2 rmind ACPI_ERROR ((AE_INFO,
398 1.1.1.2.4.2 rmind "BCD digit too large (not decimal): 0x%X",
399 1.1.1.2.4.2 rmind Temp32));
400 1.1.1.2.4.2 rmind
401 1.1.1.2.4.2 rmind Status = AE_AML_NUMERIC_OVERFLOW;
402 1.1.1.2.4.2 rmind goto Cleanup;
403 1.1.1.2.4.2 rmind }
404 1.1.1.2.4.2 rmind
405 1.1.1.2.4.2 rmind /* Sum the digit into the result with the current power of 10 */
406 1.1.1.2.4.2 rmind
407 1.1.1.2.4.2 rmind ReturnDesc->Integer.Value +=
408 1.1.1.2.4.2 rmind (((UINT64) Temp32) * PowerOfTen);
409 1.1.1.2.4.2 rmind
410 1.1.1.2.4.2 rmind /* Shift to next BCD digit */
411 1.1.1.2.4.2 rmind
412 1.1.1.2.4.2 rmind Digit >>= 4;
413 1.1.1.2.4.2 rmind
414 1.1.1.2.4.2 rmind /* Next power of 10 */
415 1.1.1.2.4.2 rmind
416 1.1.1.2.4.2 rmind PowerOfTen *= 10;
417 1.1.1.2.4.2 rmind }
418 1.1.1.2.4.2 rmind break;
419 1.1.1.2.4.2 rmind
420 1.1.1.2.4.2 rmind
421 1.1.1.2.4.2 rmind case AML_TO_BCD_OP: /* ToBcd (Operand, Result) */
422 1.1.1.2.4.2 rmind
423 1.1.1.2.4.2 rmind ReturnDesc->Integer.Value = 0;
424 1.1.1.2.4.2 rmind Digit = Operand[0]->Integer.Value;
425 1.1.1.2.4.2 rmind
426 1.1.1.2.4.2 rmind /* Each BCD digit is one nybble wide */
427 1.1.1.2.4.2 rmind
428 1.1.1.2.4.2 rmind for (i = 0; (i < AcpiGbl_IntegerNybbleWidth) && (Digit > 0); i++)
429 1.1.1.2.4.2 rmind {
430 1.1.1.2.4.2 rmind (void) AcpiUtShortDivide (Digit, 10, &Digit, &Temp32);
431 1.1.1.2.4.2 rmind
432 1.1.1.2.4.2 rmind /*
433 1.1.1.2.4.2 rmind * Insert the BCD digit that resides in the
434 1.1.1.2.4.2 rmind * remainder from above
435 1.1.1.2.4.2 rmind */
436 1.1.1.2.4.2 rmind ReturnDesc->Integer.Value |=
437 1.1.1.2.4.2 rmind (((UINT64) Temp32) << ACPI_MUL_4 (i));
438 1.1.1.2.4.2 rmind }
439 1.1.1.2.4.2 rmind
440 1.1.1.2.4.2 rmind /* Overflow if there is any data left in Digit */
441 1.1.1.2.4.2 rmind
442 1.1.1.2.4.2 rmind if (Digit > 0)
443 1.1.1.2.4.2 rmind {
444 1.1.1.2.4.2 rmind ACPI_ERROR ((AE_INFO,
445 1.1.1.2.4.2 rmind "Integer too large to convert to BCD: 0x%8.8X%8.8X",
446 1.1.1.2.4.2 rmind ACPI_FORMAT_UINT64 (Operand[0]->Integer.Value)));
447 1.1.1.2.4.2 rmind Status = AE_AML_NUMERIC_OVERFLOW;
448 1.1.1.2.4.2 rmind goto Cleanup;
449 1.1.1.2.4.2 rmind }
450 1.1.1.2.4.2 rmind break;
451 1.1.1.2.4.2 rmind
452 1.1.1.2.4.2 rmind
453 1.1.1.2.4.2 rmind case AML_COND_REF_OF_OP: /* CondRefOf (SourceObject, Result) */
454 1.1.1.2.4.2 rmind
455 1.1.1.2.4.2 rmind /*
456 1.1.1.2.4.2 rmind * This op is a little strange because the internal return value is
457 1.1.1.2.4.2 rmind * different than the return value stored in the result descriptor
458 1.1.1.2.4.2 rmind * (There are really two return values)
459 1.1.1.2.4.2 rmind */
460 1.1.1.2.4.2 rmind if ((ACPI_NAMESPACE_NODE *) Operand[0] == AcpiGbl_RootNode)
461 1.1.1.2.4.2 rmind {
462 1.1.1.2.4.2 rmind /*
463 1.1.1.2.4.2 rmind * This means that the object does not exist in the namespace,
464 1.1.1.2.4.2 rmind * return FALSE
465 1.1.1.2.4.2 rmind */
466 1.1.1.2.4.2 rmind ReturnDesc->Integer.Value = 0;
467 1.1.1.2.4.2 rmind goto Cleanup;
468 1.1.1.2.4.2 rmind }
469 1.1.1.2.4.2 rmind
470 1.1.1.2.4.2 rmind /* Get the object reference, store it, and remove our reference */
471 1.1.1.2.4.2 rmind
472 1.1.1.2.4.2 rmind Status = AcpiExGetObjectReference (Operand[0],
473 1.1.1.2.4.2 rmind &ReturnDesc2, WalkState);
474 1.1.1.2.4.2 rmind if (ACPI_FAILURE (Status))
475 1.1.1.2.4.2 rmind {
476 1.1.1.2.4.2 rmind goto Cleanup;
477 1.1.1.2.4.2 rmind }
478 1.1.1.2.4.2 rmind
479 1.1.1.2.4.2 rmind Status = AcpiExStore (ReturnDesc2, Operand[1], WalkState);
480 1.1.1.2.4.2 rmind AcpiUtRemoveReference (ReturnDesc2);
481 1.1.1.2.4.2 rmind
482 1.1.1.2.4.2 rmind /* The object exists in the namespace, return TRUE */
483 1.1.1.2.4.2 rmind
484 1.1.1.2.4.2 rmind ReturnDesc->Integer.Value = ACPI_UINT64_MAX;
485 1.1.1.2.4.2 rmind goto Cleanup;
486 1.1.1.2.4.2 rmind
487 1.1.1.2.4.2 rmind
488 1.1.1.2.4.2 rmind default:
489 1.1.1.2.4.2 rmind /* No other opcodes get here */
490 1.1.1.2.4.2 rmind break;
491 1.1.1.2.4.2 rmind }
492 1.1.1.2.4.2 rmind break;
493 1.1.1.2.4.2 rmind
494 1.1.1.2.4.2 rmind
495 1.1.1.2.4.2 rmind case AML_STORE_OP: /* Store (Source, Target) */
496 1.1.1.2.4.2 rmind
497 1.1.1.2.4.2 rmind /*
498 1.1.1.2.4.2 rmind * A store operand is typically a number, string, buffer or lvalue
499 1.1.1.2.4.2 rmind * Be careful about deleting the source object,
500 1.1.1.2.4.2 rmind * since the object itself may have been stored.
501 1.1.1.2.4.2 rmind */
502 1.1.1.2.4.2 rmind Status = AcpiExStore (Operand[0], Operand[1], WalkState);
503 1.1.1.2.4.2 rmind if (ACPI_FAILURE (Status))
504 1.1.1.2.4.2 rmind {
505 1.1.1.2.4.2 rmind return_ACPI_STATUS (Status);
506 1.1.1.2.4.2 rmind }
507 1.1.1.2.4.2 rmind
508 1.1.1.2.4.2 rmind /* It is possible that the Store already produced a return object */
509 1.1.1.2.4.2 rmind
510 1.1.1.2.4.2 rmind if (!WalkState->ResultObj)
511 1.1.1.2.4.2 rmind {
512 1.1.1.2.4.2 rmind /*
513 1.1.1.2.4.2 rmind * Normally, we would remove a reference on the Operand[0]
514 1.1.1.2.4.2 rmind * parameter; But since it is being used as the internal return
515 1.1.1.2.4.2 rmind * object (meaning we would normally increment it), the two
516 1.1.1.2.4.2 rmind * cancel out, and we simply don't do anything.
517 1.1.1.2.4.2 rmind */
518 1.1.1.2.4.2 rmind WalkState->ResultObj = Operand[0];
519 1.1.1.2.4.2 rmind WalkState->Operands[0] = NULL; /* Prevent deletion */
520 1.1.1.2.4.2 rmind }
521 1.1.1.2.4.2 rmind return_ACPI_STATUS (Status);
522 1.1.1.2.4.2 rmind
523 1.1.1.2.4.2 rmind
524 1.1.1.2.4.2 rmind /*
525 1.1.1.2.4.2 rmind * ACPI 2.0 Opcodes
526 1.1.1.2.4.2 rmind */
527 1.1.1.2.4.2 rmind case AML_COPY_OP: /* Copy (Source, Target) */
528 1.1.1.2.4.2 rmind
529 1.1.1.2.4.2 rmind Status = AcpiUtCopyIobjectToIobject (Operand[0], &ReturnDesc,
530 1.1.1.2.4.2 rmind WalkState);
531 1.1.1.2.4.2 rmind break;
532 1.1.1.2.4.2 rmind
533 1.1.1.2.4.2 rmind
534 1.1.1.2.4.2 rmind case AML_TO_DECSTRING_OP: /* ToDecimalString (Data, Result) */
535 1.1.1.2.4.2 rmind
536 1.1.1.2.4.2 rmind Status = AcpiExConvertToString (Operand[0], &ReturnDesc,
537 1.1.1.2.4.2 rmind ACPI_EXPLICIT_CONVERT_DECIMAL);
538 1.1.1.2.4.2 rmind if (ReturnDesc == Operand[0])
539 1.1.1.2.4.2 rmind {
540 1.1.1.2.4.2 rmind /* No conversion performed, add ref to handle return value */
541 1.1.1.2.4.2 rmind AcpiUtAddReference (ReturnDesc);
542 1.1.1.2.4.2 rmind }
543 1.1.1.2.4.2 rmind break;
544 1.1.1.2.4.2 rmind
545 1.1.1.2.4.2 rmind
546 1.1.1.2.4.2 rmind case AML_TO_HEXSTRING_OP: /* ToHexString (Data, Result) */
547 1.1.1.2.4.2 rmind
548 1.1.1.2.4.2 rmind Status = AcpiExConvertToString (Operand[0], &ReturnDesc,
549 1.1.1.2.4.2 rmind ACPI_EXPLICIT_CONVERT_HEX);
550 1.1.1.2.4.2 rmind if (ReturnDesc == Operand[0])
551 1.1.1.2.4.2 rmind {
552 1.1.1.2.4.2 rmind /* No conversion performed, add ref to handle return value */
553 1.1.1.2.4.2 rmind AcpiUtAddReference (ReturnDesc);
554 1.1.1.2.4.2 rmind }
555 1.1.1.2.4.2 rmind break;
556 1.1.1.2.4.2 rmind
557 1.1.1.2.4.2 rmind
558 1.1.1.2.4.2 rmind case AML_TO_BUFFER_OP: /* ToBuffer (Data, Result) */
559 1.1.1.2.4.2 rmind
560 1.1.1.2.4.2 rmind Status = AcpiExConvertToBuffer (Operand[0], &ReturnDesc);
561 1.1.1.2.4.2 rmind if (ReturnDesc == Operand[0])
562 1.1.1.2.4.2 rmind {
563 1.1.1.2.4.2 rmind /* No conversion performed, add ref to handle return value */
564 1.1.1.2.4.2 rmind AcpiUtAddReference (ReturnDesc);
565 1.1.1.2.4.2 rmind }
566 1.1.1.2.4.2 rmind break;
567 1.1.1.2.4.2 rmind
568 1.1.1.2.4.2 rmind
569 1.1.1.2.4.2 rmind case AML_TO_INTEGER_OP: /* ToInteger (Data, Result) */
570 1.1.1.2.4.2 rmind
571 1.1.1.2.4.2 rmind Status = AcpiExConvertToInteger (Operand[0], &ReturnDesc,
572 1.1.1.2.4.2 rmind ACPI_ANY_BASE);
573 1.1.1.2.4.2 rmind if (ReturnDesc == Operand[0])
574 1.1.1.2.4.2 rmind {
575 1.1.1.2.4.2 rmind /* No conversion performed, add ref to handle return value */
576 1.1.1.2.4.2 rmind AcpiUtAddReference (ReturnDesc);
577 1.1.1.2.4.2 rmind }
578 1.1.1.2.4.2 rmind break;
579 1.1.1.2.4.2 rmind
580 1.1.1.2.4.2 rmind
581 1.1.1.2.4.2 rmind case AML_SHIFT_LEFT_BIT_OP: /* ShiftLeftBit (Source, BitNum) */
582 1.1.1.2.4.2 rmind case AML_SHIFT_RIGHT_BIT_OP: /* ShiftRightBit (Source, BitNum) */
583 1.1.1.2.4.2 rmind
584 1.1.1.2.4.2 rmind /* These are two obsolete opcodes */
585 1.1.1.2.4.2 rmind
586 1.1.1.2.4.2 rmind ACPI_ERROR ((AE_INFO,
587 1.1.1.2.4.2 rmind "%s is obsolete and not implemented",
588 1.1.1.2.4.2 rmind AcpiPsGetOpcodeName (WalkState->Opcode)));
589 1.1.1.2.4.2 rmind Status = AE_SUPPORT;
590 1.1.1.2.4.2 rmind goto Cleanup;
591 1.1.1.2.4.2 rmind
592 1.1.1.2.4.2 rmind
593 1.1.1.2.4.2 rmind default: /* Unknown opcode */
594 1.1.1.2.4.2 rmind
595 1.1.1.2.4.2 rmind ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
596 1.1.1.2.4.2 rmind WalkState->Opcode));
597 1.1.1.2.4.2 rmind Status = AE_AML_BAD_OPCODE;
598 1.1.1.2.4.2 rmind goto Cleanup;
599 1.1.1.2.4.2 rmind }
600 1.1.1.2.4.2 rmind
601 1.1.1.2.4.2 rmind if (ACPI_SUCCESS (Status))
602 1.1.1.2.4.2 rmind {
603 1.1.1.2.4.2 rmind /* Store the return value computed above into the target object */
604 1.1.1.2.4.2 rmind
605 1.1.1.2.4.2 rmind Status = AcpiExStore (ReturnDesc, Operand[1], WalkState);
606 1.1.1.2.4.2 rmind }
607 1.1.1.2.4.2 rmind
608 1.1.1.2.4.2 rmind
609 1.1.1.2.4.2 rmind Cleanup:
610 1.1.1.2.4.2 rmind
611 1.1.1.2.4.2 rmind /* Delete return object on error */
612 1.1.1.2.4.2 rmind
613 1.1.1.2.4.2 rmind if (ACPI_FAILURE (Status))
614 1.1.1.2.4.2 rmind {
615 1.1.1.2.4.2 rmind AcpiUtRemoveReference (ReturnDesc);
616 1.1.1.2.4.2 rmind }
617 1.1.1.2.4.2 rmind
618 1.1.1.2.4.2 rmind /* Save return object on success */
619 1.1.1.2.4.2 rmind
620 1.1.1.2.4.2 rmind else if (!WalkState->ResultObj)
621 1.1.1.2.4.2 rmind {
622 1.1.1.2.4.2 rmind WalkState->ResultObj = ReturnDesc;
623 1.1.1.2.4.2 rmind }
624 1.1.1.2.4.2 rmind
625 1.1.1.2.4.2 rmind return_ACPI_STATUS (Status);
626 1.1.1.2.4.2 rmind }
627 1.1.1.2.4.2 rmind
628 1.1.1.2.4.2 rmind
629 1.1.1.2.4.2 rmind /*******************************************************************************
630 1.1.1.2.4.2 rmind *
631 1.1.1.2.4.2 rmind * FUNCTION: AcpiExOpcode_1A_0T_1R
632 1.1.1.2.4.2 rmind *
633 1.1.1.2.4.2 rmind * PARAMETERS: WalkState - Current state (contains AML opcode)
634 1.1.1.2.4.2 rmind *
635 1.1.1.2.4.2 rmind * RETURN: Status
636 1.1.1.2.4.2 rmind *
637 1.1.1.2.4.2 rmind * DESCRIPTION: Execute opcode with one argument, no target, and a return value
638 1.1.1.2.4.2 rmind *
639 1.1.1.2.4.2 rmind ******************************************************************************/
640 1.1.1.2.4.2 rmind
641 1.1.1.2.4.2 rmind ACPI_STATUS
642 1.1.1.2.4.2 rmind AcpiExOpcode_1A_0T_1R (
643 1.1.1.2.4.2 rmind ACPI_WALK_STATE *WalkState)
644 1.1.1.2.4.2 rmind {
645 1.1.1.2.4.2 rmind ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
646 1.1.1.2.4.2 rmind ACPI_OPERAND_OBJECT *TempDesc;
647 1.1.1.2.4.2 rmind ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
648 1.1.1.2.4.2 rmind ACPI_STATUS Status = AE_OK;
649 1.1.1.2.4.2 rmind UINT32 Type;
650 1.1.1.2.4.2 rmind UINT64 Value;
651 1.1.1.2.4.2 rmind
652 1.1.1.2.4.2 rmind
653 1.1.1.2.4.2 rmind ACPI_FUNCTION_TRACE_STR (ExOpcode_1A_0T_1R,
654 1.1.1.2.4.2 rmind AcpiPsGetOpcodeName (WalkState->Opcode));
655 1.1.1.2.4.2 rmind
656 1.1.1.2.4.2 rmind
657 1.1.1.2.4.2 rmind /* Examine the AML opcode */
658 1.1.1.2.4.2 rmind
659 1.1.1.2.4.2 rmind switch (WalkState->Opcode)
660 1.1.1.2.4.2 rmind {
661 1.1.1.2.4.2 rmind case AML_LNOT_OP: /* LNot (Operand) */
662 1.1.1.2.4.2 rmind
663 1.1.1.2.4.2 rmind ReturnDesc = AcpiUtCreateIntegerObject ((UINT64) 0);
664 1.1.1.2.4.2 rmind if (!ReturnDesc)
665 1.1.1.2.4.2 rmind {
666 1.1.1.2.4.2 rmind Status = AE_NO_MEMORY;
667 1.1.1.2.4.2 rmind goto Cleanup;
668 1.1.1.2.4.2 rmind }
669 1.1.1.2.4.2 rmind
670 1.1.1.2.4.2 rmind /*
671 1.1.1.2.4.2 rmind * Set result to ONES (TRUE) if Value == 0. Note:
672 1.1.1.2.4.2 rmind * ReturnDesc->Integer.Value is initially == 0 (FALSE) from above.
673 1.1.1.2.4.2 rmind */
674 1.1.1.2.4.2 rmind if (!Operand[0]->Integer.Value)
675 1.1.1.2.4.2 rmind {
676 1.1.1.2.4.2 rmind ReturnDesc->Integer.Value = ACPI_UINT64_MAX;
677 1.1.1.2.4.2 rmind }
678 1.1.1.2.4.2 rmind break;
679 1.1.1.2.4.2 rmind
680 1.1.1.2.4.2 rmind
681 1.1.1.2.4.2 rmind case AML_DECREMENT_OP: /* Decrement (Operand) */
682 1.1.1.2.4.2 rmind case AML_INCREMENT_OP: /* Increment (Operand) */
683 1.1.1.2.4.2 rmind
684 1.1.1.2.4.2 rmind /*
685 1.1.1.2.4.2 rmind * Create a new integer. Can't just get the base integer and
686 1.1.1.2.4.2 rmind * increment it because it may be an Arg or Field.
687 1.1.1.2.4.2 rmind */
688 1.1.1.2.4.2 rmind ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
689 1.1.1.2.4.2 rmind if (!ReturnDesc)
690 1.1.1.2.4.2 rmind {
691 1.1.1.2.4.2 rmind Status = AE_NO_MEMORY;
692 1.1.1.2.4.2 rmind goto Cleanup;
693 1.1.1.2.4.2 rmind }
694 1.1.1.2.4.2 rmind
695 1.1.1.2.4.2 rmind /*
696 1.1.1.2.4.2 rmind * Since we are expecting a Reference operand, it can be either a
697 1.1.1.2.4.2 rmind * NS Node or an internal object.
698 1.1.1.2.4.2 rmind */
699 1.1.1.2.4.2 rmind TempDesc = Operand[0];
700 1.1.1.2.4.2 rmind if (ACPI_GET_DESCRIPTOR_TYPE (TempDesc) == ACPI_DESC_TYPE_OPERAND)
701 1.1.1.2.4.2 rmind {
702 1.1.1.2.4.2 rmind /* Internal reference object - prevent deletion */
703 1.1.1.2.4.2 rmind
704 1.1.1.2.4.2 rmind AcpiUtAddReference (TempDesc);
705 1.1.1.2.4.2 rmind }
706 1.1.1.2.4.2 rmind
707 1.1.1.2.4.2 rmind /*
708 1.1.1.2.4.2 rmind * Convert the Reference operand to an Integer (This removes a
709 1.1.1.2.4.2 rmind * reference on the Operand[0] object)
710 1.1.1.2.4.2 rmind *
711 1.1.1.2.4.2 rmind * NOTE: We use LNOT_OP here in order to force resolution of the
712 1.1.1.2.4.2 rmind * reference operand to an actual integer.
713 1.1.1.2.4.2 rmind */
714 1.1.1.2.4.2 rmind Status = AcpiExResolveOperands (AML_LNOT_OP, &TempDesc, WalkState);
715 1.1.1.2.4.2 rmind if (ACPI_FAILURE (Status))
716 1.1.1.2.4.2 rmind {
717 1.1.1.2.4.2 rmind ACPI_EXCEPTION ((AE_INFO, Status,
718 1.1.1.2.4.2 rmind "While resolving operands for [%s]",
719 1.1.1.2.4.2 rmind AcpiPsGetOpcodeName (WalkState->Opcode)));
720 1.1.1.2.4.2 rmind
721 1.1.1.2.4.2 rmind goto Cleanup;
722 1.1.1.2.4.2 rmind }
723 1.1.1.2.4.2 rmind
724 1.1.1.2.4.2 rmind /*
725 1.1.1.2.4.2 rmind * TempDesc is now guaranteed to be an Integer object --
726 1.1.1.2.4.2 rmind * Perform the actual increment or decrement
727 1.1.1.2.4.2 rmind */
728 1.1.1.2.4.2 rmind if (WalkState->Opcode == AML_INCREMENT_OP)
729 1.1.1.2.4.2 rmind {
730 1.1.1.2.4.2 rmind ReturnDesc->Integer.Value = TempDesc->Integer.Value +1;
731 1.1.1.2.4.2 rmind }
732 1.1.1.2.4.2 rmind else
733 1.1.1.2.4.2 rmind {
734 1.1.1.2.4.2 rmind ReturnDesc->Integer.Value = TempDesc->Integer.Value -1;
735 1.1.1.2.4.2 rmind }
736 1.1.1.2.4.2 rmind
737 1.1.1.2.4.2 rmind /* Finished with this Integer object */
738 1.1.1.2.4.2 rmind
739 1.1.1.2.4.2 rmind AcpiUtRemoveReference (TempDesc);
740 1.1.1.2.4.2 rmind
741 1.1.1.2.4.2 rmind /*
742 1.1.1.2.4.2 rmind * Store the result back (indirectly) through the original
743 1.1.1.2.4.2 rmind * Reference object
744 1.1.1.2.4.2 rmind */
745 1.1.1.2.4.2 rmind Status = AcpiExStore (ReturnDesc, Operand[0], WalkState);
746 1.1.1.2.4.2 rmind break;
747 1.1.1.2.4.2 rmind
748 1.1.1.2.4.2 rmind
749 1.1.1.2.4.2 rmind case AML_TYPE_OP: /* ObjectType (SourceObject) */
750 1.1.1.2.4.2 rmind
751 1.1.1.2.4.2 rmind /*
752 1.1.1.2.4.2 rmind * Note: The operand is not resolved at this point because we want to
753 1.1.1.2.4.2 rmind * get the associated object, not its value. For example, we don't
754 1.1.1.2.4.2 rmind * want to resolve a FieldUnit to its value, we want the actual
755 1.1.1.2.4.2 rmind * FieldUnit object.
756 1.1.1.2.4.2 rmind */
757 1.1.1.2.4.2 rmind
758 1.1.1.2.4.2 rmind /* Get the type of the base object */
759 1.1.1.2.4.2 rmind
760 1.1.1.2.4.2 rmind Status = AcpiExResolveMultiple (WalkState, Operand[0], &Type, NULL);
761 1.1.1.2.4.2 rmind if (ACPI_FAILURE (Status))
762 1.1.1.2.4.2 rmind {
763 1.1.1.2.4.2 rmind goto Cleanup;
764 1.1.1.2.4.2 rmind }
765 1.1.1.2.4.2 rmind
766 1.1.1.2.4.2 rmind /* Allocate a descriptor to hold the type. */
767 1.1.1.2.4.2 rmind
768 1.1.1.2.4.2 rmind ReturnDesc = AcpiUtCreateIntegerObject ((UINT64) Type);
769 1.1.1.2.4.2 rmind if (!ReturnDesc)
770 1.1.1.2.4.2 rmind {
771 1.1.1.2.4.2 rmind Status = AE_NO_MEMORY;
772 1.1.1.2.4.2 rmind goto Cleanup;
773 1.1.1.2.4.2 rmind }
774 1.1.1.2.4.2 rmind break;
775 1.1.1.2.4.2 rmind
776 1.1.1.2.4.2 rmind
777 1.1.1.2.4.2 rmind case AML_SIZE_OF_OP: /* SizeOf (SourceObject) */
778 1.1.1.2.4.2 rmind
779 1.1.1.2.4.2 rmind /*
780 1.1.1.2.4.2 rmind * Note: The operand is not resolved at this point because we want to
781 1.1.1.2.4.2 rmind * get the associated object, not its value.
782 1.1.1.2.4.2 rmind */
783 1.1.1.2.4.2 rmind
784 1.1.1.2.4.2 rmind /* Get the base object */
785 1.1.1.2.4.2 rmind
786 1.1.1.2.4.2 rmind Status = AcpiExResolveMultiple (WalkState,
787 1.1.1.2.4.2 rmind Operand[0], &Type, &TempDesc);
788 1.1.1.2.4.2 rmind if (ACPI_FAILURE (Status))
789 1.1.1.2.4.2 rmind {
790 1.1.1.2.4.2 rmind goto Cleanup;
791 1.1.1.2.4.2 rmind }
792 1.1.1.2.4.2 rmind
793 1.1.1.2.4.2 rmind /*
794 1.1.1.2.4.2 rmind * The type of the base object must be integer, buffer, string, or
795 1.1.1.2.4.2 rmind * package. All others are not supported.
796 1.1.1.2.4.2 rmind *
797 1.1.1.2.4.2 rmind * NOTE: Integer is not specifically supported by the ACPI spec,
798 1.1.1.2.4.2 rmind * but is supported implicitly via implicit operand conversion.
799 1.1.1.2.4.2 rmind * rather than bother with conversion, we just use the byte width
800 1.1.1.2.4.2 rmind * global (4 or 8 bytes).
801 1.1.1.2.4.2 rmind */
802 1.1.1.2.4.2 rmind switch (Type)
803 1.1.1.2.4.2 rmind {
804 1.1.1.2.4.2 rmind case ACPI_TYPE_INTEGER:
805 1.1.1.2.4.2 rmind Value = AcpiGbl_IntegerByteWidth;
806 1.1.1.2.4.2 rmind break;
807 1.1.1.2.4.2 rmind
808 1.1.1.2.4.2 rmind case ACPI_TYPE_STRING:
809 1.1.1.2.4.2 rmind Value = TempDesc->String.Length;
810 1.1.1.2.4.2 rmind break;
811 1.1.1.2.4.2 rmind
812 1.1.1.2.4.2 rmind case ACPI_TYPE_BUFFER:
813 1.1.1.2.4.2 rmind
814 1.1.1.2.4.2 rmind /* Buffer arguments may not be evaluated at this point */
815 1.1.1.2.4.2 rmind
816 1.1.1.2.4.2 rmind Status = AcpiDsGetBufferArguments (TempDesc);
817 1.1.1.2.4.2 rmind Value = TempDesc->Buffer.Length;
818 1.1.1.2.4.2 rmind break;
819 1.1.1.2.4.2 rmind
820 1.1.1.2.4.2 rmind case ACPI_TYPE_PACKAGE:
821 1.1.1.2.4.2 rmind
822 1.1.1.2.4.2 rmind /* Package arguments may not be evaluated at this point */
823 1.1.1.2.4.2 rmind
824 1.1.1.2.4.2 rmind Status = AcpiDsGetPackageArguments (TempDesc);
825 1.1.1.2.4.2 rmind Value = TempDesc->Package.Count;
826 1.1.1.2.4.2 rmind break;
827 1.1.1.2.4.2 rmind
828 1.1.1.2.4.2 rmind default:
829 1.1.1.2.4.2 rmind ACPI_ERROR ((AE_INFO,
830 1.1.1.2.4.2 rmind "Operand must be Buffer/Integer/String/Package - found type %s",
831 1.1.1.2.4.2 rmind AcpiUtGetTypeName (Type)));
832 1.1.1.2.4.2 rmind Status = AE_AML_OPERAND_TYPE;
833 1.1.1.2.4.2 rmind goto Cleanup;
834 1.1.1.2.4.2 rmind }
835 1.1.1.2.4.2 rmind
836 1.1.1.2.4.2 rmind if (ACPI_FAILURE (Status))
837 1.1.1.2.4.2 rmind {
838 1.1.1.2.4.2 rmind goto Cleanup;
839 1.1.1.2.4.2 rmind }
840 1.1.1.2.4.2 rmind
841 1.1.1.2.4.2 rmind /*
842 1.1.1.2.4.2 rmind * Now that we have the size of the object, create a result
843 1.1.1.2.4.2 rmind * object to hold the value
844 1.1.1.2.4.2 rmind */
845 1.1.1.2.4.2 rmind ReturnDesc = AcpiUtCreateIntegerObject (Value);
846 1.1.1.2.4.2 rmind if (!ReturnDesc)
847 1.1.1.2.4.2 rmind {
848 1.1.1.2.4.2 rmind Status = AE_NO_MEMORY;
849 1.1.1.2.4.2 rmind goto Cleanup;
850 1.1.1.2.4.2 rmind }
851 1.1.1.2.4.2 rmind break;
852 1.1.1.2.4.2 rmind
853 1.1.1.2.4.2 rmind
854 1.1.1.2.4.2 rmind case AML_REF_OF_OP: /* RefOf (SourceObject) */
855 1.1.1.2.4.2 rmind
856 1.1.1.2.4.2 rmind Status = AcpiExGetObjectReference (Operand[0], &ReturnDesc, WalkState);
857 1.1.1.2.4.2 rmind if (ACPI_FAILURE (Status))
858 1.1.1.2.4.2 rmind {
859 1.1.1.2.4.2 rmind goto Cleanup;
860 1.1.1.2.4.2 rmind }
861 1.1.1.2.4.2 rmind break;
862 1.1.1.2.4.2 rmind
863 1.1.1.2.4.2 rmind
864 1.1.1.2.4.2 rmind case AML_DEREF_OF_OP: /* DerefOf (ObjReference | String) */
865 1.1.1.2.4.2 rmind
866 1.1.1.2.4.2 rmind /* Check for a method local or argument, or standalone String */
867 1.1.1.2.4.2 rmind
868 1.1.1.2.4.2 rmind if (ACPI_GET_DESCRIPTOR_TYPE (Operand[0]) == ACPI_DESC_TYPE_NAMED)
869 1.1.1.2.4.2 rmind {
870 1.1.1.2.4.2 rmind TempDesc = AcpiNsGetAttachedObject (
871 1.1.1.2.4.2 rmind (ACPI_NAMESPACE_NODE *) Operand[0]);
872 1.1.1.2.4.2 rmind if (TempDesc &&
873 1.1.1.2.4.2 rmind ((TempDesc->Common.Type == ACPI_TYPE_STRING) ||
874 1.1.1.2.4.2 rmind (TempDesc->Common.Type == ACPI_TYPE_LOCAL_REFERENCE)))
875 1.1.1.2.4.2 rmind {
876 1.1.1.2.4.2 rmind Operand[0] = TempDesc;
877 1.1.1.2.4.2 rmind AcpiUtAddReference (TempDesc);
878 1.1.1.2.4.2 rmind }
879 1.1.1.2.4.2 rmind else
880 1.1.1.2.4.2 rmind {
881 1.1.1.2.4.2 rmind Status = AE_AML_OPERAND_TYPE;
882 1.1.1.2.4.2 rmind goto Cleanup;
883 1.1.1.2.4.2 rmind }
884 1.1.1.2.4.2 rmind }
885 1.1.1.2.4.2 rmind else
886 1.1.1.2.4.2 rmind {
887 1.1.1.2.4.2 rmind switch ((Operand[0])->Common.Type)
888 1.1.1.2.4.2 rmind {
889 1.1.1.2.4.2 rmind case ACPI_TYPE_LOCAL_REFERENCE:
890 1.1.1.2.4.2 rmind /*
891 1.1.1.2.4.2 rmind * This is a DerefOf (LocalX | ArgX)
892 1.1.1.2.4.2 rmind *
893 1.1.1.2.4.2 rmind * Must resolve/dereference the local/arg reference first
894 1.1.1.2.4.2 rmind */
895 1.1.1.2.4.2 rmind switch (Operand[0]->Reference.Class)
896 1.1.1.2.4.2 rmind {
897 1.1.1.2.4.2 rmind case ACPI_REFCLASS_LOCAL:
898 1.1.1.2.4.2 rmind case ACPI_REFCLASS_ARG:
899 1.1.1.2.4.2 rmind
900 1.1.1.2.4.2 rmind /* Set Operand[0] to the value of the local/arg */
901 1.1.1.2.4.2 rmind
902 1.1.1.2.4.2 rmind Status = AcpiDsMethodDataGetValue (
903 1.1.1.2.4.2 rmind Operand[0]->Reference.Class,
904 1.1.1.2.4.2 rmind Operand[0]->Reference.Value,
905 1.1.1.2.4.2 rmind WalkState, &TempDesc);
906 1.1.1.2.4.2 rmind if (ACPI_FAILURE (Status))
907 1.1.1.2.4.2 rmind {
908 1.1.1.2.4.2 rmind goto Cleanup;
909 1.1.1.2.4.2 rmind }
910 1.1.1.2.4.2 rmind
911 1.1.1.2.4.2 rmind /*
912 1.1.1.2.4.2 rmind * Delete our reference to the input object and
913 1.1.1.2.4.2 rmind * point to the object just retrieved
914 1.1.1.2.4.2 rmind */
915 1.1.1.2.4.2 rmind AcpiUtRemoveReference (Operand[0]);
916 1.1.1.2.4.2 rmind Operand[0] = TempDesc;
917 1.1.1.2.4.2 rmind break;
918 1.1.1.2.4.2 rmind
919 1.1.1.2.4.2 rmind case ACPI_REFCLASS_REFOF:
920 1.1.1.2.4.2 rmind
921 1.1.1.2.4.2 rmind /* Get the object to which the reference refers */
922 1.1.1.2.4.2 rmind
923 1.1.1.2.4.2 rmind TempDesc = Operand[0]->Reference.Object;
924 1.1.1.2.4.2 rmind AcpiUtRemoveReference (Operand[0]);
925 1.1.1.2.4.2 rmind Operand[0] = TempDesc;
926 1.1.1.2.4.2 rmind break;
927 1.1.1.2.4.2 rmind
928 1.1.1.2.4.2 rmind default:
929 1.1.1.2.4.2 rmind
930 1.1.1.2.4.2 rmind /* Must be an Index op - handled below */
931 1.1.1.2.4.2 rmind break;
932 1.1.1.2.4.2 rmind }
933 1.1.1.2.4.2 rmind break;
934 1.1.1.2.4.2 rmind
935 1.1.1.2.4.2 rmind case ACPI_TYPE_STRING:
936 1.1.1.2.4.2 rmind break;
937 1.1.1.2.4.2 rmind
938 1.1.1.2.4.2 rmind default:
939 1.1.1.2.4.2 rmind Status = AE_AML_OPERAND_TYPE;
940 1.1.1.2.4.2 rmind goto Cleanup;
941 1.1.1.2.4.2 rmind }
942 1.1.1.2.4.2 rmind }
943 1.1.1.2.4.2 rmind
944 1.1.1.2.4.2 rmind if (ACPI_GET_DESCRIPTOR_TYPE (Operand[0]) != ACPI_DESC_TYPE_NAMED)
945 1.1.1.2.4.2 rmind {
946 1.1.1.2.4.2 rmind if ((Operand[0])->Common.Type == ACPI_TYPE_STRING)
947 1.1.1.2.4.2 rmind {
948 1.1.1.2.4.2 rmind /*
949 1.1.1.2.4.2 rmind * This is a DerefOf (String). The string is a reference
950 1.1.1.2.4.2 rmind * to a named ACPI object.
951 1.1.1.2.4.2 rmind *
952 1.1.1.2.4.2 rmind * 1) Find the owning Node
953 1.1.1.2.4.2 rmind * 2) Dereference the node to an actual object. Could be a
954 1.1.1.2.4.2 rmind * Field, so we need to resolve the node to a value.
955 1.1.1.2.4.2 rmind */
956 1.1.1.2.4.2 rmind Status = AcpiNsGetNode (WalkState->ScopeInfo->Scope.Node,
957 1.1.1.2.4.2 rmind Operand[0]->String.Pointer,
958 1.1.1.2.4.2 rmind ACPI_NS_SEARCH_PARENT,
959 1.1.1.2.4.2 rmind ACPI_CAST_INDIRECT_PTR (
960 1.1.1.2.4.2 rmind ACPI_NAMESPACE_NODE, &ReturnDesc));
961 1.1.1.2.4.2 rmind if (ACPI_FAILURE (Status))
962 1.1.1.2.4.2 rmind {
963 1.1.1.2.4.2 rmind goto Cleanup;
964 1.1.1.2.4.2 rmind }
965 1.1.1.2.4.2 rmind
966 1.1.1.2.4.2 rmind Status = AcpiExResolveNodeToValue (
967 1.1.1.2.4.2 rmind ACPI_CAST_INDIRECT_PTR (
968 1.1.1.2.4.2 rmind ACPI_NAMESPACE_NODE, &ReturnDesc),
969 1.1.1.2.4.2 rmind WalkState);
970 1.1.1.2.4.2 rmind goto Cleanup;
971 1.1.1.2.4.2 rmind }
972 1.1.1.2.4.2 rmind }
973 1.1.1.2.4.2 rmind
974 1.1.1.2.4.2 rmind /* Operand[0] may have changed from the code above */
975 1.1.1.2.4.2 rmind
976 1.1.1.2.4.2 rmind if (ACPI_GET_DESCRIPTOR_TYPE (Operand[0]) == ACPI_DESC_TYPE_NAMED)
977 1.1.1.2.4.2 rmind {
978 1.1.1.2.4.2 rmind /*
979 1.1.1.2.4.2 rmind * This is a DerefOf (ObjectReference)
980 1.1.1.2.4.2 rmind * Get the actual object from the Node (This is the dereference).
981 1.1.1.2.4.2 rmind * This case may only happen when a LocalX or ArgX is
982 1.1.1.2.4.2 rmind * dereferenced above.
983 1.1.1.2.4.2 rmind */
984 1.1.1.2.4.2 rmind ReturnDesc = AcpiNsGetAttachedObject (
985 1.1.1.2.4.2 rmind (ACPI_NAMESPACE_NODE *) Operand[0]);
986 1.1.1.2.4.2 rmind AcpiUtAddReference (ReturnDesc);
987 1.1.1.2.4.2 rmind }
988 1.1.1.2.4.2 rmind else
989 1.1.1.2.4.2 rmind {
990 1.1.1.2.4.2 rmind /*
991 1.1.1.2.4.2 rmind * This must be a reference object produced by either the
992 1.1.1.2.4.2 rmind * Index() or RefOf() operator
993 1.1.1.2.4.2 rmind */
994 1.1.1.2.4.2 rmind switch (Operand[0]->Reference.Class)
995 1.1.1.2.4.2 rmind {
996 1.1.1.2.4.2 rmind case ACPI_REFCLASS_INDEX:
997 1.1.1.2.4.2 rmind
998 1.1.1.2.4.2 rmind /*
999 1.1.1.2.4.2 rmind * The target type for the Index operator must be
1000 1.1.1.2.4.2 rmind * either a Buffer or a Package
1001 1.1.1.2.4.2 rmind */
1002 1.1.1.2.4.2 rmind switch (Operand[0]->Reference.TargetType)
1003 1.1.1.2.4.2 rmind {
1004 1.1.1.2.4.2 rmind case ACPI_TYPE_BUFFER_FIELD:
1005 1.1.1.2.4.2 rmind
1006 1.1.1.2.4.2 rmind TempDesc = Operand[0]->Reference.Object;
1007 1.1.1.2.4.2 rmind
1008 1.1.1.2.4.2 rmind /*
1009 1.1.1.2.4.2 rmind * Create a new object that contains one element of the
1010 1.1.1.2.4.2 rmind * buffer -- the element pointed to by the index.
1011 1.1.1.2.4.2 rmind *
1012 1.1.1.2.4.2 rmind * NOTE: index into a buffer is NOT a pointer to a
1013 1.1.1.2.4.2 rmind * sub-buffer of the main buffer, it is only a pointer to a
1014 1.1.1.2.4.2 rmind * single element (byte) of the buffer!
1015 1.1.1.2.4.2 rmind *
1016 1.1.1.2.4.2 rmind * Since we are returning the value of the buffer at the
1017 1.1.1.2.4.2 rmind * indexed location, we don't need to add an additional
1018 1.1.1.2.4.2 rmind * reference to the buffer itself.
1019 1.1.1.2.4.2 rmind */
1020 1.1.1.2.4.2 rmind ReturnDesc = AcpiUtCreateIntegerObject ((UINT64)
1021 1.1.1.2.4.2 rmind TempDesc->Buffer.Pointer[Operand[0]->Reference.Value]);
1022 1.1.1.2.4.2 rmind if (!ReturnDesc)
1023 1.1.1.2.4.2 rmind {
1024 1.1.1.2.4.2 rmind Status = AE_NO_MEMORY;
1025 1.1.1.2.4.2 rmind goto Cleanup;
1026 1.1.1.2.4.2 rmind }
1027 1.1.1.2.4.2 rmind break;
1028 1.1.1.2.4.2 rmind
1029 1.1.1.2.4.2 rmind
1030 1.1.1.2.4.2 rmind case ACPI_TYPE_PACKAGE:
1031 1.1.1.2.4.2 rmind
1032 1.1.1.2.4.2 rmind /*
1033 1.1.1.2.4.2 rmind * Return the referenced element of the package. We must
1034 1.1.1.2.4.2 rmind * add another reference to the referenced object, however.
1035 1.1.1.2.4.2 rmind */
1036 1.1.1.2.4.2 rmind ReturnDesc = *(Operand[0]->Reference.Where);
1037 1.1.1.2.4.2 rmind if (ReturnDesc)
1038 1.1.1.2.4.2 rmind {
1039 1.1.1.2.4.2 rmind AcpiUtAddReference (ReturnDesc);
1040 1.1.1.2.4.2 rmind }
1041 1.1.1.2.4.2 rmind break;
1042 1.1.1.2.4.2 rmind
1043 1.1.1.2.4.2 rmind
1044 1.1.1.2.4.2 rmind default:
1045 1.1.1.2.4.2 rmind
1046 1.1.1.2.4.2 rmind ACPI_ERROR ((AE_INFO,
1047 1.1.1.2.4.2 rmind "Unknown Index TargetType 0x%X in reference object %p",
1048 1.1.1.2.4.2 rmind Operand[0]->Reference.TargetType, Operand[0]));
1049 1.1.1.2.4.2 rmind Status = AE_AML_OPERAND_TYPE;
1050 1.1.1.2.4.2 rmind goto Cleanup;
1051 1.1.1.2.4.2 rmind }
1052 1.1.1.2.4.2 rmind break;
1053 1.1.1.2.4.2 rmind
1054 1.1.1.2.4.2 rmind
1055 1.1.1.2.4.2 rmind case ACPI_REFCLASS_REFOF:
1056 1.1.1.2.4.2 rmind
1057 1.1.1.2.4.2 rmind ReturnDesc = Operand[0]->Reference.Object;
1058 1.1.1.2.4.2 rmind
1059 1.1.1.2.4.2 rmind if (ACPI_GET_DESCRIPTOR_TYPE (ReturnDesc) ==
1060 1.1.1.2.4.2 rmind ACPI_DESC_TYPE_NAMED)
1061 1.1.1.2.4.2 rmind {
1062 1.1.1.2.4.2 rmind ReturnDesc = AcpiNsGetAttachedObject (
1063 1.1.1.2.4.2 rmind (ACPI_NAMESPACE_NODE *) ReturnDesc);
1064 1.1.1.2.4.2 rmind }
1065 1.1.1.2.4.2 rmind
1066 1.1.1.2.4.2 rmind /* Add another reference to the object! */
1067 1.1.1.2.4.2 rmind
1068 1.1.1.2.4.2 rmind AcpiUtAddReference (ReturnDesc);
1069 1.1.1.2.4.2 rmind break;
1070 1.1.1.2.4.2 rmind
1071 1.1.1.2.4.2 rmind
1072 1.1.1.2.4.2 rmind default:
1073 1.1.1.2.4.2 rmind ACPI_ERROR ((AE_INFO,
1074 1.1.1.2.4.2 rmind "Unknown class in reference(%p) - 0x%2.2X",
1075 1.1.1.2.4.2 rmind Operand[0], Operand[0]->Reference.Class));
1076 1.1.1.2.4.2 rmind
1077 1.1.1.2.4.2 rmind Status = AE_TYPE;
1078 1.1.1.2.4.2 rmind goto Cleanup;
1079 1.1.1.2.4.2 rmind }
1080 1.1.1.2.4.2 rmind }
1081 1.1.1.2.4.2 rmind break;
1082 1.1.1.2.4.2 rmind
1083 1.1.1.2.4.2 rmind
1084 1.1.1.2.4.2 rmind default:
1085 1.1.1.2.4.2 rmind
1086 1.1.1.2.4.2 rmind ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
1087 1.1.1.2.4.2 rmind WalkState->Opcode));
1088 1.1.1.2.4.2 rmind Status = AE_AML_BAD_OPCODE;
1089 1.1.1.2.4.2 rmind goto Cleanup;
1090 1.1.1.2.4.2 rmind }
1091 1.1.1.2.4.2 rmind
1092 1.1.1.2.4.2 rmind
1093 1.1.1.2.4.2 rmind Cleanup:
1094 1.1.1.2.4.2 rmind
1095 1.1.1.2.4.2 rmind /* Delete return object on error */
1096 1.1.1.2.4.2 rmind
1097 1.1.1.2.4.2 rmind if (ACPI_FAILURE (Status))
1098 1.1.1.2.4.2 rmind {
1099 1.1.1.2.4.2 rmind AcpiUtRemoveReference (ReturnDesc);
1100 1.1.1.2.4.2 rmind }
1101 1.1.1.2.4.2 rmind
1102 1.1.1.2.4.2 rmind /* Save return object on success */
1103 1.1.1.2.4.2 rmind
1104 1.1.1.2.4.2 rmind else
1105 1.1.1.2.4.2 rmind {
1106 1.1.1.2.4.2 rmind WalkState->ResultObj = ReturnDesc;
1107 1.1.1.2.4.2 rmind }
1108 1.1.1.2.4.2 rmind
1109 1.1.1.2.4.2 rmind return_ACPI_STATUS (Status);
1110 1.1.1.2.4.2 rmind }
1111 1.1.1.2.4.2 rmind
1112