| 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 |
Name (Z156, 0x9C) |
| 29 |
/* |
| 30 |
* Check access to elements Package/Buffer/String and Buffer Field |
| 31 |
* where the parent is an element of some complex object (Device). |
| 32 |
*/ |
| 33 |
Method (M200, 0, Serialized) |
| 34 |
{ |
| 35 |
Device (D000) |
| 36 |
{ |
| 37 |
Name (P000, Package (0x03) |
| 38 |
{ |
| 39 |
0xABCD0000, |
| 40 |
0xABCD0001, |
| 41 |
0xABCD0002 |
| 42 |
}) |
| 43 |
} |
| 44 |
|
| 45 |
Method (M001, 2, NotSerialized) |
| 46 |
{ |
| 47 |
Arg0 [0x00] = 0x11112222 |
| 48 |
} |
| 49 |
|
| 50 |
M001 (D000.P000, RefOf (D000.P000)) |
| 51 |
Local0 = DerefOf (D000.P000 [0x00]) |
| 52 |
If ((Local0 != 0x11112222)) |
| 53 |
{ |
| 54 |
ERR (__METHOD__, Z156, __LINE__, 0x00, 0x00, Local0, 0x11112222) |
| 55 |
} |
| 56 |
|
| 57 |
CH03 (__METHOD__, Z156, __LINE__, 0x00, 0x00) |
| 58 |
} |
| 59 |
|
| 60 |
Method (M201, 0, Serialized) |
| 61 |
{ |
| 62 |
Device (D000) |
| 63 |
{ |
| 64 |
Name (B000, Buffer (0x03) |
| 65 |
{ |
| 66 |
0x10, 0x11, 0x12 // ... |
| 67 |
}) |
| 68 |
} |
| 69 |
|
| 70 |
Method (M001, 2, NotSerialized) |
| 71 |
{ |
| 72 |
Arg0 [0x00] = 0x67 |
| 73 |
} |
| 74 |
|
| 75 |
M001 (D000.B000, RefOf (D000.B000)) |
| 76 |
Local0 = DerefOf (D000.B000 [0x00]) |
| 77 |
If ((Local0 != 0x67)) |
| 78 |
{ |
| 79 |
ERR (__METHOD__, Z156, __LINE__, 0x00, 0x00, Local0, 0x67) |
| 80 |
} |
| 81 |
|
| 82 |
CH03 (__METHOD__, Z156, __LINE__, 0x00, 0x00) |
| 83 |
} |
| 84 |
|
| 85 |
Method (M202, 0, Serialized) |
| 86 |
{ |
| 87 |
Device (D000) |
| 88 |
{ |
| 89 |
Name (S000, "qqqqqqqqqqqqqq") |
| 90 |
} |
| 91 |
|
| 92 |
Method (M001, 2, NotSerialized) |
| 93 |
{ |
| 94 |
Arg0 [0x00] = 0x38 |
| 95 |
} |
| 96 |
|
| 97 |
M001 (D000.S000, RefOf (D000.S000)) |
| 98 |
Local0 = DerefOf (D000.S000 [0x00]) |
| 99 |
If ((Local0 != 0x38)) |
| 100 |
{ |
| 101 |
ERR (__METHOD__, Z156, __LINE__, 0x00, 0x00, Local0, 0x38) |
| 102 |
} |
| 103 |
|
| 104 |
CH03 (__METHOD__, Z156, __LINE__, 0x00, 0x00) |
| 105 |
} |
| 106 |
|
| 107 |
/* |
| 108 |
* Element of Package instead of i000 (in m002) |
| 109 |
*/ |
| 110 |
Method (M204, 0, Serialized) |
| 111 |
{ |
| 112 |
Name (I001, 0x00) |
| 113 |
Device (D000) |
| 114 |
{ |
| 115 |
Name (PP00, Package (0x03) |
| 116 |
{ |
| 117 |
0x11111111, |
| 118 |
0x00100000, |
| 119 |
0x22223333 |
| 120 |
}) |
| 121 |
} |
| 122 |
|
| 123 |
Method (M001, 0, NotSerialized) |
| 124 |
{ |
| 125 |
If ((I001 < 0x64)) |
| 126 |
{ |
| 127 |
Local0 = DerefOf (^D000.PP00 [0x01]) |
| 128 |
Local0++ |
| 129 |
^D000.PP00 [0x01] = Local0 |
| 130 |
I001++ |
| 131 |
Local0 = (DerefOf (^D000.PP00 [0x01]) + M001 ()) |
| 132 |
Return (Local0) |
| 133 |
} |
| 134 |
|
| 135 |
Return (0x00) |
| 136 |
} |
| 137 |
|
| 138 |
Store ((DerefOf (D000.PP00 [0x01]) + M001 ()), Local0) |
| 139 |
If ((Local0 != 0x065013BA)) |
| 140 |
{ |
| 141 |
ERR (__METHOD__, Z156, __LINE__, 0x00, 0x00, Local0, 0x065013BA) |
| 142 |
} |
| 143 |
|
| 144 |
Local0 = DerefOf (D000.PP00 [0x01]) |
| 145 |
If ((Local0 != 0x00100064)) |
| 146 |
{ |
| 147 |
ERR (__METHOD__, Z156, __LINE__, 0x00, 0x00, Local0, 0x00100064) |
| 148 |
} |
| 149 |
|
| 150 |
CH03 (__METHOD__, Z156, __LINE__, 0x00, 0x00) |
| 151 |
} |
| 152 |
|
| 153 |
Method (N002, 0, NotSerialized) |
| 154 |
{ |
| 155 |
If (0x01) |
| 156 |
{ |
| 157 |
SRMT ("m200") |
| 158 |
M200 () |
| 159 |
SRMT ("m201") |
| 160 |
M201 () |
| 161 |
SRMT ("m202") |
| 162 |
M202 () |
| 163 |
SRMT ("m204") |
| 164 |
M204 () |
| 165 |
} |
| 166 |
Else |
| 167 |
{ |
| 168 |
SRMT ("m200") |
| 169 |
M200 () |
| 170 |
} |
| 171 |
} |