1/* 2 * Some or all of this work - Copyright (c) 2006 - 2016, 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 * Integer 31 * 32 * (verify exceptions caused by the imprope use of Integer type objects) 33 */ 34 35Name(z093, 93) 36 37Name(i100, 0xabcd1234) 38 39// Expected exceptions: 40// 41// 47 - AE_AML_OPERAND_TYPE 42// Note: an object reference is defined by spec 43// to be an Integer, nevertheless it is supposed 44// that the product should distinguish Integer Data 45// from a reference. 46// 47Method(m4b1, 1, Serialized) 48{ 49 Name(ts, "m4b1") 50 51 Name(i000, 0x76543210) 52 53 Event(e000) 54 55 // Local Named Object 56 Method(m000, 1, Serialized) 57 { 58 Name(i000, 0x89abcdef) 59 60 // DerefOf 61 62 if (y083) { 63 Store (DerefOf(i000), Local1) 64 CH06(arg0, 0, 47) 65 } 66 67 // Index 68 69 Index(i000, 0, Local1) 70 CH06(arg0, 2, 47) 71 72 // ConcatenateResTemplate 73 74 ConcatenateResTemplate(i000, ResourceTemplate(){}, Local1) 75 CH06(arg0, 5, 47) 76 77 ConcatenateResTemplate(ResourceTemplate(){}, i000, Local1) 78 CH06(arg0, 6, 47) 79 } 80 81 // Global Named Object 82 Method(m001, 1) 83 { 84 // DerefOf 85 86 if (y083) { 87 Store (DerefOf(i100), Local1) 88 CH06(arg0, 7, 47) 89 } 90 91 // Index 92 93 Index(i100, 0, Local1) 94 CH06(arg0, 9, 47) 95 96 // ConcatenateResTemplate 97 98 ConcatenateResTemplate(i100, ResourceTemplate(){}, Local1) 99 CH06(arg0, 12, 47) 100 101 ConcatenateResTemplate(ResourceTemplate(){}, i100, Local1) 102 CH06(arg0, 13, 47) 103 } 104 105 // Argument 106 Method(m002, 2) 107 { 108 // DerefOf 109 110 Store (DerefOf(arg1), Local1) 111 CH06(arg0, 14, 47) 112 113 // Release 114 115 Release(arg1) 116 CH06(arg0, 15, 47) 117 118 // Reset 119 120 Reset(arg1) 121 CH06(arg0, 16, 47) 122 123 // Signal 124 125 Signal(arg1) 126 CH06(arg0, 17, 47) 127 128 // Acquire 129 130 Store(Acquire(arg1, 0), Local1) 131 CH06(arg0, 18, 47) 132 133 // ConcatenateResTemplate 134 135 ConcatenateResTemplate(arg1, ResourceTemplate(){}, Local1) 136 CH06(arg0, 21, 47) 137 138 ConcatenateResTemplate(ResourceTemplate(){}, arg1, Local1) 139 CH06(arg0, 22, 47) 140 141 // Index 142 143 Index(arg1, 0, Local1) 144 CH06(arg0, 24, 47) 145 146 // Wait 147 148 Store(Wait(arg1, 0), Local1) 149 CH06(arg0, 25, 47) 150 151 // Match 152 153 Store (Match(arg1, MTR, 0, MTR, 0, 0), Local1) 154 CH06(arg0, 26, 47) 155 } 156 157 // Local 158 Method(m003, 1) 159 { 160 Store(0x89abcdef, Local0) 161 162 // DerefOf 163 164 Store(DerefOf(Local0), Local1) 165 CH06(arg0, 27, 47) 166 167 // Release 168 169 Release(Local0) 170 CH06(arg0, 28, 47) 171 172 // Reset 173 174 Reset(Local0) 175 CH06(arg0, 29, 47) 176 177 // Signal 178 179 Signal(Local0) 180 CH06(arg0, 30, 47) 181 182 // Acquire 183 184 Store(Acquire(Local0, 0), Local1) 185 CH06(arg0, 31, 47) 186 187 // ConcatenateResTemplate 188 189 ConcatenateResTemplate(Local0, ResourceTemplate(){}, Local1) 190 CH06(arg0, 34, 47) 191 192 ConcatenateResTemplate(ResourceTemplate(){}, Local0, Local1) 193 CH06(arg0, 35, 47) 194 195 // Index 196 197 Index(Local0, 0, Local1) 198 CH06(arg0, 37, 47) 199 200 // Wait 201 202 Store(Wait(Local0, 0), Local1) 203 CH06(arg0, 38, 47) 204 205 // Match 206 207 Store (Match(Local0, MTR, 0, MTR, 0, 0), Local1) 208 CH06(arg0, 39, 47) 209 } 210 211 // An element of Package 212 Method(m004, 1, Serialized) 213 { 214 Name(p000, Package(){0x89abcdef}) 215 216 // DeRefOf(Index(Package, Ind)) 217 218 Store (DerefOf(DeRefOf(Index(p000, 0))), Local1) 219 CH06(arg0, 40, 47) 220 221 Store (Index(DeRefOf(Index(p000, 0)), 0), Local1) 222 CH06(arg0, 41, 47) 223 224 Store (Match(DeRefOf(Index(p000, 0)), MTR, 0, MTR, 0, 0), Local1) 225 CH06(arg0, 42, 47) 226 227 // DeRefOf(Index(Package, Ind, Dest)) 228 229 Store (DerefOf(DeRefOf(Index(p000, 0, Local0))), Local1) 230 CH06(arg0, 43, 47) 231 232 Store (Index(DeRefOf(Index(p000, 0, Local0)), 0), Local1) 233 CH06(arg0, 44, 47) 234 235 Store (Match(DeRefOf(Index(p000, 0, Local0)), MTR, 0, MTR, 0, 0), Local1) 236 CH06(arg0, 45, 47) 237 } 238 239 // Reference to Object 240 Method(m005, 2) 241 { 242 Store(arg0, Debug) 243 Store(arg1, Debug) 244 245 Store(ObjectType(arg1), Local0) 246 if (LNotEqual(Local0, 1)) { 247 err(arg0, z093, 46, 0, 0, Local0, 1) 248 return (1) 249 } 250 251 Store (DerefOf(arg1), Local1) 252 CH03(ts, z093, 0, 0, 0) 253 254 Store (DerefOf(DerefOf(arg1)), Local1) 255 CH06(arg0, 47, 47) 256 257 Store (Index(DerefOf(arg1), 0), Local1) 258 CH06(arg0, 48, 47) 259 260 Store (Match(DerefOf(arg1), MTR, 0, MTR, 0, 0), Local1) 261 CH06(arg0, 49, 47) 262 263 return (0) 264 } 265 266 // Result of Method invocation 267 Method(m006, 1, Serialized) 268 { 269 Name(i000, 0) // Label to check m000 invocations 270 271 Method(m000, 1) 272 { 273 Store(arg0, i000) 274 Store(0x89abcdef, Local0) 275 Return (Local0) 276 } 277 278 Method(CH00, 2) 279 { 280 if (LNotEqual(i000, arg1)) { 281 err(arg0, z093, 50, 0, 0, i000, arg1) 282 } 283 } 284 285 Store (DerefOf(m000(1)), Local1) 286 CH06(arg0, 51, 47) 287 CH00(arg0, 1) 288 289 Release(m000(2)) 290 CH06(arg0, 52, 47) 291 if (y600) { 292 CH00(arg0, 2) 293 } 294 295 Reset(m000(3)) 296 CH06(arg0, 53, 47) 297 if (y600) { 298 CH00(arg0, 3) 299 } 300 301 Signal(m000(4)) 302 CH06(arg0, 54, 47) 303 if (y600) { 304 CH00(arg0, 4) 305 } 306 307 Store(Acquire(m000(5), 0), Local1) 308 CH06(arg0, 55, 47) 309 if (y600) { 310 CH00(arg0, 5) 311 } 312 313 Store (Index(m000(6), 0), Local1) 314 CH06(arg0, 56, 47) 315 CH00(arg0, 6) 316 317 Store(Wait(m000(7), 0), Local1) 318 CH06(arg0, 57, 47) 319 if (y600) { 320 CH00(arg0, 7) 321 } 322 323 Store (Match(m000(8), MTR, 0, MTR, 0, 0), Local1) 324 CH06(arg0, 58, 47) 325 CH00(arg0, 8) 326 } 327 328 // Reference to Object as Result of Method invocation 329 Method(m007, 1, Serialized) 330 { 331 Name(i000, 0x89abcdef) 332 333 Name(i001, 0) // Label to check m000 invocations 334 335 Method(m000, 2) 336 { 337 Store(arg0, i001) 338 if (LEqual(arg1, 0)) { 339 Store(Refof(i100), Local0) 340 } elseif (LEqual(arg1, 1)) { 341 Store(Refof(i000), Local0) 342 } 343 Return (Local0) 344 } 345 346 Method(CH00, 2) 347 { 348 if (LNotEqual(i001, arg1)) { 349 err(arg0, z093, 59, 0, 0, i000, arg1) 350 } 351 } 352 353 Name(lpN0, 2) 354 Name(lpC0, 0) 355 356 While (lpN0) { 357 Multiply(3, lpC0, Local0) 358 359 Store(0, i001) 360 361 Store (DerefOf(m000(1, lpC0)), Local1) 362 CH03(ts, z093, Add(1, lpC0), 0, 0) 363 CH00(arg0, 1) 364 365 Store (DerefOf(DerefOf(m000(2, lpC0))), Local1) 366 CH06(arg0, Add(60, Local0), 47) 367 CH00(arg0, 2) 368 369 Store (Index(DerefOf(m000(3, lpC0)), 0), Local1) 370 CH06(arg0, Add(61, Local0), 47) 371 CH00(arg0, 3) 372 373 Store (Match(DerefOf(m000(4, lpC0)), MTR, 0, MTR, 0, 0), Local1) 374 CH06(arg0, Add(62, Local0), 47) 375 CH00(arg0, 4) 376 377 Decrement(lpN0) 378 Increment(lpC0) 379 } 380 } 381 382 CH03(ts, z093, 3, 0, 0) 383 384 // Local Named Object 385 m000(ts) 386 387 // Global Named Object 388 m001(ts) 389 390 // Argument 391 m002(ts, 0x76543210) 392 393 // Local 394 m003(ts) 395 396 // An element of Package 397 m004(ts) 398 399 400 // Reference to Local Named Object 401 402 m005(Concatenate(ts, "-m005-RefLocName"), RefOf(i000)) 403 404 Store(RefOf(i000), Local0) 405 m005(Concatenate(ts, "-m005-RefLocName2"), Local0) 406 407 CondRefOf(i000, Local0) 408 m005(Concatenate(ts, "-m005-CondRefLocName"), Local0) 409 410 m005(Concatenate(ts, "-m005-RefGlobName"), RefOf(i100)) 411 412 Store(RefOf(i100), Local0) 413 m005(Concatenate(ts, "-m005-RefGlobName2"), Local0) 414 415 CondRefOf(i100, Local0) 416 m005(Concatenate(ts, "-m005-CondRefGlobName"), Local0) 417 418 419 // Reference to Local 420 421 Store(0x89abcdef, Local0) 422 423 m005(Concatenate(ts, "-m005-RefLocal"), RefOf(Local0)) 424 425 Store(RefOf(Local0), Local1) 426 m005(Concatenate(ts, "-m005-RefLocal2"), Local1) 427 428 CondRefOf(Local0, Local1) 429 m005(Concatenate(ts, "-m005-CondRefLocal"), Local1) 430 431 432 // Reference to Arg 433 434 m005(Concatenate(ts, "-m005-RefArg"), RefOf(arg0)) 435 436 Store(RefOf(arg0), Local0) 437 m005(Concatenate(ts, "-m005-RefArg2"), Local0) 438 439 CondRefOf(arg0, Local0) 440 m005(Concatenate(ts, "-m005-CondRefArg"), Local0) 441 442 443 // Index to Package 444 445 Name(p000, Package(){0x76543210}) 446 447 if (y113) { 448 m005(Concatenate(ts, "-m005-Index"), Index(p000, 0)) 449 } 450 451 Store(Index(p000, 0), Local0) 452 m005(Concatenate(ts, "-m005-Index2"), Local0) 453 454 if (y113) { 455 m005(Concatenate(ts, "-m005-Index3"), Index(p000, 0, Local0)) 456 } 457 458 Index(p000, 0, Local0) 459 m005(Concatenate(ts, "-m005-Index4"), Local0) 460 461 Store(Index(p000, 0, Local0), Local1) 462 m005(Concatenate(ts, "-m005-Index5"), Local1) 463 464 // Result of Method invocation 465 m006(ts) 466 467 // Reference to Object as Result of Method invocation 468 if (y500) { 469 m007(ts) 470 } 471} 472