• 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 * FixedDma Resource Descriptor Macro
33 */
34
35Name (p450, Package() {
36	ResourceTemplate () {
37		FixedDma (0xf1f2, 0x1234, Width8Bit)
38	},
39	ResourceTemplate () {
40		FixedDma (0xe1e2, 0x000F, Width16Bit)
41	},
42	ResourceTemplate () {
43		FixedDma (0xd1d2, 0x00F0, Width32Bit)
44	},
45	ResourceTemplate () {
46		FixedDma (0xc1c2, 0x0F00, Width64Bit)
47	},
48	ResourceTemplate () {
49		FixedDma (0xb1b2, 0xF000, Width128Bit)
50	},
51	ResourceTemplate () {
52		FixedDma (0xa1a2, 0xFFFF, Width256Bit)
53	},
54	
55	// Default DMA width is Width32Bit
56	
57	ResourceTemplate () {
58		FixedDma (0x9192, 4567)
59	},
60
61	ResourceTemplate () {
62		FixedDma (0x8182, 4567, , TDMA)
63	},
64})
65
66
67Name (p451, Package() {
68	Buffer () {0x55, 0xF2, 0xF1, 0x34, 0x12, 0x00, 0x79, 0x00},
69	Buffer () {0x55, 0xE2, 0xE1, 0x0F, 0x00, 0x01, 0x79, 0x00},
70	Buffer () {0x55, 0xD2, 0xD1, 0xF0, 0x00, 0x02, 0x79, 0x00},
71	Buffer () {0x55, 0xC2, 0xC1, 0x00, 0x0F, 0x03, 0x79, 0x00},
72	Buffer () {0x55, 0xB2, 0xB1, 0x00, 0xF0, 0x04, 0x79, 0x00},
73	Buffer () {0x55, 0xA2, 0xA1, 0xFF, 0xFF, 0x05, 0x79, 0x00},
74	Buffer () {0x55, 0x92, 0x91, 0xD7, 0x11, 0x02, 0x79, 0x00},
75	Buffer () {0x55, 0x82, 0x81, 0xD7, 0x11, 0x02, 0x79, 0x00},
76})
77
78Method(RT20,, Serialized)
79{
80	Name(ts, "RT20")
81
82	// Emit test header, set the filename
83
84	THDR (ts, "FixedDMA Resource Descriptor Macro", __FILE__)
85
86    // The main test packages must have the same number of entries
87
88    If (LNotEqual (SizeOf (p450), SizeOf (p451)))
89    {
90        err (ts, 177, 0, 0, 0, 0, "Incorrect package length")
91        Return ()
92    }
93
94    // Main test case for packages above
95
96	m330(ts, SizeOf (p450), "p450", p450, p451)
97	
98    // Check resource descriptor tag offsets
99
100	Store (
101	    ResourceTemplate () {
102		    FixedDma (0xe1e2, 0x000F, Width16Bit, DMA0)
103		    FixedDma (0xd1d2, 0x00F0, Width32Bit, DMA1)
104	    }, Local0)
105
106	m331(ts, 1, DMA0._DMA, 0x08, DMA1._DMA, 0x38, "_DMA")
107	m331(ts, 2, DMA0._TYP, 0x18, DMA1._TYP, 0x48, "_TYP")
108	m331(ts, 3, DMA0._SIZ, 0x28, DMA1._SIZ, 0x58, "_SIZ")
109}
110
111
112