Debian Codegraph @

tests/aslts/src/runtime/collections/bdemo/ACPICA/0244/DECL.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 * Bug 244:
30 *
31 * SUMMARY: Acquire/Release in a global level AML code is not valid,
32 * removed from test suite.
33 */
34 /*Mutex(T804, 8) */
35 /*Mutex(T805, 8) */
36 /*Mutex(T806, 8) */
37 /*Mutex(T807, 8) */
38 /*
39 * These declarations are used for to check the Acquire
40 * and Release operations in a global level AML code.
41 */
42 /*Name(i101, 0) // non-zero means that this test was run */
43 /*Name(i104, 1) */
44 /*Name(i105, 1) */
45 /*Name(i106, 1) */
46 /*Name(i107, 1) */
47 /*
48 Method(m137)
49 {
50 Store(1, i101)
51 Store("m137 started", Debug)
52 if (LNot(i104)) {
53 Release(T804)
54 }
55 Store("m137 completed", Debug)
56 return (1)
57 }
58 Method(m13e)
59 {
60 Store(1, i101)
61 Store("m13e started", Debug)
62 Store(Acquire(T805, 0xffff), i105)
63 Store("m13e completed", Debug)
64 return (1)
65 }
66 Method(m13f)
67 {
68 Store(1, i101)
69 Store("m13f started", Debug)
70 if (LNot(i105)) {
71 Release(T805)
72 }
73 Store("m13f completed", Debug)
74 return (1)
75 }
76 Method(m140)
77 {
78 Store(1, i101)
79 Store("m140 started", Debug)
80 Store(Acquire(T807, 0xffff), i107)
81 Store("m140 completed", Debug)
82 return (1)
83 }
84 */
85 /* Acquire/Release T804 */
86 /*Name(b11c, Buffer(Add(1, Store(Acquire(T804, 0xffff), i104))){0}) */
87 /*Name(b11d, Buffer(m137()){0}) */
88 /* Acquire/Release T805 */
89 /*Name(b11e, Buffer(m13e()){0}) */
90 /*Name(b11f, Buffer(m13f()){0}) */
91 /* Acquire T806 */
92 /*Name(b120, Buffer(Add(1, Store(Acquire(T806, 0xffff), i106))){0}) */
93 /* Acquire T807 */
94 /*Name(b121, Buffer(m140()){0}) */
95 /*
96 * m03c - check, register errors and reset the global level execution exception,
97 * set up id01 to non-zero in error case.
98 */
99 /*Name(i108, 0) */
100 /*Name(BUF2, Buffer(m03c()){}) */
101 /*
102 Method(m03c)
103 {
104 if (CH03("", 0, 0x000, __LINE__, 0))
105 {
106 Store(1, i108)
107 }
108 }
109 */
110 Method (M02E, 0, NotSerialized)
111 {
112 /*
113 Method(m0b9)
114 {
115 if (i108) {
116 err("", zFFF, __LINE__, 0, 0, 0, 0)
117 }
118 if (LNot(i101)) {
119 Store("******** Test was not run !!!!!!!!!!!!!", Debug)
120 err("", zFFF, __LINE__, 0, 0, 0, 0)
121 return
122 }
123 Store("******** Test started", Debug)
124 CH03("", 0, 0x003, __LINE__, 0)
125 if (i104) {
126 Store("!!!!!!!! ERROR 1: Acquire(T804, 0xffff) failed", Debug)
127 err("", zFFF, __LINE__, 0, 0, 0, 0)
128 } else {
129 Store("Ok: Acquire(T804, 0xffff)", Debug)
130 }
131 if (i105) {
132 Store("!!!!!!!! ERROR 2: Acquire(T805, 0xffff) failed", Debug)
133 err("", zFFF, __LINE__, 0, 0, 0, 0)
134 } else {
135 Store("Ok: Acquire(T805, 0xffff)", Debug)
136 }
137 Release(T804)
138 CH04("", 0, 65, 0, __LINE__, 0, 0) // AE_AML_MUTEX_NOT_ACQUIRED
139 Release(T805)
140 CH04("", 0, 65, 0, __LINE__, 0, 0) // AE_AML_MUTEX_NOT_ACQUIRED
141 // Release T807
142 if (LNot(i107)) {
143 Release(T807)
144 } else {
145 Store("!!!!!!!! ERROR 7: Acquire(T807, 0xffff) failed", Debug)
146 err("", zFFF, __LINE__, 0, 0, 0, 0)
147 }
148 CH03("", 0, 0x009, __LINE__, 0)
149 // Release T806
150 if (LNot(i106)) {
151 Release(T806)
152 } else {
153 Store("!!!!!!!! ERROR 5: Acquire(T806, 0xffff) failed", Debug)
154 err("", zFFF, __LINE__, 0, 0, 0, 0)
155 }
156 CH03("", 0, 0x00b, __LINE__, 0)
157 Store("******** Test finished", Debug)
158 }
159 Method(mm00)
160 {
161 m0b9()
162 }
163 mm00()
164 */
165 }
166
167 Method (M030, 0, Serialized)
168 {
169 Mutex (T804, 0x08)
170 Mutex (T805, 0x08)
171 Mutex (T806, 0x08)
172 Mutex (T807, 0x08)
173 /*
174 * These declarations are used for to check the Acquire
175 * and Release operations in a global level AML code.
176 */
177 Name (I101, 0x00) /* non-zero means that this test was run */
178 Name (I104, 0x01)
179 Name (I105, 0x01)
180 Name (I106, 0x01)
181 Name (I107, 0x01)
182 Method (M137, 0, NotSerialized)
183 {
184 I101 = 0x01
185 Debug = "m137 started"
186 If (!I104)
187 {
188 Release (T804)
189 }
190
191 Debug = "m137 completed"
192 Return (0x01)
193 }
194
195 Method (M13E, 0, NotSerialized)
196 {
197 I101 = 0x01
198 Debug = "m13e started"
199 I105 = Acquire (T805, 0xFFFF)
200 Debug = "m13e completed"
201 Return (0x01)
202 }
203
204 Method (M13F, 0, NotSerialized)
205 {
206 I101 = 0x01
207 Debug = "m13f started"
208 If (!I105)
209 {
210 Release (T805)
211 }
212
213 Debug = "m13f completed"
214 Return (0x01)
215 }
216
217 Method (M140, 0, NotSerialized)
218 {
219 I101 = 0x01
220 Debug = "m140 started"
221 I107 = Acquire (T807, 0xFFFF)
222 Debug = "m140 completed"
223 Return (0x01)
224 }
225
226 /* Acquire/Release T804 */
227
228 Name (B11C, Buffer ((0x01 + I104 = Acquire (T804, 0xFFFF)))
229 {
230 0x00 // .
231 })
232 Name (B11D, Buffer (M137 ())
233 {
234 0x00 // .
235 })
236 /* Acquire/Release T805 */
237
238 Name (B11E, Buffer (M13E ())
239 {
240 0x00 // .
241 })
242 Name (B11F, Buffer (M13F ())
243 {
244 0x00 // .
245 })
246 /* Acquire T806 */
247
248 Name (B120, Buffer ((0x01 + I106 = Acquire (T806, 0xFFFF)))
249 {
250 0x00 // .
251 })
252 /* Acquire T807 */
253
254 Name (B121, Buffer (M140 ())
255 {
256 0x00 // .
257 })
258 Method (M0B9, 0, NotSerialized)
259 {
260 If (!I101)
261 {
262 Debug = "******** Test was not run !!!!!!!!!!!!!"
263 ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, 0x00, 0x00)
264 Return (Zero)
265 }
266
267 Debug = "******** Test started"
268 CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
269 If (I104)
270 {
271 Debug = "!!!!!!!! ERROR 1: Acquire(T804, 0xffff) failed"
272 ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, 0x00, 0x00)
273 }
274 Else
275 {
276 Debug = "Ok: Acquire(T804, 0xffff)"
277 }
278
279 If (I105)
280 {
281 Debug = "!!!!!!!! ERROR 2: Acquire(T805, 0xffff) failed"
282 ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, 0x00, 0x00)
283 }
284 Else
285 {
286 Debug = "Ok: Acquire(T805, 0xffff)"
287 }
288
289 Release (T804)
290 CH04 (__METHOD__, 0x00, 0x41, 0x00, __LINE__, 0x00, 0x00) /* AE_AML_MUTEX_NOT_ACQUIRED */
291 Release (T805)
292 CH04 (__METHOD__, 0x00, 0x41, 0x00, __LINE__, 0x00, 0x00) /* AE_AML_MUTEX_NOT_ACQUIRED */
293 /* Release T807 */
294
295 If (!I107)
296 {
297 Release (T807)
298 }
299 Else
300 {
301 Debug = "!!!!!!!! ERROR 7: Acquire(T807, 0xffff) failed"
302 ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, 0x00, 0x00)
303 }
304
305 CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
306 /* Release T806 */
307
308 If (!I106)
309 {
310 Release (T806)
311 }
312 Else
313 {
314 Debug = "!!!!!!!! ERROR 5: Acquire(T806, 0xffff) failed"
315 ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, 0x00, 0x00)
316 }
317
318 CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00)
319 Debug = "******** Test finished"
320 }
321
322 Method (MM00, 0, NotSerialized)
323 {
324 M0B9 ()
325 }
326
327 MM00 ()
328 }