• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /barrelfish-2018-10-04/lib/acpica/tests/aslts/src/runtime/collections/functional/manipulation/
1/*
2 * Some or all of this work - Copyright (c) 2006 - 2016, 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/*
30 * Data type conversion and manipulation
31 */
32
33/*
34!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
35SEE: to be a few updated, see below
36!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
37*/
38
39
40// ObjectType, Type of object
41
42// Check ObjectType operator for:
43// - all the Types of objects,
44// - all the ways Obtaining those objects,
45// - all the ways Passing objects to ObjectType.
46//
47// Types     - {0-16}, see specs.
48// Obtaining - different creating operators,...
49// Passing   - immediately local, immediately global,
50//             by ArgX, by LocalX,...
51
52
53Name(z040, 40)
54
55// Global objects
56
57Name(n002, 0x90801020)
58Name(n003, 0x9189192989396949)
59Name(n005, "9876")
60Name(b003, Buffer(4) {12, 13, 14, 15})
61
62// Exercise all the ways creating the source objects of different types
63//
64//  0 - Uninitialized
65//
66//  Integers
67//
68//      One, Ones, Zero, Revision, Timer          (compile error)
69//      immediate 32-bit Integer constant imagine (compile error)
70//      immediate 64-bit Integer constant imagine (compile error)
71//
72//  1 - 32-bit Integers
73//
74//      32-bit Integer passed by LocalX
75//      32-bit Integer passed by ArgX
76//      32-bit Integer passed by local Name
77//      32-bit Integer passed by global Name
78//
79//  2 - 64-bit Integers
80//
81//      64-bit Integer passed by LocalX
82//      64-bit Integer passed by ArgX
83//      64-bit Integer passed by local Name
84//      64-bit Integer passed by global Name
85//
86// String
87//
88//  3 - String
89//
90// Field Units
91//
92//  4 - Field Unit created by Field
93//  5 - Field Unit created by BankField
94//  6 - Field Unit created by IndexField
95//
96// Buffers
97//
98//    - buffer passed immediately (compile error)
99//  7 - buffer passed by LocalX
100//  8 - buffer passed by ArgX
101//  9 - buffer passed by local Name
102// 10 - buffer passed by global Name
103//
104// Buffer Fields
105//
106// 11 - CreateBitField          (bit field)
107// 12 - CreateByteField         (byte field)
108// 13 - CreateDWordField        (DWord field)
109// 14 - CreateField      32-bit (arbitrary length bit field)
110// 15 - CreateField      64-bit (arbitrary length bit field)
111// 16 - CreateField      65-bit (arbitrary length bit field)
112// 17 - CreateQWordField        (QWord field)
113// 18 - CreateWordField         (Word field)
114//
115// 19 - Index, Index with String   (reference to Buffer Fields)
116// 20 - Index, Index with Buffer   (reference to Buffer Fields)
117// 21 - Index, Index with Package  (reference to object in Package)
118//
119// 22 - Data Table Operation Region
120// 23 - Debug Object
121// 24 - Device
122// 25 - Event
123// 26 - Method
124// 27 - Function
125// 28 - Mutex
126// 29 - Operation Region
127// 30 - Package
128// 31 - Power Resource
129// 32 - Processor
130// 33 - Thermal Zone
131// 34 - DDB Handle
132//
133//
134// Name - add all other objects by the name and so on ... !!!!!!!!!!!!!!!!!
135//
136//
137// Local7 - returned result
138//
139Method(m0f1, 7, Serialized)
140{
141	OperationRegion(r000, SystemMemory, 0x100, 0x100)
142	OperationRegion(r001, SystemMemory, 0x100, 0x100)
143
144	if (arg1) {
145		Store(0, Local7)
146	}
147
148	switch (ToInteger (arg1)) {
149		case (0) {
150
151			// Uninitialized
152
153			/*
154			 * Bug 9 fixed.
155			 * if (arg1) {
156			 *	Store(0, Local0)
157			 *	Store(0, Local1)
158			 *	Store(0, Local2)
159			 *	Store(0, Local3)
160			 *	Store(0, Local4)
161			 *	Store(0, Local5)
162			 *	Store(0, Local6)
163			 *	Store(0, Local7)
164			 * }
165			 */
166
167			Store(ObjectType(Local0), Local7)
168			if (LNotEqual(Local7, c008)) {
169				err(arg0, z040, 0, 0, 0, Local7, c008)
170			}
171			Store(ObjectType(Local1), Local7)
172			if (LNotEqual(Local7, c008)) {
173				err(arg0, z040, 1, 0, 0, Local7, c008)
174			}
175			Store(ObjectType(Local2), Local7)
176			if (LNotEqual(Local7, c008)) {
177				err(arg0, z040, 2, 0, 0, Local7, c008)
178			}
179			Store(ObjectType(Local3), Local7)
180			if (LNotEqual(Local7, c008)) {
181				err(arg0, z040, 3, 0, 0, Local7, c008)
182			}
183			Store(ObjectType(Local4), Local7)
184			if (LNotEqual(Local7, c008)) {
185				err(arg0, z040, 4, 0, 0, Local7, c008)
186			}
187			Store(ObjectType(Local5), Local7)
188			if (LNotEqual(Local7, c008)) {
189				err(arg0, z040, 5, 0, 0, Local7, c008)
190			}
191			Store(ObjectType(Local6), Local7)
192			if (LNotEqual(Local7, c008)) {
193				err(arg0, z040, 6, 0, 0, Local7, c008)
194			}
195		}
196		case (1) {
197
198			// 32-bit Integers
199
200			// By LocalX
201
202			Store(0x12345678, Local0)
203			Store(ObjectType(Local0), Local7)
204			if (LNotEqual(Local7, c009)) {
205				err(arg0, z040, 7, 0, 0, Local7, c009)
206			}
207			if (LNotEqual(Local0, 0x12345678)) {
208				err(arg0, z040, 8, 0, 0, Local0, 0x12345678)
209			}
210
211			// By ArgX
212
213			Store(ObjectType(Arg2), Local7)
214			if (LNotEqual(Local7, c009)) {
215				err(arg0, z040, 9, 0, 0, Local7, c009)
216			}
217			if (LNotEqual(Arg2, 0x81223344)) {
218				err(arg0, z040, 10, 0, 0, Arg2, 0x81223344)
219			}
220
221			// By Name locally
222
223			Name(n000, 0x98127364)
224			Store(ObjectType(n000), Local7)
225			if (LNotEqual(Local7, c009)) {
226				err(arg0, z040, 11, 0, 0, Local7, c009)
227			}
228			if (LNotEqual(n000, 0x98127364)) {
229				err(arg0, z040, 12, 0, 0, n000, 0x98127364)
230			}
231
232			// By Name globally
233
234			Store(ObjectType(n002), Local7)
235			if (LNotEqual(Local7, c009)) {
236				err(arg0, z040, 13, 0, 0, Local7, c009)
237			}
238			if (LNotEqual(n002, 0x90801020)) {
239				err(arg0, z040, 14, 0, 0, n002, 0x90801020)
240			}
241
242			// Not a Buffer in 32-bit mode
243
244			Store(0xa1b2c3d4e5c6e7f8, Local0)
245			Store(ObjectType(Local0), Local7)
246			if (LNotEqual(Local7, c009)) {
247				err(arg0, z040, 15, 0, 0, Local7, c009)
248			}
249		}
250		case (2) {
251
252			// 64-bit Integers
253
254			if (LEqual(F64, 1)) {
255
256				// By LocalX
257
258				Store(0xa1b2c3d4e5c6e7f8, Local0)
259				Store(ObjectType(Local0), Local7)
260				if (LNotEqual(Local7, c009)) {
261					err(arg0, z040, 16, 0, 0, Local7, c009)
262				}
263				if (LNotEqual(Local0, 0xa1b2c3d4e5c6e7f8)) {
264					err(arg0, z040, 17, 0, 0, Local0, 0xa1b2c3d4e5c6e7f8)
265				}
266
267				// By ArgX
268
269				Store(ObjectType(Arg2), Local7)
270				if (LNotEqual(Local7, c009)) {
271					err(arg0, z040, 18, 0, 0, Local7, c009)
272				}
273				if (LNotEqual(Arg2, 0xfabefac489501248)) {
274					err(arg0, z040, 19, 0, 0, Arg2, 0xfabefac489501248)
275				}
276
277				// By Name locally
278
279				Name(n001, 0x9081122384356647)
280				Store(ObjectType(n001), Local7)
281				if (LNotEqual(Local7, c009)) {
282					err(arg0, z040, 20, 0, 0, Local7, c009)
283				}
284				if (LNotEqual(n001, 0x9081122384356647)) {
285					err(arg0, z040, 21, 0, 0, n001, 0x9081122384356647)
286				}
287
288				// By Name globally
289
290				Store(ObjectType(n003), Local7)
291				if (LNotEqual(Local7, c009)) {
292					err(arg0, z040, 22, 0, 0, Local7, c009)
293				}
294				if (LNotEqual(n003, 0x9189192989396949)) {
295					err(arg0, z040, 23, 0, 0, n003, 0x9189192989396949)
296				}
297			}
298		}
299		case (3) {
300
301			// String
302
303			// By LocalX
304
305			Store("", Local0)
306			Store(ObjectType(Local0), Local7)
307			if (LNotEqual(Local7, c00a)) {
308				err(arg0, z040, 24, 0, 0, Local7, c00a)
309			}
310
311			Store("1", Local0)
312			Store(ObjectType(Local0), Local7)
313			if (LNotEqual(Local7, c00a)) {
314				err(arg0, z040, 25, 0, 0, Local7, c00a)
315			}
316
317			Store("abcd", Local0)
318			Store(ObjectType(Local0), Local7)
319			if (LNotEqual(Local7, c00a)) {
320				err(arg0, z040, 26, 0, 0, Local7, c00a)
321			}
322
323			Store("qwrt", Local0)
324			Store(ObjectType(Local0), Local7)
325			if (LNotEqual(Local7, c00a)) {
326				err(arg0, z040, 27, 0, 0, Local7, c00a)
327			}
328
329			// By ArgX
330
331			Store(ObjectType(Arg2), Local7)
332			if (LNotEqual(Local7, c00a)) {
333				err(arg0, z040, 28, 0, 0, Local7, c00a)
334			}
335			if (LNotEqual(Arg2, "zxcvbnm0912345678ok")) {
336				err(arg0, z040, 29, 0, 0, Arg2, "zxcvbnm0912345678ok")
337			}
338
339			// By Name locally
340
341			Name(n004, "")
342			Store(ObjectType(n004), Local7)
343			if (LNotEqual(Local7, c00a)) {
344				err(arg0, z040, 30, 0, 0, Local7, c00a)
345			}
346			if (LNotEqual(n004, "")) {
347				err(arg0, z040, 31, 0, 0, n004, "")
348			}
349
350			// By Name globally
351
352			Store(ObjectType(n005), Local7)
353			if (LNotEqual(Local7, c00a)) {
354				err(arg0, z040, 32, 0, 0, Local7, c00a)
355			}
356			if (LNotEqual(n005, "9876")) {
357				err(arg0, z040, 33, 0, 0, n005, "9876")
358			}
359
360		}
361		case (4) {
362
363			// Field Unit
364
365			// OperationRegion(r000, SystemMemory, 0x100, 0x100)
366			Field(r000, ByteAcc, NoLock, Preserve) {
367				f000, 8,
368				f222, 32,
369				f223, 57,
370				f224, 64,
371				f225, 71
372			}
373			Store(0x8d, f000)
374
375			Store(ObjectType(f000), Local7)
376			if (LNotEqual(Local7, c00d)) {
377				err(arg0, z040, 34, 0, 0, Local7, c00d)
378			}
379			if (LNotEqual(f000, 0x8d)) {
380				err(arg0, z040, 35, 0, 0, f000, 0x8d)
381			}
382
383			Store(ObjectType(f222), Local7)
384			if (LNotEqual(Local7, c00d)) {
385				err(arg0, z040, 36, 0, 0, Local7, c00d)
386			}
387			Store(ObjectType(f223), Local7)
388			if (LNotEqual(Local7, c00d)) {
389				err(arg0, z040, 37, 0, 0, Local7, c00d)
390			}
391			Store(ObjectType(f224), Local7)
392			if (LNotEqual(Local7, c00d)) {
393				err(arg0, z040, 38, 0, 0, Local7, c00d)
394			}
395			Store(ObjectType(f225), Local7)
396			if (LNotEqual(Local7, c00d)) {
397				err(arg0, z040, 39, 0, 0, Local7, c00d)
398			}
399		}
400		case (5) {
401
402			// BankField
403
404			// OperationRegion(r001, SystemMemory, 0x100, 0x100)
405			Field(r001, ByteAcc, NoLock, Preserve) {
406				bnk0, 8
407			}
408			BankField(r001, bnk0, 0, ByteAcc, NoLock, Preserve) {
409				Offset(16),
410				bkf0, 8,
411			}
412			Store(0x95, bkf0)
413
414			Store(ObjectType(bkf0), Local7)
415			if (LNotEqual(Local7, c00d)) {
416				err(arg0, z040, 40, 0, 0, Local7, c00d)
417			}
418			if (LNotEqual(bkf0, 0x95)) {
419				err(arg0, z040, 41, 0, 0, bkf0, 0x95)
420			}
421		}
422		case (6) {
423
424			// IndexField
425
426			OperationRegion(r002, SystemMemory, 0x100, 0x100)
427			Field(r002, ByteAcc, NoLock, Preserve) {
428				f00a, 16,
429				f00b, 16
430			}
431			IndexField (f00a, f00b, ByteAcc, NoLock, Preserve) {
432				if00, 8,
433				if01, 8
434			}
435
436			Store(0xa0, f00a)
437			Store(0xa1, f00b)
438			Store(0xa2, if00)
439			Store(0xa3, if01)
440
441			Store(ObjectType(f00a), Local7)
442			if (LNotEqual(Local7, c00d)) {
443				err(arg0, z040, 42, 0, 0, Local7, c00d)
444			}
445			Store(ObjectType(f00b), Local7)
446			if (LNotEqual(Local7, c00d)) {
447				err(arg0, z040, 43, 0, 0, Local7, c00d)
448			}
449			Store(ObjectType(if00), Local7)
450			if (LNotEqual(Local7, c00d)) {
451				err(arg0, z040, 44, 0, 0, Local7, c00d)
452			}
453			Store(ObjectType(if01), Local7)
454			if (LNotEqual(Local7, c00d)) {
455				err(arg0, z040, 45, 0, 0, Local7, c00d)
456			}
457		}
458		case (7) {
459
460			// Buffer
461
462			Store(Buffer(4) {0, 1, 2, 3}, Local0)
463			Store(ObjectType(Local0), Local7)
464			if (LNotEqual(Local7, c00b)) {
465				err(arg0, z040, 46, 0, 0, Local7, c00b)
466			}
467			if (LNotEqual(Local0, Buffer(4) {0, 1, 2, 3})) {
468				err(arg0, z040, 47, 0, 0, 0, 0)
469			}
470		}
471		case (8) {
472
473			// Buffer
474
475			Store(ObjectType(Arg2), Local7)
476			if (LNotEqual(Local7, c00b)) {
477				err(arg0, z040, 48, 0, 0, Local7, c00b)
478			}
479			if (LNotEqual(Arg2, Buffer(4) {4, 5, 6, 7})) {
480				err(arg0, z040, 49, 0, 0, 0, 0)
481			}
482		}
483		case (9) {
484
485			// Buffer
486
487			Name(b000, Buffer(4) {8, 9, 10, 11})
488			Store(ObjectType(b000), Local7)
489			if (LNotEqual(Local7, c00b)) {
490				err(arg0, z040, 50, 0, 0, Local7, c00b)
491			}
492			if (LNotEqual(b000, Buffer(4) {8, 9, 10, 11})) {
493				err(arg0, z040, 51, 0, 0, 0, 0)
494			}
495		}
496		case (10) {
497
498			// Buffer
499
500			Store(ObjectType(b003), Local7)
501			if (LNotEqual(Local7, c00b)) {
502				err(arg0, z040, 52, 0, 0, Local7, c00b)
503			}
504			if (LNotEqual(b003, Buffer(4) {12, 13, 14, 15})) {
505				err(arg0, z040, 53, 0, 0, 0, 0)
506			}
507		}
508		case (11) {
509
510			// Buffer Field
511
512			Store(Buffer(4) {16, 17, 18, 19}, Local0)
513			CreateBitField(Local0, 3, f001)
514			Store(ObjectType(f001), Local7)
515			if (LNotEqual(Local7, c016)) {
516				err(arg0, z040, 54, 0, 0, Local7, c016)
517			}
518			if (LNotEqual(Local0, Buffer(4) {16, 17, 18, 19})) {
519				err(arg0, z040, 55, 0, 0, 0, 0)
520			}
521		}
522		case (12) {
523
524			// Buffer Field
525
526			Store(Buffer(4) {20, 21, 22, 23}, Local0)
527			CreateByteField(Local0, 3, f002)
528			Store(ObjectType(f002), Local7)
529			if (LNotEqual(Local7, c016)) {
530				err(arg0, z040, 56, 0, 0, Local7, c016)
531			}
532			if (LNotEqual(Local0, Buffer(4) {20, 21, 22, 23})) {
533				err(arg0, z040, 57, 0, 0, 0, 0)
534			}
535		}
536		case (13) {
537
538			// Buffer Field
539
540			Store(Buffer(4) {24, 25, 26, 27}, Local0)
541			CreateDWordField(Local0, 0, f003)
542			Store(ObjectType(f003), Local7)
543			if (LNotEqual(Local7, c016)) {
544				err(arg0, z040, 58, 0, 0, Local7, c016)
545			}
546			if (LNotEqual(Local0, Buffer(4) {24, 25, 26, 27})) {
547				err(arg0, z040, 59, 0, 0, 0, 0)
548			}
549		}
550		case (14) {
551
552			// Buffer Field
553
554			Store(Buffer(4) {28, 29, 30, 31}, Local0)
555			CreateField(Local0, 0, 32, f004)
556			Store(ObjectType(f004), Local7)
557			if (LNotEqual(Local7, c016)) {
558				err(arg0, z040, 60, 0, 0, Local7, c016)
559			}
560			if (LNotEqual(Local0, Buffer(4) {28, 29, 30, 31})) {
561				err(arg0, z040, 61, 0, 0, 0, 0)
562			}
563		}
564		case (15) {
565
566			// Buffer Field
567
568			Store(Buffer() {33, 34, 35, 36, 37, 38, 39, 40, 41}, Local0)
569			CreateField(Local0, 0, 64, f005)
570			Store(ObjectType(f005), Local7)
571			if (LNotEqual(Local7, c016)) {
572				err(arg0, z040, 62, 0, 0, Local7, c016)
573			}
574			if (LNotEqual(Local0, Buffer() {33, 34, 35, 36, 37,
575								38, 39, 40, 41})) {
576				err(arg0, z040, 63, 0, 0, 0, 0)
577			}
578		}
579		case (16) {
580
581			// Buffer Field
582
583			Store(Buffer() {42, 43, 44, 45, 46, 47, 48, 49, 50}, Local0)
584			CreateField(Local0, 0, 65, f006)
585			Store(ObjectType(f006), Local7)
586			if (LNotEqual(Local7, c016)) {
587				err(arg0, z040, 64, 0, 0, Local7, c016)
588			}
589			if (LNotEqual(Local0, Buffer() {42, 43, 44, 45, 46, 47, 48, 49, 50})) {
590				err(arg0, z040, 65, 0, 0, 0, 0)
591			}
592
593			CreateField(Local0, 0, 17, f111)
594			Store(ObjectType(f111), Local7)
595			if (LNotEqual(Local7, c016)) {
596				err(arg0, z040, 66, 0, 0, Local7, c016)
597			}
598			CreateField(Local0, 0, 57, f112)
599			Store(ObjectType(f112), Local7)
600			if (LNotEqual(Local7, c016)) {
601				err(arg0, z040, 67, 0, 0, Local7, c016)
602			}
603		}
604		case (17) {
605
606			// Buffer Field
607
608			Store(Buffer() {42, 43, 44, 45, 46, 47, 48, 49, 50}, Local0)
609			CreateQWordField(Local0, 0, f007)
610			Store(ObjectType(f007), Local7)
611			if (LNotEqual(Local7, c016)) {
612				err(arg0, z040, 68, 0, 0, Local7, c016)
613			}
614			if (LNotEqual(Local0, Buffer() {42, 43, 44, 45, 46, 47, 48, 49, 50})) {
615				err(arg0, z040, 69, 0, 0, 0, 0)
616			}
617		}
618		case (18) {
619
620			// Buffer Field
621
622			Store(Buffer() {51, 52, 53, 54}, Local0)
623			CreateWordField(Local0, 0, f008)
624			Store(ObjectType(f008), Local7)
625			if (LNotEqual(Local7, c016)) {
626				err(arg0, z040, 70, 0, 0, Local7, c016)
627			}
628			if (LNotEqual(Local0, Buffer() {51, 52, 53, 54})) {
629				err(arg0, z040, 71, 0, 0, 0, 0)
630			}
631		}
632		case (19) {
633
634			// Buffer Field
635
636			Store("q", Local0)
637			Store(Index(Local0, 0), Local1)
638			Store(ObjectType(Local1), Local7)
639			if (LNotEqual(Local7, c016)) {
640				err(arg0, z040, 72, 0, 0, Local7, c016)
641			}
642			if (LNotEqual(Local0, "q")) {
643				err(arg0, z040, 73, 0, 0, 0, 0)
644			}
645
646			Store("qw", Local0)
647			Store(Index(Local0, 0), Local1)
648			Store(ObjectType(Local1), Local7)
649			if (LNotEqual(Local7, c016)) {
650				err(arg0, z040, 74, 0, 0, Local7, c016)
651			}
652			if (LNotEqual(Local0, "qw")) {
653				err(arg0, z040, 75, 0, 0, 0, 0)
654			}
655
656			Store("qwertyu", Local0)
657			Store(Index(Local0, 0), Local1)
658			Store(ObjectType(Local1), Local7)
659			if (LNotEqual(Local7, c016)) {
660				err(arg0, z040, 76, 0, 0, Local7, c016)
661			}
662			if (LNotEqual(Local0, "qwertyu")) {
663				err(arg0, z040, 77, 0, 0, 0, 0)
664			}
665
666			Store("qwertyuiop", Local0)
667			Store(Index(Local0, 0), Local1)
668			Store(ObjectType(Local1), Local7)
669			if (LNotEqual(Local7, c016)) {
670				err(arg0, z040, 78, 0, 0, Local7, c016)
671			}
672			if (LNotEqual(Local0, "qwertyuiop")) {
673				err(arg0, z040, 79, 0, 0, 0, 0)
674			}
675		}
676		case (20) {
677
678			// Buffer Field
679
680			Store(Buffer() {42, 43, 44, 45}, Local0)
681			Store(Index(Local0, 0), Local1)
682			Store(ObjectType(Local1), Local7)
683			if (LNotEqual(Local7, c016)) {
684				err(arg0, z040, 80, 0, 0, Local7, c016)
685			}
686			if (LNotEqual(Local0, Buffer() {42, 43, 44, 45})) {
687				err(arg0, z040, 81, 0, 0, 0, 0)
688			}
689
690			Store(Buffer() {42, 43, 44, 45, 46, 47, 48, 49}, Local0)
691			Store(Index(Local0, 0), Local1)
692			Store(ObjectType(Local1), Local7)
693			if (LNotEqual(Local7, c016)) {
694				err(arg0, z040, 82, 0, 0, Local7, c016)
695			}
696			if (LNotEqual(Local0, Buffer() {42, 43, 44, 45, 46, 47, 48, 49})) {
697				err(arg0, z040, 83, 0, 0, 0, 0)
698			}
699
700			Store(Buffer() {42, 43, 44, 45, 46, 47, 48, 49, 50}, Local0)
701			Store(Index(Local0, 0), Local1)
702			Store(ObjectType(Local1), Local7)
703			if (LNotEqual(Local7, c016)) {
704				err(arg0, z040, 84, 0, 0, Local7, c016)
705			}
706			if (LNotEqual(Local0, Buffer() {42, 43, 44, 45, 46, 47, 48, 49, 50})) {
707				err(arg0, z040, 85, 0, 0, 0, 0)
708			}
709		}
710		case (21) {
711
712			// Index with ...
713
714			Store(Package() {
715					Package() {
716						0x98765432,
717						Buffer() {0x12},
718						Package() {0x12345678},
719						"qwertyui"},
720					Buffer() {0x12},
721					"q",
722					0x98765432}, LOcal0)
723
724			// Package
725
726			Store(Index(Local0, 0), Local1)
727			Store(ObjectType(Local1), Local7)
728			if (LNotEqual(Local7, c00c)) {
729				err(arg0, z040, 86, 0, 0, Local7, c00c)
730			}
731
732			// Buffer
733
734			Store(Index(Local0, 1), Local1)
735			Store(ObjectType(Local1), Local7)
736			if (LNotEqual(Local7, c00b)) {
737				err(arg0, z040, 87, 0, 0, Local7, c00b)
738			}
739
740			// String
741
742			Store(Index(Local0, 2), Local1)
743			Store(ObjectType(Local1), Local7)
744			if (LNotEqual(Local7, c00a)) {
745				err(arg0, z040, 88, 0, 0, Local7, c00a)
746			}
747
748			// Integer
749
750			Store(Index(Local0, 3), Local1)
751			Store(ObjectType(Local1), Local7)
752			if (LNotEqual(Local7, c009)) {
753				err(arg0, z040, 89, 0, 0, Local7, c009)
754			}
755		}
756		case (22) {
757
758			// Operation Region
759
760			DataTableRegion (HDR0, "DSDT", "", "")
761			Store(ObjectType(HDR0), Local7)
762			if (LNotEqual(Local7, c012)) {
763				err(arg0, z040, 90, 0, 0, Local7, c012)
764			}
765		}
766		case (23) {
767
768			// Debug Object
769
770			Store(ObjectType(Debug), Local7)
771			if (LNotEqual(Local7, c018)) {
772				err(arg0, z040, 91, 0, 0, Local7, c018)
773			}
774		}
775		case (24) {
776
777			// Device
778
779			Device(dv00) {}
780			Store(ObjectType(dv00), Local7)
781			if (LNotEqual(Local7, c00e)) {
782				err(arg0, z040, 92, 0, 0, Local7, c00e)
783			}
784		}
785		case (25) {
786
787			// Event
788
789			Event(evt0)
790			Store(ObjectType(evt0), Local7)
791			if (LNotEqual(Local7, c00f)) {
792				err(arg0, z040, 93, 0, 0, Local7, c00f)
793			}
794		}
795		case (26) {
796
797			// Method
798
799			Method(m0f2) { return (0x1234) }
800			Store(ObjectType(m0f2), Local7)
801			if (LNotEqual(Local7, c010)) {
802				err(arg0, z040, 94, 0, 0, Local7, c010)
803			}
804		}
805		case (27) {
806/*
807 *			// Function
808 *
809 *			Function(mof3) { return (0) }
810 *			Store(ObjectType(m0f3), Local7)
811 *			if (LNotEqual(Local7, c010)) {
812 *				err(arg0, z040, 95, 0, 0, Local7, c010)
813 *			}
814 */
815		}
816		case (28) {
817
818			// Mutex
819
820			Mutex(mt00, 0)
821			Store(ObjectType(mt00), Local7)
822			if (LNotEqual(Local7, c011)) {
823				err(arg0, z040, 96, 0, 0, Local7, c011)
824			}
825		}
826		case (29) {
827
828			// Operation Region
829
830			Store(ObjectType(r000), Local7)
831			if (LNotEqual(Local7, c012)) {
832				err(arg0, z040, 97, 0, 0, Local7, c012)
833			}
834			Store(ObjectType(r001), Local7)
835			if (LNotEqual(Local7, c012)) {
836				err(arg0, z040, 98, 0, 0, Local7, c012)
837			}
838		}
839		case (30) {
840
841			// Package
842
843			Name(p000, Package() {0x12345678})
844			Name(p001, Package() {0x12345678, 0x9abcdef0})
845			Name(p002, Package() {0x12345678, 0x9abcdef0, 0x9abcdef0})
846			Name(p003, Package() {0x123456789abcdef0})
847			Name(p004, Package() {0x123456789abcdef0, 0x123456789abcdef0})
848			Name(p005, Package() {0x123456789abcdef0,
849							0x123456789abcdef0, 0x123456789abcdef0})
850			Name(p006, Package() {Buffer(1) {}})
851			Name(p007, Package() {Buffer(32) {}})
852			Name(p008, Package() {Buffer(64) {}})
853			Name(p009, Package() {Buffer(125) {}})
854			Name(p00a, Package() {0x12, Buffer() {0x12}})
855			Name(p00b, Package() {0x12, Package() {0x12}})
856			Name(p00c, Package() {Buffer() {0x12}})
857			Name(p00d, Package() {Buffer() {0x12}, 0x12345678})
858			Name(p00e, Package() {Buffer() {0x12}, Buffer() {0x12}})
859			Name(p00f, Package() {Buffer() {0x12}, Package() {0x12}})
860			Name(p010, Package() {Package() {0x12345678}})
861			Name(p011, Package() {Package() {0x12345678}, 0x12345678})
862			Name(p012, Package() {Package() {0x12345678}, Buffer() {0x12}})
863			Name(p013, Package() {Package() {0x12345678}, Package() {0x12}})
864
865
866			Store(ObjectType(p000), Local7)
867			if (LNotEqual(Local7, c00c)) {
868				err(arg0, z040, 99, 0, 0, Local7, c00c)
869			}
870			Store(ObjectType(p001), Local7)
871			if (LNotEqual(Local7, c00c)) {
872				err(arg0, z040, 100, 0, 0, Local7, c00c)
873			}
874			Store(ObjectType(p002), Local7)
875			if (LNotEqual(Local7, c00c)) {
876				err(arg0, z040, 101, 0, 0, Local7, c00c)
877			}
878			Store(ObjectType(p003), Local7)
879			if (LNotEqual(Local7, c00c)) {
880				err(arg0, z040, 102, 0, 0, Local7, c00c)
881			}
882			Store(ObjectType(p004), Local7)
883			if (LNotEqual(Local7, c00c)) {
884				err(arg0, z040, 103, 0, 0, Local7, c00c)
885			}
886			Store(ObjectType(p005), Local7)
887			if (LNotEqual(Local7, c00c)) {
888				err(arg0, z040, 104, 0, 0, Local7, c00c)
889			}
890			Store(ObjectType(p006), Local7)
891			if (LNotEqual(Local7, c00c)) {
892				err(arg0, z040, 105, 0, 0, Local7, c00c)
893			}
894			Store(ObjectType(p007), Local7)
895			if (LNotEqual(Local7, c00c)) {
896				err(arg0, z040, 106, 0, 0, Local7, c00c)
897			}
898			Store(ObjectType(p008), Local7)
899			if (LNotEqual(Local7, c00c)) {
900				err(arg0, z040, 107, 0, 0, Local7, c00c)
901			}
902			Store(ObjectType(p009), Local7)
903			if (LNotEqual(Local7, c00c)) {
904				err(arg0, z040, 108, 0, 0, Local7, c00c)
905			}
906			Store(ObjectType(p00a), Local7)
907			if (LNotEqual(Local7, c00c)) {
908				err(arg0, z040, 109, 0, 0, Local7, c00c)
909			}
910			Store(ObjectType(p00b), Local7)
911			if (LNotEqual(Local7, c00c)) {
912				err(arg0, z040, 110, 0, 0, Local7, c00c)
913			}
914			Store(ObjectType(p00c), Local7)
915			if (LNotEqual(Local7, c00c)) {
916				err(arg0, z040, 111, 0, 0, Local7, c00c)
917			}
918			Store(ObjectType(p00d), Local7)
919			if (LNotEqual(Local7, c00c)) {
920				err(arg0, z040, 112, 0, 0, Local7, c00c)
921			}
922			Store(ObjectType(p00e), Local7)
923			if (LNotEqual(Local7, c00c)) {
924				err(arg0, z040, 113, 0, 0, Local7, c00c)
925			}
926			Store(ObjectType(p00f), Local7)
927			if (LNotEqual(Local7, c00c)) {
928				err(arg0, z040, 114, 0, 0, Local7, c00c)
929			}
930			Store(ObjectType(p010), Local7)
931			if (LNotEqual(Local7, c00c)) {
932				err(arg0, z040, 115, 0, 0, Local7, c00c)
933			}
934			Store(ObjectType(p011), Local7)
935			if (LNotEqual(Local7, c00c)) {
936				err(arg0, z040, 116, 0, 0, Local7, c00c)
937			}
938			Store(ObjectType(p012), Local7)
939			if (LNotEqual(Local7, c00c)) {
940				err(arg0, z040, 117, 0, 0, Local7, c00c)
941			}
942			Store(ObjectType(p013), Local7)
943			if (LNotEqual(Local7, c00c)) {
944				err(arg0, z040, 118, 0, 0, Local7, c00c)
945			}
946		}
947		case (31) {
948
949			// Power Resource
950
951			PowerResource(pwr0, 1, 0) {Method(m000){return (0)}}
952			Store(ObjectType(pwr0), Local7)
953			if (LNotEqual(Local7, c013)) {
954				err(arg0, z040, 119, 0, 0, Local7, c013)
955			}
956		}
957		case (32) {
958
959			// Processor
960
961			Processor(pr00, 0, 0xFFFFFFFF, 0) {}
962			Store(ObjectType(pr00), Local7)
963			if (LNotEqual(Local7, c014)) {
964				err(arg0, z040, 120, 0, 0, Local7, c014)
965			}
966		}
967		case (33) {
968			ThermalZone(tz00) {}
969			Store(ObjectType(tz00), Local7)
970			if (LNotEqual(Local7, c015)) {
971				err(arg0, z040, 121, 0, 0, Local7, c015)
972			}
973		}
974		case (34) {
975/*
976			// Reserved for DDB Handle
977
978Store("==================================== zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", Debug)
979
980//			Store (LoadTable ("OEM1", "MYOEM", "TABLE1", "\\_SB.PCI0", "MYD",
981//					 	Package () {0, "\\_SB.PCI0"}), Local0)
982
983			Store (LoadTable("OEM1", "MYOEM", "TABLE1"), Local0)
984			Store(ObjectType(Local0), Local7)
985			if (LNotEqual(Local7, c017)) {
986				err(arg0, z040, 122, 0, 0, Local7, c017)
987			}
988
989Store("==================================== uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu", Debug)
990*/
991		}
992		Default {
993			err(arg0, z040, 123, 0, 0, 0, 0)
994		}
995	}
996
997	return (Local7)
998}
999
1000Method(m0f0, 0, Serialized)
1001{
1002	Name(ts, "m0f0")
1003
1004	Store("TEST: m0f0, ObjectType", Debug)
1005
1006	Store(0, Local5)
1007	Store(35, Local4)
1008
1009	While(Local4) {
1010
1011		Store(0, Local2)
1012
1013		switch (ToInteger (Local5)) {
1014			case (1) {
1015				Store(0x81223344, Local2)
1016			}
1017			case (2) {
1018				Store(0xfabefac489501248, Local2)
1019			}
1020			case (3) {
1021				Store("zxcvbnm0912345678ok", Local2)
1022			}
1023			case (8) {
1024				Store(Buffer(4) {4, 5, 6, 7}, Local2)
1025			}
1026		}
1027
1028		m0f1(ts, Local5, Local2, 0, 0, 0, 0)
1029
1030		Increment(Local5)
1031		Decrement(Local4)
1032	}
1033}
1034
1035// Run-method
1036Method(OBT0)
1037{
1038	Store("TEST: OBT0, Type of object", Debug)
1039
1040	m0f0()
1041}
1042