Print this page
update to acpica-unix2-20131218
acpica-unix2-20130823
PANKOVs restructure
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/intel/io/acpica/dispatcher/dswexec.c
+++ new/usr/src/common/acpica/components/dispatcher/dswexec.c
1 1 /******************************************************************************
2 2 *
3 3 * Module Name: dswexec - Dispatcher method execution callbacks;
4 4 * dispatch to interpreter.
5 5 *
6 6 *****************************************************************************/
7 7
8 8 /*
9 - * Copyright (C) 2000 - 2011, Intel Corp.
9 + * Copyright (C) 2000 - 2013, Intel Corp.
10 10 * All rights reserved.
11 11 *
12 12 * Redistribution and use in source and binary forms, with or without
13 13 * modification, are permitted provided that the following conditions
14 14 * are met:
15 15 * 1. Redistributions of source code must retain the above copyright
16 16 * notice, this list of conditions, and the following disclaimer,
17 17 * without modification.
18 18 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
19 19 * substantially similar to the "NO WARRANTY" disclaimer below
20 20 * ("Disclaimer") and any redistribution must be conditioned upon
21 21 * including a substantially similar Disclaimer requirement for further
22 22 * binary redistribution.
23 23 * 3. Neither the names of the above-listed copyright holders nor the names
24 24 * of any contributors may be used to endorse or promote products derived
25 25 * from this software without specific prior written permission.
26 26 *
27 27 * Alternatively, this software may be distributed under the terms of the
28 28 * GNU General Public License ("GPL") version 2 as published by the Free
29 29 * Software Foundation.
30 30 *
31 31 * NO WARRANTY
32 32 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33 33 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34 34 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
35 35 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36 36 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37 37 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38 38 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 39 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
40 40 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
41 41 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
42 42 * POSSIBILITY OF SUCH DAMAGES.
43 43 */
44 44
45 45 #define __DSWEXEC_C__
46 46
47 47 #include "acpi.h"
48 48 #include "accommon.h"
49 49 #include "acparser.h"
50 50 #include "amlcode.h"
51 51 #include "acdispat.h"
52 52 #include "acinterp.h"
53 53 #include "acnamesp.h"
54 54 #include "acdebug.h"
55 55
56 56
57 57 #define _COMPONENT ACPI_DISPATCHER
58 58 ACPI_MODULE_NAME ("dswexec")
59 59
60 60 /*
61 61 * Dispatch table for opcode classes
62 62 */
63 63 static ACPI_EXECUTE_OP AcpiGbl_OpTypeDispatch [] =
64 64 {
65 65 AcpiExOpcode_0A_0T_1R,
66 66 AcpiExOpcode_1A_0T_0R,
67 67 AcpiExOpcode_1A_0T_1R,
68 68 AcpiExOpcode_1A_1T_0R,
69 69 AcpiExOpcode_1A_1T_1R,
70 70 AcpiExOpcode_2A_0T_0R,
71 71 AcpiExOpcode_2A_0T_1R,
72 72 AcpiExOpcode_2A_1T_1R,
73 73 AcpiExOpcode_2A_2T_1R,
74 74 AcpiExOpcode_3A_0T_0R,
75 75 AcpiExOpcode_3A_1T_1R,
76 76 AcpiExOpcode_6A_0T_1R
77 77 };
78 78
79 79
80 80 /*****************************************************************************
81 81 *
82 82 * FUNCTION: AcpiDsGetPredicateValue
83 83 *
84 84 * PARAMETERS: WalkState - Current state of the parse tree walk
85 85 * ResultObj - if non-zero, pop result from result stack
86 86 *
87 87 * RETURN: Status
88 88 *
89 89 * DESCRIPTION: Get the result of a predicate evaluation
90 90 *
91 91 ****************************************************************************/
92 92
93 93 ACPI_STATUS
94 94 AcpiDsGetPredicateValue (
95 95 ACPI_WALK_STATE *WalkState,
96 96 ACPI_OPERAND_OBJECT *ResultObj)
97 97 {
98 98 ACPI_STATUS Status = AE_OK;
99 99 ACPI_OPERAND_OBJECT *ObjDesc;
100 100 ACPI_OPERAND_OBJECT *LocalObjDesc = NULL;
101 101
102 102
103 103 ACPI_FUNCTION_TRACE_PTR (DsGetPredicateValue, WalkState);
104 104
105 105
106 106 WalkState->ControlState->Common.State = 0;
107 107
108 108 if (ResultObj)
109 109 {
110 110 Status = AcpiDsResultPop (&ObjDesc, WalkState);
111 111 if (ACPI_FAILURE (Status))
112 112 {
113 113 ACPI_EXCEPTION ((AE_INFO, Status,
114 114 "Could not get result from predicate evaluation"));
115 115
116 116 return_ACPI_STATUS (Status);
117 117 }
118 118 }
119 119 else
120 120 {
121 121 Status = AcpiDsCreateOperand (WalkState, WalkState->Op, 0);
122 122 if (ACPI_FAILURE (Status))
123 123 {
124 124 return_ACPI_STATUS (Status);
125 125 }
126 126
127 127 Status = AcpiExResolveToValue (&WalkState->Operands [0], WalkState);
128 128 if (ACPI_FAILURE (Status))
129 129 {
130 130 return_ACPI_STATUS (Status);
131 131 }
132 132
133 133 ObjDesc = WalkState->Operands [0];
134 134 }
135 135
136 136 if (!ObjDesc)
137 137 {
138 138 ACPI_ERROR ((AE_INFO,
139 139 "No predicate ObjDesc=%p State=%p",
140 140 ObjDesc, WalkState));
141 141
142 142 return_ACPI_STATUS (AE_AML_NO_OPERAND);
143 143 }
144 144
145 145 /*
146 146 * Result of predicate evaluation must be an Integer
147 147 * object. Implicitly convert the argument if necessary.
148 148 */
149 149 Status = AcpiExConvertToInteger (ObjDesc, &LocalObjDesc, 16);
150 150 if (ACPI_FAILURE (Status))
151 151 {
152 152 goto Cleanup;
153 153 }
154 154
155 155 if (LocalObjDesc->Common.Type != ACPI_TYPE_INTEGER)
156 156 {
↓ open down ↓ |
137 lines elided |
↑ open up ↑ |
157 157 ACPI_ERROR ((AE_INFO,
158 158 "Bad predicate (not an integer) ObjDesc=%p State=%p Type=0x%X",
159 159 ObjDesc, WalkState, ObjDesc->Common.Type));
160 160
161 161 Status = AE_AML_OPERAND_TYPE;
162 162 goto Cleanup;
163 163 }
164 164
165 165 /* Truncate the predicate to 32-bits if necessary */
166 166
167 - AcpiExTruncateFor32bitTable (LocalObjDesc);
167 + (void) AcpiExTruncateFor32bitTable (LocalObjDesc);
168 168
169 169 /*
170 170 * Save the result of the predicate evaluation on
171 171 * the control stack
172 172 */
173 173 if (LocalObjDesc->Integer.Value)
174 174 {
175 175 WalkState->ControlState->Common.Value = TRUE;
176 176 }
177 177 else
178 178 {
179 179 /*
180 180 * Predicate is FALSE, we will just toss the
181 181 * rest of the package
182 182 */
183 183 WalkState->ControlState->Common.Value = FALSE;
184 184 Status = AE_CTRL_FALSE;
185 185 }
186 186
187 187 /* Predicate can be used for an implicit return value */
188 188
189 189 (void) AcpiDsDoImplicitReturn (LocalObjDesc, WalkState, TRUE);
190 190
191 191
192 192 Cleanup:
193 193
194 194 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%p\n",
195 195 WalkState->ControlState->Common.Value, WalkState->Op));
196 196
197 197 /* Break to debugger to display result */
198 198
199 199 ACPI_DEBUGGER_EXEC (AcpiDbDisplayResultObject (LocalObjDesc, WalkState));
200 200
201 201 /*
202 202 * Delete the predicate result object (we know that
203 203 * we don't need it anymore)
204 204 */
205 205 if (LocalObjDesc != ObjDesc)
206 206 {
207 207 AcpiUtRemoveReference (LocalObjDesc);
208 208 }
209 209 AcpiUtRemoveReference (ObjDesc);
210 210
211 211 WalkState->ControlState->Common.State = ACPI_CONTROL_NORMAL;
212 212 return_ACPI_STATUS (Status);
213 213 }
214 214
215 215
↓ open down ↓ |
38 lines elided |
↑ open up ↑ |
216 216 /*****************************************************************************
217 217 *
218 218 * FUNCTION: AcpiDsExecBeginOp
219 219 *
220 220 * PARAMETERS: WalkState - Current state of the parse tree walk
221 221 * OutOp - Where to return op if a new one is created
222 222 *
223 223 * RETURN: Status
224 224 *
225 225 * DESCRIPTION: Descending callback used during the execution of control
226 - * methods. This is where most operators and operands are
226 + * methods. This is where most operators and operands are
227 227 * dispatched to the interpreter.
228 228 *
229 229 ****************************************************************************/
230 230
231 231 ACPI_STATUS
232 232 AcpiDsExecBeginOp (
233 233 ACPI_WALK_STATE *WalkState,
234 234 ACPI_PARSE_OBJECT **OutOp)
235 235 {
236 236 ACPI_PARSE_OBJECT *Op;
237 237 ACPI_STATUS Status = AE_OK;
238 238 UINT32 OpcodeClass;
239 239
240 240
241 241 ACPI_FUNCTION_TRACE_PTR (DsExecBeginOp, WalkState);
242 242
243 243
244 244 Op = WalkState->Op;
245 245 if (!Op)
246 246 {
247 247 Status = AcpiDsLoad2BeginOp (WalkState, OutOp);
248 248 if (ACPI_FAILURE (Status))
249 249 {
250 250 goto ErrorExit;
251 251 }
252 252
253 253 Op = *OutOp;
254 254 WalkState->Op = Op;
255 255 WalkState->Opcode = Op->Common.AmlOpcode;
256 256 WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
257 257
258 258 if (AcpiNsOpensScope (WalkState->OpInfo->ObjectType))
259 259 {
260 260 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
261 261 "(%s) Popping scope for Op %p\n",
262 262 AcpiUtGetTypeName (WalkState->OpInfo->ObjectType), Op));
263 263
264 264 Status = AcpiDsScopeStackPop (WalkState);
265 265 if (ACPI_FAILURE (Status))
266 266 {
267 267 goto ErrorExit;
268 268 }
269 269 }
270 270 }
271 271
272 272 if (Op == WalkState->Origin)
273 273 {
274 274 if (OutOp)
275 275 {
276 276 *OutOp = Op;
277 277 }
278 278
279 279 return_ACPI_STATUS (AE_OK);
280 280 }
281 281
282 282 /*
283 283 * If the previous opcode was a conditional, this opcode
284 284 * must be the beginning of the associated predicate.
285 285 * Save this knowledge in the current scope descriptor
286 286 */
287 287 if ((WalkState->ControlState) &&
288 288 (WalkState->ControlState->Common.State ==
289 289 ACPI_CONTROL_CONDITIONAL_EXECUTING))
290 290 {
291 291 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Exec predicate Op=%p State=%p\n",
292 292 Op, WalkState));
293 293
294 294 WalkState->ControlState->Common.State = ACPI_CONTROL_PREDICATE_EXECUTING;
295 295
296 296 /* Save start of predicate */
297 297
298 298 WalkState->ControlState->Control.PredicateOp = Op;
299 299 }
300 300
301 301
302 302 OpcodeClass = WalkState->OpInfo->Class;
303 303
304 304 /* We want to send namepaths to the load code */
305 305
306 306 if (Op->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
307 307 {
308 308 OpcodeClass = AML_CLASS_NAMED_OBJECT;
309 309 }
310 310
↓ open down ↓ |
74 lines elided |
↑ open up ↑ |
311 311 /*
312 312 * Handle the opcode based upon the opcode type
313 313 */
314 314 switch (OpcodeClass)
315 315 {
316 316 case AML_CLASS_CONTROL:
317 317
318 318 Status = AcpiDsExecBeginControlOp (WalkState, Op);
319 319 break;
320 320
321 -
322 321 case AML_CLASS_NAMED_OBJECT:
323 322
324 323 if (WalkState->WalkType & ACPI_WALK_METHOD)
325 324 {
326 325 /*
327 326 * Found a named object declaration during method execution;
328 - * we must enter this object into the namespace. The created
327 + * we must enter this object into the namespace. The created
329 328 * object is temporary and will be deleted upon completion of
330 329 * the execution of this method.
331 330 *
332 331 * Note 10/2010: Except for the Scope() op. This opcode does
333 332 * not actually create a new object, it refers to an existing
334 333 * object. However, for Scope(), we want to indeed open a
335 334 * new scope.
336 335 */
337 336 if (Op->Common.AmlOpcode != AML_SCOPE_OP)
338 337 {
339 338 Status = AcpiDsLoad2BeginOp (WalkState, NULL);
340 339 }
341 340 else
342 341 {
↓ open down ↓ |
4 lines elided |
↑ open up ↑ |
343 342 Status = AcpiDsScopeStackPush (Op->Named.Node,
344 343 Op->Named.Node->Type, WalkState);
345 344 if (ACPI_FAILURE (Status))
346 345 {
347 346 return_ACPI_STATUS (Status);
348 347 }
349 348 }
350 349 }
351 350 break;
352 351
353 -
354 352 case AML_CLASS_EXECUTE:
355 353 case AML_CLASS_CREATE:
356 354
357 355 break;
358 356
359 -
360 357 default:
358 +
361 359 break;
362 360 }
363 361
364 362 /* Nothing to do here during method execution */
365 363
366 364 return_ACPI_STATUS (Status);
367 365
368 366
369 367 ErrorExit:
370 368 Status = AcpiDsMethodError (Status, WalkState);
371 369 return_ACPI_STATUS (Status);
372 370 }
373 371
↓ open down ↓ |
3 lines elided |
↑ open up ↑ |
374 372
375 373 /*****************************************************************************
376 374 *
377 375 * FUNCTION: AcpiDsExecEndOp
378 376 *
379 377 * PARAMETERS: WalkState - Current state of the parse tree walk
380 378 *
381 379 * RETURN: Status
382 380 *
383 381 * DESCRIPTION: Ascending callback used during the execution of control
384 - * methods. The only thing we really need to do here is to
382 + * methods. The only thing we really need to do here is to
385 383 * notice the beginning of IF, ELSE, and WHILE blocks.
386 384 *
387 385 ****************************************************************************/
388 386
389 387 ACPI_STATUS
390 388 AcpiDsExecEndOp (
391 389 ACPI_WALK_STATE *WalkState)
392 390 {
393 391 ACPI_PARSE_OBJECT *Op;
394 392 ACPI_STATUS Status = AE_OK;
395 393 UINT32 OpType;
396 394 UINT32 OpClass;
397 395 ACPI_PARSE_OBJECT *NextOp;
398 396 ACPI_PARSE_OBJECT *FirstArg;
399 397
400 398
401 399 ACPI_FUNCTION_TRACE_PTR (DsExecEndOp, WalkState);
402 400
403 401
404 402 Op = WalkState->Op;
405 403 OpType = WalkState->OpInfo->Type;
406 404 OpClass = WalkState->OpInfo->Class;
407 405
408 406 if (OpClass == AML_CLASS_UNKNOWN)
409 407 {
410 408 ACPI_ERROR ((AE_INFO, "Unknown opcode 0x%X", Op->Common.AmlOpcode));
411 409 return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
412 410 }
413 411
414 412 FirstArg = Op->Common.Value.Arg;
415 413
416 414 /* Init the walk state */
417 415
418 416 WalkState->NumOperands = 0;
419 417 WalkState->OperandIndex = 0;
420 418 WalkState->ReturnDesc = NULL;
421 419 WalkState->ResultObj = NULL;
422 420
423 421 /* Call debugger for single step support (DEBUG build only) */
424 422
425 423 ACPI_DEBUGGER_EXEC (Status = AcpiDbSingleStep (WalkState, Op, OpClass));
426 424 ACPI_DEBUGGER_EXEC (if (ACPI_FAILURE (Status)) {return_ACPI_STATUS (Status);});
427 425
428 426 /* Decode the Opcode Class */
429 427
430 428 switch (OpClass)
431 429 {
432 430 case AML_CLASS_ARGUMENT: /* Constants, literals, etc. */
433 431
↓ open down ↓ |
39 lines elided |
↑ open up ↑ |
434 432 if (WalkState->Opcode == AML_INT_NAMEPATH_OP)
435 433 {
436 434 Status = AcpiDsEvaluateNamePath (WalkState);
437 435 if (ACPI_FAILURE (Status))
438 436 {
439 437 goto Cleanup;
440 438 }
441 439 }
442 440 break;
443 441
444 -
445 442 case AML_CLASS_EXECUTE: /* Most operators with arguments */
446 443
447 444 /* Build resolved operand stack */
448 445
449 446 Status = AcpiDsCreateOperands (WalkState, FirstArg);
450 447 if (ACPI_FAILURE (Status))
451 448 {
452 449 goto Cleanup;
453 450 }
454 451
455 452 /*
456 453 * All opcodes require operand resolution, with the only exceptions
457 454 * being the ObjectType and SizeOf operators.
458 455 */
459 456 if (!(WalkState->OpInfo->Flags & AML_NO_OPERAND_RESOLVE))
460 457 {
461 458 /* Resolve all operands */
↓ open down ↓ |
7 lines elided |
↑ open up ↑ |
462 459
463 460 Status = AcpiExResolveOperands (WalkState->Opcode,
464 461 &(WalkState->Operands [WalkState->NumOperands -1]),
465 462 WalkState);
466 463 }
467 464
468 465 if (ACPI_SUCCESS (Status))
469 466 {
470 467 /*
471 468 * Dispatch the request to the appropriate interpreter handler
472 - * routine. There is one routine per opcode "type" based upon the
469 + * routine. There is one routine per opcode "type" based upon the
473 470 * number of opcode arguments and return type.
474 471 */
475 472 Status = AcpiGbl_OpTypeDispatch[OpType] (WalkState);
476 473 }
477 474 else
478 475 {
479 476 /*
480 477 * Treat constructs of the form "Store(LocalX,LocalX)" as noops when the
481 478 * Local is uninitialized.
482 479 */
483 480 if ((Status == AE_AML_UNINITIALIZED_LOCAL) &&
484 481 (WalkState->Opcode == AML_STORE_OP) &&
485 482 (WalkState->Operands[0]->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
486 483 (WalkState->Operands[1]->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
487 484 (WalkState->Operands[0]->Reference.Class ==
488 485 WalkState->Operands[1]->Reference.Class) &&
489 486 (WalkState->Operands[0]->Reference.Value ==
490 487 WalkState->Operands[1]->Reference.Value))
491 488 {
492 489 Status = AE_OK;
493 490 }
494 491 else
495 492 {
496 493 ACPI_EXCEPTION ((AE_INFO, Status,
497 494 "While resolving operands for [%s]",
498 495 AcpiPsGetOpcodeName (WalkState->Opcode)));
499 496 }
500 497 }
501 498
502 499 /* Always delete the argument objects and clear the operand stack */
503 500
504 501 AcpiDsClearOperands (WalkState);
505 502
506 503 /*
↓ open down ↓ |
24 lines elided |
↑ open up ↑ |
507 504 * If a result object was returned from above, push it on the
508 505 * current result stack
509 506 */
510 507 if (ACPI_SUCCESS (Status) &&
511 508 WalkState->ResultObj)
512 509 {
513 510 Status = AcpiDsResultPush (WalkState->ResultObj, WalkState);
514 511 }
515 512 break;
516 513
517 -
518 514 default:
519 515
520 516 switch (OpType)
521 517 {
522 518 case AML_TYPE_CONTROL: /* Type 1 opcode, IF/ELSE/WHILE/NOOP */
523 519
524 520 /* 1 Operand, 0 ExternalResult, 0 InternalResult */
525 521
526 522 Status = AcpiDsExecEndControlOp (WalkState, Op);
527 523
528 524 break;
529 525
530 -
531 526 case AML_TYPE_METHOD_CALL:
532 -
533 527 /*
534 528 * If the method is referenced from within a package
535 529 * declaration, it is not a invocation of the method, just
536 530 * a reference to it.
537 531 */
538 532 if ((Op->Asl.Parent) &&
539 533 ((Op->Asl.Parent->Asl.AmlOpcode == AML_PACKAGE_OP) ||
540 534 (Op->Asl.Parent->Asl.AmlOpcode == AML_VAR_PACKAGE_OP)))
541 535 {
542 536 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
543 537 "Method Reference in a Package, Op=%p\n", Op));
544 538
545 539 Op->Common.Node = (ACPI_NAMESPACE_NODE *) Op->Asl.Value.Arg->Asl.Node;
546 540 AcpiUtAddReference (Op->Asl.Value.Arg->Asl.Node->Object);
547 541 return_ACPI_STATUS (AE_OK);
548 542 }
549 543
550 - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method invocation, Op=%p\n", Op));
544 + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
545 + "Method invocation, Op=%p\n", Op));
551 546
552 547 /*
553 548 * (AML_METHODCALL) Op->Asl.Value.Arg->Asl.Node contains
554 549 * the method Node pointer
555 550 */
556 551 /* NextOp points to the op that holds the method name */
557 552
558 553 NextOp = FirstArg;
559 554
560 555 /* NextOp points to first argument op */
561 556
562 557 NextOp = NextOp->Common.Next;
563 558
564 559 /*
565 560 * Get the method's arguments and put them on the operand stack
566 561 */
567 562 Status = AcpiDsCreateOperands (WalkState, NextOp);
568 563 if (ACPI_FAILURE (Status))
569 564 {
570 565 break;
571 566 }
572 567
573 568 /*
574 569 * Since the operands will be passed to another control method,
575 570 * we must resolve all local references here (Local variables,
576 571 * arguments to *this* method, etc.)
577 572 */
578 573 Status = AcpiDsResolveOperands (WalkState);
579 574 if (ACPI_FAILURE (Status))
580 575 {
581 576 /* On error, clear all resolved operands */
582 577
583 578 AcpiDsClearOperands (WalkState);
584 579 break;
585 580 }
586 581
587 582 /*
588 583 * Tell the walk loop to preempt this running method and
↓ open down ↓ |
28 lines elided |
↑ open up ↑ |
589 584 * execute the new method
590 585 */
591 586 Status = AE_CTRL_TRANSFER;
592 587
593 588 /*
594 589 * Return now; we don't want to disturb anything,
595 590 * especially the operand count!
596 591 */
597 592 return_ACPI_STATUS (Status);
598 593
599 -
600 594 case AML_TYPE_CREATE_FIELD:
601 595
602 596 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
603 597 "Executing CreateField Buffer/Index Op=%p\n", Op));
604 598
605 599 Status = AcpiDsLoad2EndOp (WalkState);
606 600 if (ACPI_FAILURE (Status))
607 601 {
608 602 break;
609 603 }
610 604
611 605 Status = AcpiDsEvalBufferFieldOperands (WalkState, Op);
612 606 break;
↓ open down ↓ |
3 lines elided |
↑ open up ↑ |
613 607
614 608
615 609 case AML_TYPE_CREATE_OBJECT:
616 610
617 611 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
618 612 "Executing CreateObject (Buffer/Package) Op=%p\n", Op));
619 613
620 614 switch (Op->Common.Parent->Common.AmlOpcode)
621 615 {
622 616 case AML_NAME_OP:
623 -
624 617 /*
625 618 * Put the Node on the object stack (Contains the ACPI Name
626 619 * of this object)
627 620 */
628 621 WalkState->Operands[0] = (void *) Op->Common.Parent->Common.Node;
629 622 WalkState->NumOperands = 1;
630 623
631 624 Status = AcpiDsCreateNode (WalkState,
632 625 Op->Common.Parent->Common.Node,
633 626 Op->Common.Parent);
634 627 if (ACPI_FAILURE (Status))
635 628 {
636 629 break;
637 630 }
638 631
639 632 /* Fall through */
640 633 /*lint -fallthrough */
641 634
642 635 case AML_INT_EVAL_SUBTREE_OP:
643 636
644 637 Status = AcpiDsEvalDataObjectOperands (WalkState, Op,
645 638 AcpiNsGetAttachedObject (Op->Common.Parent->Common.Node));
646 639 break;
647 640
648 641 default:
649 642
650 643 Status = AcpiDsEvalDataObjectOperands (WalkState, Op, NULL);
651 644 break;
652 645 }
653 646
↓ open down ↓ |
20 lines elided |
↑ open up ↑ |
654 647 /*
655 648 * If a result object was returned from above, push it on the
656 649 * current result stack
657 650 */
658 651 if (WalkState->ResultObj)
659 652 {
660 653 Status = AcpiDsResultPush (WalkState->ResultObj, WalkState);
661 654 }
662 655 break;
663 656
664 -
665 657 case AML_TYPE_NAMED_FIELD:
666 658 case AML_TYPE_NAMED_COMPLEX:
667 659 case AML_TYPE_NAMED_SIMPLE:
668 660 case AML_TYPE_NAMED_NO_OBJ:
669 661
670 662 Status = AcpiDsLoad2EndOp (WalkState);
671 663 if (ACPI_FAILURE (Status))
672 664 {
673 665 break;
674 666 }
675 667
676 668 if (Op->Common.AmlOpcode == AML_REGION_OP)
677 669 {
678 670 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
679 671 "Executing OpRegion Address/Length Op=%p\n", Op));
680 672
681 673 Status = AcpiDsEvalRegionOperands (WalkState, Op);
682 674 if (ACPI_FAILURE (Status))
683 675 {
684 676 break;
685 677 }
686 678 }
687 679 else if (Op->Common.AmlOpcode == AML_DATA_REGION_OP)
688 680 {
689 681 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
690 682 "Executing DataTableRegion Strings Op=%p\n", Op));
691 683
692 684 Status = AcpiDsEvalTableRegionOperands (WalkState, Op);
693 685 if (ACPI_FAILURE (Status))
694 686 {
695 687 break;
696 688 }
697 689 }
698 690 else if (Op->Common.AmlOpcode == AML_BANK_FIELD_OP)
699 691 {
700 692 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
↓ open down ↓ |
26 lines elided |
↑ open up ↑ |
701 693 "Executing BankField Op=%p\n", Op));
702 694
703 695 Status = AcpiDsEvalBankFieldOperands (WalkState, Op);
704 696 if (ACPI_FAILURE (Status))
705 697 {
706 698 break;
707 699 }
708 700 }
709 701 break;
710 702
711 -
712 703 case AML_TYPE_UNDEFINED:
713 704
714 705 ACPI_ERROR ((AE_INFO,
715 706 "Undefined opcode type Op=%p", Op));
716 707 return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
717 708
718 -
719 709 case AML_TYPE_BOGUS:
720 710
721 711 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
722 712 "Internal opcode=%X type Op=%p\n",
723 713 WalkState->Opcode, Op));
724 714 break;
725 715
726 -
727 716 default:
728 717
729 718 ACPI_ERROR ((AE_INFO,
730 - "Unimplemented opcode, class=0x%X type=0x%X Opcode=-0x%X Op=%p",
719 + "Unimplemented opcode, class=0x%X type=0x%X Opcode=0x%X Op=%p",
731 720 OpClass, OpType, Op->Common.AmlOpcode, Op));
732 721
733 722 Status = AE_NOT_IMPLEMENTED;
734 723 break;
735 724 }
736 725 }
737 726
738 727 /*
739 728 * ACPI 2.0 support for 64-bit integers: Truncate numeric
740 729 * result value if we are executing from a 32-bit ACPI table
741 730 */
742 - AcpiExTruncateFor32bitTable (WalkState->ResultObj);
731 + (void) AcpiExTruncateFor32bitTable (WalkState->ResultObj);
743 732
744 733 /*
745 734 * Check if we just completed the evaluation of a
746 735 * conditional predicate
747 736 */
748 737 if ((ACPI_SUCCESS (Status)) &&
749 738 (WalkState->ControlState) &&
750 739 (WalkState->ControlState->Common.State ==
751 740 ACPI_CONTROL_PREDICATE_EXECUTING) &&
752 741 (WalkState->ControlState->Control.PredicateOp == Op))
753 742 {
754 743 Status = AcpiDsGetPredicateValue (WalkState, WalkState->ResultObj);
755 744 WalkState->ResultObj = NULL;
756 745 }
757 746
758 747
759 748 Cleanup:
760 749
761 750 if (WalkState->ResultObj)
762 751 {
763 752 /* Break to debugger to display result */
764 753
765 754 ACPI_DEBUGGER_EXEC (AcpiDbDisplayResultObject (WalkState->ResultObj,
766 755 WalkState));
767 756
768 757 /*
769 758 * Delete the result op if and only if:
770 759 * Parent will not use the result -- such as any
771 760 * non-nested type2 op in a method (parent will be method)
772 761 */
773 762 AcpiDsDeleteResultIfNotUsed (Op, WalkState->ResultObj, WalkState);
774 763 }
775 764
776 765 #ifdef _UNDER_DEVELOPMENT
777 766
778 767 if (WalkState->ParserState.Aml == WalkState->ParserState.AmlEnd)
779 768 {
780 769 AcpiDbMethodEnd (WalkState);
781 770 }
782 771 #endif
783 772
784 773 /* Invoke exception handler on error */
785 774
↓ open down ↓ |
33 lines elided |
↑ open up ↑ |
786 775 if (ACPI_FAILURE (Status))
787 776 {
788 777 Status = AcpiDsMethodError (Status, WalkState);
789 778 }
790 779
791 780 /* Always clear the object stack */
792 781
793 782 WalkState->NumOperands = 0;
794 783 return_ACPI_STATUS (Status);
795 784 }
796 -
797 -
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX