Print this page
update to acpica-unix2-20140114
acpica-unix2-20130823
PANKOVs restructure
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/intel/io/acpica/executer/exresop.c
+++ new/usr/src/common/acpica/components/executer/exresop.c
1 -
2 1 /******************************************************************************
3 2 *
4 3 * Module Name: exresop - AML Interpreter operand/object resolution
5 4 *
6 5 *****************************************************************************/
7 6
8 7 /*
9 - * Copyright (C) 2000 - 2011, Intel Corp.
8 + * Copyright (C) 2000 - 2014, Intel Corp.
10 9 * All rights reserved.
11 10 *
12 11 * Redistribution and use in source and binary forms, with or without
13 12 * modification, are permitted provided that the following conditions
14 13 * are met:
15 14 * 1. Redistributions of source code must retain the above copyright
16 15 * notice, this list of conditions, and the following disclaimer,
17 16 * without modification.
18 17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
19 18 * substantially similar to the "NO WARRANTY" disclaimer below
20 19 * ("Disclaimer") and any redistribution must be conditioned upon
21 20 * including a substantially similar Disclaimer requirement for further
22 21 * binary redistribution.
23 22 * 3. Neither the names of the above-listed copyright holders nor the names
24 23 * of any contributors may be used to endorse or promote products derived
25 24 * from this software without specific prior written permission.
26 25 *
27 26 * Alternatively, this software may be distributed under the terms of the
28 27 * GNU General Public License ("GPL") version 2 as published by the Free
29 28 * Software Foundation.
30 29 *
31 30 * NO WARRANTY
32 31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33 32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34 33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
35 34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36 35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37 36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38 37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
40 39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
41 40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
42 41 * POSSIBILITY OF SUCH DAMAGES.
43 42 */
44 43
45 44 #define __EXRESOP_C__
46 45
47 46 #include "acpi.h"
48 47 #include "accommon.h"
49 48 #include "amlcode.h"
50 49 #include "acparser.h"
51 50 #include "acinterp.h"
52 51 #include "acnamesp.h"
53 52
54 53
55 54 #define _COMPONENT ACPI_EXECUTER
56 55 ACPI_MODULE_NAME ("exresop")
57 56
58 57 /* Local prototypes */
59 58
60 59 static ACPI_STATUS
61 60 AcpiExCheckObjectType (
62 61 ACPI_OBJECT_TYPE TypeNeeded,
63 62 ACPI_OBJECT_TYPE ThisType,
64 63 void *Object);
65 64
66 65
67 66 /*******************************************************************************
68 67 *
69 68 * FUNCTION: AcpiExCheckObjectType
70 69 *
71 70 * PARAMETERS: TypeNeeded Object type needed
72 71 * ThisType Actual object type
73 72 * Object Object pointer
74 73 *
75 74 * RETURN: Status
76 75 *
77 76 * DESCRIPTION: Check required type against actual type
78 77 *
79 78 ******************************************************************************/
80 79
81 80 static ACPI_STATUS
82 81 AcpiExCheckObjectType (
83 82 ACPI_OBJECT_TYPE TypeNeeded,
84 83 ACPI_OBJECT_TYPE ThisType,
85 84 void *Object)
86 85 {
87 86 ACPI_FUNCTION_ENTRY ();
88 87
89 88
90 89 if (TypeNeeded == ACPI_TYPE_ANY)
↓ open down ↓ |
71 lines elided |
↑ open up ↑ |
91 90 {
92 91 /* All types OK, so we don't perform any typechecks */
93 92
94 93 return (AE_OK);
95 94 }
96 95
97 96 if (TypeNeeded == ACPI_TYPE_LOCAL_REFERENCE)
98 97 {
99 98 /*
100 99 * Allow the AML "Constant" opcodes (Zero, One, etc.) to be reference
101 - * objects and thus allow them to be targets. (As per the ACPI
100 + * objects and thus allow them to be targets. (As per the ACPI
102 101 * specification, a store to a constant is a noop.)
103 102 */
104 103 if ((ThisType == ACPI_TYPE_INTEGER) &&
105 104 (((ACPI_OPERAND_OBJECT *) Object)->Common.Flags & AOPOBJ_AML_CONSTANT))
106 105 {
107 106 return (AE_OK);
108 107 }
109 108 }
110 109
111 110 if (TypeNeeded != ThisType)
112 111 {
113 112 ACPI_ERROR ((AE_INFO,
114 113 "Needed type [%s], found [%s] %p",
115 114 AcpiUtGetTypeName (TypeNeeded),
116 115 AcpiUtGetTypeName (ThisType), Object));
117 116
118 117 return (AE_AML_OPERAND_TYPE);
119 118 }
120 119
121 120 return (AE_OK);
122 121 }
123 122
124 123
125 124 /*******************************************************************************
126 125 *
127 126 * FUNCTION: AcpiExResolveOperands
128 127 *
129 128 * PARAMETERS: Opcode - Opcode being interpreted
130 129 * StackPtr - Pointer to the operand stack to be
131 130 * resolved
132 131 * WalkState - Current state
133 132 *
134 133 * RETURN: Status
135 134 *
136 135 * DESCRIPTION: Convert multiple input operands to the types required by the
137 136 * target operator.
138 137 *
139 138 * Each 5-bit group in ArgTypes represents one required
140 139 * operand and indicates the required Type. The corresponding operand
141 140 * will be converted to the required type if possible, otherwise we
142 141 * abort with an exception.
143 142 *
144 143 ******************************************************************************/
145 144
146 145 ACPI_STATUS
147 146 AcpiExResolveOperands (
148 147 UINT16 Opcode,
149 148 ACPI_OPERAND_OBJECT **StackPtr,
150 149 ACPI_WALK_STATE *WalkState)
151 150 {
152 151 ACPI_OPERAND_OBJECT *ObjDesc;
153 152 ACPI_STATUS Status = AE_OK;
154 153 UINT8 ObjectType;
155 154 UINT32 ArgTypes;
156 155 const ACPI_OPCODE_INFO *OpInfo;
157 156 UINT32 ThisArgType;
158 157 ACPI_OBJECT_TYPE TypeNeeded;
159 158 UINT16 TargetOp = 0;
160 159
161 160
162 161 ACPI_FUNCTION_TRACE_U32 (ExResolveOperands, Opcode);
163 162
164 163
165 164 OpInfo = AcpiPsGetOpcodeInfo (Opcode);
166 165 if (OpInfo->Class == AML_CLASS_UNKNOWN)
167 166 {
168 167 return_ACPI_STATUS (AE_AML_BAD_OPCODE);
169 168 }
170 169
171 170 ArgTypes = OpInfo->RuntimeArgs;
172 171 if (ArgTypes == ARGI_INVALID_OPCODE)
173 172 {
174 173 ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
175 174 Opcode));
176 175
177 176 return_ACPI_STATUS (AE_AML_INTERNAL);
178 177 }
179 178
180 179 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
181 180 "Opcode %X [%s] RequiredOperandTypes=%8.8X\n",
182 181 Opcode, OpInfo->Name, ArgTypes));
183 182
184 183 /*
185 184 * Normal exit is with (ArgTypes == 0) at end of argument list.
186 185 * Function will return an exception from within the loop upon
187 186 * finding an entry which is not (or cannot be converted
188 187 * to) the required type; if stack underflows; or upon
189 188 * finding a NULL stack entry (which should not happen).
190 189 */
191 190 while (GET_CURRENT_ARG_TYPE (ArgTypes))
192 191 {
193 192 if (!StackPtr || !*StackPtr)
194 193 {
195 194 ACPI_ERROR ((AE_INFO, "Null stack entry at %p",
196 195 StackPtr));
197 196
198 197 return_ACPI_STATUS (AE_AML_INTERNAL);
199 198 }
200 199
201 200 /* Extract useful items */
202 201
203 202 ObjDesc = *StackPtr;
204 203
205 204 /* Decode the descriptor type */
206 205
207 206 switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc))
208 207 {
209 208 case ACPI_DESC_TYPE_NAMED:
210 209
211 210 /* Namespace Node */
212 211
213 212 ObjectType = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type;
214 213
215 214 /*
216 215 * Resolve an alias object. The construction of these objects
217 216 * guarantees that there is only one level of alias indirection;
↓ open down ↓ |
106 lines elided |
↑ open up ↑ |
218 217 * thus, the attached object is always the aliased namespace node
219 218 */
220 219 if (ObjectType == ACPI_TYPE_LOCAL_ALIAS)
221 220 {
222 221 ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjDesc);
223 222 *StackPtr = ObjDesc;
224 223 ObjectType = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type;
225 224 }
226 225 break;
227 226
228 -
229 227 case ACPI_DESC_TYPE_OPERAND:
230 228
231 229 /* ACPI internal object */
232 230
233 231 ObjectType = ObjDesc->Common.Type;
234 232
235 233 /* Check for bad ACPI_OBJECT_TYPE */
236 234
237 235 if (!AcpiUtValidObjectType (ObjectType))
238 236 {
239 237 ACPI_ERROR ((AE_INFO,
240 238 "Bad operand object type [0x%X]", ObjectType));
241 239
242 240 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
243 241 }
244 242
245 243 if (ObjectType == (UINT8) ACPI_TYPE_LOCAL_REFERENCE)
246 244 {
247 245 /* Validate the Reference */
248 246
249 247 switch (ObjDesc->Reference.Class)
250 248 {
251 249 case ACPI_REFCLASS_DEBUG:
252 250
253 251 TargetOp = AML_DEBUG_OP;
254 252
255 253 /*lint -fallthrough */
256 254
257 255 case ACPI_REFCLASS_ARG:
258 256 case ACPI_REFCLASS_LOCAL:
259 257 case ACPI_REFCLASS_INDEX:
260 258 case ACPI_REFCLASS_REFOF:
261 259 case ACPI_REFCLASS_TABLE: /* DdbHandle from LOAD_OP or LOAD_TABLE_OP */
262 260 case ACPI_REFCLASS_NAME: /* Reference to a named object */
263 261
264 262 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
265 263 "Operand is a Reference, Class [%s] %2.2X\n",
266 264 AcpiUtGetReferenceName (ObjDesc),
267 265 ObjDesc->Reference.Class));
268 266 break;
269 267
270 268 default:
↓ open down ↓ |
32 lines elided |
↑ open up ↑ |
271 269
272 270 ACPI_ERROR ((AE_INFO,
273 271 "Unknown Reference Class 0x%2.2X in %p",
274 272 ObjDesc->Reference.Class, ObjDesc));
275 273
276 274 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
277 275 }
278 276 }
279 277 break;
280 278
281 -
282 279 default:
283 280
284 281 /* Invalid descriptor */
285 282
286 283 ACPI_ERROR ((AE_INFO, "Invalid descriptor %p [%s]",
287 284 ObjDesc, AcpiUtGetDescriptorName (ObjDesc)));
288 285
289 286 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
290 287 }
291 288
292 289 /* Get one argument type, point to the next */
293 290
294 291 ThisArgType = GET_CURRENT_ARG_TYPE (ArgTypes);
295 292 INCREMENT_ARG_LIST (ArgTypes);
296 293
297 294 /*
298 295 * Handle cases where the object does not need to be
299 296 * resolved to a value
300 297 */
301 298 switch (ThisArgType)
302 299 {
303 300 case ARGI_REF_OR_STRING: /* Can be a String or Reference */
304 301
305 302 if ((ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_OPERAND) &&
306 303 (ObjDesc->Common.Type == ACPI_TYPE_STRING))
307 304 {
308 305 /*
309 306 * String found - the string references a named object and
310 307 * must be resolved to a node
311 308 */
312 309 goto NextOperand;
313 310 }
314 311
315 312 /*
316 313 * Else not a string - fall through to the normal Reference
317 314 * case below
↓ open down ↓ |
26 lines elided |
↑ open up ↑ |
318 315 */
319 316 /*lint -fallthrough */
320 317
321 318 case ARGI_REFERENCE: /* References: */
322 319 case ARGI_INTEGER_REF:
323 320 case ARGI_OBJECT_REF:
324 321 case ARGI_DEVICE_REF:
325 322 case ARGI_TARGETREF: /* Allows implicit conversion rules before store */
326 323 case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */
327 324 case ARGI_SIMPLE_TARGET: /* Name, Local, or Arg - no implicit conversion */
328 -
329 325 /*
330 326 * Need an operand of type ACPI_TYPE_LOCAL_REFERENCE
331 327 * A Namespace Node is OK as-is
332 328 */
333 329 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_NAMED)
334 330 {
335 331 goto NextOperand;
336 332 }
337 333
338 334 Status = AcpiExCheckObjectType (ACPI_TYPE_LOCAL_REFERENCE,
339 335 ObjectType, ObjDesc);
340 336 if (ACPI_FAILURE (Status))
341 337 {
342 338 return_ACPI_STATUS (Status);
343 339 }
344 340 goto NextOperand;
345 341
346 -
347 342 case ARGI_DATAREFOBJ: /* Store operator only */
348 -
349 343 /*
350 344 * We don't want to resolve IndexOp reference objects during
351 345 * a store because this would be an implicit DeRefOf operation.
352 346 * Instead, we just want to store the reference object.
353 347 * -- All others must be resolved below.
354 348 */
355 349 if ((Opcode == AML_STORE_OP) &&
356 350 ((*StackPtr)->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
357 351 ((*StackPtr)->Reference.Class == ACPI_REFCLASS_INDEX))
358 352 {
359 353 goto NextOperand;
360 354 }
361 355 break;
362 356
363 357 default:
358 +
364 359 /* All cases covered above */
360 +
365 361 break;
366 362 }
367 363
368 364 /*
369 365 * Resolve this object to a value
370 366 */
371 367 Status = AcpiExResolveToValue (StackPtr, WalkState);
372 368 if (ACPI_FAILURE (Status))
373 369 {
374 370 return_ACPI_STATUS (Status);
375 371 }
376 372
377 373 /* Get the resolved object */
378 374
379 375 ObjDesc = *StackPtr;
380 376
381 377 /*
382 378 * Check the resulting object (value) type
383 379 */
384 380 switch (ThisArgType)
385 381 {
386 382 /*
387 383 * For the simple cases, only one type of resolved object
388 384 * is allowed
389 385 */
390 386 case ARGI_MUTEX:
391 387
392 388 /* Need an operand of type ACPI_TYPE_MUTEX */
393 389
394 390 TypeNeeded = ACPI_TYPE_MUTEX;
395 391 break;
396 392
397 393 case ARGI_EVENT:
398 394
399 395 /* Need an operand of type ACPI_TYPE_EVENT */
400 396
401 397 TypeNeeded = ACPI_TYPE_EVENT;
402 398 break;
403 399
404 400 case ARGI_PACKAGE: /* Package */
405 401
406 402 /* Need an operand of type ACPI_TYPE_PACKAGE */
407 403
408 404 TypeNeeded = ACPI_TYPE_PACKAGE;
409 405 break;
410 406
411 407 case ARGI_ANYTYPE:
412 408
413 409 /* Any operand type will do */
414 410
415 411 TypeNeeded = ACPI_TYPE_ANY;
416 412 break;
417 413
418 414 case ARGI_DDBHANDLE:
419 415
420 416 /* Need an operand of type ACPI_TYPE_DDB_HANDLE */
421 417
422 418 TypeNeeded = ACPI_TYPE_LOCAL_REFERENCE;
423 419 break;
424 420
425 421
426 422 /*
427 423 * The more complex cases allow multiple resolved object types
428 424 */
429 425 case ARGI_INTEGER:
430 426
431 427 /*
432 428 * Need an operand of type ACPI_TYPE_INTEGER,
433 429 * But we can implicitly convert from a STRING or BUFFER
434 430 * Aka - "Implicit Source Operand Conversion"
435 431 */
436 432 Status = AcpiExConvertToInteger (ObjDesc, StackPtr, 16);
437 433 if (ACPI_FAILURE (Status))
438 434 {
439 435 if (Status == AE_TYPE)
440 436 {
441 437 ACPI_ERROR ((AE_INFO,
442 438 "Needed [Integer/String/Buffer], found [%s] %p",
443 439 AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
444 440
445 441 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
446 442 }
↓ open down ↓ |
72 lines elided |
↑ open up ↑ |
447 443
448 444 return_ACPI_STATUS (Status);
449 445 }
450 446
451 447 if (ObjDesc != *StackPtr)
452 448 {
453 449 AcpiUtRemoveReference (ObjDesc);
454 450 }
455 451 goto NextOperand;
456 452
457 -
458 453 case ARGI_BUFFER:
459 -
460 454 /*
461 455 * Need an operand of type ACPI_TYPE_BUFFER,
462 456 * But we can implicitly convert from a STRING or INTEGER
463 457 * Aka - "Implicit Source Operand Conversion"
464 458 */
465 459 Status = AcpiExConvertToBuffer (ObjDesc, StackPtr);
466 460 if (ACPI_FAILURE (Status))
467 461 {
468 462 if (Status == AE_TYPE)
469 463 {
470 464 ACPI_ERROR ((AE_INFO,
471 465 "Needed [Integer/String/Buffer], found [%s] %p",
472 466 AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
473 467
474 468 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
475 469 }
↓ open down ↓ |
6 lines elided |
↑ open up ↑ |
476 470
477 471 return_ACPI_STATUS (Status);
478 472 }
479 473
480 474 if (ObjDesc != *StackPtr)
481 475 {
482 476 AcpiUtRemoveReference (ObjDesc);
483 477 }
484 478 goto NextOperand;
485 479
486 -
487 480 case ARGI_STRING:
488 -
489 481 /*
490 482 * Need an operand of type ACPI_TYPE_STRING,
491 483 * But we can implicitly convert from a BUFFER or INTEGER
492 484 * Aka - "Implicit Source Operand Conversion"
493 485 */
494 486 Status = AcpiExConvertToString (ObjDesc, StackPtr,
495 487 ACPI_IMPLICIT_CONVERT_HEX);
496 488 if (ACPI_FAILURE (Status))
497 489 {
498 490 if (Status == AE_TYPE)
499 491 {
500 492 ACPI_ERROR ((AE_INFO,
501 493 "Needed [Integer/String/Buffer], found [%s] %p",
502 494 AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
503 495
504 496 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
505 497 }
↓ open down ↓ |
7 lines elided |
↑ open up ↑ |
506 498
507 499 return_ACPI_STATUS (Status);
508 500 }
509 501
510 502 if (ObjDesc != *StackPtr)
511 503 {
512 504 AcpiUtRemoveReference (ObjDesc);
513 505 }
514 506 goto NextOperand;
515 507
516 -
517 508 case ARGI_COMPUTEDATA:
518 509
519 510 /* Need an operand of type INTEGER, STRING or BUFFER */
520 511
521 512 switch (ObjDesc->Common.Type)
522 513 {
523 514 case ACPI_TYPE_INTEGER:
524 515 case ACPI_TYPE_STRING:
525 516 case ACPI_TYPE_BUFFER:
526 517
527 518 /* Valid operand */
528 519 break;
↓ open down ↓ |
2 lines elided |
↑ open up ↑ |
529 520
530 521 default:
531 522 ACPI_ERROR ((AE_INFO,
532 523 "Needed [Integer/String/Buffer], found [%s] %p",
533 524 AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
534 525
535 526 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
536 527 }
537 528 goto NextOperand;
538 529
539 -
540 530 case ARGI_BUFFER_OR_STRING:
541 531
542 532 /* Need an operand of type STRING or BUFFER */
543 533
544 534 switch (ObjDesc->Common.Type)
545 535 {
546 536 case ACPI_TYPE_STRING:
547 537 case ACPI_TYPE_BUFFER:
548 538
549 539 /* Valid operand */
550 540 break;
551 541
552 542 case ACPI_TYPE_INTEGER:
553 543
554 544 /* Highest priority conversion is to type Buffer */
555 545
556 546 Status = AcpiExConvertToBuffer (ObjDesc, StackPtr);
557 547 if (ACPI_FAILURE (Status))
558 548 {
559 549 return_ACPI_STATUS (Status);
560 550 }
561 551
562 552 if (ObjDesc != *StackPtr)
563 553 {
564 554 AcpiUtRemoveReference (ObjDesc);
565 555 }
566 556 break;
↓ open down ↓ |
17 lines elided |
↑ open up ↑ |
567 557
568 558 default:
569 559 ACPI_ERROR ((AE_INFO,
570 560 "Needed [Integer/String/Buffer], found [%s] %p",
571 561 AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
572 562
573 563 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
574 564 }
575 565 goto NextOperand;
576 566
577 -
578 567 case ARGI_DATAOBJECT:
579 568 /*
580 569 * ARGI_DATAOBJECT is only used by the SizeOf operator.
581 570 * Need a buffer, string, package, or RefOf reference.
582 571 *
583 572 * The only reference allowed here is a direct reference to
584 573 * a namespace node.
585 574 */
586 575 switch (ObjDesc->Common.Type)
587 576 {
588 577 case ACPI_TYPE_PACKAGE:
589 578 case ACPI_TYPE_STRING:
590 579 case ACPI_TYPE_BUFFER:
591 580 case ACPI_TYPE_LOCAL_REFERENCE:
592 581
593 582 /* Valid operand */
594 583 break;
595 584
596 585 default:
586 +
597 587 ACPI_ERROR ((AE_INFO,
598 588 "Needed [Buffer/String/Package/Reference], found [%s] %p",
599 589 AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
600 590
601 591 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
602 592 }
603 593 goto NextOperand;
604 594
605 -
606 595 case ARGI_COMPLEXOBJ:
607 596
608 597 /* Need a buffer or package or (ACPI 2.0) String */
609 598
610 599 switch (ObjDesc->Common.Type)
611 600 {
612 601 case ACPI_TYPE_PACKAGE:
613 602 case ACPI_TYPE_STRING:
614 603 case ACPI_TYPE_BUFFER:
615 604
616 605 /* Valid operand */
617 606 break;
618 607
619 608 default:
609 +
620 610 ACPI_ERROR ((AE_INFO,
621 611 "Needed [Buffer/String/Package], found [%s] %p",
622 612 AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
623 613
624 614 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
625 615 }
626 616 goto NextOperand;
627 617
628 -
629 618 case ARGI_REGION_OR_BUFFER: /* Used by Load() only */
630 619
631 620 /* Need an operand of type REGION or a BUFFER (which could be a resolved region field) */
632 621
633 622 switch (ObjDesc->Common.Type)
634 623 {
635 624 case ACPI_TYPE_BUFFER:
636 625 case ACPI_TYPE_REGION:
637 626
638 627 /* Valid operand */
639 628 break;
640 629
641 630 default:
631 +
642 632 ACPI_ERROR ((AE_INFO,
643 633 "Needed [Region/Buffer], found [%s] %p",
644 634 AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
645 635
646 636 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
647 637 }
648 638 goto NextOperand;
649 639
650 -
651 640 case ARGI_DATAREFOBJ:
652 641
653 642 /* Used by the Store() operator only */
654 643
655 644 switch (ObjDesc->Common.Type)
656 645 {
657 646 case ACPI_TYPE_INTEGER:
658 647 case ACPI_TYPE_PACKAGE:
659 648 case ACPI_TYPE_STRING:
660 649 case ACPI_TYPE_BUFFER:
661 650 case ACPI_TYPE_BUFFER_FIELD:
662 651 case ACPI_TYPE_LOCAL_REFERENCE:
663 652 case ACPI_TYPE_LOCAL_REGION_FIELD:
664 653 case ACPI_TYPE_LOCAL_BANK_FIELD:
665 654 case ACPI_TYPE_LOCAL_INDEX_FIELD:
666 655 case ACPI_TYPE_DDB_HANDLE:
↓ open down ↓ |
6 lines elided |
↑ open up ↑ |
667 656
668 657 /* Valid operand */
669 658 break;
670 659
671 660 default:
672 661
673 662 if (AcpiGbl_EnableInterpreterSlack)
674 663 {
675 664 /*
676 665 * Enable original behavior of Store(), allowing any and all
677 - * objects as the source operand. The ACPI spec does not
666 + * objects as the source operand. The ACPI spec does not
678 667 * allow this, however.
679 668 */
680 669 break;
681 670 }
682 671
683 672 if (TargetOp == AML_DEBUG_OP)
684 673 {
685 674 /* Allow store of any object to the Debug object */
686 675
687 676 break;
688 677 }
689 678
690 679 ACPI_ERROR ((AE_INFO,
691 680 "Needed Integer/Buffer/String/Package/Ref/Ddb], found [%s] %p",
692 681 AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
693 682
694 683 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
695 684 }
696 685 goto NextOperand;
697 686
698 -
699 687 default:
700 688
701 689 /* Unknown type */
702 690
703 691 ACPI_ERROR ((AE_INFO,
704 692 "Internal - Unknown ARGI (required operand) type 0x%X",
705 693 ThisArgType));
706 694
707 695 return_ACPI_STATUS (AE_BAD_PARAMETER);
708 696 }
709 697
710 698 /*
711 699 * Make sure that the original object was resolved to the
712 700 * required object type (Simple cases only).
713 701 */
714 702 Status = AcpiExCheckObjectType (TypeNeeded,
715 703 (*StackPtr)->Common.Type, *StackPtr);
716 704 if (ACPI_FAILURE (Status))
717 705 {
718 706 return_ACPI_STATUS (Status);
719 707 }
720 708
721 709 NextOperand:
722 710 /*
723 711 * If more operands needed, decrement StackPtr to point
724 712 * to next operand on stack
725 713 */
726 714 if (GET_CURRENT_ARG_TYPE (ArgTypes))
↓ open down ↓ |
18 lines elided |
↑ open up ↑ |
727 715 {
728 716 StackPtr--;
729 717 }
730 718 }
731 719
732 720 ACPI_DUMP_OPERANDS (WalkState->Operands,
733 721 AcpiPsGetOpcodeName (Opcode), WalkState->NumOperands);
734 722
735 723 return_ACPI_STATUS (Status);
736 724 }
737 -
738 -
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX