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 29Name(z156, 156) 30 31/* 32 * Check access to elements Package/Buffer/String and Buffer Field 33 * where the parent is an element of some complex object (Device). 34 */ 35 36Method(m200,, Serialized) 37{ 38 Name(ts, "m200") 39 Device(d000) 40 { 41 Name(p000, Package() {0xabcd0000, 0xabcd0001, 0xabcd0002}) 42 } 43 44 Method(m001, 2) 45 { 46 Store(0x11112222, Index(arg0, 0)) 47 } 48 49 m001(d000.p000, RefOf(d000.p000)) 50 51 Store(DerefOf(Index(d000.p000, 0)), Local0) 52 53 if (LNotEqual(Local0, 0x11112222)) { 54 err(ts, z156, 0x000, 0, 0, Local0, 0x11112222) 55 } 56 57 CH03(ts, z156, 0x001, 0, 0) 58} 59 60Method(m201,, Serialized) 61{ 62 Name(ts, "m201") 63 Device(d000) 64 { 65 Name(b000, Buffer() {0x10, 0x11, 0x12}) 66 } 67 Method(m001, 2) 68 { 69 Store(0x67, Index(arg0, 0)) 70 } 71 72 m001(d000.b000, RefOf(d000.b000)) 73 74 Store(DerefOf(Index(d000.b000, 0)), Local0) 75 76 if (LNotEqual(Local0, 0x67)) { 77 err(ts, z156, 0x002, 0, 0, Local0, 0x67) 78 } 79 80 CH03(ts, z156, 0x003, 0, 0) 81} 82 83Method(m202,, Serialized) 84{ 85 Name(ts, "m202") 86 Device(d000) 87 { 88 Name(s000, "qqqqqqqqqqqqqq") 89 } 90 Method(m001, 2) 91 { 92 Store(0x38, Index(arg0, 0)) 93 } 94 95 m001(d000.s000, RefOf(d000.s000)) 96 97 Store(DerefOf(Index(d000.s000, 0)), Local0) 98 99 if (LNotEqual(Local0, 0x38)) { 100 err(ts, z156, 0x004, 0, 0, Local0, 0x38) 101 } 102 103 CH03(ts, z156, 0x005, 0, 0) 104} 105 106/* 107 * Element of Package instead of i000 (in m002) 108 */ 109Method(m204,, Serialized) 110{ 111 Name(ts, "m204") 112 Name(i001, 0) 113 Device(d000) 114 { 115 Name(pp00, Package() {0x11111111, 0x00100000, 0x22223333}) 116 } 117 118 Method(m001) 119 { 120 if (LLess(i001, 100)) { 121 122 Store(DerefOf(Index(^d000.pp00, 1)), Local0) 123 Increment(Local0) 124 Store(Local0, Index(^d000.pp00, 1)) 125 Increment(i001) 126 Add(DerefOf(Index(^d000.pp00, 1)), m001(), Local0) 127 Return (Local0) 128 } 129 Return (0) 130 } 131 Store(Add(DerefOf(Index(d000.pp00, 1)), m001()), Local0) 132 133 if (LNotEqual(Local0, 0x065013BA)) { 134 err(ts, z156, 0x00a, 0, 0, Local0, 0x065013BA) 135 } 136 137 Store(DerefOf(Index(d000.pp00, 1)), Local0) 138 139 if (LNotEqual(Local0, 0x00100064)) { 140 err(ts, z156, 0x00b, 0, 0, Local0, 0x00100064) 141 } 142 143 CH03(ts, z156, 0x00c, 0, 0) 144} 145 146Method(n002) 147{ 148if (1) { 149 SRMT("m200") 150 m200() 151 SRMT("m201") 152 m201() 153 SRMT("m202") 154 m202() 155 SRMT("m204") 156 m204() 157} else { 158 SRMT("m200") 159 m200() 160} 161} 162 163