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    /*  ///////////////////////////////////////////////////////////////////////// */
29    /*  0 - Acquire                (arg0, arg1)                         => Local7 */
30    /*  1 - Add                    (arg0, arg1, RES)                    => Local7 */
31    /*  2 - And                    (arg0, arg1, RES)                    => Local7 */
32    /*  3 - Concatenate            (arg0, arg1, RES)                    => Local7 */
33    /*  4 - ConcatenateResTemplate (arg0, arg1, RES)                    => Local7 */
34    /*  5 - CondRefOf              (arg0, RES)                          => Local7 */
35    /*  6 - CopyObject             (arg0, RES)                          => Local7 */
36    /*  7 - Decrement              (arg0 --> RES)                       => Local7 */
37    /*  8 - DerefOf                (arg0)                               => Local7 */
38    /*  9 - Divide                 (arg0, arg1, RES, RES)               => Local7 */
39    /* 10 - Fatal                  (arg0, arg1, arg2) */
40    /* 11 - FindSetLeftBit         (arg0, RES)                          => Local7 */
41    /* 12 - FindSetRightBit        (arg0, RES)                          => Local7 */
42    /* 13 - FromBCD                (arg0, RES)                          => Local7 */
43    /* 14 - Increment              (arg0 --> RES)                       => Local7 */
44    /* 15 - Index                  (arg0, arg1, RES)                    => Local7 */
45    /* 16 - LAnd                   (arg0, arg1)                         => Local7 */
46    /* 17 - LEqual                 (arg0, arg1)                         => Local7 */
47    /* 18 - LGreater               (arg0, arg1)                         => Local7 */
48    /* 19 - LGreaterEqual          (arg0, arg1)                         => Local7 */
49    /* 20 - LLess                  (arg0, arg1)                         => Local7 */
50    /* 21 - LLessEqual             (arg0, arg1)                         => Local7 */
51    /* 22 - LNot                   (arg0)                               => Local7 */
52    /* 23 - LNotEqual              (arg0, arg1)                         => Local7 */
53    /* 24 - LOr                    (arg0, arg1)                         => Local7 */
54    /* 25 - Match    <arg1-O1,O2>  (arg0, <O1>, arg2, <O2>, arg3, arg4) => Local7 */
55    /* 26 - Mid                    (arg0, arg1, arg2, RES)              => Local7 */
56    /* 27 - Mod                    (arg0, arg1, RES)                    => Local7 */
57    /* 28 - Multiply               (arg0, arg1, RES)                    => Local7 */
58    /* 29 - NAnd                   (arg0, arg1, RES)                    => Local7 */
59    /* 30 - NOr                    (arg0, arg1, RES)                    => Local7 */
60    /* 31 - Not                    (arg0, RES)                          => Local7 */
61    /* 32 - ObjectType             (arg0)                               => Local7 */
62    /* 33 - Or                     (arg0, arg1, RES)                    => Local7 */
63    /* 34 - RefOf                  (arg0)                               => Local7 */
64    /* 35 - Release                (arg0) */
65    /* 36 - Reset                  (arg0) */
66    /* 37 - Return                 (arg0) */
67    /* 38 - ShiftLeft              (arg0, arg1, RES)                    => Local7 */
68    /* 39 - ShiftRight             (arg0, arg1, RES)                    => Local7 */
69    /* 40 - Signal                 (arg0) */
70    /* 41 - SizeOf                 (arg0)                               => Local7 */
71    /* 42 - Sleep                  (arg0) */
72    /* 43 - Stall                  (arg0) */
73    /* 44 - Store                  (arg0, RES)                          => Local7 */
74    /* 45 - Subtract               (arg0, arg1, RES)                    => Local7 */
75    /* 46 - ToBCD                  (arg0, RES)                          => Local7 */
76    /* 47 - ToBuffer               (arg0, RES)                          => Local7 */
77    /* 48 - ToDecimalString        (arg0, RES)                          => Local7 */
78    /* 49 - ToHexString            (arg0, RES)                          => Local7 */
79    /* 50 - ToInteger              (arg0, RES)                          => Local7 */
80    /* 51 - ToString               (arg0, arg1, RES)                    => Local7 */
81    /* 52 - Wait                   (arg0, arg1)                         => Local7 */
82    /* 53 - XOr                    (arg0, arg1, RES)                    => Local7 */
83    /* ////////////////////////////////////////////////////////////////////////// */
84    Name (Z082, 0x52)
85    /* Flag - verify result with the contents of Package */
86
87    Name (FLG2, 0x3859A0D4)
88    /* Flag - it is expected that operation will cause exception */
89
90    Name (FLG3, 0x00)
91    /* Flag - don't do further checkings */
92
93    Name (FLG4, 0x00)
94    /* Collect calls to all operators */
95    /* */
96    /* arg0-arg4 - parameters of operators */
97    /* arg5      - miscellaneous */
98    /* arg6      - opcode of operation */
99    Method (M480, 7, Serialized)
100    {
101        Name (TS, "m480")
102        Name (PR00, 0x00)
103        Name (PR01, 0x00)
104        Name (CHK0, 0x01)
105        Name (RES0, 0x00)
106        Name (RES1, 0x00)
107        Name (RES2, 0x00)
108        If ((Arg5 == FLG2))
109        {
110            CHK0 = 0x00
111        }
112
113        If (CHK0)
114        {
115            Name (TMP0, 0x00)
116            Name (TMP1, 0x00)
117            Name (OT00, 0x00)
118            Name (OT01, 0x00)
119            Name (OT02, 0x00)
120            Name (OT03, 0x00)
121            Name (OT04, 0x00)
122            Name (OT05, 0x00)
123            Name (OT06, 0x00)
124            OT00 = ObjectType (Arg0)
125            OT01 = ObjectType (Arg1)
126            OT02 = ObjectType (Arg2)
127            OT03 = ObjectType (Arg3)
128            OT04 = ObjectType (Arg4)
129            OT05 = ObjectType (Arg5)
130            OT06 = ObjectType (Arg6)
131            Local0 = Arg0
132            Local1 = Arg1
133            Local2 = Arg2
134            Local3 = Arg3
135            Local4 = Arg4
136            Local5 = Arg5
137            Local6 = Arg6
138            Name (OT10, 0x00)
139            Name (OT11, 0x00)
140            Name (OT12, 0x00)
141            Name (OT13, 0x00)
142            Name (OT14, 0x00)
143            Name (OT15, 0x00)
144            Name (OT16, 0x00)
145            OT10 = ObjectType (Local0)
146            OT11 = ObjectType (Local1)
147            OT12 = ObjectType (Local2)
148            OT13 = ObjectType (Local3)
149            OT14 = ObjectType (Local4)
150            OT15 = ObjectType (Local5)
151            OT16 = ObjectType (Local6)
152        } /* if(chk0) */
153
154        Local7 = 0x00
155        If (PR00)
156        {
157            Debug = "===================== m480, Start:"
158            Debug = Arg0
159            Debug = Arg1
160            Debug = Arg2
161            Debug = Arg3
162            Debug = Arg4
163            Debug = Arg5
164            Debug = Arg6
165            If (CHK0)
166            {
167                Debug = "--------"
168                Debug = Local0
169                Debug = Local1
170                Debug = Local2
171                Debug = Local3
172                Debug = Local4
173                Debug = Local5
174                Debug = Local6
175                Debug = Local7
176            }
177
178            Debug = "=====================."
179        }
180
181        Switch (ToInteger (Arg6))
182        {
183            Case (0x00)
184            {
185                Local7 = Acquire (Arg0, 0x0064)
186            }
187            Case (0x01)
188            {
189                RES0 = 0x01
190                Local7 = Arg5 = (Arg0 + Arg1)
191            }
192            Case (0x02)
193            {
194                RES0 = 0x01
195                Local7 = Arg5 = (Arg0 & Arg1)
196            }
197            Case (0x03)
198            {
199                RES0 = 0x01
200                Local7 = Concatenate (Arg0, Arg1, Arg5)
201            }
202            Case (0x04)
203            {
204                RES0 = 0x01
205                Local7 = ConcatenateResTemplate (Arg0, Arg1, Arg5)
206            }
207            Case (0x05)
208            {
209                RES2 = 0x01
210                Local7 = CondRefOf (Arg0, Arg5)
211            }
212            Case (0x06)
213            {
214                RES0 = 0x01
215                Local7 = CopyObject (Arg0, Arg5)
216            }
217            Case (0x07)
218            {
219                RES0 = 0x01
220                Arg5 = Arg0
221                Local7 = Arg5--
222            }
223            Case (0x08)
224            {
225                Local7 = DerefOf (Arg0)
226            }
227            Case (0x09)
228            {
229                RES0 = 0x01
230                RES1 = 0x01
231                Local7 = Divide (Arg0, Arg1, Arg2, Arg5)
232            }
233            Case (0x0A)
234            {
235                Fatal (0xFF, 0xFFFFFFFF, Arg0)
236            }
237            Case (0x0B)
238            {
239                RES0 = 0x01
240                Local7 = FindSetLeftBit (Arg0, Arg5)
241            }
242            Case (0x0C)
243            {
244                RES0 = 0x01
245                Local7 = FindSetRightBit (Arg0, Arg5)
246            }
247            Case (0x0D)
248            {
249                RES0 = 0x01
250                Local7 = FromBCD (Arg0, Arg5)
251            }
252            Case (0x0E)
253            {
254                RES0 = 0x01
255                Arg5 = Arg0
256                Local7 = Arg5++
257            }
258            Case (0x0F)
259            {
260                RES0 = 0x01
261                Local7 = Arg5 = Arg0 [Arg1]
262            }
263            Case (0x10)
264            {
265                Local7 = (Arg0 && Arg1)
266            }
267            Case (0x11)
268            {
269                Local7 = (Arg0 == Arg1)
270            }
271            Case (0x12)
272            {
273                Local7 = (Arg0 > Arg1)
274            }
275            Case (0x13)
276            {
277                Local7 = (Arg0 >= Arg1)
278            }
279            Case (0x14)
280            {
281                Local7 = (Arg0 < Arg1)
282            }
283            Case (0x15)
284            {
285                Local7 = (Arg0 <= Arg1)
286            }
287            Case (0x16)
288            {
289                Local7 = !Arg0
290            }
291            Case (0x17)
292            {
293                Local7 = (Arg0 != Arg1)
294            }
295            Case (0x18)
296            {
297                Local7 = (Arg0 || Arg1)
298            }
299            Case (0x19)
300            {
301                /* arg1 - determine OP1 and OP2 */
302
303                Local7 = Match (Arg0, MTR, Arg2, MTR, Arg3, Arg4)
304            }
305            Case (0x1A)
306            {
307                RES0 = 0x01
308                Local7 = Mid (Arg0, Arg1, Arg2, Arg5)
309            }
310            Case (0x1B)
311            {
312                RES0 = 0x01
313                Local7 = Arg5 = (Arg0 % Arg1)
314            }
315            Case (0x1C)
316            {
317                RES0 = 0x01
318                Local7 = Arg5 = (Arg0 * Arg1)
319            }
320            Case (0x1D)
321            {
322                RES0 = 0x01
323                Local7 = NAnd (Arg0, Arg1, Arg5)
324            }
325            Case (0x1E)
326            {
327                RES0 = 0x01
328                Local7 = NOr (Arg0, Arg1, Arg5)
329            }
330            Case (0x1F)
331            {
332                RES0 = 0x01
333                Local7 = Arg5 = ~Arg0
334            }
335            Case (0x20)
336            {
337                Local7 = ObjectType (Arg0)
338            }
339            Case (0x21)
340            {
341                RES0 = 0x01
342                Local7 = Arg5 = (Arg0 | Arg1)
343            }
344            Case (0x22)
345            {
346                Local7 = RefOf (Arg0)
347            }
348            Case (0x23)
349            {
350                Release (Arg0)
351            }
352            Case (0x24)
353            {
354                Reset (Arg0)
355            }
356            Case (0x25)
357            {
358                Return (Arg0)
359            }
360            Case (0x26)
361            {
362                RES0 = 0x01
363                Local7 = Arg5 = (Arg0 << Arg1)
364            }
365            Case (0x27)
366            {
367                RES0 = 0x01
368                Local7 = Arg5 = (Arg0 >> Arg1)
369            }
370            Case (0x28)
371            {
372                Signal (Arg0)
373            }
374            Case (0x29)
375            {
376                Local7 = SizeOf (Arg0)
377            }
378            Case (0x2A)
379            {
380                Sleep (Arg0)
381            }
382            Case (0x2B)
383            {
384                Stall (Arg0)
385            }
386            Case (0x2C)
387            {
388                RES0 = 0x01
389                Local7 = Arg5 = Arg0
390            }
391            Case (0x2D)
392            {
393                RES0 = 0x01
394                Local7 = Arg5 = (Arg0 - Arg1)
395            }
396            Case (0x2E)
397            {
398                RES0 = 0x01
399                Local7 = ToBCD (Arg0, Arg5)
400            }
401            Case (0x2F)
402            {
403                RES0 = 0x01
404                Local7 = ToBuffer (Arg0, Arg5)
405            }
406            Case (0x30)
407            {
408                RES0 = 0x01
409                Local7 = ToDecimalString (Arg0, Arg5)
410            }
411            Case (0x31)
412            {
413                RES0 = 0x01
414                Local7 = ToHexString (Arg0, Arg5)
415            }
416            Case (0x32)
417            {
418                RES0 = 0x01
419                Local7 = ToInteger (Arg0, Arg5)
420            }
421            Case (0x33)
422            {
423                RES0 = 0x01
424                Local7 = ToString (Arg0, Arg1, Arg5)
425            }
426            Case (0x34)
427            {
428                Local7 = Wait (Arg0, Arg1)
429            }
430            Case (0x35)
431            {
432                RES0 = 0x01
433                Local7 = Arg5 = (Arg0 ^ Arg1)
434            }
435            Default
436            {
437                Debug = "Param error 0"
438                Local0 = 0x01
439                Local1 = 0x00
440                Divide (Local0, Local1, Local2, Local3)
441            }
442
443        }
444
445        If (FLG3)
446        {
447            /* It was expected that operation will cause exception. */
448            /* We verify only the presence of exception. */
449            /* Nothing to do more. */
450            Return (0x01)
451        }
452
453        If (FLG4)
454        {
455            /* Don't do further checkings. */
456
457            Return (0x01)
458        }
459
460        If (CHK0)
461        {
462            /* Types of ArgX are save */
463
464            TMP0 = ObjectType (Arg0)
465            If ((TMP0 != OT00))
466            {
467                ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT00)
468            }
469
470            TMP0 = ObjectType (Arg1)
471            If ((TMP0 != OT01))
472            {
473                ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT01)
474            }
475
476            TMP0 = ObjectType (Arg2)
477            If ((TMP0 != OT02))
478            {
479                ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT02)
480            }
481
482            TMP0 = ObjectType (Arg3)
483            If ((TMP0 != OT03))
484            {
485                ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT03)
486            }
487
488            TMP0 = ObjectType (Arg4)
489            If ((TMP0 != OT04))
490            {
491                ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT04)
492            }
493
494            If (RES0)
495            {
496                TMP0 = ObjectType (Arg5)
497                If ((TMP0 != OT05))
498                {
499                    ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT05)
500                }
501            }
502
503            TMP0 = ObjectType (Arg6)
504            If ((TMP0 != OT06))
505            {
506                ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT06)
507            }
508
509            /* Types of LocalX are save, and data of LocalX and ArgX are identical */
510
511            TMP0 = ObjectType (Local0)
512            If ((TMP0 != OT10))
513            {
514                ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT10)
515            }
516            Else
517            {
518                M481 (TS, 0x08, TMP0, Local0, Arg0)
519            }
520
521            TMP0 = ObjectType (Local1)
522            If ((TMP0 != OT11))
523            {
524                ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT11)
525            }
526            Else
527            {
528                M481 (TS, 0x0A, TMP0, Local1, Arg1)
529            }
530
531            If (RES1)
532            {
533                TMP0 = ObjectType (Local2)
534                If ((TMP0 != OT12))
535                {
536                    ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT12)
537                }
538                Else
539                {
540                    M481 (TS, 0x0C, TMP0, Local2, Arg2)
541                }
542            }
543
544            TMP0 = ObjectType (Local3)
545            If ((TMP0 != OT13))
546            {
547                ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT13)
548            }
549            Else
550            {
551                M481 (TS, 0x0E, TMP0, Local3, Arg3)
552            }
553
554            TMP0 = ObjectType (Local4)
555            If ((TMP0 != OT14))
556            {
557                ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT14)
558            }
559            Else
560            {
561                M481 (TS, 0x10, TMP0, Local4, Arg4)
562            }
563
564            TMP0 = ObjectType (Local5)
565            If ((TMP0 != OT15))
566            {
567                ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT15)
568            }
569            ElseIf (RES0)
570            {
571                M481 (TS, 0x12, TMP0, Local5, Arg5)
572            }
573
574            TMP0 = ObjectType (Local6)
575            If ((TMP0 != OT16))
576            {
577                ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT16)
578            }
579            Else
580            {
581                M481 (TS, 0x14, TMP0, Local6, Arg6)
582            }
583
584            If (RES2)
585            {
586                If ((Local7 != Ones))
587                {
588                    ERR (TS, Z082, __LINE__, 0x00, 0x00, Local7, Ones)
589                }
590            }
591            ElseIf (RES0)
592            {
593                TMP0 = ObjectType (Local7)
594                TMP1 = ObjectType (Arg5)
595                If ((TMP0 != TMP1))
596                {
597                    ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, TMP1)
598                }
599                Else
600                {
601                    M481 (TS, 0x17, TMP0, Local7, Arg5)
602                }
603            }
604        } /* if(chk0) */
605
606        If (PR01)
607        {
608            Debug = "===================== m480, Finish:"
609            Debug = Arg0
610            Debug = Arg1
611            Debug = Arg2
612            Debug = Arg3
613            Debug = Arg4
614            Debug = Arg5
615            Debug = Arg6
616            If (CHK0)
617            {
618                Debug = "--------"
619                Debug = Local0
620                Debug = Local1
621                Debug = Local2
622                Debug = Local3
623                Debug = Local4
624                Debug = Local5
625                Debug = Local6
626                Debug = Local7
627            }
628
629            Debug = "=====================."
630        }
631
632        Return (Local7)
633    }
634
635    /* Compare the contents of arg3 and arg4, arg2 - the type of objects */
636
637    Method (M481, 5, Serialized)
638    {
639        Local0 = 0x00
640        Switch (ToInteger (Arg2))
641        {
642            Case (0x01)
643            {
644                If ((Arg3 != Arg4))
645                {
646                    ERR (Arg0, Z082, __LINE__, 0x00, 0x00, Arg1, 0x00)
647                    Local0 = 0x01
648                }
649            }
650            Case (0x02)
651            {
652                If ((Arg3 != Arg4))
653                {
654                    ERR (Arg0, Z082, __LINE__, 0x00, 0x00, Arg1, 0x00)
655                    Local0 = 0x01
656                }
657            }
658            Case (0x03)
659            {
660                If ((Arg3 != Arg4))
661                {
662                    ERR (Arg0, Z082, __LINE__, 0x00, 0x00, Arg1, 0x00)
663                    Local0 = 0x01
664                }
665            }
666
667        }
668
669        If (Local0)
670        {
671            Debug = Arg3
672            Debug = Arg4
673        }
674    }
675
676    /* Layer for checking referencies */
677    /* */
678    /* arg0-arg4 - parameters of operators */
679    /* arg5      - miscellaneous */
680    /* arg6      - opcode of operation */
681    Method (M482, 7, Serialized)
682    {
683        /*///////////////// */
684        /* */
685        /* !!!!!!!!!!!!!!  ?????????????????????????????????????? */
686        /* */
687        /* Looks like a bug - why this construction is impossible: */
688        /* */
689        /*	Name(OT11, ObjectType(arg0)) */
690        /*	Name(a000, arg0) */
691        /*///////////////// */
692        Name (TS, "m482")
693        Name (PK06, 0x00)
694        Name (TMP0, 0x00)
695        Name (OT00, 0x00)
696        Name (OT01, 0x00)
697        Name (OT02, 0x00)
698        Name (OT03, 0x00)
699        Name (OT04, 0x00)
700        Name (OT05, 0x00)
701        Name (OT06, 0x00)
702        OT00 = ObjectType (Arg0)
703        OT01 = ObjectType (Arg1)
704        OT02 = ObjectType (Arg2)
705        OT03 = ObjectType (Arg3)
706        OT04 = ObjectType (Arg4)
707        OT05 = ObjectType (Arg5)
708        OT06 = ObjectType (Arg6)
709        /* Operation */
710
711        OT06 = ObjectType (Arg6)
712        If ((OT06 == 0x04))
713        {
714            Local6 = DerefOf (Arg6 [0x00])
715            PK06 = 0x01
716        }
717        Else
718        {
719            Local6 = Arg6
720        }
721
722        Local0 = Arg0
723        Local1 = Arg1
724        Local2 = Arg2
725        Local3 = Arg3
726        Local4 = Arg4
727        Local5 = Arg5
728        /*	Store(arg6, Local6) */
729
730        Local7 = Arg6
731        Name (OT10, 0x00)
732        Name (OT11, 0x00)
733        Name (OT12, 0x00)
734        Name (OT13, 0x00)
735        Name (OT14, 0x00)
736        Name (OT15, 0x00)
737        Name (OT16, 0x00)
738        OT10 = ObjectType (Local0)
739        OT11 = ObjectType (Local1)
740        OT12 = ObjectType (Local2)
741        OT13 = ObjectType (Local3)
742        OT14 = ObjectType (Local4)
743        OT15 = ObjectType (Local5)
744        OT16 = ObjectType (Local6)
745        Local7 = M480 (Local0, Local1, Local2, Local3, Local4, Local5, Local6)
746        /* Types of ArgX are save */
747
748        TMP0 = ObjectType (Arg0)
749        If ((TMP0 != OT00))
750        {
751            ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT00)
752        }
753
754        TMP0 = ObjectType (Arg1)
755        If ((TMP0 != OT01))
756        {
757            ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT01)
758        }
759
760        TMP0 = ObjectType (Arg2)
761        If ((TMP0 != OT02))
762        {
763            ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT02)
764        }
765
766        TMP0 = ObjectType (Arg3)
767        If ((TMP0 != OT03))
768        {
769            ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT03)
770        }
771
772        TMP0 = ObjectType (Arg4)
773        If ((TMP0 != OT04))
774        {
775            ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT04)
776        }
777
778        TMP0 = ObjectType (Arg5)
779        If ((TMP0 != OT05))
780        {
781            ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT05)
782        }
783
784        TMP0 = ObjectType (Arg6)
785        If ((TMP0 != OT06))
786        {
787            ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT06)
788        }
789
790        /* Types of LocalX are save, and data of LocalX and ArgX are identical */
791
792        TMP0 = ObjectType (Local0)
793        If ((TMP0 != OT10))
794        {
795            ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT10)
796        }
797        Else
798        {
799            M481 (TS, 0x23, TMP0, Local0, Arg0)
800        }
801
802        TMP0 = ObjectType (Local1)
803        If ((TMP0 != OT11))
804        {
805            ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT11)
806        }
807        Else
808        {
809            M481 (TS, 0x25, TMP0, Local1, Arg1)
810        }
811
812        TMP0 = ObjectType (Local2)
813        If ((TMP0 != OT12))
814        {
815            ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT12)
816        }
817        Else
818        {
819            M481 (TS, 0x27, TMP0, Local2, Arg2)
820        }
821
822        TMP0 = ObjectType (Local3)
823        If ((TMP0 != OT13))
824        {
825            ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT13)
826        }
827        Else
828        {
829            M481 (TS, 0x29, TMP0, Local3, Arg3)
830        }
831
832        TMP0 = ObjectType (Local4)
833        If ((TMP0 != OT14))
834        {
835            ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT14)
836        }
837        Else
838        {
839            M481 (TS, 0x2B, TMP0, Local4, Arg4)
840        }
841
842        TMP0 = ObjectType (Local5)
843        If ((TMP0 != OT15))
844        {
845            ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT15)
846        }
847        Else
848        {
849            M481 (TS, 0x2D, TMP0, Local5, Arg5)
850        }
851
852        TMP0 = ObjectType (Local6)
853        If ((TMP0 != OT16))
854        {
855            ERR (TS, Z082, __LINE__, 0x00, 0x00, TMP0, OT16)
856        }
857        /* Package is passed by arg6 */
858        /* m481(ts, 47, tmp0, Local6, arg6) */
859        Else
860        {
861        }
862
863        If (PK06)
864        {
865            /* SEE: either to remove this ability??????????????????? */
866            /* Presence of result */
867            Local0 = DerefOf (Arg6 [0x01])
868            If (Local0)
869            {
870                /* Type of result */
871
872                Local0 = DerefOf (Arg6 [0x02])
873                /* Result */
874
875                Local1 = DerefOf (Arg6 [0x03])
876                Local2 = ObjectType (Local7)
877                Local3 = 0x00
878                If ((Local2 != Local0))
879                {
880                    ERR (TS, Z082, __LINE__, 0x00, 0x00, 0x00, 0x00)
881                    Debug = "Expected type of result:"
882                    Debug = Local0
883                    Debug = "The type of obtained result:"
884                    Debug = Local2
885                    Local3 = 0x01
886                }
887                ElseIf ((Local7 != Local1))
888                {
889                    ERR (TS, Z082, __LINE__, 0x00, 0x00, 0x00, 0x00)
890                    Local3 = 0x01
891                }
892
893                If (Local3)
894                {
895                    Debug = "Expected result:"
896                    Debug = Local1
897                    Debug = "Actual result:"
898                    Debug = Local7
899                }
900            }
901        }
902
903        Return (Local7)
904    }
905