Debian Codegraph @

tests/aslts/src/runtime/collections/bdemo/ACPICA/0198/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 /*
30 * Bug 198:
31 *
32 * SUMMARY: AML interpretation in 32-bit slack mode becomes unstable after some exceptions
33 */
34
35 /* SEE below: "Would be useful to continue for other ASL operators" */
36
37 Name(id24, 0)
38
39 Method(mfa9,, Serialized) {
40
41 Event(e900)
42 Event(e9Z0)
43 Mutex(mx90, 0)
44 Mutex(mx91, 0)
45 Device(d900) { Name(i900, 0xabcd0017) }
46 Device(d9Z0) { Name(i900, 0xabcd0017) }
47 ThermalZone(tz90) {}
48 ThermalZone(tz91) {}
49 Processor(pr90, 0, 0xFFFFFFFF, 0) {}
50 Processor(pr91, 0, 0xFFFFFFFF, 0) {}
51 OperationRegion(r900, SystemMemory, 0x100, 0x100)
52 OperationRegion(r9Z0, SystemMemory, 0x100, 0x100)
53 PowerResource(pw90, 1, 0) {Method(mmmm){return (0)}}
54 PowerResource(pw91, 1, 0) {Method(mmmm){return (0)}}
55
56 Name(RMRC, 0)
57 Name(NRMT, "QQQQ")
58 Name(CTST, "CTST")
59 Name(RR44, Package(8) {})
60 Name(RR55, Package(8) {})
61 Name(s000, "The expected contents of 0-th elements of both Packages - RR44 and RR55")
62
63 // Error checking
64 Method(m000, 1) {
65 Store("======================================== sit 1", Debug)
66 Store(arg0, Debug)
67 Store(RMRC, Debug)
68 Store(DerefOf(Index(RR44, 0)), Debug)
69 Store(DerefOf(Index(RR55, 0)), Debug)
70
71 Store(DerefOf(Index(RR44, 0)), Local0)
72 Store(DerefOf(Index(RR55, 0)), Local1)
73
74 if (LNotEqual(Local0, s000)) {
75 // Store("Error 0", Debug)
76 err("", zFFF, __LINE__, 0, 0, Local0, s000)
77 }
78 if (LNotEqual(Local1, s000)) {
79 // Store("Error 1", Debug)
80 err("", zFFF, __LINE__, 0, 0, Local0, s000)
81 }
82
83 Store("========================================.", Debug)
84 }
85
86 Method(m001,, Serialized) {
87
88 Name(b000, Buffer(4) {})
89
90 if (SizeOf(NRMT)) {
91 Store("vvvvvv", Local0)
92 Concatenate(Local0, "PASS:", Local1)
93 Concatenate(":", CTST, Local0)
94
95 // This - eliminates the effect
96 // Store(s000, Local0)
97
98 Store("The expected contents of 0-th elements of both Packages - RR44 and RR55", Local0)
99
100 // The order of RR55 and RR44 is essential, only the first is then corrupted:
101
102 Store(Local0, Index(RR44, RMRC))
103 Store(Local0, Index(RR55, RMRC))
104
105 m000(0x1000)
106 // m000()
107
108 Increment(RMRC)
109 }
110
111 m000(0x1001)
112 // m000()
113 }
114
115 Method(m002)
116 {
117 Store("ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ RR44", Index(RR44, 0))
118 Store("ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ RR55", Index(RR55, 0))
119
120 Store(10000000000, Local0)
121 Store(0, Local1)
122
123 if (LEqual(id24, 0)) {
124 // Only this causes the effect:
125 ToBCD(Local0, Local2)
126 } elseif (LEqual(id24, 1)) {
127 Divide(1, Local1, Local2)
128 } elseif (LEqual(id24, 2)) {
129 Divide(1, Local1, Local7, Local2)
130 } elseif (LEqual(id24, 3)) {
131 Store(SizeOf(d9Z0), Local2)
132 } elseif (LEqual(id24, 4)) {
133 Store(0, Local0)
134 Store(Acquire (Local0, 1), Local2)
135 } elseif (LEqual(id24, 5)) {
136 CopyObject(e900, Local0)
137 Add(0, Local0, Local2)
138 } elseif (LEqual(id24, 6)) {
139 CopyObject(e900, Local0)
140 And(0, Local0, Local2)
141 } elseif (LEqual(id24, 7)) {
142 Store("zzzzzxx", Local0)
143 CopyObject(e900, Local1)
144 Concatenate(Local0, Local1, Local2)
145 } elseif (LEqual(id24, 8)) {
146 CopyObject(e900, Local0)
147 CondRefOf(Local0, Local2)
148 }
149
150 if (LNotEqual(Local2, 0)) {
151 Store("Zizi 012345", Debug)
152 }
153
154 // If you uncomment this Store the effect will disappear
155
156 // Store(0, Local0)
157 }
158
159
160 // If you uncomment this Store then another one of RR44 and RR55 will be corrupted
161 // (see comment to m001)
162
163 // Store("m002", NRMT)
164
165 // Store("--------------!!!!!!!!!!!--------- RR44", Debug)
166 // Store(Index(RR44, 0), Debug)
167 // Store("--------------!!!!!!!!!!!--------- RR55", Debug)
168 // Store(Index(RR55, 0), Debug)
169 Store("---------------------------------- SSSSSSSS 0", Debug)
170
171 CH03("", 0, 0x002, __LINE__, 0)
172 m002()
173
174 // Store("---------------------------------- SSSSSSSS 1", Debug)
175
176 m001()
177
178 // Store("---------------------------------- SSSSSSSS 2", Debug)
179
180 m000(0x1009)
181
182 // m000()
183
184 if (LEqual(id24, 0)) {
185 if (F64) {
186 CH03("", 0, 0x003, __LINE__, 0)
187 } else {
188 CH04("", 0, 0xff, 0, __LINE__, 0, 0) // AE_AML_NUMERIC_OVERFLOW
189 }
190 } else {
191 CH04("", 0, 0xff, 0, __LINE__, 0, 0) // AE_AML_NUMERIC_OVERFLOW
192 }
193 }
194
195 Method(mfaa) {
196
197 Store(0, id24)
198 mfa9()
199
200 Store(1, id24)
201 mfa9()
202
203 Store(2, id24)
204 mfa9()
205
206 Store(3, id24)
207 mfa9()
208
209 Store(4, id24)
210 mfa9()
211
212 Store(5, id24)
213 mfa9()
214
215 Store(6, id24)
216 mfa9()
217
218 Store(7, id24)
219 mfa9()
220
221 Store(8, id24)
222 mfa9()
223
224 /* Would be useful to continue for other ASL operators */
225 }