• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /barrelfish-2018-10-04/lib/acpica/tests/aslts/src/runtime/collections/functional/descriptor/
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 * Resource Descriptor macros
31 *
32 * Word Bus Number Resource Descriptor Macro
33 */
34
35Name (p428, Package() {
36
37	// Byte 4 (General Flags) of Word Address Space Descriptor
38
39	ResourceTemplate () {
40		WordBusNumber (ResourceProducer, MinNotFixed, MaxNotFixed, PosDecode,
41			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff)
42	},
43	ResourceTemplate () {
44		WordBusNumber (ResourceProducer, MinNotFixed, MaxNotFixed, SubDecode,
45			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff)
46	},
47	ResourceTemplate () {
48		WordBusNumber (ResourceProducer, MinNotFixed, MaxFixed, PosDecode,
49			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff)
50	},
51	ResourceTemplate () {
52		WordBusNumber (ResourceProducer, MinNotFixed, MaxFixed, SubDecode,
53			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff)
54	},
55	ResourceTemplate () {
56		WordBusNumber (ResourceProducer, MinFixed, MaxNotFixed, PosDecode,
57			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff)
58	},
59	ResourceTemplate () {
60		WordBusNumber (ResourceProducer, MinFixed, MaxNotFixed, SubDecode,
61			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff)
62	},
63	ResourceTemplate () {
64		WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
65			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff)
66	},
67	ResourceTemplate () {
68		WordBusNumber (ResourceProducer, MinFixed, MaxFixed, SubDecode,
69			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff)
70	},
71	ResourceTemplate () {
72		WordBusNumber (ResourceConsumer, MinNotFixed, MaxNotFixed, PosDecode,
73			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff)
74	},
75	ResourceTemplate () {
76		WordBusNumber (ResourceConsumer, MinNotFixed, MaxNotFixed, SubDecode,
77			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff)
78	},
79	ResourceTemplate () {
80		WordBusNumber (ResourceConsumer, MinNotFixed, MaxFixed, PosDecode,
81			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff)
82	},
83	ResourceTemplate () {
84		WordBusNumber (ResourceConsumer, MinNotFixed, MaxFixed, SubDecode,
85			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff)
86	},
87	ResourceTemplate () {
88		WordBusNumber (ResourceConsumer, MinFixed, MaxNotFixed, PosDecode,
89			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff)
90	},
91	ResourceTemplate () {
92		WordBusNumber (ResourceConsumer, MinFixed, MaxNotFixed, SubDecode,
93			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff)
94	},
95	ResourceTemplate () {
96		WordBusNumber (ResourceConsumer, MinFixed, MaxFixed, PosDecode,
97			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff)
98	},
99	ResourceTemplate () {
100		WordBusNumber (ResourceConsumer, MinFixed, MaxFixed, SubDecode,
101			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff)
102	},
103
104	// Particular cases
105
106	ResourceTemplate () {
107		WordBusNumber ( , , , ,
108			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff)
109	},
110	ResourceTemplate () {
111		WordBusNumber ( , , , ,
112			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff, )
113	},
114
115	// Resource Source
116
117	ResourceTemplate () {
118		WordBusNumber ( , , , ,
119			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff,
120			0x01, "")
121	},
122	ResourceTemplate () {
123		WordBusNumber ( , , , ,
124			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff,
125			0x0f, "P")
126	},
127	ResourceTemplate () {
128		WordBusNumber ( , , , ,
129			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff,
130			0xf0, "PATH")
131	},
132	ResourceTemplate () {
133		WordBusNumber ( , , , ,
134			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff,
135			0xff,
136			"!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !\"#$%&'()*",
137			)
138	},
139
140	// Particular cases
141
142	ResourceTemplate () {
143		WordBusNumber (ResourceConsumer, MinFixed, MaxFixed, SubDecode,
144			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff,
145			0xff, "PATHPATHPATH", WBN0)
146	},
147	ResourceTemplate () {
148		WordBusNumber (ResourceConsumer, MinFixed, MaxFixed, SubDecode,
149			0, 0, 0, 0, 0,
150			0xff, "PATHPATHPATH", )
151	},
152
153	// 20051021, relaxation for omitted ResourceSource (bug-fix 70 rejection)
154	ResourceTemplate () {
155		WordBusNumber ( , , , ,
156			0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff,
157			0x0f)
158	},
159})
160
161/*
162ACPI Specification, Revision 3.0, September 2, 2004
1636.4.3.5.3   Word Address Space Descriptor
164
165Bus Number Word Address Space Descriptor layout:
166
167Byte 0 (Tag Bits): Value=10001000B (0x88) (Type = 1, Large item name = 0x8)
168Byte 1 (Length, bits[7:0]): Variable: Value = 13 (minimum)
169Byte 2 (Length, bits[15:8]): Variable: Value = 0 (minimum)
170Byte 3 (Resource Type):
171	2		Bus number range
172Byte 4 (General Flags):
173	Bits[7:4] 	Reserved (must be 0)
174	Bit[3] 		Min Address Fixed, _MAF:
175			1	The specified maximum address is fixed
176			0	The specified maximum address is not fixed
177				and can be changed
178	Bit[2] 		Max Address Fixed,_MIF:
179			1	The specified minimum address is fixed
180			0	The specified minimum address is not fixed
181				and can be changed
182	Bit[1] 		Decode Type, _DEC:
183			1	This bridge subtractively decodes this address
184	 	 	 	(top level bridges only)
185			0	This bridge positively decodes this address
186	Bit[0] 		Consumer/Producer:
187			1-This device consumes this resource
188			0-This device produces and consumes this resource
189Byte 5 (Type Specific Flags):
190		Flags that are specific to each resource type. The meaning of the flags
191		in this field depends on the value of the Resource Type field (see above)
192	Bit[7:0]	Reserved (must be 0)
193Byte 6 (Address space granularity, _GRA bits[7:0]):
194	A set bit in this mask means that this bit is decoded. All bits less
195	significant than the most significant set bit must be set. (in other
196	words, the value of the full Address Space Granularity field (all 16
197	bits) must be a number (2**n-1).
198Byte 7 (Address space granularity, _GRA bits[15:8])
199Byte 8 (Address range minimum, _MIN bits [7:0]):
200	For bridges that translate addresses, this is the address space
201	on the secondary side of the bridge
202Byte 9 (Address range minimum, _MIN bits[15:8])
203Byte 10 (Address range maximum, _MAX bits [7:0]): See comment for _MIN
204Byte 11 (Address range maximum, _MAX bits[15:8])
205Byte 12 (Address Translation offset, _TRA bits [7:0]):
206	For bridges that translate addresses across the bridge, this is the
207	offset that must be added to the address on the secondary side to obtain
208	the address on the primary side. Non-bridge devices must list 0 for all
209	Address Translation offset bits
210Byte 13 (Address Translation offset, _TRA bits[15:8])
211Byte 14 (Address Length, _LEN bits [7:0])
212Byte 15 (Address Length, _LEN bits[15:8])
213Byte 16 (Resource Source Index):
214	(Optional) Only present if Resource Source (below) is present. This
215	field gives an index to the specific resource descriptor that this
216	device consumes from in the current resource template for the device
217	object pointed to in Resource Source
218String (Resource Source):
219	(Optional) If present, the device that uses this descriptor consumes
220	its resources from the resources produced by the named device object.
221	If not present, the device consumes its resources out of a global pool.
222	If not present, the device consumes this resource from its hierarchical
223	parent.
224*/
225
226Name (p429, Package() {
227
228	// Byte 4 (General Flags) of Word Address Space Descriptor
229
230	Buffer () {0x88, 0x0d, 0x00, 0x02, 0x00, 0x00,
231		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe, 0x79, 0x00},
232	Buffer () {0x88, 0x0d, 0x00, 0x02, 0x02, 0x00,
233		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe, 0x79, 0x00},
234	Buffer () {0x88, 0x0d, 0x00, 0x02, 0x08, 0x00,
235		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe, 0x79, 0x00},
236	Buffer () {0x88, 0x0d, 0x00, 0x02, 0x0a, 0x00,
237		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe, 0x79, 0x00},
238	Buffer () {0x88, 0x0d, 0x00, 0x02, 0x04, 0x00,
239		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe, 0x79, 0x00},
240	Buffer () {0x88, 0x0d, 0x00, 0x02, 0x06, 0x00,
241		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe, 0x79, 0x00},
242	Buffer () {0x88, 0x0d, 0x00, 0x02, 0x0c, 0x00,
243		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe, 0x79, 0x00},
244	Buffer () {0x88, 0x0d, 0x00, 0x02, 0x0e, 0x00,
245		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe, 0x79, 0x00},
246	Buffer () {0x88, 0x0d, 0x00, 0x02, 0x01, 0x00,
247		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe, 0x79, 0x00},
248	Buffer () {0x88, 0x0d, 0x00, 0x02, 0x03, 0x00,
249		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe, 0x79, 0x00},
250	Buffer () {0x88, 0x0d, 0x00, 0x02, 0x09, 0x00,
251		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe, 0x79, 0x00},
252	Buffer () {0x88, 0x0d, 0x00, 0x02, 0x0b, 0x00,
253		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe, 0x79, 0x00},
254	Buffer () {0x88, 0x0d, 0x00, 0x02, 0x05, 0x00,
255		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe, 0x79, 0x00},
256	Buffer () {0x88, 0x0d, 0x00, 0x02, 0x07, 0x00,
257		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe, 0x79, 0x00},
258	Buffer () {0x88, 0x0d, 0x00, 0x02, 0x0d, 0x00,
259		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe, 0x79, 0x00},
260	Buffer () {0x88, 0x0d, 0x00, 0x02, 0x0f, 0x00,
261		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe, 0x79, 0x00},
262
263	// Particular cases
264
265	Buffer () {0x88, 0x0d, 0x00, 0x02, 0x01, 0x00,
266		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe, 0x79, 0x00},
267	Buffer () {0x88, 0x0d, 0x00, 0x02, 0x01, 0x00,
268		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe, 0x79, 0x00},
269
270	// Resource Source
271
272	Buffer () {0x88, 0x0f, 0x00, 0x02, 0x01, 0x00,
273		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe,
274		0x01, 0x00, 0x79, 0x00},
275	Buffer () {0x88, 0x10, 0x00, 0x02, 0x01, 0x00,
276		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe,
277		0x0f, 0x50, 0x00, 0x79, 0x00},
278	Buffer () {0x88, 0x13, 0x00, 0x02, 0x01, 0x00,
279		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe,
280		0xf0, 0x50, 0x41, 0x54, 0x48, 0x00, 0x79, 0x00},
281	Buffer () {0x88, 0xd7, 0x00, 0x02, 0x01, 0x00,
282		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe,
283		0xff,
284		0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
285		0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
286		0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
287		0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40,
288		0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
289		0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50,
290		0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
291		0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60,
292		0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
293		0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70,
294		0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
295		0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x20, 0x21,
296		0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29,
297		0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31,
298		0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
299		0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41,
300		0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
301		0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51,
302		0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
303		0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61,
304		0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
305		0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71,
306		0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
307		0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x20, 0x21, 0x22,
308		0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a,
309		0x00, 0x79, 0x00},
310
311	// Particular cases
312
313	Buffer () {0x88, 0x1b, 0x00, 0x02, 0x0f, 0x00,
314		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe,
315		0xff, 0x50, 0x41, 0x54, 0x48, 0x50, 0x41, 0x54,
316		0x48, 0x50, 0x41, 0x54, 0x48, 0x00, 0x79, 0x00},
317	Buffer () {0x88, 0x1b, 0x00, 0x02, 0x0f, 0x00,
318		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
319		0xff, 0x50, 0x41, 0x54, 0x48, 0x50, 0x41, 0x54,
320		0x48, 0x50, 0x41, 0x54, 0x48, 0x00, 0x79, 0x00},
321
322	// 20051021, relaxation for omitted ResourceSource (bug-fix 70 rejection)
323	Buffer () {0x88, 0x0e, 0x00, 0x02, 0x01, 0x00,
324		0xf7, 0xf6, 0xf9, 0xf8, 0xfb, 0xfa, 0xfd, 0xfc, 0xff, 0xfe,
325		0x0f, 0x79, 0x00},
326})
327
328Method(RT12,, Serialized)
329{
330	Name(ts, "RT12")
331
332	// Emit test header, set the filename
333
334	THDR (ts, "WordBusNumber Resource Descriptor Macro", __FILE__)
335
336    // Main test case for packages above
337
338	m330(ts, 25, "p428", p428, p429)
339
340    // Check resource descriptor tag offsets
341
342	Store (
343		ResourceTemplate () {
344			WordBusNumber (ResourceProducer, MinNotFixed, MaxNotFixed, PosDecode,
345				0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff, , , WBN0)
346			WordBusNumber (ResourceConsumer, MinNotFixed, MaxNotFixed, PosDecode,
347				0xf6f7, 0xf8f9, 0xfafb, 0xfcfd, 0xfeff, , , WBN1)
348		}, Local0)
349
350	m331(ts, 1,  WBN0._DEC, 0x21, WBN1._DEC, 0xa1, "_DEC")
351	m331(ts, 2,  WBN0._MIF, 0x22, WBN1._MIF, 0xa2, "_MIF")
352	m331(ts, 3,  WBN0._MAF, 0x23, WBN1._MAF, 0xa3, "_MAF")
353	m331(ts, 7,  WBN0._GRA, 0x30, WBN1._GRA, 0xB0, "_GRA")
354	m331(ts, 8,  WBN0._MIN, 0x40, WBN1._MIN, 0xC0, "_MIN")
355	m331(ts, 9,  WBN0._MAX, 0x50, WBN1._MAX, 0xD0, "_MAX")
356	m331(ts, 10, WBN0._TRA, 0x60, WBN1._TRA, 0xE0, "_TRA")
357	m331(ts, 11, WBN0._LEN, 0x70, WBN1._LEN, 0xF0, "_LEN")
358}
359