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 * Resource Descriptor macros 31 * 32 * Long Vendor Resource Descriptor 33 */ 34 35Name (p410, Package() { 36 ResourceTemplate () { 37 VendorLong () {0x8f, 38 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 39 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff} 40 }, 41 ResourceTemplate () { 42 VendorLong () {0x9f, 43 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 44 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 45 0x00, 0x01, 0x02, 0x03} 46 }, 47 48 ResourceTemplate () { 49 VendorLong () {0xaf, 50 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 51 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 52 // 257 bytes 53 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 54 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 55 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 56 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 57 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 58 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 59 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111,112, 60 113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128, 61 129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144, 62 145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160, 63 161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176, 64 177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192, 65 193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208, 66 209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224, 67 225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240, 68 241,242,243,244,245,246,247,248,249,250,251,252,253,254,255, 0, 1} 69 }, 70 71 // next cases might produce compiler warnings or errors 72 ResourceTemplate () { 73 VendorLong () {} 74 }, 75 ResourceTemplate () { 76 VendorLong () {0xbf} 77 }, 78 ResourceTemplate () { 79 VendorLong () {0xcf, 80 0xf0} 81 }, 82 ResourceTemplate () { 83 VendorLong () {0xdf, 84 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 85 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe} 86 }, 87}) 88 89/* 90ACPI Specification, Revision 3.0, September 2, 2004 916.4.3.2 Vendor-Defined Descriptor 92 93Large Vendor-Defined Descriptor layout: 94 95Byte 0 (Tag Bits): Value = 10000100B (0X84) (Type = 1, Large item name = 0x4) 96Byte 1 (Length, bits[7:0]): Lower eight bits of data length (UUIID & vendor defined data) 97Byte 2 (Length, bits[15:8]): Upper eight bits of data length (UUID & vendor defined data) 98Byte 3 (UUID specific descriptor sub type): UUID specific descriptor sub type value 99Byte 4-19 (UUID): UUID Value 100Byte 20-(Length+2) (Vendor Defined Data): Vendor defined data bytes 101*/ 102 103Name (p411, Package() { 104 Buffer () { 105 0x84, 0x11, 0x00, 0x8f, 106 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 107 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 0x79, 0x00}, 108 Buffer () { 109 0x84, 0x15, 0x00, 0x9f, 110 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 111 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 112 0x00, 0x01, 0x02, 0x03, 0x79, 0x00}, 113 Buffer () { 114 0x84, 0x12, 0x01, 0xaf, 115 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 116 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 117 // 257 bytes 118 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 119 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 120 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 121 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 122 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 123 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 124 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111,112, 125 113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128, 126 129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144, 127 145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160, 128 161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176, 129 177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192, 130 193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208, 131 209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224, 132 225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240, 133 241,242,243,244,245,246,247,248,249,250,251,252,253,254,255, 0, 1, 134 0x79, 0x00}, 135 136 Buffer () { 137 0x84, 0x00, 0x00, 0x79, 0x00}, 138 Buffer () { 139 0x84, 0x01, 0x00, 0xbf, 0x79, 0x00}, 140 Buffer () { 141 0x84, 0x02, 0x00, 0xcf, 142 0xf0, 0x79, 0x00}, 143 Buffer () { 144 0x84, 0x10, 0x00, 0xdf, 145 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 146 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0x79, 0x00}, 147}) 148 149Method(RT09,, Serialized) 150{ 151 Name(ts, "RT09") 152 153 // Emit test header, set the filename 154 155 THDR (ts, "Long Vendor Resource Descriptor Macro", __FILE__) 156 157 // Main test case for packages above 158 159 m330(ts, 7, "p410", p410, p411) 160 161 // VendorLong has DescriptorName 162 // but has not fields in it. 163 164 Store ( 165 ResourceTemplate () { 166 VendorLong (VL00) {0x8f, 167 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 168 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff} 169 }, Local0) 170} 171