Debian Codegraph @

tests/aslts/src/runtime/collections/Identity2MS/abbu/initial/ns_in20.asl

raw
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 /*
30 * Source file ns_0000.asl
31 *
32 * The tests differ those from ns_0000.asl by that the objects are
33 * passed to methods as argument (Arg) but not directly by name.
34 */
35
36 Name(z165, 165)
37
38 /*
39 * Named Integer i000
40 */
41
42 /*
43 * Simple, 3-level
44 */
45 Method(in20, 1, Serialized)
46 {
47 Name(ts, "in20")
48 Name(i000, 0x00000001)
49 Name(p000, Package() {1,2,3,4})
50
51 Name(i001, 0)
52
53 CH03(ts, z165, 0x000, __LINE__, 0)
54
55 Store(arg0, i001)
56
57 Method(m000, 1)
58 {
59 Method(m001, 1)
60 {
61 Method(m002, 1)
62 {
63 Method(m003, 1)
64 {
65 if (i001) {
66 CopyObject(p000, arg0)
67 }
68 Return (0xabcd0000)
69 }
70 Return (Add(arg0, m003(arg0)))
71 }
72 Return (Add(arg0, m002(arg0)))
73 }
74 Store(Add(arg0, m001(arg0)), Local0)
75
76 Return (Local0)
77 }
78
79 Store(m000(i000), Local0)
80
81 if (LNotEqual(Local0, 0xabcd0003)) {
82 err(ts, z165, __LINE__, 0, 0, Local0, 0xabcd0003)
83 }
84 }
85
86 /*
87 * 8-level
88 * added writing into i000:
89 * Store(0x00040000, i000)
90 */
91 Method(in21, 1, Serialized)
92 {
93 Name(ts, "in21")
94 Name(i000, 0x00000001)
95 Name(i001, 0)
96 Name(p000, Package() {1,2,3,4})
97
98 Store(arg0, i001)
99
100 Method(m001, 1)
101 {
102 Method(m002, 1)
103 {
104 Method(m003, 1)
105 {
106 Method(m004, 1)
107 {
108 Method(m005, 1)
109 {
110 Method(m006, 1)
111 {
112 Method(m007, 1)
113 {
114 Method(m008, 1)
115 {
116 if (i001)
117 {
118 CopyObject(p000, arg0)
119 }
120 Return (0)
121 }
122 Store(0x80000000, arg0)
123 Return (Add(arg0, m008(arg0)))
124 }
125 Store(0x07000000, arg0)
126 Return (Add(arg0, m007(arg0)))
127 }
128 Store(0x00600000, arg0)
129 Return (Add(arg0, m006(arg0)))
130 }
131 Store(0x00050000, arg0)
132 Return (Add(arg0, m005(arg0)))
133 }
134 Store(0x00004000, arg0)
135 Return (Add(arg0, m004(arg0)))
136 }
137 Store(0x00000300, arg0)
138 Return (Add(arg0, m003(arg0)))
139 }
140 Store(0x00000020, arg0)
141 Return (Add(arg0, m002(arg0)))
142 }
143
144 Store(Add(i000, m001(i000)), Local0)
145
146 if (LNotEqual(Local0, 0x87654321)) {
147 err(ts, z165, __LINE__, 0, 0, Local0, 0x87654321)
148 }
149
150 if (LNotEqual(i000, 0x00000001)) {
151 err(ts, z165, __LINE__, 0, 0, i000, 0x00000001)
152 }
153 }
154
155 /*
156 * Recurcive execution of m001:
157 * Add(i000, m001(), Local0)
158 */
159 Method(in22,, Serialized)
160 {
161 Name(ts, "in22")
162 Name(i000, 0x00100000)
163 Name(i001, 0)
164
165 Method(m000, 1)
166 {
167 Method(m001, 1)
168 {
169 /*
170 * Because of the stack overflow issues on MS the number
171 * of repetitions was changed from 100 to 9 here.
172 */
173 if (LLess(i001, 9)) {
174 Increment(arg0)
175 Increment(i001)
176 Add(arg0, m001(arg0), Local0)
177 Return (Local0)
178 }
179 Return (0)
180 }
181 Store(Add(arg0, m001(arg0)), Local0)
182 Return (Local0)
183 }
184
185 Store(Add(i000, m000(i000)), Local0)
186
187 if (LNotEqual(Local0, 0x00b0002d)) {
188 err(ts, z165, __LINE__, 0, 0, Local0, 0x00b0002d)
189 }
190
191 if (LNotEqual(i000, 0x00100000)) {
192 err(ts, z165, __LINE__, 0, 0, i000, 0x00100000)
193 }
194 }
195
196 /*
197 * Arg instead of i000 (in in01)
198 */
199 Method(in23, 2, Serialized)
200 {
201 Name(ts, "in23")
202 Name(i001, 0)
203 Name(p000, Package() {1,2,3,4})
204
205 Store(arg0, i001)
206
207 Store(0x00000001, arg1)
208
209 Method(m001, 1)
210 {
211 Method(m002, 1)
212 {
213 Method(m003, 1)
214 {
215 Method(m004, 1)
216 {
217 Method(m005, 1)
218 {
219 Method(m006, 1)
220 {
221 Method(m007, 1)
222 {
223 Method(m008, 1)
224 {
225 if (i001)
226 {
227 CopyObject(p000, arg0)
228 }
229 Return (0)
230 }
231 Store(0x80000000, arg0)
232 Return (Add(arg0, m008(8)))
233 }
234 Store(0x07000000, arg0)
235 Return (Add(arg0, m007(7)))
236 }
237 Store(0x00600000, arg0)
238 Return (Add(arg0, m006(6)))
239 }
240 Store(0x00050000, arg0)
241 Return (Add(arg0, m005(5)))
242 }
243 Store(0x00004000, arg0)
244 Return (Add(arg0, m004(4)))
245 }
246 Store(0x00000300, arg0)
247 Return (Add(arg0, m003(3)))
248 }
249 Store(0x00000020, arg0)
250 Return (Add(arg0, m002(2)))
251 }
252 Store(Add(arg1, m001(1)), Local0)
253
254 if (LNotEqual(Local0, 0x87654321)) {
255 err(ts, z165, __LINE__, 0, 0, Local0, 0x87654321)
256 }
257
258 if (LNotEqual(arg1, 1)) {
259 err(ts, z165, __LINE__, 0, 0, arg1, 1)
260 }
261
262 CH03(ts, z165, 0x011, __LINE__, 0)
263 }
264
265 Method(ini2)
266 {
267 SRMT("in20-0")
268 in20(0)
269 SRMT("in21-0")
270 in21(0)
271 SRMT("in22")
272 in22()
273 SRMT("in23-0")
274 in23(0, 0)
275
276 CH03("ini2", z165, 0x000, __LINE__, 0)
277 }