Debian Codegraph @

tests/aslts/src/runtime/collections/complex/namespace/ns5.asl

raw
1 in progress
2
3 do these tests - enclose in method, pass device to method and check that
4 really deal with objects of initial device Integer/package/buffer/string/...
5
6 /*
7
8 same as ns2 (and+ to cover all type Fields elements of Package /buffer/string)
9 but pass that device/power/tz/... by argument. do for all types of combined
10 objects: device/power/tz/...
11
12
13 */
14 Name(z159, 159)
15
16
17 /*
18 * Check access to elements Package/Buffer/String and Buffer Field
19 * where the parent is an element of some complex object (Device).
20 */
21
22 Method(m500)
23 {
24 Name(ts, "m500")
25 Device(d000)
26 {
27 Name(p000, Package() {0xabcd0000, 0xabcd0001, 0xabcd0002})
28 }
29
30 Method(m001, 2)
31 {
32 Store(0x11112222, Index(arg0, 0))
33 }
34
35 m001(d000.p000, RefOf(d000.p000))
36
37 Store(DerefOf(Index(d000.p000, 0)), Local0)
38
39 if (LNotEqual(Local0, 0x11112222)) {
40 err(ts, z159, __LINE__, 0, 0, Local0, 0x11112222)
41 }
42
43 CH03(ts, z159, 0x100, __LINE__, 0)
44 }
45
46 Method(m501)
47 {
48 Name(ts, "m501")
49 Device(d000)
50 {
51 Name(b000, Buffer() {0x10, 0x11, 0x12})
52 }
53 Method(m001, 2)
54 {
55 Store(0x67, Index(arg0, 0))
56 }
57
58 m001(d000.b000, RefOf(d000.b000))
59
60 Store(DerefOf(Index(d000.b000, 0)), Local0)
61
62 if (LNotEqual(Local0, 0x67)) {
63 err(ts, z159, __LINE__, 0, 0, Local0, 0x67)
64 }
65
66 CH03(ts, z159, 0x101, __LINE__, 0)
67 }
68
69 Method(m502)
70 {
71 Name(ts, "m502")
72 Device(d000)
73 {
74 Name(s000, "qqqqqqqqqqqqqq")
75 }
76 Method(m001, 2)
77 {
78 Store(0x38, Index(arg0, 0))
79 }
80
81 m001(d000.s000, RefOf(d000.s000))
82
83 Store(DerefOf(Index(d000.s000, 0)), Local0)
84
85 if (LNotEqual(Local0, 0x38)) {
86 err(ts, z159, __LINE__, 0, 0, Local0, 0x38)
87 }
88
89 CH03(ts, z159, 0x102, __LINE__, 0)
90 }
91
92 /*
93 * Element of Package instead of i000 (in m001)
94 */
95 Method(m503, 1)
96 {
97 Name(ts, "m503")
98 Name(i001, 0)
99 Name(p000, Package() {1,2,3,4})
100 Device(d000)
101 {
102 Name(pp00, Package() {0x11111111, 0x00000001, 0x22223333})
103 }
104
105 CH03(ts, z159, 0x103, __LINE__, 0)
106
107 Store(arg0, i001)
108
109 Method(m001)
110 {
111 Method(m002)
112 {
113 Method(m003)
114 {
115 Method(m004)
116 {
117 Method(m005)
118 {
119 Method(m006)
120 {
121 Method(m007)
122 {
123 Method(m008)
124 {
125 if (i001)
126 {
127 Store(p000, Index(\m503.d000.pp00, 1))
128 }
129 Return (0)
130 }
131 Store(0x80000000, Index(\m503.d000.pp00, 1))
132 Return (Add(DerefOf(Index(\m503.d000.pp00, 1)), m008()))
133 }
134 Store(0x07000000, Index(\m503.d000.pp00, 1))
135 Return (Add(DerefOf(Index(\m503.d000.pp00, 1)), m007()))
136 }
137 Store(0x00600000, Index(\m503.d000.pp00, 1))
138 Return (Add(DerefOf(Index(\m503.d000.pp00, 1)), m006()))
139 }
140 Store(0x00050000, Index(\m503.d000.pp00, 1))
141 Return (Add(DerefOf(Index(\m503.d000.pp00, 1)), m005()))
142 }
143 Store(0x00004000, Index(\m503.d000.pp00, 1))
144 Return (Add(DerefOf(Index(\m503.d000.pp00, 1)), m004()))
145 }
146 Store(0x00000300, Index(\m503.d000.pp00, 1))
147 Return (Add(DerefOf(Index(\m503.d000.pp00, 1)), m003()))
148 }
149 Store(0x00000020, Index(^d000.pp00, 1))
150 Return (Add(DerefOf(Index(^d000.pp00, 1)), m002()))
151 }
152 Store(Add(DerefOf(Index(d000.pp00, 1)), m001()), Local0)
153
154 if (LNotEqual(Local0, 0x87654321)) {
155 err(ts, z159, __LINE__, 0, 0, Local0, 0x87654321)
156 }
157
158 Store(DerefOf(Index(d000.pp00, 1)), Local0)
159
160 if (LNotEqual(Local0, 0x80000000)) {
161 err(ts, z159, __LINE__, 0, 0, Local0, 0x80000000)
162 }
163
164 CH03(ts, z159, 0x104, __LINE__, 0)
165 }
166
167 /*
168 * Element of Package instead of i000 (in m002)
169 */
170 Method(m504)
171 {
172 Name(ts, "m504")
173 Name(i001, 0)
174 Device(d000)
175 {
176 Name(pp00, Package() {0x11111111, 0x00100000, 0x22223333})
177 }
178
179 Method(m001)
180 {
181 if (LLess(i001, 100)) {
182
183 Store(DerefOf(Index(^d000.pp00, 1)), Local0)
184 Increment(Local0)
185 Store(Local0, Index(^d000.pp00, 1))
186 Increment(i001)
187 Add(DerefOf(Index(^d000.pp00, 1)), m001(), Local0)
188 Return (Local0)
189 }
190 Return (0)
191 }
192 Store(Add(DerefOf(Index(d000.pp00, 1)), m001()), Local0)
193
194 if (LNotEqual(Local0, 0x065013BA)) {
195 err(ts, z159, __LINE__, 0, 0, Local0, 0x065013BA)
196 }
197
198 Store(DerefOf(Index(d000.pp00, 1)), Local0)
199
200 if (LNotEqual(Local0, 0x00100064)) {
201 err(ts, z159, __LINE__, 0, 0, Local0, 0x00100064)
202 }
203
204 CH03(ts, z159, 0x105, __LINE__, 0)
205 }
206
207 /*
208 * Buffer Field instead of i000 (in m001)
209 */
210 Method(m505, 1)
211 {
212 Name(ts, "m505")
213 Name(i001, 0)
214 Name(p000, Package() {1,2,3,4})
215
216 CH03(ts, z159, 0x200, __LINE__, 0)
217
218 Device(d000)
219 {
220 Name(b000, Buffer(16) {})
221 CreateField(b000, 5, 32, bf00)
222 }
223
224 CH03(ts, z159, 0x106, __LINE__, 0)
225
226 if (0) {
227 CreateField(d000.b000, 5, 32, bf00)
228 }
229
230 Store(arg0, i001)
231
232 Method(m001)
233 {
234 Method(m002)
235 {
236 Method(m003)
237 {
238 Method(m004)
239 {
240 Method(m005)
241 {
242 Method(m006)
243 {
244 Method(m007)
245 {
246 Method(m008)
247 {
248 if (i001)
249 {
250 Store(p000, Index(\m505.d000.bf00, 1))
251 }
252 Return (0)
253 }
254 Store(0x80000000, Index(\m505.d000.bf00, 1))
255 Return (Add(DerefOf(Index(\m505.d000.bf00, 1)), m008()))
256 }
257 Store(0x07000000, Index(\m505.d000.bf00, 1))
258 Return (Add(DerefOf(Index(\m505.d000.bf00, 1)), m007()))
259 }
260 Store(0x00600000, Index(\m505.d000.bf00, 1))
261 Return (Add(DerefOf(Index(\m505.d000.bf00, 1)), m006()))
262 }
263 Store(0x00050000, Index(\m505.d000.bf00, 1))
264 Return (Add(DerefOf(Index(\m505.d000.bf00, 1)), m005()))
265 }
266 Store(0x00004000, Index(\m505.d000.bf00, 1))
267 Return (Add(DerefOf(Index(\m505.d000.bf00, 1)), m004()))
268 }
269 Store(0x00000300, Index(\m505.d000.bf00, 1))
270 Return (Add(DerefOf(Index(\m505.d000.bf00, 1)), m003()))
271 }
272 Store(0x00000020, Index(^d000.bf00, 1))
273 Return (Add(DerefOf(Index(^d000.bf00, 1)), m002()))
274 }
275 Store(Add(DerefOf(Index(d000.bf00, 1)), m001()), Local0)
276
277 if (LNotEqual(Local0, 0x87654321)) {
278 err(ts, z159, __LINE__, 0, 0, Local0, 0x87654321)
279 }
280
281 Store(DerefOf(Index(d000.bf00, 1)), Local0)
282
283 if (LNotEqual(Local0, 0x80000000)) {
284 err(ts, z159, __LINE__, 0, 0, Local0, 0x80000000)
285 }
286
287 CH03(ts, z159, 0x107, __LINE__, 0)
288 }
289
290
291 Method(n005)
292 {
293 if (1) {
294 SRMT("m500")
295 m500()
296 SRMT("m501")
297 m501()
298 SRMT("m502")
299 m502()
300 SRMT("m503-0")
301 m503(0)
302 SRMT("m503-1")
303 if (y200) {
304 m503(1)
305 } else {
306 BLCK()
307 }
308 SRMT("m504")
309 m504()
310 SRMT("m505-0")
311 if (y216) {
312 m505(0)
313 } else {
314 BLCK()
315 }
316 SRMT("m505-1")
317 if (LAnd(y200, y216)) {
318 m505(1)
319 } else {
320 BLCK()
321 }
322 } else {
323 SRMT("m505-0")
324 m505(0)
325 }
326 }