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     * Resource Descriptor macros
30     *
31     * IRQNoFlags() Interrupt Resource Descriptor Macro
32     */
33    Name (P402, Package (0x12)
34    {
35        ResourceTemplate ()
36        {
37            IRQNoFlags ()
38                {0}
39        },
40
41        ResourceTemplate ()
42        {
43            IRQNoFlags ()
44                {1}
45        },
46
47        ResourceTemplate ()
48        {
49            IRQNoFlags ()
50                {2}
51        },
52
53        ResourceTemplate ()
54        {
55            IRQNoFlags ()
56                {3}
57        },
58
59        ResourceTemplate ()
60        {
61            IRQNoFlags ()
62                {4}
63        },
64
65        ResourceTemplate ()
66        {
67            IRQNoFlags ()
68                {5}
69        },
70
71        ResourceTemplate ()
72        {
73            IRQNoFlags ()
74                {6}
75        },
76
77        ResourceTemplate ()
78        {
79            IRQNoFlags ()
80                {7}
81        },
82
83        ResourceTemplate ()
84        {
85            IRQNoFlags ()
86                {8}
87        },
88
89        ResourceTemplate ()
90        {
91            IRQNoFlags ()
92                {9}
93        },
94
95        ResourceTemplate ()
96        {
97            IRQNoFlags ()
98                {10}
99        },
100
101        ResourceTemplate ()
102        {
103            IRQNoFlags ()
104                {11}
105        },
106
107        ResourceTemplate ()
108        {
109            IRQNoFlags ()
110                {12}
111        },
112
113        ResourceTemplate ()
114        {
115            IRQNoFlags ()
116                {13}
117        },
118
119        ResourceTemplate ()
120        {
121            IRQNoFlags ()
122                {14}
123        },
124
125        ResourceTemplate ()
126        {
127            IRQNoFlags ()
128                {15}
129        },
130
131        ResourceTemplate ()
132        {
133            IRQNoFlags ()
134                {}
135        },
136
137        ResourceTemplate ()
138        {
139            IRQNoFlags ()
140                {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}
141        }
142    })
143    /*
144     ACPI Specification, Revision 3.0, September 2, 2004
145     6.4.2.1   IRQ Descriptor
146     IRQ Descriptor layout (length = 2):
147     Byte 0 (Tag Bits): Value = 00100010B (0x22) (Type = 0, small item name = 0x4, length = 2),
148     Byte 1 (IRQ mask bits[7:0]): IRQ0 <=> bit[0]
149     Byte 2 (IRQ mask bits[15:8]): IRQ8 <=> bit[0]
150     */
151    Name (P403, Package (0x12)
152    {
153        ResourceTemplate ()
154        {
155            IRQNoFlags ()
156                {0}
157        },
158
159        ResourceTemplate ()
160        {
161            IRQNoFlags ()
162                {1}
163        },
164
165        ResourceTemplate ()
166        {
167            IRQNoFlags ()
168                {2}
169        },
170
171        ResourceTemplate ()
172        {
173            IRQNoFlags ()
174                {3}
175        },
176
177        ResourceTemplate ()
178        {
179            IRQNoFlags ()
180                {4}
181        },
182
183        ResourceTemplate ()
184        {
185            IRQNoFlags ()
186                {5}
187        },
188
189        ResourceTemplate ()
190        {
191            IRQNoFlags ()
192                {6}
193        },
194
195        ResourceTemplate ()
196        {
197            IRQNoFlags ()
198                {7}
199        },
200
201        ResourceTemplate ()
202        {
203            IRQNoFlags ()
204                {8}
205        },
206
207        ResourceTemplate ()
208        {
209            IRQNoFlags ()
210                {9}
211        },
212
213        ResourceTemplate ()
214        {
215            IRQNoFlags ()
216                {10}
217        },
218
219        ResourceTemplate ()
220        {
221            IRQNoFlags ()
222                {11}
223        },
224
225        ResourceTemplate ()
226        {
227            IRQNoFlags ()
228                {12}
229        },
230
231        ResourceTemplate ()
232        {
233            IRQNoFlags ()
234                {13}
235        },
236
237        ResourceTemplate ()
238        {
239            IRQNoFlags ()
240                {14}
241        },
242
243        ResourceTemplate ()
244        {
245            IRQNoFlags ()
246                {15}
247        },
248
249        ResourceTemplate ()
250        {
251            IRQNoFlags ()
252                {}
253        },
254
255        ResourceTemplate ()
256        {
257            IRQNoFlags ()
258                {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}
259        }
260    })
261    Method (RT02, 0, Serialized)
262    {
263        /* Emit test header, set the filename */
264
265        THDR (__METHOD__, "IRQNoFlags Resource Descriptor Macro", "irqnoflags.asl")
266        /* Main test case for packages above */
267
268        M330 (__METHOD__, 0x12, "p402", P402, P403)
269    }
270