Deleted Added
full compact
exoparg2.c (114237) exoparg2.c (126372)
1/******************************************************************************
2 *
3 * Module Name: exoparg2 - AML execution - opcodes with 2 arguments
1/******************************************************************************
2 *
3 * Module Name: exoparg2 - AML execution - opcodes with 2 arguments
4 * $Revision: 117 $
4 * $Revision: 119 $
5 *
6 *****************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
5 *
6 *****************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999 - 2003, Intel Corp.
12 * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
13 * All rights reserved.
14 *
15 * 2. License
16 *
17 * 2.1. This is your license from Intel Corp. under its intellectual property
18 * rights. You may have additional license terms from the party that provided
19 * you this software, covering your right to use that party's intellectual
20 * property rights.
21 *
22 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23 * copy of the source code appearing in this file ("Covered Code") an
24 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25 * base code distributed originally by Intel ("Original Intel Code") to copy,
26 * make derivatives, distribute, use and display any portion of the Covered
27 * Code in any form, with the right to sublicense such rights; and
28 *
29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30 * license (with the right to sublicense), under only those claims of Intel
31 * patents that are infringed by the Original Intel Code, to make, use, sell,
32 * offer to sell, and import the Covered Code and derivative works thereof
33 * solely to the minimum extent necessary to exercise the above copyright
34 * license, and in no event shall the patent license extend to any additions
35 * to or modifications of the Original Intel Code. No other license or right
36 * is granted directly or by implication, estoppel or otherwise;
37 *
38 * The above copyright and patent license is granted only if the following
39 * conditions are met:
40 *
41 * 3. Conditions
42 *
43 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44 * Redistribution of source code of any substantial portion of the Covered
45 * Code or modification with rights to further distribute source must include
46 * the above Copyright Notice, the above License, this list of Conditions,
47 * and the following Disclaimer and Export Compliance provision. In addition,
48 * Licensee must cause all Covered Code to which Licensee contributes to
49 * contain a file documenting the changes Licensee made to create that Covered
50 * Code and the date of any change. Licensee must include in that file the
51 * documentation of any changes made by any predecessor Licensee. Licensee
52 * must include a prominent statement that the modification is derived,
53 * directly or indirectly, from Original Intel Code.
54 *
55 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56 * Redistribution of source code of any substantial portion of the Covered
57 * Code or modification without rights to further distribute source must
58 * include the following Disclaimer and Export Compliance provision in the
59 * documentation and/or other materials provided with distribution. In
60 * addition, Licensee may not authorize further sublicense of source of any
61 * portion of the Covered Code, and must include terms to the effect that the
62 * license from Licensee to its licensee is limited to the intellectual
63 * property embodied in the software Licensee provides to its licensee, and
64 * not to intellectual property embodied in modifications its licensee may
65 * make.
66 *
67 * 3.3. Redistribution of Executable. Redistribution in executable form of any
68 * substantial portion of the Covered Code or modification must reproduce the
69 * above Copyright Notice, and the following Disclaimer and Export Compliance
70 * provision in the documentation and/or other materials provided with the
71 * distribution.
72 *
73 * 3.4. Intel retains all right, title, and interest in and to the Original
74 * Intel Code.
75 *
76 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77 * Intel shall be used in advertising or otherwise to promote the sale, use or
78 * other dealings in products derived from or relating to the Covered Code
79 * without prior written authorization from Intel.
80 *
81 * 4. Disclaimer and Export Compliance
82 *
83 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
86 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
87 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89 * PARTICULAR PURPOSE.
90 *
91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98 * LIMITED REMEDY.
99 *
100 * 4.3. Licensee shall not export, either directly or indirectly, any of this
101 * software or system incorporating such software without first obtaining any
102 * required license or other approval from the U. S. Department of Commerce or
103 * any other agency or department of the United States Government. In the
104 * event Licensee exports any such software from the United States or
105 * re-exports any such software from a foreign destination, Licensee shall
106 * ensure that the distribution and export/re-export of the software is in
107 * compliance with all laws, regulations, orders, or other restrictions of the
108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109 * any of its subsidiaries will export/re-export any technical data, process,
110 * software, or service, directly or indirectly, to any country for which the
111 * United States government or any agency thereof requires an export license,
112 * other governmental approval, or letter of assurance, without first obtaining
113 * such license, approval or letter.
114 *
115 *****************************************************************************/
116
117
118#define __EXOPARG2_C__
119
120#include "acpi.h"
121#include "acparser.h"
122#include "acinterp.h"
123#include "acevents.h"
124#include "amlcode.h"
125
126
127#define _COMPONENT ACPI_EXECUTER
128 ACPI_MODULE_NAME ("exoparg2")
129
130
131/*!
132 * Naming convention for AML interpreter execution routines.
133 *
134 * The routines that begin execution of AML opcodes are named with a common
135 * convention based upon the number of arguments, the number of target operands,
136 * and whether or not a value is returned:
137 *
138 * AcpiExOpcode_xA_yT_zR
139 *
140 * Where:
141 *
142 * xA - ARGUMENTS: The number of arguments (input operands) that are
143 * required for this opcode type (1 through 6 args).
144 * yT - TARGETS: The number of targets (output operands) that are required
145 * for this opcode type (0, 1, or 2 targets).
146 * zR - RETURN VALUE: Indicates whether this opcode type returns a value
147 * as the function return (0 or 1).
148 *
149 * The AcpiExOpcode* functions are called via the Dispatcher component with
150 * fully resolved operands.
151!*/
152
153
154/*******************************************************************************
155 *
156 * FUNCTION: AcpiExOpcode_2A_0T_0R
157 *
158 * PARAMETERS: WalkState - Current walk state
159 *
160 * RETURN: Status
161 *
162 * DESCRIPTION: Execute opcode with two arguments, no target, and no return
163 * value.
164 *
165 * ALLOCATION: Deletes both operands
166 *
167 ******************************************************************************/
168
169ACPI_STATUS
170AcpiExOpcode_2A_0T_0R (
171 ACPI_WALK_STATE *WalkState)
172{
173 ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
174 ACPI_NAMESPACE_NODE *Node;
175 ACPI_STATUS Status = AE_OK;
176
177
178 ACPI_FUNCTION_TRACE_STR ("ExOpcode_2A_0T_0R",
179 AcpiPsGetOpcodeName (WalkState->Opcode));
180
181
182 /* Examine the opcode */
183
184 switch (WalkState->Opcode)
185 {
186 case AML_NOTIFY_OP: /* Notify (NotifyObject, NotifyValue) */
187
188 /* The first operand is a namespace node */
189
190 Node = (ACPI_NAMESPACE_NODE *) Operand[0];
191
192 /* Notifies allowed on this object? */
193
194 if (!AcpiEvIsNotifyObject (Node))
195 {
196 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unexpected notify object type [%s]\n",
197 AcpiUtGetTypeName (Node->Type)));
198
199 Status = AE_AML_OPERAND_TYPE;
200 break;
201 }
202
203 /*
204 * Dispatch the notify to the appropriate handler
205 * NOTE: the request is queued for execution after this method
206 * completes. The notify handlers are NOT invoked synchronously
207 * from this thread -- because handlers may in turn run other
208 * control methods.
209 */
210 Status = AcpiEvQueueNotifyRequest (Node,
211 (UINT32) Operand[1]->Integer.Value);
212 break;
213
214
215 default:
216
217 ACPI_REPORT_ERROR (("AcpiExOpcode_2A_0T_0R: Unknown opcode %X\n",
218 WalkState->Opcode));
219 Status = AE_AML_BAD_OPCODE;
220 }
221
222 return_ACPI_STATUS (Status);
223}
224
225
226/*******************************************************************************
227 *
228 * FUNCTION: AcpiExOpcode_2A_2T_1R
229 *
230 * PARAMETERS: WalkState - Current walk state
231 *
232 * RETURN: Status
233 *
234 * DESCRIPTION: Execute a dyadic operator (2 operands) with 2 output targets
235 * and one implicit return value.
236 *
237 ******************************************************************************/
238
239ACPI_STATUS
240AcpiExOpcode_2A_2T_1R (
241 ACPI_WALK_STATE *WalkState)
242{
243 ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
244 ACPI_OPERAND_OBJECT *ReturnDesc1 = NULL;
245 ACPI_OPERAND_OBJECT *ReturnDesc2 = NULL;
246 ACPI_STATUS Status;
247
248
249 ACPI_FUNCTION_TRACE_STR ("ExOpcode_2A_2T_1R", AcpiPsGetOpcodeName (WalkState->Opcode));
250
251
252 /*
253 * Execute the opcode
254 */
255 switch (WalkState->Opcode)
256 {
257 case AML_DIVIDE_OP: /* Divide (Dividend, Divisor, RemainderResult QuotientResult) */
258
259 ReturnDesc1 = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
260 if (!ReturnDesc1)
261 {
262 Status = AE_NO_MEMORY;
263 goto Cleanup;
264 }
265
266 ReturnDesc2 = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
267 if (!ReturnDesc2)
268 {
269 Status = AE_NO_MEMORY;
270 goto Cleanup;
271 }
272
273 /* Quotient to ReturnDesc1, remainder to ReturnDesc2 */
274
275 Status = AcpiUtDivide (&Operand[0]->Integer.Value, &Operand[1]->Integer.Value,
276 &ReturnDesc1->Integer.Value, &ReturnDesc2->Integer.Value);
277 if (ACPI_FAILURE (Status))
278 {
279 goto Cleanup;
280 }
281 break;
282
283
284 default:
285
286 ACPI_REPORT_ERROR (("AcpiExOpcode_2A_2T_1R: Unknown opcode %X\n",
287 WalkState->Opcode));
288 Status = AE_AML_BAD_OPCODE;
289 goto Cleanup;
290 }
291
292
293 /* Store the results to the target reference operands */
294
295 Status = AcpiExStore (ReturnDesc2, Operand[2], WalkState);
296 if (ACPI_FAILURE (Status))
297 {
298 goto Cleanup;
299 }
300
301 Status = AcpiExStore (ReturnDesc1, Operand[3], WalkState);
302 if (ACPI_FAILURE (Status))
303 {
304 goto Cleanup;
305 }
306
307 /* Return the remainder */
308
309 WalkState->ResultObj = ReturnDesc1;
310
311
312Cleanup:
313 /*
314 * Since the remainder is not returned indirectly, remove a reference to
315 * it. Only the quotient is returned indirectly.
316 */
317 AcpiUtRemoveReference (ReturnDesc2);
318
319 if (ACPI_FAILURE (Status))
320 {
321 /* Delete the return object */
322
323 AcpiUtRemoveReference (ReturnDesc1);
324 }
325
326 return_ACPI_STATUS (Status);
327}
328
329
330/*******************************************************************************
331 *
332 * FUNCTION: AcpiExOpcode_2A_1T_1R
333 *
334 * PARAMETERS: WalkState - Current walk state
335 *
336 * RETURN: Status
337 *
338 * DESCRIPTION: Execute opcode with two arguments, one target, and a return
339 * value.
340 *
341 ******************************************************************************/
342
343ACPI_STATUS
344AcpiExOpcode_2A_1T_1R (
345 ACPI_WALK_STATE *WalkState)
346{
347 ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
348 ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
349 ACPI_OPERAND_OBJECT *TempDesc = NULL;
350 UINT32 Index;
351 ACPI_STATUS Status = AE_OK;
352 ACPI_SIZE Length;
353
354
355 ACPI_FUNCTION_TRACE_STR ("ExOpcode_2A_1T_1R", AcpiPsGetOpcodeName (WalkState->Opcode));
356
357
358 /*
359 * Execute the opcode
360 */
361 if (WalkState->OpInfo->Flags & AML_MATH)
362 {
363 /* All simple math opcodes (add, etc.) */
364
365 ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
366 if (!ReturnDesc)
367 {
368 Status = AE_NO_MEMORY;
369 goto Cleanup;
370 }
371
372 ReturnDesc->Integer.Value = AcpiExDoMathOp (WalkState->Opcode,
373 Operand[0]->Integer.Value,
374 Operand[1]->Integer.Value);
375 goto StoreResultToTarget;
376 }
377
378
379 switch (WalkState->Opcode)
380 {
381 case AML_MOD_OP: /* Mod (Dividend, Divisor, RemainderResult (ACPI 2.0) */
382
383 ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
384 if (!ReturnDesc)
385 {
386 Status = AE_NO_MEMORY;
387 goto Cleanup;
388 }
389
390 /* ReturnDesc will contain the remainder */
391
392 Status = AcpiUtDivide (&Operand[0]->Integer.Value, &Operand[1]->Integer.Value,
393 NULL, &ReturnDesc->Integer.Value);
394 break;
395
396
397 case AML_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */
398
399 /*
400 * Convert the second operand if necessary. The first operand
401 * determines the type of the second operand, (See the Data Types
402 * section of the ACPI specification.) Both object types are
403 * guaranteed to be either Integer/String/Buffer by the operand
404 * resolution mechanism above.
405 */
406 switch (ACPI_GET_OBJECT_TYPE (Operand[0]))
407 {
408 case ACPI_TYPE_INTEGER:
409 Status = AcpiExConvertToInteger (Operand[1], &TempDesc, WalkState);
410 break;
411
412 case ACPI_TYPE_STRING:
413 Status = AcpiExConvertToString (Operand[1], &TempDesc, 16, ACPI_UINT32_MAX, WalkState);
414 break;
415
416 case ACPI_TYPE_BUFFER:
417 Status = AcpiExConvertToBuffer (Operand[1], &TempDesc, WalkState);
418 break;
419
420 default:
13 * All rights reserved.
14 *
15 * 2. License
16 *
17 * 2.1. This is your license from Intel Corp. under its intellectual property
18 * rights. You may have additional license terms from the party that provided
19 * you this software, covering your right to use that party's intellectual
20 * property rights.
21 *
22 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23 * copy of the source code appearing in this file ("Covered Code") an
24 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25 * base code distributed originally by Intel ("Original Intel Code") to copy,
26 * make derivatives, distribute, use and display any portion of the Covered
27 * Code in any form, with the right to sublicense such rights; and
28 *
29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30 * license (with the right to sublicense), under only those claims of Intel
31 * patents that are infringed by the Original Intel Code, to make, use, sell,
32 * offer to sell, and import the Covered Code and derivative works thereof
33 * solely to the minimum extent necessary to exercise the above copyright
34 * license, and in no event shall the patent license extend to any additions
35 * to or modifications of the Original Intel Code. No other license or right
36 * is granted directly or by implication, estoppel or otherwise;
37 *
38 * The above copyright and patent license is granted only if the following
39 * conditions are met:
40 *
41 * 3. Conditions
42 *
43 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44 * Redistribution of source code of any substantial portion of the Covered
45 * Code or modification with rights to further distribute source must include
46 * the above Copyright Notice, the above License, this list of Conditions,
47 * and the following Disclaimer and Export Compliance provision. In addition,
48 * Licensee must cause all Covered Code to which Licensee contributes to
49 * contain a file documenting the changes Licensee made to create that Covered
50 * Code and the date of any change. Licensee must include in that file the
51 * documentation of any changes made by any predecessor Licensee. Licensee
52 * must include a prominent statement that the modification is derived,
53 * directly or indirectly, from Original Intel Code.
54 *
55 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56 * Redistribution of source code of any substantial portion of the Covered
57 * Code or modification without rights to further distribute source must
58 * include the following Disclaimer and Export Compliance provision in the
59 * documentation and/or other materials provided with distribution. In
60 * addition, Licensee may not authorize further sublicense of source of any
61 * portion of the Covered Code, and must include terms to the effect that the
62 * license from Licensee to its licensee is limited to the intellectual
63 * property embodied in the software Licensee provides to its licensee, and
64 * not to intellectual property embodied in modifications its licensee may
65 * make.
66 *
67 * 3.3. Redistribution of Executable. Redistribution in executable form of any
68 * substantial portion of the Covered Code or modification must reproduce the
69 * above Copyright Notice, and the following Disclaimer and Export Compliance
70 * provision in the documentation and/or other materials provided with the
71 * distribution.
72 *
73 * 3.4. Intel retains all right, title, and interest in and to the Original
74 * Intel Code.
75 *
76 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77 * Intel shall be used in advertising or otherwise to promote the sale, use or
78 * other dealings in products derived from or relating to the Covered Code
79 * without prior written authorization from Intel.
80 *
81 * 4. Disclaimer and Export Compliance
82 *
83 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
86 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
87 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89 * PARTICULAR PURPOSE.
90 *
91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98 * LIMITED REMEDY.
99 *
100 * 4.3. Licensee shall not export, either directly or indirectly, any of this
101 * software or system incorporating such software without first obtaining any
102 * required license or other approval from the U. S. Department of Commerce or
103 * any other agency or department of the United States Government. In the
104 * event Licensee exports any such software from the United States or
105 * re-exports any such software from a foreign destination, Licensee shall
106 * ensure that the distribution and export/re-export of the software is in
107 * compliance with all laws, regulations, orders, or other restrictions of the
108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109 * any of its subsidiaries will export/re-export any technical data, process,
110 * software, or service, directly or indirectly, to any country for which the
111 * United States government or any agency thereof requires an export license,
112 * other governmental approval, or letter of assurance, without first obtaining
113 * such license, approval or letter.
114 *
115 *****************************************************************************/
116
117
118#define __EXOPARG2_C__
119
120#include "acpi.h"
121#include "acparser.h"
122#include "acinterp.h"
123#include "acevents.h"
124#include "amlcode.h"
125
126
127#define _COMPONENT ACPI_EXECUTER
128 ACPI_MODULE_NAME ("exoparg2")
129
130
131/*!
132 * Naming convention for AML interpreter execution routines.
133 *
134 * The routines that begin execution of AML opcodes are named with a common
135 * convention based upon the number of arguments, the number of target operands,
136 * and whether or not a value is returned:
137 *
138 * AcpiExOpcode_xA_yT_zR
139 *
140 * Where:
141 *
142 * xA - ARGUMENTS: The number of arguments (input operands) that are
143 * required for this opcode type (1 through 6 args).
144 * yT - TARGETS: The number of targets (output operands) that are required
145 * for this opcode type (0, 1, or 2 targets).
146 * zR - RETURN VALUE: Indicates whether this opcode type returns a value
147 * as the function return (0 or 1).
148 *
149 * The AcpiExOpcode* functions are called via the Dispatcher component with
150 * fully resolved operands.
151!*/
152
153
154/*******************************************************************************
155 *
156 * FUNCTION: AcpiExOpcode_2A_0T_0R
157 *
158 * PARAMETERS: WalkState - Current walk state
159 *
160 * RETURN: Status
161 *
162 * DESCRIPTION: Execute opcode with two arguments, no target, and no return
163 * value.
164 *
165 * ALLOCATION: Deletes both operands
166 *
167 ******************************************************************************/
168
169ACPI_STATUS
170AcpiExOpcode_2A_0T_0R (
171 ACPI_WALK_STATE *WalkState)
172{
173 ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
174 ACPI_NAMESPACE_NODE *Node;
175 ACPI_STATUS Status = AE_OK;
176
177
178 ACPI_FUNCTION_TRACE_STR ("ExOpcode_2A_0T_0R",
179 AcpiPsGetOpcodeName (WalkState->Opcode));
180
181
182 /* Examine the opcode */
183
184 switch (WalkState->Opcode)
185 {
186 case AML_NOTIFY_OP: /* Notify (NotifyObject, NotifyValue) */
187
188 /* The first operand is a namespace node */
189
190 Node = (ACPI_NAMESPACE_NODE *) Operand[0];
191
192 /* Notifies allowed on this object? */
193
194 if (!AcpiEvIsNotifyObject (Node))
195 {
196 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unexpected notify object type [%s]\n",
197 AcpiUtGetTypeName (Node->Type)));
198
199 Status = AE_AML_OPERAND_TYPE;
200 break;
201 }
202
203 /*
204 * Dispatch the notify to the appropriate handler
205 * NOTE: the request is queued for execution after this method
206 * completes. The notify handlers are NOT invoked synchronously
207 * from this thread -- because handlers may in turn run other
208 * control methods.
209 */
210 Status = AcpiEvQueueNotifyRequest (Node,
211 (UINT32) Operand[1]->Integer.Value);
212 break;
213
214
215 default:
216
217 ACPI_REPORT_ERROR (("AcpiExOpcode_2A_0T_0R: Unknown opcode %X\n",
218 WalkState->Opcode));
219 Status = AE_AML_BAD_OPCODE;
220 }
221
222 return_ACPI_STATUS (Status);
223}
224
225
226/*******************************************************************************
227 *
228 * FUNCTION: AcpiExOpcode_2A_2T_1R
229 *
230 * PARAMETERS: WalkState - Current walk state
231 *
232 * RETURN: Status
233 *
234 * DESCRIPTION: Execute a dyadic operator (2 operands) with 2 output targets
235 * and one implicit return value.
236 *
237 ******************************************************************************/
238
239ACPI_STATUS
240AcpiExOpcode_2A_2T_1R (
241 ACPI_WALK_STATE *WalkState)
242{
243 ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
244 ACPI_OPERAND_OBJECT *ReturnDesc1 = NULL;
245 ACPI_OPERAND_OBJECT *ReturnDesc2 = NULL;
246 ACPI_STATUS Status;
247
248
249 ACPI_FUNCTION_TRACE_STR ("ExOpcode_2A_2T_1R", AcpiPsGetOpcodeName (WalkState->Opcode));
250
251
252 /*
253 * Execute the opcode
254 */
255 switch (WalkState->Opcode)
256 {
257 case AML_DIVIDE_OP: /* Divide (Dividend, Divisor, RemainderResult QuotientResult) */
258
259 ReturnDesc1 = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
260 if (!ReturnDesc1)
261 {
262 Status = AE_NO_MEMORY;
263 goto Cleanup;
264 }
265
266 ReturnDesc2 = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
267 if (!ReturnDesc2)
268 {
269 Status = AE_NO_MEMORY;
270 goto Cleanup;
271 }
272
273 /* Quotient to ReturnDesc1, remainder to ReturnDesc2 */
274
275 Status = AcpiUtDivide (&Operand[0]->Integer.Value, &Operand[1]->Integer.Value,
276 &ReturnDesc1->Integer.Value, &ReturnDesc2->Integer.Value);
277 if (ACPI_FAILURE (Status))
278 {
279 goto Cleanup;
280 }
281 break;
282
283
284 default:
285
286 ACPI_REPORT_ERROR (("AcpiExOpcode_2A_2T_1R: Unknown opcode %X\n",
287 WalkState->Opcode));
288 Status = AE_AML_BAD_OPCODE;
289 goto Cleanup;
290 }
291
292
293 /* Store the results to the target reference operands */
294
295 Status = AcpiExStore (ReturnDesc2, Operand[2], WalkState);
296 if (ACPI_FAILURE (Status))
297 {
298 goto Cleanup;
299 }
300
301 Status = AcpiExStore (ReturnDesc1, Operand[3], WalkState);
302 if (ACPI_FAILURE (Status))
303 {
304 goto Cleanup;
305 }
306
307 /* Return the remainder */
308
309 WalkState->ResultObj = ReturnDesc1;
310
311
312Cleanup:
313 /*
314 * Since the remainder is not returned indirectly, remove a reference to
315 * it. Only the quotient is returned indirectly.
316 */
317 AcpiUtRemoveReference (ReturnDesc2);
318
319 if (ACPI_FAILURE (Status))
320 {
321 /* Delete the return object */
322
323 AcpiUtRemoveReference (ReturnDesc1);
324 }
325
326 return_ACPI_STATUS (Status);
327}
328
329
330/*******************************************************************************
331 *
332 * FUNCTION: AcpiExOpcode_2A_1T_1R
333 *
334 * PARAMETERS: WalkState - Current walk state
335 *
336 * RETURN: Status
337 *
338 * DESCRIPTION: Execute opcode with two arguments, one target, and a return
339 * value.
340 *
341 ******************************************************************************/
342
343ACPI_STATUS
344AcpiExOpcode_2A_1T_1R (
345 ACPI_WALK_STATE *WalkState)
346{
347 ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
348 ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
349 ACPI_OPERAND_OBJECT *TempDesc = NULL;
350 UINT32 Index;
351 ACPI_STATUS Status = AE_OK;
352 ACPI_SIZE Length;
353
354
355 ACPI_FUNCTION_TRACE_STR ("ExOpcode_2A_1T_1R", AcpiPsGetOpcodeName (WalkState->Opcode));
356
357
358 /*
359 * Execute the opcode
360 */
361 if (WalkState->OpInfo->Flags & AML_MATH)
362 {
363 /* All simple math opcodes (add, etc.) */
364
365 ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
366 if (!ReturnDesc)
367 {
368 Status = AE_NO_MEMORY;
369 goto Cleanup;
370 }
371
372 ReturnDesc->Integer.Value = AcpiExDoMathOp (WalkState->Opcode,
373 Operand[0]->Integer.Value,
374 Operand[1]->Integer.Value);
375 goto StoreResultToTarget;
376 }
377
378
379 switch (WalkState->Opcode)
380 {
381 case AML_MOD_OP: /* Mod (Dividend, Divisor, RemainderResult (ACPI 2.0) */
382
383 ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
384 if (!ReturnDesc)
385 {
386 Status = AE_NO_MEMORY;
387 goto Cleanup;
388 }
389
390 /* ReturnDesc will contain the remainder */
391
392 Status = AcpiUtDivide (&Operand[0]->Integer.Value, &Operand[1]->Integer.Value,
393 NULL, &ReturnDesc->Integer.Value);
394 break;
395
396
397 case AML_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */
398
399 /*
400 * Convert the second operand if necessary. The first operand
401 * determines the type of the second operand, (See the Data Types
402 * section of the ACPI specification.) Both object types are
403 * guaranteed to be either Integer/String/Buffer by the operand
404 * resolution mechanism above.
405 */
406 switch (ACPI_GET_OBJECT_TYPE (Operand[0]))
407 {
408 case ACPI_TYPE_INTEGER:
409 Status = AcpiExConvertToInteger (Operand[1], &TempDesc, WalkState);
410 break;
411
412 case ACPI_TYPE_STRING:
413 Status = AcpiExConvertToString (Operand[1], &TempDesc, 16, ACPI_UINT32_MAX, WalkState);
414 break;
415
416 case ACPI_TYPE_BUFFER:
417 Status = AcpiExConvertToBuffer (Operand[1], &TempDesc, WalkState);
418 break;
419
420 default:
421 ACPI_REPORT_ERROR (("Concat - invalid obj type: %X\n",
422 ACPI_GET_OBJECT_TYPE (Operand[0])));
421 Status = AE_AML_INTERNAL;
422 }
423
424 if (ACPI_FAILURE (Status))
425 {
426 goto Cleanup;
427 }
428
429 /*
430 * Both operands are now known to be the same object type
431 * (Both are Integer, String, or Buffer), and we can now perform the
432 * concatenation.
433 */
434 Status = AcpiExDoConcatenate (Operand[0], TempDesc, &ReturnDesc, WalkState);
435 if (TempDesc != Operand[1])
436 {
437 AcpiUtRemoveReference (TempDesc);
438 }
439 break;
440
441
442 case AML_TO_STRING_OP: /* ToString (Buffer, Length, Result) (ACPI 2.0) */
443
444 /*
445 * Input object is guaranteed to be a buffer at this point (it may have
446 * been converted.) Copy the raw buffer data to a new object of type String.
447 */
448
449 /* Get the length of the new string */
450
451 Length = 0;
452 if (Operand[1]->Integer.Value == 0)
453 {
454 /* Handle optional length value */
455
456 Operand[1]->Integer.Value = ACPI_INTEGER_MAX;
457 }
458
459 while ((Length < Operand[0]->Buffer.Length) &&
460 (Length < Operand[1]->Integer.Value) &&
461 (Operand[0]->Buffer.Pointer[Length]))
462 {
463 Length++;
464 }
465
466 if (Length > ACPI_MAX_STRING_CONVERSION)
467 {
468 Status = AE_AML_STRING_LIMIT;
469 goto Cleanup;
470 }
471
472 /* Create the internal return object */
473
474 ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_STRING);
475 if (!ReturnDesc)
476 {
477 Status = AE_NO_MEMORY;
478 goto Cleanup;
479 }
480
481 /* Allocate a new string buffer (Length + 1 for null terminator) */
482
483 ReturnDesc->String.Pointer = ACPI_MEM_CALLOCATE (Length + 1);
484 if (!ReturnDesc->String.Pointer)
485 {
486 Status = AE_NO_MEMORY;
487 goto Cleanup;
488 }
489
490 /* Copy the raw buffer data with no transform */
491
492 ACPI_MEMCPY (ReturnDesc->String.Pointer, Operand[0]->Buffer.Pointer, Length);
493
494 /* Set the string length */
495
496 ReturnDesc->String.Length = (UINT32) Length;
497 break;
498
499
500 case AML_CONCAT_RES_OP: /* ConcatenateResTemplate (Buffer, Buffer, Result) (ACPI 2.0) */
501
502 Status = AcpiExConcatTemplate (Operand[0], Operand[1], &ReturnDesc, WalkState);
503 break;
504
505
506 case AML_INDEX_OP: /* Index (Source Index Result) */
507
508 /* Create the internal return object */
509
510 ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_LOCAL_REFERENCE);
511 if (!ReturnDesc)
512 {
513 Status = AE_NO_MEMORY;
514 goto Cleanup;
515 }
516
517 Index = (UINT32) Operand[1]->Integer.Value;
518
519 /*
520 * At this point, the Source operand is either a Package or a Buffer
521 */
522 if (ACPI_GET_OBJECT_TYPE (Operand[0]) == ACPI_TYPE_PACKAGE)
523 {
524 /* Object to be indexed is a Package */
525
526 if (Index >= Operand[0]->Package.Count)
527 {
528 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index value (%X) beyond package end (%X)\n",
529 Index, Operand[0]->Package.Count));
530 Status = AE_AML_PACKAGE_LIMIT;
531 goto Cleanup;
532 }
533
534 ReturnDesc->Reference.TargetType = ACPI_TYPE_PACKAGE;
423 Status = AE_AML_INTERNAL;
424 }
425
426 if (ACPI_FAILURE (Status))
427 {
428 goto Cleanup;
429 }
430
431 /*
432 * Both operands are now known to be the same object type
433 * (Both are Integer, String, or Buffer), and we can now perform the
434 * concatenation.
435 */
436 Status = AcpiExDoConcatenate (Operand[0], TempDesc, &ReturnDesc, WalkState);
437 if (TempDesc != Operand[1])
438 {
439 AcpiUtRemoveReference (TempDesc);
440 }
441 break;
442
443
444 case AML_TO_STRING_OP: /* ToString (Buffer, Length, Result) (ACPI 2.0) */
445
446 /*
447 * Input object is guaranteed to be a buffer at this point (it may have
448 * been converted.) Copy the raw buffer data to a new object of type String.
449 */
450
451 /* Get the length of the new string */
452
453 Length = 0;
454 if (Operand[1]->Integer.Value == 0)
455 {
456 /* Handle optional length value */
457
458 Operand[1]->Integer.Value = ACPI_INTEGER_MAX;
459 }
460
461 while ((Length < Operand[0]->Buffer.Length) &&
462 (Length < Operand[1]->Integer.Value) &&
463 (Operand[0]->Buffer.Pointer[Length]))
464 {
465 Length++;
466 }
467
468 if (Length > ACPI_MAX_STRING_CONVERSION)
469 {
470 Status = AE_AML_STRING_LIMIT;
471 goto Cleanup;
472 }
473
474 /* Create the internal return object */
475
476 ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_STRING);
477 if (!ReturnDesc)
478 {
479 Status = AE_NO_MEMORY;
480 goto Cleanup;
481 }
482
483 /* Allocate a new string buffer (Length + 1 for null terminator) */
484
485 ReturnDesc->String.Pointer = ACPI_MEM_CALLOCATE (Length + 1);
486 if (!ReturnDesc->String.Pointer)
487 {
488 Status = AE_NO_MEMORY;
489 goto Cleanup;
490 }
491
492 /* Copy the raw buffer data with no transform */
493
494 ACPI_MEMCPY (ReturnDesc->String.Pointer, Operand[0]->Buffer.Pointer, Length);
495
496 /* Set the string length */
497
498 ReturnDesc->String.Length = (UINT32) Length;
499 break;
500
501
502 case AML_CONCAT_RES_OP: /* ConcatenateResTemplate (Buffer, Buffer, Result) (ACPI 2.0) */
503
504 Status = AcpiExConcatTemplate (Operand[0], Operand[1], &ReturnDesc, WalkState);
505 break;
506
507
508 case AML_INDEX_OP: /* Index (Source Index Result) */
509
510 /* Create the internal return object */
511
512 ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_LOCAL_REFERENCE);
513 if (!ReturnDesc)
514 {
515 Status = AE_NO_MEMORY;
516 goto Cleanup;
517 }
518
519 Index = (UINT32) Operand[1]->Integer.Value;
520
521 /*
522 * At this point, the Source operand is either a Package or a Buffer
523 */
524 if (ACPI_GET_OBJECT_TYPE (Operand[0]) == ACPI_TYPE_PACKAGE)
525 {
526 /* Object to be indexed is a Package */
527
528 if (Index >= Operand[0]->Package.Count)
529 {
530 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index value (%X) beyond package end (%X)\n",
531 Index, Operand[0]->Package.Count));
532 Status = AE_AML_PACKAGE_LIMIT;
533 goto Cleanup;
534 }
535
536 ReturnDesc->Reference.TargetType = ACPI_TYPE_PACKAGE;
535 ReturnDesc->Reference.Object = Operand[0]->Package.Elements [Index];
537 ReturnDesc->Reference.Object = Operand[0];
536 ReturnDesc->Reference.Where = &Operand[0]->Package.Elements [Index];
537 }
538 else
539 {
540 /* Object to be indexed is a Buffer */
541
542 if (Index >= Operand[0]->Buffer.Length)
543 {
544 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index value (%X) beyond end of buffer (%X)\n",
545 Index, Operand[0]->Buffer.Length));
546 Status = AE_AML_BUFFER_LIMIT;
547 goto Cleanup;
548 }
549
550 ReturnDesc->Reference.TargetType = ACPI_TYPE_BUFFER_FIELD;
551 ReturnDesc->Reference.Object = Operand[0];
552 }
553
554 /* Complete the Index reference object */
555
556 ReturnDesc->Reference.Opcode = AML_INDEX_OP;
557 ReturnDesc->Reference.Offset = Index;
558
559 /* Store the reference to the Target */
560
561 Status = AcpiExStore (ReturnDesc, Operand[2], WalkState);
562
563 /* Return the reference */
564
565 WalkState->ResultObj = ReturnDesc;
566 goto Cleanup;
567
568
569 default:
570
571 ACPI_REPORT_ERROR (("AcpiExOpcode_2A_1T_1R: Unknown opcode %X\n",
572 WalkState->Opcode));
573 Status = AE_AML_BAD_OPCODE;
574 break;
575 }
576
577
578StoreResultToTarget:
579
580 if (ACPI_SUCCESS (Status))
581 {
582 /*
583 * Store the result of the operation (which is now in ReturnDesc) into
584 * the Target descriptor.
585 */
586 Status = AcpiExStore (ReturnDesc, Operand[2], WalkState);
587 if (ACPI_FAILURE (Status))
588 {
589 goto Cleanup;
590 }
591
592 if (!WalkState->ResultObj)
593 {
594 WalkState->ResultObj = ReturnDesc;
595 }
596 }
597
598
599Cleanup:
600
601 /* Delete return object on error */
602
603 if (ACPI_FAILURE (Status))
604 {
605 AcpiUtRemoveReference (ReturnDesc);
606 }
607
608 return_ACPI_STATUS (Status);
609}
610
611
612/*******************************************************************************
613 *
614 * FUNCTION: AcpiExOpcode_2A_0T_1R
615 *
616 * PARAMETERS: WalkState - Current walk state
617 *
618 * RETURN: Status
619 *
620 * DESCRIPTION: Execute opcode with 2 arguments, no target, and a return value
621 *
622 ******************************************************************************/
623
624ACPI_STATUS
625AcpiExOpcode_2A_0T_1R (
626 ACPI_WALK_STATE *WalkState)
627{
628 ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
629 ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
630 ACPI_STATUS Status = AE_OK;
631 BOOLEAN LogicalResult = FALSE;
632
633
634 ACPI_FUNCTION_TRACE_STR ("ExOpcode_2A_0T_1R", AcpiPsGetOpcodeName (WalkState->Opcode));
635
636
637 /* Create the internal return object */
638
639 ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
640 if (!ReturnDesc)
641 {
642 Status = AE_NO_MEMORY;
643 goto Cleanup;
644 }
645
646 /*
647 * Execute the Opcode
648 */
649 if (WalkState->OpInfo->Flags & AML_LOGICAL) /* LogicalOp (Operand0, Operand1) */
650 {
651 LogicalResult = AcpiExDoLogicalOp (WalkState->Opcode,
652 Operand[0]->Integer.Value,
653 Operand[1]->Integer.Value);
654 goto StoreLogicalResult;
655 }
656
657
658 switch (WalkState->Opcode)
659 {
660 case AML_ACQUIRE_OP: /* Acquire (MutexObject, Timeout) */
661
662 Status = AcpiExAcquireMutex (Operand[1], Operand[0], WalkState);
663 if (Status == AE_TIME)
664 {
665 LogicalResult = TRUE; /* TRUE = Acquire timed out */
666 Status = AE_OK;
667 }
668 break;
669
670
671 case AML_WAIT_OP: /* Wait (EventObject, Timeout) */
672
673 Status = AcpiExSystemWaitEvent (Operand[1], Operand[0]);
674 if (Status == AE_TIME)
675 {
676 LogicalResult = TRUE; /* TRUE, Wait timed out */
677 Status = AE_OK;
678 }
679 break;
680
681
682 default:
683
684 ACPI_REPORT_ERROR (("AcpiExOpcode_2A_0T_1R: Unknown opcode %X\n",
685 WalkState->Opcode));
686 Status = AE_AML_BAD_OPCODE;
687 goto Cleanup;
688 }
689
690
691StoreLogicalResult:
692 /*
693 * Set return value to according to LogicalResult. logical TRUE (all ones)
694 * Default is FALSE (zero)
695 */
696 if (LogicalResult)
697 {
698 ReturnDesc->Integer.Value = ACPI_INTEGER_MAX;
699 }
700
701 WalkState->ResultObj = ReturnDesc;
702
703
704Cleanup:
705
706 /* Delete return object on error */
707
708 if (ACPI_FAILURE (Status))
709 {
710 AcpiUtRemoveReference (ReturnDesc);
711 }
712
713 return_ACPI_STATUS (Status);
714}
715
716
538 ReturnDesc->Reference.Where = &Operand[0]->Package.Elements [Index];
539 }
540 else
541 {
542 /* Object to be indexed is a Buffer */
543
544 if (Index >= Operand[0]->Buffer.Length)
545 {
546 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index value (%X) beyond end of buffer (%X)\n",
547 Index, Operand[0]->Buffer.Length));
548 Status = AE_AML_BUFFER_LIMIT;
549 goto Cleanup;
550 }
551
552 ReturnDesc->Reference.TargetType = ACPI_TYPE_BUFFER_FIELD;
553 ReturnDesc->Reference.Object = Operand[0];
554 }
555
556 /* Complete the Index reference object */
557
558 ReturnDesc->Reference.Opcode = AML_INDEX_OP;
559 ReturnDesc->Reference.Offset = Index;
560
561 /* Store the reference to the Target */
562
563 Status = AcpiExStore (ReturnDesc, Operand[2], WalkState);
564
565 /* Return the reference */
566
567 WalkState->ResultObj = ReturnDesc;
568 goto Cleanup;
569
570
571 default:
572
573 ACPI_REPORT_ERROR (("AcpiExOpcode_2A_1T_1R: Unknown opcode %X\n",
574 WalkState->Opcode));
575 Status = AE_AML_BAD_OPCODE;
576 break;
577 }
578
579
580StoreResultToTarget:
581
582 if (ACPI_SUCCESS (Status))
583 {
584 /*
585 * Store the result of the operation (which is now in ReturnDesc) into
586 * the Target descriptor.
587 */
588 Status = AcpiExStore (ReturnDesc, Operand[2], WalkState);
589 if (ACPI_FAILURE (Status))
590 {
591 goto Cleanup;
592 }
593
594 if (!WalkState->ResultObj)
595 {
596 WalkState->ResultObj = ReturnDesc;
597 }
598 }
599
600
601Cleanup:
602
603 /* Delete return object on error */
604
605 if (ACPI_FAILURE (Status))
606 {
607 AcpiUtRemoveReference (ReturnDesc);
608 }
609
610 return_ACPI_STATUS (Status);
611}
612
613
614/*******************************************************************************
615 *
616 * FUNCTION: AcpiExOpcode_2A_0T_1R
617 *
618 * PARAMETERS: WalkState - Current walk state
619 *
620 * RETURN: Status
621 *
622 * DESCRIPTION: Execute opcode with 2 arguments, no target, and a return value
623 *
624 ******************************************************************************/
625
626ACPI_STATUS
627AcpiExOpcode_2A_0T_1R (
628 ACPI_WALK_STATE *WalkState)
629{
630 ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
631 ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
632 ACPI_STATUS Status = AE_OK;
633 BOOLEAN LogicalResult = FALSE;
634
635
636 ACPI_FUNCTION_TRACE_STR ("ExOpcode_2A_0T_1R", AcpiPsGetOpcodeName (WalkState->Opcode));
637
638
639 /* Create the internal return object */
640
641 ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
642 if (!ReturnDesc)
643 {
644 Status = AE_NO_MEMORY;
645 goto Cleanup;
646 }
647
648 /*
649 * Execute the Opcode
650 */
651 if (WalkState->OpInfo->Flags & AML_LOGICAL) /* LogicalOp (Operand0, Operand1) */
652 {
653 LogicalResult = AcpiExDoLogicalOp (WalkState->Opcode,
654 Operand[0]->Integer.Value,
655 Operand[1]->Integer.Value);
656 goto StoreLogicalResult;
657 }
658
659
660 switch (WalkState->Opcode)
661 {
662 case AML_ACQUIRE_OP: /* Acquire (MutexObject, Timeout) */
663
664 Status = AcpiExAcquireMutex (Operand[1], Operand[0], WalkState);
665 if (Status == AE_TIME)
666 {
667 LogicalResult = TRUE; /* TRUE = Acquire timed out */
668 Status = AE_OK;
669 }
670 break;
671
672
673 case AML_WAIT_OP: /* Wait (EventObject, Timeout) */
674
675 Status = AcpiExSystemWaitEvent (Operand[1], Operand[0]);
676 if (Status == AE_TIME)
677 {
678 LogicalResult = TRUE; /* TRUE, Wait timed out */
679 Status = AE_OK;
680 }
681 break;
682
683
684 default:
685
686 ACPI_REPORT_ERROR (("AcpiExOpcode_2A_0T_1R: Unknown opcode %X\n",
687 WalkState->Opcode));
688 Status = AE_AML_BAD_OPCODE;
689 goto Cleanup;
690 }
691
692
693StoreLogicalResult:
694 /*
695 * Set return value to according to LogicalResult. logical TRUE (all ones)
696 * Default is FALSE (zero)
697 */
698 if (LogicalResult)
699 {
700 ReturnDesc->Integer.Value = ACPI_INTEGER_MAX;
701 }
702
703 WalkState->ResultObj = ReturnDesc;
704
705
706Cleanup:
707
708 /* Delete return object on error */
709
710 if (ACPI_FAILURE (Status))
711 {
712 AcpiUtRemoveReference (ReturnDesc);
713 }
714
715 return_ACPI_STATUS (Status);
716}
717
718