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