• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /barrelfish-2018-10-04/lib/acpica/tests/aslts/src/runtime/collections/functional/name/
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 * Miscellaneous named object creation
31 */
32
33Name(z133, 133)
34
35/*
36 * This sub-test is intended to comprehensively verify
37 * the Control Method declaration syntax implementation.
38 *
39 * Declare the Control Method Objects of different signature,
40 * check that properly specified or default arguments values
41 * provide required functionality.
42 *
43 *    17.5.75    Method (Declare Control Method)
44 *    Syntax
45 * Method (MethodName, NumArgs, SerializeRule, SyncLevel,
46 *         ReturnType, ParameterTypes) {TermList}
47 *
48 *    Validated Assertions:
49 *
50 * - Control Method declaration creates an Object in the ACPI
51 *   namespace which can be referred by the specified MethodName
52 *   either to initiate its invocation or to obtain its AML Object
53 *   type. Also MethodName can be used to save a copy of the Object
54 *   or a reference to it in another AML Object.
55 *
56 * - ASL compiler should allow only a Namestring data type in the
57 *   MethodName position.
58 *
59 * - ASL compiler should allow only an Type3Opcode (integer) constant
60 *   expression of the value in the range 0-7 in the NumArgs position.
61 *   NumArgs is optional argument.
62 *
63 * - ASL compiler should allow only the keywords 'NotSerialized'
64 *   and 'Serialized' in the SerializeRule position. SerializeRule
65 *   is optional argument.
66 *
67 * - ASL compiler should allow only an Type3Opcode (integer) constant
68 *   expression of the value in the range 0-15 in the SyncLevel position.
69 *   SyncLevel is optional argument. If no SyncLevel is specified, SyncLevel
70 *   0 is assumed.
71 *
72 * - ASL compiler should allow only an ObjectTypeKeyword or
73 *   a comma-separated ObjectTypeKeywords enclosed with curly
74 *   brackets (OTK package) in the ReturnType position. ReturnType
75 *   is optional argument. If no ReturnType is specified, ReturnType
76 *   UnknownObj is assumed.
77 *   ObjectTypeKeyword := UnknownObj | IntObj | StrObj | BuffObj |
78 *                        PkgObj | FieldUnitObj | DeviceObj | EventObj |
79 *                        MethodObj | MutexObj | OpRegionObj | PowerResObj |
80 *                        ThermalZoneObj | BuffFieldObj | DDBHandleObj
81 *
82 * - Every ASL data type should have a respective unique ObjectType Keyword.
83 *
84 * - ASL compiler should report an error when an actual Object specified
85 *   to be returned is of inappropriate type.
86 *
87 * - ASL compiler should report an error when there is at least one
88 *   control path in the method that returns no any actual Object.
89 *
90 * - ASL compiler should report an error when some different from
91 *   UnknownObj ObjectType Keyword specified in the ReturnType position
92 *   but no any actual Object specified to be returned.
93 *
94 * - ASL compiler should allow only an OTK package or a package
95 *   containing OTK packages along with ObjectTypeKeywords in the
96 *   ParameterTypes position.
97 *
98 * - ASL compiler should report an error when ParameterTypes is specified
99 *   and the number of members in the ParameterTypes package don't match
100 *   NumArgs.
101 *
102 * - ASL compiler should report an error when an actual Object
103 *   specified to be a respective argument of the Method is of
104 *   inappropriate type.
105 *
106 * - System software should execute a control method by referencing
107 *   the objects in the Method body in order.
108 *
109 * - Method opens a name scope. All namespace references that occur
110 *   during the method execution are relative to the Method package
111 *   location.
112 *
113 * - If the  method is declared as Serialized, it can be called
114 *   recursively, maybe, through another auxiliary method.
115 *
116 * - One method declared as Serialized can call another
117 *   one declared as Serialized too when the SyncLevel of
118 *   the second method is not less than that of the first.
119 *
120 * - The method declared as Serialized can acquire an Mutex
121 *   when the SyncLevel of the Mutex is not less than that of
122 *   the method.
123 *
124 * - If some method acquired an Mutex it can call another one
125 *   declared as Serialized when the SyncLevel of the called
126 *   method is not less than that of the Mutex.
127 *
128 * - All Acquire terms must refer to a synchronization object
129 *   with an equal or greater SyncLevel to the current Method level.
130 *
131 * - The method declared as Serialized can release an Mutex
132 *   when the SyncLevel of the Mutex is not less than that of
133 *   the method.
134 *
135 * - All namespace objects created by a method should be destroyed
136 *   when method execution exits.
137 *
138 */
139
140// Flags of types of Computational Data Objects
141// (Fields and Integer, String, Buffer)
142Name(bz00, Buffer() {0,1,1,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0})
143
144// Check Result of operation on equal to Benchmark value
145// m680(<method name>,
146//	<internal type of error if it occurs>,
147//	<Result>,
148//	<Benchmark value>)
149Method(m205, 4)
150{
151	Store(ObjectType(arg2), Local0)
152	Store(ObjectType(arg3), Local1)
153	if (LNotEqual(Local0, Local1)) {
154		err(Concatenate(arg0, "-OType"), z133, arg1, 0, 0, Local0, Local1)
155		Return (1)
156	} elseif (Derefof(Index(bz00, Local0))) {
157		if (LNot(y119)) {
158			if (LEqual(Local1, 1)) {
159				// Cast 64-bit to 32-bit
160				if (LNot(F64)) {
161					Store(arg3, arg3)
162				}
163			}
164		}
165		if (LNotEqual(arg2, arg3)) {
166			err(arg0, z133, arg1, 0, 0, arg2, arg3)
167			Return (1)
168		}
169	} elseif (LEqual(Local0, 8)) {
170		// Methods, compare the results of them
171		Store(m209(Concatenate(arg0, "-Method"), arg1, arg2, arg3), Local2)
172		Return (Local2)
173	} elseif (LEqual(Local0, 4)) {
174		// Packages
175		Store(m20a(Concatenate(arg0, "-Pack"), arg1, arg2, arg3), Local2)
176		Return (Local2)
177	}
178	Return (0)
179}
180
181// Check that Results of the Methods are equal each other
182Method(m209, 4, Serialized)
183{
184	Name(MMM0, 0)
185	Name(MMM1, 0)
186
187	CopyObject(arg2, MMM0)
188	CopyObject(arg3, MMM1)
189
190	Return (m205(arg0, arg1, MMM0, MMM1))
191}
192
193// Check that two Packages are equal each other
194Method(m20a, 4)
195{
196	Store(Sizeof(arg3), Local0)
197	if (LNotEqual(Sizeof(arg2), Local0)) {
198		err(Concatenate(arg0, "-Size"), z133, arg1, 0, 0, Sizeof(arg2), Local0)
199		Return (1)
200	}
201	While (Local0) {
202		Decrement(Local0)
203		Store(ObjectType(Derefof(Index(arg2, Local0))), Local1)
204		Store(ObjectType(Derefof(Index(arg3, Local0))), Local2)
205		if (LNotEqual(Local1, Local2)) {
206			// ObjectType is corrupted
207			err(Concatenate(arg0, "-OType"), z133, arg1, 0, 0, Local1, Local2)
208			Return (1)
209		} elseif (Derefof(Index(bz00, Local1))) {
210			// the computational data type
211			if (LNotEqual(
212					Derefof(Index(arg2, Local0)),
213					Derefof(Index(arg3, Local0)))) {
214				// The value is corrupted
215				err(arg0, z133, arg1, 0, 0, Derefof(Index(arg2, Local0)), Derefof(Index(arg3, Local0)))
216				Return (1)
217			}
218		}
219	}
220	Return (0)
221}
222
223Scope(\_SB){
224	Method(m206){}
225}
226
227Method(m207,, Serialized)
228{
229	Name(ts, "m207")
230
231	Method(m240)
232	{
233		Method(mm00) {Return ("\\m207.m240.mm00")}
234		Method(\_SB.m206.mm00) {Return ("\\_SB.m206.mm00")}
235	
236		m205(ts, 1, ObjectType(mm00), 8)
237		m205(ts, 2, mm00(), "\\m207.m240.mm00")
238
239		m205(ts, 3, ObjectType(\m207.m240.mm00), 8)
240		m205(ts, 4, \m207.m240.mm00(), "\\m207.m240.mm00")
241
242		m205(ts, 5, ObjectType(^m240.mm00), 8)
243		m205(ts, 6, ^m240.mm00(), "\\m207.m240.mm00")
244
245		m205(ts, 7, ObjectType(\_SB.m206.mm00), 8)
246		m205(ts, 8, \_SB.m206.mm00(), "\\_SB.m206.mm00")
247	}
248
249	Method(m241)
250	{
251		Method(mm10) {Return ("\\m207.m241.mm10")}
252		Method(mm20, ) {Return ("\\m207.m241.mm20")}
253		Method(mm30, , ) {Return ("\\m207.m241.mm30")}
254		Method(mm40, , , ) {Return ("\\m207.m241.mm40")}
255		Method(mm50, , , , ) {Return ("\\m207.m241.mm50")}
256		Method(mm60, , , , , ) {Return ("\\m207.m241.mm60")}
257
258		Method(mm00, 0) {Return ("\\m207.m241.mm00")}
259		Method(mm01, 1) {Return ("\\m207.m241.mm01")}
260		Method(mm02, 2) {Return ("\\m207.m241.mm02")}
261		Method(mm03, 3) {Return ("\\m207.m241.mm03")}
262		Method(mm04, 4) {Return ("\\m207.m241.mm04")}
263		Method(mm05, 5) {Return ("\\m207.m241.mm05")}
264		Method(mm06, 6) {Return ("\\m207.m241.mm06")}
265		Method(mm07, 7) {Return ("\\m207.m241.mm07")}
266
267		// Numargs as Type3Opcode (integer) constant expression
268// Invalid checksum warning
269//		Method(mm09, Add(6, 1)) {Return ("\\m207.m241.mm09")}
270
271		m205(ts,  9, ObjectType(mm10), 8)
272		m205(ts, 10, mm10(), "\\m207.m241.mm10")
273
274		m205(ts, 11, ObjectType(mm20), 8)
275		m205(ts, 12, mm20(), "\\m207.m241.mm20")
276
277		m205(ts, 13, ObjectType(mm30), 8)
278		m205(ts, 14, mm30(), "\\m207.m241.mm30")
279
280		m205(ts, 15, ObjectType(mm40), 8)
281		m205(ts, 16, mm40(), "\\m207.m241.mm40")
282
283		m205(ts, 17, ObjectType(mm50), 8)
284		m205(ts, 18, mm50(), "\\m207.m241.mm50")
285
286		m205(ts, 19, ObjectType(mm60), 8)
287		
288		if (y157) {
289			m205(ts, 20, mm60(), "\\m207.m241.mm60")
290		}
291
292		m205(ts, 21, ObjectType(mm00), 8)
293		m205(ts, 22, mm00(), "\\m207.m241.mm00")
294
295		m205(ts, 23, ObjectType(mm01), 8)
296		m205(ts, 24, mm01(0), "\\m207.m241.mm01")
297
298		m205(ts, 25, ObjectType(mm02), 8)
299		m205(ts, 26, mm02(0, 1), "\\m207.m241.mm02")
300
301		m205(ts, 27, ObjectType(mm03), 8)
302		m205(ts, 28, mm03(0, 1, 2), "\\m207.m241.mm03")
303
304		m205(ts, 29, ObjectType(mm04), 8)
305		m205(ts, 30, mm04(0, 1, 2, 3), "\\m207.m241.mm04")
306
307		m205(ts, 31, ObjectType(mm05), 8)
308		m205(ts, 32, mm05(0, 1, 2, 3, 4), "\\m207.m241.mm05")
309
310		m205(ts, 33, ObjectType(mm06), 8)
311		m205(ts, 34, mm06(0, 1, 2, 3, 4, 5), "\\m207.m241.mm06")
312
313		m205(ts, 35, ObjectType(mm07), 8)
314		m205(ts, 36, mm07(0, 1, 2, 3, 4, 5, 6), "\\m207.m241.mm07")
315
316// Invalid checksum warning
317//		m205(ts, 37, ObjectType(mm09), 8)
318// Too many arguments ^  (MM09 requires 0)
319//		m205(ts, 38, mm09(0, 1, 2, 3, 4, 5, 6), "\\m207.m241.mm09")
320	}
321
322	Method(m242)
323	{
324		Method(mm10, , NotSerialized) {Return ("\\m207.m242.mm10")}
325		Method(mm20, , Serialized) {Return ("\\m207.m242.mm20")}
326		Method(mm30, , NotSerialized, ) {Return ("\\m207.m242.mm30")}
327		Method(mm40, , Serialized, , ) {Return ("\\m207.m242.mm40")}
328		Method(mm50, , NotSerialized, , , ) {Return ("\\m207.m242.mm50")}
329		Method(mm60, , Serialized, , , ) {Return ("\\m207.m242.mm60")}
330
331		Method(mm00, 0, Serialized, 0) {Return ("\\m207.m242.mm00")}
332		Method(mm01, 1, Serialized, 1) {Return ("\\m207.m242.mm01")}
333		Method(mm02, 2, Serialized, 2) {Return ("\\m207.m242.mm02")}
334		Method(mm03, 3, Serialized, 3) {Return ("\\m207.m242.mm03")}
335		Method(mm04, 4, Serialized, 4) {Return ("\\m207.m242.mm04")}
336		Method(mm05, 5, Serialized, 5) {Return ("\\m207.m242.mm05")}
337		Method(mm06, 6, Serialized, 6) {Return ("\\m207.m242.mm06")}
338		Method(mm07, 7, Serialized, 7) {Return ("\\m207.m242.mm07")}
339		Method(mm08, 0, Serialized, 8) {Return ("\\m207.m242.mm08")}
340		Method(mm09, 1, Serialized, 9) {Return ("\\m207.m242.mm09")}
341		Method(mm0a, 2, Serialized, 10) {Return ("\\m207.m242.mm0a")}
342		Method(mm0b, 3, Serialized, 11) {Return ("\\m207.m242.mm0b")}
343		Method(mm0c, 4, Serialized, 12) {Return ("\\m207.m242.mm0c")}
344		Method(mm0d, 5, Serialized, 13) {Return ("\\m207.m242.mm0d")}
345		Method(mm0e, 6, Serialized, 14) {Return ("\\m207.m242.mm0e")}
346		Method(mm0f, 7, Serialized, 15) {Return ("\\m207.m242.mm0f")}
347
348		// Numargs as Type3Opcode (integer) constant expression
349// Invalid checksum warning
350//		Method(mm70, Add(6, 1), NotSerialized) {Return ("\\m207.m242.mm70")}
351
352		// SyncLevel as Type3Opcode (integer) constant expression
353		Method(mm80, 7, Serialized, Add(14, 1)) {Return ("\\m207.m242.mm80")}
354
355		// Both Numargs and SyncLevel as Type3Opcode (integer) constant expressions
356// Invalid checksum warning
357//		Method(mm90, Add(6, 1), Serialized, Add(14, 1)) {Return ("\\m207.m242.mm90")}
358
359		m205(ts, 39, ObjectType(mm10), 8)
360		m205(ts, 40, mm10(), "\\m207.m242.mm10")
361
362		m205(ts, 41, ObjectType(mm10), 8)
363		m205(ts, 42, mm20(), "\\m207.m242.mm20")
364
365		m205(ts, 43, ObjectType(mm10), 8)
366		m205(ts, 44, mm30(), "\\m207.m242.mm30")
367
368		m205(ts, 45, ObjectType(mm10), 8)
369		m205(ts, 46, mm40(), "\\m207.m242.mm40")
370
371		m205(ts, 47, ObjectType(mm10), 8)
372		if (y157) {
373			m205(ts, 48, mm50(), "\\m207.m242.mm50")
374		}
375
376		m205(ts, 49, ObjectType(mm10), 8)
377		if (y157) {
378			m205(ts, 50, mm60(), "\\m207.m242.mm60")
379		}
380
381		m205(ts, 51, ObjectType(mm00), 8)
382		m205(ts, 52, mm00(), "\\m207.m242.mm00")
383
384		m205(ts, 53, ObjectType(mm01), 8)
385		m205(ts, 54, mm01(0), "\\m207.m242.mm01")
386
387		m205(ts, 55, ObjectType(mm02), 8)
388		m205(ts, 56, mm02(0, 1), "\\m207.m242.mm02")
389
390		m205(ts, 57, ObjectType(mm03), 8)
391		m205(ts, 58, mm03(0, 1, 2), "\\m207.m242.mm03")
392
393		m205(ts, 59, ObjectType(mm04), 8)
394		m205(ts, 60, mm04(0, 1, 2, 3), "\\m207.m242.mm04")
395
396		m205(ts, 61, ObjectType(mm05), 8)
397		m205(ts, 62, mm05(0, 1, 2, 3, 4), "\\m207.m242.mm05")
398
399		m205(ts, 63, ObjectType(mm06), 8)
400		m205(ts, 64, mm06(0, 1, 2, 3, 4, 5), "\\m207.m242.mm06")
401
402		m205(ts, 65, ObjectType(mm07), 8)
403		m205(ts, 66, mm07(0, 1, 2, 3, 4, 5, 6), "\\m207.m242.mm07")
404
405		m205(ts, 67, ObjectType(mm00), 8)
406		m205(ts, 68, mm08(), "\\m207.m242.mm08")
407
408		m205(ts, 69, ObjectType(mm01), 8)
409		m205(ts, 70, mm09(0), "\\m207.m242.mm09")
410
411		m205(ts, 71, ObjectType(mm02), 8)
412		m205(ts, 72, mm0a(0, 1), "\\m207.m242.mm0a")
413
414		m205(ts, 73, ObjectType(mm03), 8)
415		m205(ts, 74, mm0b(0, 1, 2), "\\m207.m242.mm0b")
416
417		m205(ts, 75, ObjectType(mm04), 8)
418		m205(ts, 76, mm0c(0, 1, 2, 3), "\\m207.m242.mm0c")
419
420		m205(ts, 77, ObjectType(mm05), 8)
421		m205(ts, 78, mm0d(0, 1, 2, 3, 4), "\\m207.m242.mm0d")
422
423		m205(ts, 79, ObjectType(mm06), 8)
424		m205(ts, 80, mm0e(0, 1, 2, 3, 4, 5), "\\m207.m242.mm0e")
425
426		m205(ts, 81, ObjectType(mm07), 8)
427		m205(ts, 82, mm0f(0, 1, 2, 3, 4, 5, 6), "\\m207.m242.mm0f")
428
429// Invalid checksum warning
430//		m205(ts, 83, ObjectType(mm70), 8)
431//	Too many arguments ^  (MM70 requires 0)
432//		m205(ts, 84, mm70(0, 1, 2, 3, 4, 5, 6), "\\m207.m242.mm70")
433
434		m205(ts, 85, ObjectType(mm80), 8)
435// Outstanding allocations
436//		m205(ts, 86, mm80(0, 1, 2, 3, 4, 5, 6), "\\m207.m242.mm80")
437
438// Invalid checksum warning
439//		m205(ts, 87, ObjectType(mm90), 8)
440//	Too many arguments ^  (MM90 requires 0)
441//		m205(ts, 88, mm90(0, 1, 2, 3, 4, 5, 6), "\\m207.m242.mm90")
442	}
443
444	// Integer
445	Name(INT0, 0xfedcba9876543210)
446
447	// String
448	Name(STR0, "source string")
449
450	// Buffer
451	Name(BUF0, Buffer(9){9,8,7,6,5,4,3,2,1})
452
453	// Initializer of Fields
454	Name(BUF2, Buffer(9){0x95,0x85,0x75,0x65,0x55,0x45,0x35,0x25,0x15})
455
456	// Base of Buffer Fields
457	Name(BUFZ, Buffer(48){})
458
459	// Package
460	Name(PAC0, Package(3) {
461		0xfedcba987654321f,
462		"test package",
463		Buffer(9){19,18,17,16,15,14,13,12,11},
464	})
465
466	// Operation Region
467	OperationRegion(OPR0, SystemMemory, 0, 48)
468
469	// Field Unit
470	Field(OPR0, ByteAcc, NoLock, Preserve) {
471		FLU0, 69,
472		FLU2, 64,
473		FLU4, 32,
474	}
475
476	// Device
477	Device(DEV0) {Name(s000, "DEV0")}
478
479	// Event
480	Event(EVE0)
481
482	// Method
483	Method(MMM0) {Return ("ff0X")}
484
485	// Mutex
486	Mutex(MTX0, 0)
487
488	// Power Resource
489	PowerResource(PWR0, 0, 0) {Name(s000, "PWR0")}
490
491	// Processor
492	Processor(CPU0, 0x0, 0xFFFFFFFF, 0x0) {Name(s000, "CPU0")}
493
494	// Thermal Zone
495	ThermalZone(TZN0) {Name(s000, "TZN0")}
496
497	// Buffer Field
498	Createfield(BUFZ,   0, 69, BFL0)
499	Createfield(BUFZ,  80, 64, BFL2)
500	Createfield(BUFZ, 160, 32, BFL4)
501
502	// DDBHandle
503	Name(DDB0, Ones)
504
505	// Reference
506	Name(ORF0, "ORF0")
507	Name(REF0, Package(1){})
508
509	Method(m243)
510	{
511		Method(mm00, 1, , , UnknownObj) {Add(Derefof(arg0), 1, arg0)}
512
513		Method(mm01, , , , IntObj) {Return (INT0)}
514		Method(mm11, , , , StrObj) {Return (INT0)}
515		Method(mm02, , , , StrObj) {Return (STR0)}
516		Method(mm03, , , , BuffObj) {Return (BUF0)}
517		Method(mm04, , , , PkgObj) {Return (PAC0)}
518		Method(mm05, , , , FieldUnitObj) {Return (FLU0)}
519		Method(mm06, , , , DeviceObj) {Return (DEV0)}
520		Method(mm07, , , , EventObj) {Return (EVE0)}
521		Method(mm08, , , , MethodObj) {
522			CopyObject(MMM0, Local0)
523			Return (Local0)
524		}
525		Method(mm09, , , , MutexObj) {Return (MTX0)}
526		Method(mm0a, , , , OpRegionObj) {Return (OPR0)}
527		Method(mm0b, , , , PowerResObj) {Return (PWR0)}
528		Method(mm0c, , , , ProcessorObj) {Return (CPU0)}
529		Method(mm0d, , , , ThermalZoneObj) {Return (TZN0)}
530		Method(mm0e, , , , BuffFieldObj) {Return (BFL0)}
531		Method(mm0f, , , , DDBHandleObj) {Return (DDB0)}
532
533		// Formal declaration
534		// Method(mm0g, , , , DebugObj) {Return (Debug)}
535
536		Method(mm0h, , , , IntObj) {Return (Refof(ORF0))}
537
538		Store(0xfedcba9876543210, Local0)
539		m205(ts, 89, ObjectType(mm00), 8)
540		mm00(Refof(Local0))
541		m205(ts, 90, Local0, 0xfedcba9876543211)
542
543		m205(ts, 91, ObjectType(mm01), 8)
544		m205(ts, 92, mm01(), INT0)
545
546		m205(ts, 93, ObjectType(mm02), 8)
547		m205(ts, 94, mm02(), STR0)
548
549		m205(ts, 95, ObjectType(mm03), 8)
550		m205(ts, 96, mm03(), BUF0)
551
552		m205(ts, 97, ObjectType(mm04), 8)
553		m205(ts, 98, mm04(), PAC0)
554
555		m205(ts, 99, ObjectType(mm05), 8)
556		m205(ts, 100, mm05(), FLU0)
557
558		m205(ts, 101, ObjectType(mm06), 8)
559		m205(ts, 102, mm06(), DEV0)
560
561		m205(ts, 103, ObjectType(mm07), 8)
562		m205(ts, 104, mm07(), EVE0)
563
564		m205(ts, 105, ObjectType(mm08), 8)
565		CopyObject(MMM0, Local0)
566		m205(ts, 106, mm08(), Local0)
567
568		m205(ts, 107, ObjectType(mm09), 8)
569		m205(ts, 108, mm09(), MTX0)
570
571		m205(ts, 109, ObjectType(mm0a), 8)
572		m205(ts, 110, mm0a(), OPR0)
573
574		m205(ts, 111, ObjectType(mm0b), 8)
575		m205(ts, 112, mm0b(), PWR0)
576
577		m205(ts, 113, ObjectType(mm0c), 8)
578		m205(ts, 114, mm0c(), CPU0)
579
580		m205(ts, 115, ObjectType(mm0d), 8)
581		
582		if (y350) {
583			m205(ts, 116, mm0d(), TZN0)
584		}
585
586		m205(ts, 117, ObjectType(mm0e), 8)
587		m205(ts, 118, mm0e(), BFL0)
588
589		m205(ts, 119, ObjectType(mm0f), 8)
590		m205(ts, 120, mm0f(), DDB0)
591
592		/*
593			m205(ts, 121, ObjectType(mm0g), 8)
594			m205(ts, 122, mm0g(), Debug)
595		*/
596
597		m205(ts, 123, ObjectType(mm0h), 8)
598		m205(ts, 124, DeRefof(mm0h()), ORF0)
599	}
600
601	Method(m244)
602	{
603		Method(mm00, , , , {IntObj, StrObj}) {Return (STR0)}
604		Method(mm01, , , , {IntObj, StrObj, BuffObj, PkgObj,
605								FieldUnitObj, DeviceObj, EventObj, MethodObj,
606								MutexObj, OpRegionObj, PowerResObj, /*ProcessorObj,*/
607								ThermalZoneObj, BuffFieldObj, DDBHandleObj})
608			{Return (INT0)}
609
610		m205(ts, 125, ObjectType(mm00), 8)
611		m205(ts, 126, mm00(), STR0)
612
613		m205(ts, 127, ObjectType(mm01), 8)
614		m205(ts, 128, mm01(), INT0)
615	}
616
617	Method(m245,, Serialized)
618	{
619		Name(Flag, Ones)
620
621		// List of types of the parameters contains the same keyword
622		Method(mm00, 1, , , , IntObj) {Store(0, Flag)}
623		Method(mm01, 1, , , , {IntObj}) {Store(1, Flag)}
624		Method(mm02, 2, , , , {IntObj, IntObj}) {Store(2, Flag)}
625		Method(mm03, 3, , , , {IntObj, IntObj, IntObj}) {Store(3, Flag)}
626		Method(mm04, 4, , , , {IntObj, IntObj, IntObj, IntObj}) {Store(4, Flag)}
627		Method(mm05, 5, , , , {IntObj, IntObj, IntObj, IntObj,
628				IntObj}) {Store(5, Flag)}
629		Method(mm06, 6, , , , {IntObj, IntObj, IntObj, IntObj,
630				IntObj, IntObj}) {Store(6, Flag)}
631		Method(mm07, 7, , , , {IntObj, IntObj, IntObj, IntObj,
632				IntObj, IntObj, IntObj}) {Store(7, Flag)}
633
634		// List of types of the parameters contains the UnknownObj keyword
635		Method(mm08, 1, , , , UnknownObj) {Store(8, Flag)}
636		Method(mm09, 1, , , , {UnknownObj}) {Store(9, Flag)}
637		Method(mm0a, 7, , , , {UnknownObj, UnknownObj, UnknownObj, UnknownObj,
638				UnknownObj, UnknownObj, UnknownObj}) {Store(10, Flag)}
639
640		// List of types of the parameters contains different keywords
641		Method(mm10, 2, , , , {IntObj, StrObj}) {Store(16, Flag)}
642		Method(mm11, 2, , , , {IntObj, BuffObj}) {Store(17, Flag)}
643		Method(mm12, 2, , , , {StrObj, BuffObj}) {Store(18, Flag)}
644		Method(mm13, 3, , , , {IntObj, StrObj, BuffObj}) {Store(19, Flag)}
645		Method(mm14, 4, , , , {IntObj, StrObj, BuffObj, PkgObj}) {Store(20, Flag)}
646		Method(mm15, 5, , , , {IntObj, StrObj, BuffObj, PkgObj,
647				FieldUnitObj}) {Store(21, Flag)}
648		Method(mm16, 6, , , , {IntObj, StrObj, BuffObj, PkgObj,
649				FieldUnitObj, DeviceObj}) {Store(22, Flag)}
650		Method(mm17, 7, , , , {IntObj, StrObj, BuffObj, PkgObj,
651				FieldUnitObj, DeviceObj, EventObj}) {Store(23, Flag)}
652		Method(mm18, 7, , , , {MethodObj, MutexObj, OpRegionObj, PowerResObj,
653				ThermalZoneObj, BuffFieldObj, DDBHandleObj}) {Store(24, Flag)}
654
655		// List of types of the parameters contains keyword packages
656		// along with different keywords
657		Method(mm20, 1, , , , {{IntObj}}) {Store(32, Flag)}
658		Method(mm21, 1, , , , {{IntObj, StrObj}}) {Store(33, Flag)}
659/*
660// Bug 148
661		Method(mm22, 1, , , , {{IntObj, StrObj, BuffObj, PkgObj,
662				FieldUnitObj, DeviceObj, EventObj, MethodObj,
663				MutexObj, OpRegionObj, PowerResObj, //ProcessorObj,
664				ThermalZoneObj, BuffFieldObj, DDBHandleObj}}) {Store(34, Flag)}
665*/
666		Method(mm23, 2, , , , {{IntObj}, IntObj}) {Store(35, Flag)}
667		Method(mm24, 2, , , , {{IntObj}, StrObj}) {Store(36, Flag)}
668		Method(mm25, 2, , , , {{IntObj}, BuffObj}) {Store(37, Flag)}
669		Method(mm26, 2, , , , {{IntObj}, {IntObj}}) {Store(38, Flag)}
670		Method(mm27, 2, , , , {{IntObj}, {StrObj}}) {Store(39, Flag)}
671		Method(mm28, 2, , , , {{IntObj}, {BuffObj}}) {Store(40, Flag)}
672		Method(mm29, 2, , , , {{StrObj}, {BuffObj}}) {Store(41, Flag)}
673/*
674// Bug 148
675		Method(mm2a, 7, , , , {
676			{IntObj, StrObj, BuffObj, PkgObj, FieldUnitObj, DeviceObj, EventObj, MethodObj,
677			 MutexObj, OpRegionObj, PowerResObj, ThermalZoneObj, BuffFieldObj, DDBHandleObj},
678			{IntObj, StrObj, BuffObj, PkgObj, FieldUnitObj, DeviceObj, EventObj, MethodObj,
679			 MutexObj, OpRegionObj, PowerResObj, ThermalZoneObj, BuffFieldObj, DDBHandleObj},
680			{IntObj, StrObj, BuffObj, PkgObj, FieldUnitObj, DeviceObj, EventObj, MethodObj,
681			 MutexObj, OpRegionObj, PowerResObj, ThermalZoneObj, BuffFieldObj, DDBHandleObj},
682			{IntObj, StrObj, BuffObj, PkgObj, FieldUnitObj, DeviceObj, EventObj, MethodObj,
683			 MutexObj, OpRegionObj, PowerResObj, ThermalZoneObj, BuffFieldObj, DDBHandleObj},
684			{IntObj, StrObj, BuffObj, PkgObj, FieldUnitObj, DeviceObj, EventObj, MethodObj,
685			 MutexObj, OpRegionObj, PowerResObj, ThermalZoneObj, BuffFieldObj, DDBHandleObj},
686			{IntObj, StrObj, BuffObj, PkgObj, FieldUnitObj, DeviceObj, EventObj, MethodObj,
687			 MutexObj, OpRegionObj, PowerResObj, ThermalZoneObj, BuffFieldObj, DDBHandleObj},
688			{IntObj, StrObj, BuffObj, PkgObj, FieldUnitObj, DeviceObj, EventObj, MethodObj,
689			 MutexObj, OpRegionObj, PowerResObj, ThermalZoneObj, BuffFieldObj, DDBHandleObj},
690		}) {Store(42, Flag)}
691*/
692
693		// List of types of the parameters contains the same keyword
694
695		m205(ts, 129, ObjectType(mm00), 8)
696		mm00(1)
697		m205(ts, 130, Flag, 0)
698
699		m205(ts, 131, ObjectType(mm01), 8)
700		mm01(1)
701		m205(ts, 132, Flag, 1)
702
703		m205(ts, 133, ObjectType(mm02), 8)
704		mm02(1, 2)
705		m205(ts, 134, Flag, 2)
706
707		m205(ts, 135, ObjectType(mm03), 8)
708		mm03(1, 2, 3)
709		m205(ts, 136, Flag, 3)
710
711		m205(ts, 137, ObjectType(mm04), 8)
712		mm04(1, 2, 3, 4)
713		m205(ts, 138, Flag, 4)
714
715		m205(ts, 139, ObjectType(mm05), 8)
716		mm05(1, 2, 3, 4, 5)
717		m205(ts, 140, Flag, 5)
718
719		m205(ts, 141, ObjectType(mm06), 8)
720		mm06(1, 2, 3, 4, 5, 6)
721		m205(ts, 142, Flag, 6)
722
723		m205(ts, 143, ObjectType(mm07), 8)
724		mm07(1, 2, 3, 4, 5, 6, 7)
725		m205(ts, 144, Flag, 7)
726
727
728		// List of types of the parameters contains the UnknownObj keyword
729
730		m205(ts, 145, ObjectType(mm08), 8)
731		mm08(1)
732		m205(ts, 146, Flag, 8)
733
734		m205(ts, 147, ObjectType(mm09), 8)
735		mm09(1)
736		m205(ts, 148, Flag, 9)
737
738		m205(ts, 149, ObjectType(mm0a), 8)
739		mm0a(1, 2, 3, 4, 5, 6, 7)
740		m205(ts, 150, Flag, 10)
741
742		// List of types of the parameters contains different keywords
743
744		m205(ts, 151, ObjectType(mm10), 8)
745		mm10(1, 2)
746		m205(ts, 152, Flag, 16)
747
748		m205(ts, 153, ObjectType(mm11), 8)
749		mm11(1, 2)
750		m205(ts, 154, Flag, 17)
751
752		m205(ts, 155, ObjectType(mm12), 8)
753		mm12(1, 2)
754		m205(ts, 156, Flag, 18)
755
756		m205(ts, 157, ObjectType(mm13), 8)
757		mm13(1, 2, 3)
758		m205(ts, 158, Flag, 19)
759
760		m205(ts, 159, ObjectType(mm14), 8)
761		mm14(1, 2, 3, 4)
762		m205(ts, 160, Flag, 20)
763
764		m205(ts, 161, ObjectType(mm15), 8)
765		mm15(1, 2, 3, 4, 5)
766		m205(ts, 162, Flag, 21)
767
768		m205(ts, 163, ObjectType(mm16), 8)
769		mm16(1, 2, 3, 4, 5, 6)
770		m205(ts, 164, Flag, 22)
771
772		m205(ts, 165, ObjectType(mm17), 8)
773		mm17(1, 2, 3, 4, 5, 6, 7)
774		m205(ts, 166, Flag, 23)
775
776		m205(ts, 167, ObjectType(mm18), 8)
777		mm18(1, 2, 3, 4, 5, 6, 7)
778		m205(ts, 168, Flag, 24)
779
780
781		// List of types of the parameters contains keyword packages
782		// along with different keywords
783
784		m205(ts, 169, ObjectType(mm20), 8)
785		mm20(1)
786		m205(ts, 170, Flag, 32)
787
788		m205(ts, 171, ObjectType(mm21), 8)
789		mm21(1)
790		m205(ts, 172, Flag, 33)
791
792/*
793// Bug 148
794		m205(ts, 173, ObjectType(mm22), 8)
795		mm22(1)
796		m205(ts, 174, Flag, 34)
797*/
798
799		m205(ts, 175, ObjectType(mm23), 8)
800		mm23(1, 2)
801		m205(ts, 176, Flag, 35)
802
803		m205(ts, 177, ObjectType(mm24), 8)
804		mm24(1, 2)
805		m205(ts, 178, Flag, 36)
806
807		m205(ts, 179, ObjectType(mm25), 8)
808		mm25(1, 2)
809		m205(ts, 180, Flag, 37)
810
811		m205(ts, 181, ObjectType(mm26), 8)
812		mm26(1, 2)
813		m205(ts, 182, Flag, 38)
814
815		m205(ts, 183, ObjectType(mm27), 8)
816		mm27(1, 2)
817		m205(ts, 184, Flag, 39)
818
819		m205(ts, 185, ObjectType(mm28), 8)
820		mm28(1, 2)
821		m205(ts, 186, Flag, 40)
822
823		m205(ts, 187, ObjectType(mm29), 8)
824		mm29(1, 2)
825		m205(ts, 188, Flag, 41)
826
827/*
828// Bug 148
829		m205(ts, 189, ObjectType(mm2a), 8)
830		mm2a(1, 2, 3, 4, 5, 6, 7)
831		m205(ts, 190, Flag, 42)
832*/
833	}
834
835	// UnSerialized Method can be invoked recursively
836	Method(m246,, Serialized)
837	{
838		Name(i000, 0)
839
840		Method(mm00, 1)
841		{
842			Increment(i000)
843
844			if (arg0) {
845				mm01()
846			}
847		}
848
849		Method(mm01) {mm00(0)}
850
851		Store(0, i000)
852		mm00(0)
853		m205(ts, 191, i000, 1)
854
855		Store(0, i000)
856		mm00(1)
857		m205(ts, 192, i000, 2)
858	}
859
860	// Serialized Method can be invoked recursively
861	Method(m247,, Serialized)
862	{
863		Name(i000, 0)
864
865		Method(mm00, 1, Serialized, 0)
866		{
867			Increment(i000)
868
869			if (arg0) {
870				mm01()
871			}
872		}
873
874		Method(mm01) {mm00(0)}
875
876		Store(0, i000)
877		mm00(0)
878		m205(ts, 193, i000, 1)
879
880		Store(0, i000)
881		mm00(1)
882		m205(ts, 194, i000, 2)
883	}
884
885	// Serialized Method can invoke another Serialized One
886	// if SyncLevel is not lowered
887	Method(m248,, Serialized)
888	{
889		Name(i000, 0)
890
891		Method(mm00, 1, Serialized, 0)
892		{
893			Increment(i000)
894
895			if (arg0) {
896				mm01()
897			}
898		}
899
900		Method(mm01, 0, Serialized, 15)
901		{
902			Increment(i000)
903		}
904
905		Store(0, i000)
906		mm00(0)
907		m205(ts, 195, i000, 1)
908
909		Store(0, i000)
910		mm00(1)
911		m205(ts, 196, i000, 2)
912	}
913
914	// Serialized Method can acquire an Mutex
915	// if SyncLevel is not lowered
916	Method(m249,, Serialized)
917	{
918		Mutex(MTX0, 15)
919		Name(i000, 0)
920
921		Method(mm00, 1, Serialized, 0)
922		{
923			Increment(i000)
924
925			if (arg0) {
926				Store(Acquire(MTX0, 0), Local0)
927				if (LNot(m205(ts, 197, Local0, Zero))) {
928					Increment(i000)
929					Release(MTX0)
930				}
931			}
932		}
933
934		Store(0, i000)
935		mm00(0)
936		m205(ts, 198, i000, 1)
937
938		Store(0, i000)
939		mm00(1)
940		m205(ts, 199, i000, 2)
941	}
942
943	// When Serialized Method calls another one then
944	// the last can acquire an Mutex if SyncLevel is not lowered
945	Method(m24a,, Serialized)
946	{
947		Mutex(MTX1, 15)
948		Name(i000, 0)
949
950		Method(mm00, 1, Serialized, 0)
951		{
952			Increment(i000)
953
954			if (arg0) {
955				mm01()
956			}
957		}
958
959		Method(mm01)
960		{
961			Store(Acquire(MTX1, 0), Local0)
962			if (LNot(m205(ts, 200, Local0, Zero))) {
963				Increment(i000)
964				Release(MTX1)
965			}
966		}
967
968		Store(0, i000)
969		mm00(0)
970		m205(ts, 201, i000, 1)
971
972		Store(0, i000)
973		mm00(1)
974		m205(ts, 202, i000, 2)
975	}
976
977	// UnSerialized Method acquiring an Mutex can invoke
978	// another Serialized One if SyncLevel is not lowered
979	Method(m24b,, Serialized)
980	{
981		Mutex(MTX0, 0)
982		Name(i000, 0)
983
984		Method(mm00, 1)
985		{
986			Store(Acquire(MTX0, 0), Local0)
987			if (LNot(m205(ts, 203, Local0, Zero))) {
988				Increment(i000)
989
990				if (arg0) {
991					mm01()
992				}
993				Release(MTX0)
994			}
995		}
996
997		Method(mm01, 0, Serialized, 15)
998		{
999			Increment(i000)
1000		}
1001
1002		Store(0, i000)
1003		mm00(0)
1004		m205(ts, 204, i000, 1)
1005
1006		Store(0, i000)
1007		mm00(1)
1008		m205(ts, 205, i000, 2)
1009	}
1010
1011	// When UnSerialized Method acquiring an Mutex invokes
1012	// another Serialized One then the last can release the
1013	// Mutex if Mutex's SyncLevel is not lower than the Method's
1014	Method(m24c,, Serialized)
1015	{
1016		Mutex(MTX0, 0)
1017		Name(i000, 0)
1018
1019		Method(mm00, 1)
1020		{
1021			Store(Acquire(MTX0, 0), Local0)
1022			if (LNot(m205(ts, 206, Local0, Zero))) {
1023				Increment(i000)
1024
1025				if (arg0) {
1026					mm01()
1027				} else {
1028					Release(MTX0)
1029				}
1030			}
1031		}
1032
1033		Method(mm01, 0, Serialized)
1034		{
1035			Increment(i000)
1036			Release(MTX0)
1037		}
1038
1039		Store(0, i000)
1040		mm00(0)
1041		m205(ts, 207, i000, 1)
1042
1043		Store(0, i000)
1044		mm00(1)
1045		m205(ts, 208, i000, 2)
1046	}
1047
1048	SRMT("m240")
1049	m240()
1050	SRMT("m241")
1051	m241()
1052	SRMT("m242")
1053	m242()
1054	SRMT("m243")
1055	m243()
1056	SRMT("m244")
1057	m244()
1058	SRMT("m245")
1059	m245()
1060	SRMT("m246")
1061	m246()
1062
1063	SRMT("m247")
1064	if (y349) {
1065		m247()
1066	} else {
1067		BLCK()
1068	}
1069
1070	SRMT("m248")
1071	m248()
1072	SRMT("m249")
1073	m249()
1074	SRMT("m24a")
1075	m24a()
1076	SRMT("m24b")
1077	m24b()
1078	SRMT("m24c")
1079	m24c()
1080}
1081
1082// Run-method
1083Method(NM01)
1084{
1085	Store("TEST: NM01, Declare Control Method Named Object", Debug)
1086
1087	m207()
1088
1089	CH03("NM01", z133, 209, 0, 0)
1090}
1091