Debian Codegraph @

tests/aslts/src/runtime/collections/complex/namespace/ns1.asl

raw
1 /*
2 * Some or all of this work - Copyright (c) 2006 - 2021, Intel Corp.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without modification,
6 * are permitted provided that the following conditions are met:
7 *
8 * Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 * Neither the name of Intel Corporation nor the names of its contributors
14 * may be used to endorse or promote products derived from this software
15 * without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28 Name (Z155, 0x9B)
29 /*
30 * Three tests below are here
31 * as specific type arguments passing -
32 * arguments though passed directly to method, not as references,
33 * nevertheless allow access to the elements of original objects.
34 */
35 Method (M100, 0, Serialized)
36 {
37 Name (P000, Package (0x03)
38 {
39 0xABCD0000,
40 0xABCD0001,
41 0xABCD0002
42 })
43 Method (M001, 2, NotSerialized)
44 {
45 Arg0 [0x00] = 0x11112222
46 }
47
48 M001 (P000, RefOf (P000))
49 Local0 = DerefOf (P000 [0x00])
50 If ((Local0 != 0x11112222))
51 {
52 ERR (__METHOD__, Z155, __LINE__, 0x00, 0x00, Local0, 0x11112222)
53 }
54
55 CH03 (__METHOD__, Z155, __LINE__, 0x00, 0x00)
56 }
57
58 Method (M101, 0, Serialized)
59 {
60 Name (B000, Buffer (0x03)
61 {
62 0x10, 0x11, 0x12 // ...
63 })
64 Method (M001, 2, NotSerialized)
65 {
66 Arg0 [0x00] = 0x67
67 }
68
69 M001 (B000, RefOf (B000))
70 Local0 = DerefOf (B000 [0x00])
71 If ((Local0 != 0x67))
72 {
73 ERR (__METHOD__, Z155, __LINE__, 0x00, 0x00, Local0, 0x67)
74 }
75
76 CH03 (__METHOD__, Z155, __LINE__, 0x00, 0x00)
77 }
78
79 Method (M102, 0, Serialized)
80 {
81 Name (S000, "qqqqqqqqqqqqqq")
82 Method (M001, 2, NotSerialized)
83 {
84 Arg0 [0x00] = 0x38
85 }
86
87 M001 (S000, RefOf (S000))
88 Local0 = DerefOf (S000 [0x00])
89 If ((Local0 != 0x38))
90 {
91 ERR (__METHOD__, Z155, __LINE__, 0x00, 0x00, Local0, 0x38)
92 }
93
94 CH03 (__METHOD__, Z155, __LINE__, 0x00, 0x00)
95 }
96
97 /*
98 * Element of Package instead of i000 (in m001)
99 */
100 Method (M103, 1, Serialized)
101 {
102 Name (I001, 0x00)
103 Name (P000, Package (0x04)
104 {
105 0x01,
106 0x02,
107 0x03,
108 0x04
109 })
110 Name (PP00, Package (0x03)
111 {
112 0x11111111,
113 0x01,
114 0x22223333
115 })
116 CH03 (__METHOD__, Z155, __LINE__, 0x00, 0x00)
117 I001 = Arg0
118 Method (M001, 0, NotSerialized)
119 {
120 Method (M002, 0, NotSerialized)
121 {
122 Method (M003, 0, NotSerialized)
123 {
124 Method (M004, 0, NotSerialized)
125 {
126 Method (M005, 0, NotSerialized)
127 {
128 Method (M006, 0, NotSerialized)
129 {
130 Method (M007, 0, NotSerialized)
131 {
132 Method (M008, 0, NotSerialized)
133 {
134 If (I001)
135 {
136 PP00 [0x01] = P000 /* \M103.P000 */
137 }
138
139 Return (0x00)
140 }
141
142 PP00 [0x01] = 0x80000000
143 Return ((DerefOf (PP00 [0x01]) + M008 ()))
144 }
145
146 PP00 [0x01] = 0x07000000
147 Return ((DerefOf (PP00 [0x01]) + M007 ()))
148 }
149
150 PP00 [0x01] = 0x00600000
151 Return ((DerefOf (PP00 [0x01]) + M006 ()))
152 }
153
154 PP00 [0x01] = 0x00050000
155 Return ((DerefOf (PP00 [0x01]) + M005 ()))
156 }
157
158 PP00 [0x01] = 0x4000
159 Return ((DerefOf (PP00 [0x01]) + M004 ()))
160 }
161
162 PP00 [0x01] = 0x0300
163 Return ((DerefOf (PP00 [0x01]) + M003 ()))
164 }
165
166 PP00 [0x01] = 0x20
167 Return ((DerefOf (PP00 [0x01]) + M002 ()))
168 }
169
170 Store ((DerefOf (PP00 [0x01]) + M001 ()), Local0)
171 If ((Local0 != 0x87654321))
172 {
173 ERR (__METHOD__, Z155, __LINE__, 0x00, 0x00, Local0, 0x87654321)
174 }
175
176 Local0 = DerefOf (PP00 [0x01])
177 If ((Local0 != 0x80000000))
178 {
179 ERR (__METHOD__, Z155, __LINE__, 0x00, 0x00, Local0, 0x80000000)
180 }
181
182 CH03 (__METHOD__, Z155, __LINE__, 0x00, 0x00)
183 }
184
185 /*
186 * Element of Package instead of i000 (in m002)
187 */
188 Method (M104, 0, Serialized)
189 {
190 Name (I001, 0x00)
191 Name (PP00, Package (0x03)
192 {
193 0x11111111,
194 0x00100000,
195 0x22223333
196 })
197 Method (M001, 0, NotSerialized)
198 {
199 If ((I001 < 0x64))
200 {
201 Local0 = DerefOf (PP00 [0x01])
202 Local0++
203 PP00 [0x01] = Local0
204 I001++
205 Local0 = (DerefOf (PP00 [0x01]) + M001 ())
206 Return (Local0)
207 }
208
209 Return (0x00)
210 }
211
212 Store ((DerefOf (PP00 [0x01]) + M001 ()), Local0)
213 If ((Local0 != 0x065013BA))
214 {
215 ERR (__METHOD__, Z155, __LINE__, 0x00, 0x00, Local0, 0x065013BA)
216 }
217
218 Local0 = DerefOf (PP00 [0x01])
219 If ((Local0 != 0x00100064))
220 {
221 ERR (__METHOD__, Z155, __LINE__, 0x00, 0x00, Local0, 0x00100064)
222 }
223
224 CH03 (__METHOD__, Z155, __LINE__, 0x00, 0x00)
225 }
226
227 /*
228 * Buffer Field instead of i000 (in m001)
229 */
230 Method (M105, 1, Serialized)
231 {
232 Name (I001, 0x00)
233 Name (B000, Buffer (0x10){})
234 CreateField (B000, 0x05, 0x20, BF00)
235 CH03 (__METHOD__, Z155, __LINE__, 0x00, 0x00)
236 I001 = Arg0
237 Method (M001, 0, NotSerialized)
238 {
239 Method (M002, 0, NotSerialized)
240 {
241 Method (M003, 0, NotSerialized)
242 {
243 Method (M004, 0, NotSerialized)
244 {
245 Method (M005, 0, NotSerialized)
246 {
247 Method (M006, 0, NotSerialized)
248 {
249 Method (M007, 0, NotSerialized)
250 {
251 Method (M008, 0, NotSerialized)
252 {
253 If (I001)
254 {
255 BF00 = 0x11223344
256 }
257
258 Return (0x00)
259 }
260
261 BF00 = 0x80000000
262 Return ((BF00 + M008 ()))
263 }
264
265 BF00 = 0x07000000
266 Return ((BF00 + M007 ()))
267 }
268
269 BF00 = 0x00600000
270 Return ((BF00 + M006 ()))
271 }
272
273 BF00 = 0x00050000
274 Return ((BF00 + M005 ()))
275 }
276
277 BF00 = 0x4000
278 Return ((BF00 + M004 ()))
279 }
280
281 BF00 = 0x0300
282 Return ((BF00 + M003 ()))
283 }
284
285 BF00 = 0x20
286 Return ((BF00 + M002 ()))
287 }
288
289 BF00 = 0x01
290 Store ((BF00 + M001 ()), Local0)
291 If ((Local0 != 0x87654321))
292 {
293 ERR (__METHOD__, Z155, __LINE__, 0x00, 0x00, Local0, 0x87654321)
294 }
295
296 If (Arg0)
297 {
298 Local1 = Buffer() {0x44, 0x33, 0x22, 0x11}
299 }
300 Else
301 {
302 Local1 = Buffer() {0x00, 0x00, 0x00, 0x80}
303 }
304
305 If ((BF00 != Local1))
306 {
307 ERR (__METHOD__, Z155, __LINE__, 0x00, 0x00, BF00, Local1)
308 }
309
310 CH03 (__METHOD__, Z155, __LINE__, 0x00, 0x00)
311 }
312
313 /*
314 * Field instead of i000 (in m001)
315 */
316 Method (M106, 1, Serialized)
317 {
318 Name (I001, 0x00)
319 OperationRegion (R000, SystemMemory, 0x0100, 0x0100)
320 Field (R000, ByteAcc, NoLock, Preserve)
321 {
322 F000, 32,
323 F001, 32
324 }
325
326 CH03 (__METHOD__, Z155, __LINE__, 0x00, 0x00)
327 I001 = Arg0
328 Method (M001, 0, NotSerialized)
329 {
330 Method (M002, 0, NotSerialized)
331 {
332 Method (M003, 0, NotSerialized)
333 {
334 Method (M004, 0, NotSerialized)
335 {
336 Method (M005, 0, NotSerialized)
337 {
338 Method (M006, 0, NotSerialized)
339 {
340 Method (M007, 0, NotSerialized)
341 {
342 Method (M008, 0, NotSerialized)
343 {
344 If (I001)
345 {
346 F001 = 0x11223344
347 }
348
349 Return (0x00)
350 }
351
352 F001 = 0x80000000
353 Return ((F001 + M008 ()))
354 }
355
356 F001 = 0x07000000
357 Return ((F001 + M007 ()))
358 }
359
360 F001 = 0x00600000
361 Return ((F001 + M006 ()))
362 }
363
364 F001 = 0x00050000
365 Return ((F001 + M005 ()))
366 }
367
368 F001 = 0x4000
369 Return ((F001 + M004 ()))
370 }
371
372 F001 = 0x0300
373 Return ((F001 + M003 ()))
374 }
375
376 F001 = 0x20
377 Return ((F001 + M002 ()))
378 }
379
380 F001 = 0x01
381 Store ((F001 + M001 ()), Local0)
382 If ((Local0 != 0x87654321))
383 {
384 ERR (__METHOD__, Z155, __LINE__, 0x00, 0x00, Local0, 0x87654321)
385 }
386
387 If (Arg0)
388 {
389 Local1 = 0x11223344
390 }
391 Else
392 {
393 Local1 = 0x80000000
394 }
395
396 If ((F001 != Local1))
397 {
398 ERR (__METHOD__, Z155, __LINE__, 0x00, 0x00, F001, Local1)
399 }
400
401 CH03 (__METHOD__, Z155, __LINE__, 0x00, 0x00)
402 }
403
404 /*
405 * Bank Field instead of i000 (in m001)
406 *
407 * (is this test correct?)
408 */
409 Method (M107, 1, Serialized)
410 {
411 Name (I001, 0x00)
412 OperationRegion (R000, SystemMemory, 0x0100, 0x0100)
413 Field (R000, ByteAcc, NoLock, Preserve)
414 {
415 F000, 32,
416 F001, 32
417 }
418
419 BankField (R000, F001, 0x00, ByteAcc, NoLock, Preserve)
420 {
421 BNK0, 32
422 }
423
424 CH03 (__METHOD__, Z155, __LINE__, 0x00, 0x00)
425 I001 = Arg0
426 Method (M001, 0, NotSerialized)
427 {
428 Method (M002, 0, NotSerialized)
429 {
430 Method (M003, 0, NotSerialized)
431 {
432 Method (M004, 0, NotSerialized)
433 {
434 Method (M005, 0, NotSerialized)
435 {
436 Method (M006, 0, NotSerialized)
437 {
438 Method (M007, 0, NotSerialized)
439 {
440 Method (M008, 0, NotSerialized)
441 {
442 If (I001)
443 {
444 BNK0 = 0x11223344
445 }
446
447 Return (0x00)
448 }
449
450 BNK0 = 0x80000000
451 Return ((BNK0 + M008 ()))
452 }
453
454 BNK0 = 0x07000000
455 Return ((BNK0 + M007 ()))
456 }
457
458 BNK0 = 0x00600000
459 Return ((BNK0 + M006 ()))
460 }
461
462 BNK0 = 0x00050000
463 Return ((BNK0 + M005 ()))
464 }
465
466 BNK0 = 0x4000
467 Return ((BNK0 + M004 ()))
468 }
469
470 BNK0 = 0x0300
471 Return ((BNK0 + M003 ()))
472 }
473
474 BNK0 = 0x20
475 Return ((BNK0 + M002 ()))
476 }
477
478 BNK0 = 0x01
479 Store ((BNK0 + M001 ()), Local0)
480 If ((Local0 != 0x87654321))
481 {
482 ERR (__METHOD__, Z155, __LINE__, 0x00, 0x00, Local0, 0x87654321)
483 }
484
485 If (Arg0)
486 {
487 Local1 = 0x11223344
488 }
489 Else
490 {
491 Local1 = 0x80000000
492 }
493
494 If ((BNK0 != Local1))
495 {
496 ERR (__METHOD__, Z155, __LINE__, 0x00, 0x00, BNK0, Local1)
497 }
498
499 CH03 (__METHOD__, Z155, __LINE__, 0x00, 0x00)
500 }
501
502 /*
503 * Index Field instead of i000 (in m001)
504 *
505 * (is this test correct?)
506 */
507 Method (M108, 1, Serialized)
508 {
509 Name (I001, 0x00)
510 OperationRegion (R000, SystemMemory, 0x0100, 0x0100)
511 Field (R000, ByteAcc, NoLock, Preserve)
512 {
513 F000, 32,
514 F001, 32
515 }
516
517 IndexField (F000, F001, ByteAcc, NoLock, Preserve)
518 {
519 IF00, 32
520 }
521
522 CH03 (__METHOD__, Z155, __LINE__, 0x00, 0x00)
523 I001 = Arg0
524 Method (M001, 0, NotSerialized)
525 {
526 Method (M002, 0, NotSerialized)
527 {
528 Method (M003, 0, NotSerialized)
529 {
530 Method (M004, 0, NotSerialized)
531 {
532 Method (M005, 0, NotSerialized)
533 {
534 Method (M006, 0, NotSerialized)
535 {
536 Method (M007, 0, NotSerialized)
537 {
538 Method (M008, 0, NotSerialized)
539 {
540 If (I001)
541 {
542 IF00 = 0x11223344
543 }
544
545 Return (0x00)
546 }
547
548 IF00 = 0x80000000
549 Return ((IF00 + M008 ()))
550 }
551
552 IF00 = 0x07000000
553 Return ((IF00 + M007 ()))
554 }
555
556 IF00 = 0x00600000
557 Return ((IF00 + M006 ()))
558 }
559
560 IF00 = 0x00050000
561 Return ((IF00 + M005 ()))
562 }
563
564 IF00 = 0x4000
565 Return ((IF00 + M004 ()))
566 }
567
568 IF00 = 0x0300
569 Return ((IF00 + M003 ()))
570 }
571
572 IF00 = 0x20
573 Return ((IF00 + M002 ()))
574 }
575
576 IF00 = 0x01
577 Store ((IF00 + M001 ()), Local0)
578 If ((Local0 != 0x87654321))
579 {
580 ERR (__METHOD__, Z155, __LINE__, 0x00, 0x00, Local0, 0x87654321)
581 }
582
583 If (Arg0)
584 {
585 Local1 = 0x11223344
586 }
587 Else
588 {
589 Local1 = 0x80000000
590 }
591
592 If ((IF00 != Local1))
593 {
594 ERR (__METHOD__, Z155, __LINE__, 0x00, 0x00, IF00, Local1)
595 }
596
597 CH03 (__METHOD__, Z155, __LINE__, 0x00, 0x00)
598 }
599
600 /*
601 * Element of Buffer instead of i000 (in m001)
602 */
603 Method (M109, 1, Serialized)
604 {
605 Name (I001, 0x00)
606 Name (B000, Buffer (0x03)
607 {
608 0x11, 0x01, 0x22 // .."
609 })
610 CH03 (__METHOD__, Z155, __LINE__, 0x00, 0x00)
611 I001 = Arg0
612 Method (M001, 0, NotSerialized)
613 {
614 Method (M002, 0, NotSerialized)
615 {
616 Method (M003, 0, NotSerialized)
617 {
618 Method (M004, 0, NotSerialized)
619 {
620 Method (M005, 0, NotSerialized)
621 {
622 Method (M006, 0, NotSerialized)
623 {
624 Method (M007, 0, NotSerialized)
625 {
626 Method (M008, 0, NotSerialized)
627 {
628 If (I001)
629 {
630 B000 [0x01] = 0xFF
631 }
632
633 Return (0x00)
634 }
635
636 B000 [0x01] = 0x08
637 Return ((DerefOf (B000 [0x01]) + M008 ()))
638 }
639
640 B000 [0x01] = 0x07
641 Return ((DerefOf (B000 [0x01]) + M007 ()))
642 }
643
644 B000 [0x01] = 0x06
645 Return ((DerefOf (B000 [0x01]) + M006 ()))
646 }
647
648 B000 [0x01] = 0x05
649 Return ((DerefOf (B000 [0x01]) + M005 ()))
650 }
651
652 B000 [0x01] = 0x04
653 Return ((DerefOf (B000 [0x01]) + M004 ()))
654 }
655
656 B000 [0x01] = 0x03
657 Return ((DerefOf (B000 [0x01]) + M003 ()))
658 }
659
660 B000 [0x01] = 0x02
661 Return ((DerefOf (B000 [0x01]) + M002 ()))
662 }
663
664 Store ((DerefOf (B000 [0x01]) + M001 ()), Local0)
665 If ((Local0 != 0x24))
666 {
667 ERR (__METHOD__, Z155, __LINE__, 0x00, 0x00, Local0, 0x24)
668 }
669
670 Local0 = DerefOf (B000 [0x01])
671 If (Arg0)
672 {
673 Local1 = 0xFF
674 }
675 Else
676 {
677 Local1 = 0x08
678 }
679
680 If ((Local0 != Local1))
681 {
682 ERR (__METHOD__, Z155, __LINE__, 0x00, 0x00, Local0, Local1)
683 }
684
685 CH03 (__METHOD__, Z155, __LINE__, 0x00, 0x00)
686 }
687
688 /*
689 * Element of String instead of i000 (in m001)
690 */
691 Method (M10A, 1, Serialized)
692 {
693 Name (I001, 0x00)
694 Name (S000, "q\x01ertyuiop")
695 CH03 (__METHOD__, Z155, __LINE__, 0x00, 0x00)
696 I001 = Arg0
697 Method (M001, 0, NotSerialized)
698 {
699 Method (M002, 0, NotSerialized)
700 {
701 Method (M003, 0, NotSerialized)
702 {
703 Method (M004, 0, NotSerialized)
704 {
705 Method (M005, 0, NotSerialized)
706 {
707 Method (M006, 0, NotSerialized)
708 {
709 Method (M007, 0, NotSerialized)
710 {
711 Method (M008, 0, NotSerialized)
712 {
713 If (I001)
714 {
715 S000 [0x01] = 0xFF
716 }
717
718 Return (0x00)
719 }
720
721 S000 [0x01] = 0x08
722 Return ((DerefOf (S000 [0x01]) + M008 ()))
723 }
724
725 S000 [0x01] = 0x07
726 Return ((DerefOf (S000 [0x01]) + M007 ()))
727 }
728
729 S000 [0x01] = 0x06
730 Return ((DerefOf (S000 [0x01]) + M006 ()))
731 }
732
733 S000 [0x01] = 0x05
734 Return ((DerefOf (S000 [0x01]) + M005 ()))
735 }
736
737 S000 [0x01] = 0x04
738 Return ((DerefOf (S000 [0x01]) + M004 ()))
739 }
740
741 S000 [0x01] = 0x03
742 Return ((DerefOf (S000 [0x01]) + M003 ()))
743 }
744
745 S000 [0x01] = 0x02
746 Return ((DerefOf (S000 [0x01]) + M002 ()))
747 }
748
749 Store ((DerefOf (S000 [0x01]) + M001 ()), Local0)
750 If ((Local0 != 0x24))
751 {
752 ERR (__METHOD__, Z155, __LINE__, 0x00, 0x00, Local0, 0x24)
753 }
754
755 Local0 = DerefOf (S000 [0x01])
756 If (Arg0)
757 {
758 Local1 = 0xFF
759 }
760 Else
761 {
762 Local1 = 0x08
763 }
764
765 If ((Local0 != Local1))
766 {
767 ERR (__METHOD__, Z155, __LINE__, 0x00, 0x00, Local0, Local1)
768 }
769
770 CH03 (__METHOD__, Z155, __LINE__, 0x00, 0x00)
771 }
772
773 Method (N001, 0, NotSerialized)
774 {
775 If (0x01)
776 {
777 SRMT ("m100")
778 M100 ()
779 SRMT ("m101")
780 M101 ()
781 SRMT ("m102")
782 M102 ()
783 SRMT ("m103-0")
784 M103 (0x00)
785 SRMT ("m103-1")
786 If (Y200)
787 {
788 M103 (0x01)
789 }
790 Else
791 {
792 BLCK ()
793 }
794
795 SRMT ("m104")
796 M104 ()
797 SRMT ("m105-0")
798 M105 (0x00)
799 SRMT ("m105-1")
800 M105 (0x01)
801 SRMT ("m106-0")
802 M106 (0x00)
803 SRMT ("m106-1")
804 M106 (0x01)
805 SRMT ("m107-0")
806 M107 (0x00)
807 SRMT ("m107-1")
808 M107 (0x01)
809 SRMT ("m108-0")
810 M108 (0x00)
811 SRMT ("m108-1")
812 M108 (0x01)
813 SRMT ("m109-0")
814 M109 (0x00)
815 SRMT ("m109-1")
816 M109 (0x01)
817 SRMT ("m10a-0")
818 M10A (0x00)
819 SRMT ("m10a-1")
820 M10A (0x01)
821 SRMT ("m10a-0-2") /* Run it twice: see bug 265 */
822 M10A (0x00)
823 M10A (0x00)
824 }
825 Else
826 {
827 SRMT ("m10a-0")
828 M10A (0x00)
829 SRMT ("m10a-1")
830 M10A (0x00)
831 }
832 }