1 NoEcho(' 2 /****************************************************************************** 3 * 4 * Module Name: aslhelpers.y - helper and option terms 5 * 6 *****************************************************************************/ 7 8 /* 9 * Copyright (C) 2000 - 2017, Intel Corp. 10 * All rights reserved. 11 * 12 * Redistribution and use in source and binary forms, with or without 13 * modification, are permitted provided that the following conditions 14 * are met: 15 * 1. Redistributions of source code must retain the above copyright 16 * notice, this list of conditions, and the following disclaimer, 17 * without modification. 18 * 2. Redistributions in binary form must reproduce at minimum a disclaimer 19 * substantially similar to the "NO WARRANTY" disclaimer below 20 * ("Disclaimer") and any redistribution must be conditioned upon 21 * including a substantially similar Disclaimer requirement for further 22 * binary redistribution. 23 * 3. Neither the names of the above-listed copyright holders nor the names 24 * of any contributors may be used to endorse or promote products derived 25 * from this software without specific prior written permission. 26 * 27 * Alternatively, this software may be distributed under the terms of the 28 * GNU General Public License ("GPL") version 2 as published by the Free 29 * Software Foundation. 30 * 31 * NO WARRANTY 32 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 33 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 34 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 35 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 36 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 37 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 38 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 39 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 40 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 41 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 42 * POSSIBILITY OF SUCH DAMAGES. 43 */ 44 45 ') 46 47 48 /******************************************************************************* 49 * 50 * ASL Helper Terms 51 * 52 ******************************************************************************/ 53 54 OptionalBusMasterKeyword 55 : ',' {$$ = TrCreateLeafNode ( 56 PARSEOP_BUSMASTERTYPE_MASTER);} 57 | ',' PARSEOP_BUSMASTERTYPE_MASTER {$$ = TrCreateLeafNode ( 58 PARSEOP_BUSMASTERTYPE_MASTER);} 59 | ',' PARSEOP_BUSMASTERTYPE_NOTMASTER {$$ = TrCreateLeafNode ( 60 PARSEOP_BUSMASTERTYPE_NOTMASTER);} 61 ; 62 63 OptionalAccessAttribTerm 64 : {$$ = NULL;} 65 | ',' {$$ = NULL;} 66 | ',' ByteConstExpr {$$ = $2;} 67 | ',' AccessAttribKeyword {$$ = $2;} 68 ; 69 70 OptionalAccessSize 71 : {$$ = TrCreateValuedLeafNode ( 72 PARSEOP_BYTECONST, 0);} 73 | ',' {$$ = TrCreateValuedLeafNode ( 74 PARSEOP_BYTECONST, 0);} 75 | ',' ByteConstExpr {$$ = $2;} 76 ; 77 78 OptionalAddressingMode 79 : ',' {$$ = NULL;} 80 | ',' AddressingModeKeyword {$$ = $2;} 81 ; 82 83 OptionalAddressRange 84 : {$$ = NULL;} 85 | ',' {$$ = NULL;} 86 | ',' AddressKeyword {$$ = $2;} 87 ; 88 89 OptionalBitsPerByte 90 : ',' {$$ = NULL;} 91 | ',' BitsPerByteKeyword {$$ = $2;} 92 ; 93 94 OptionalBuffer_Last 95 : {$$ = NULL;} 96 | ',' {$$ = NULL;} 97 | ',' RawDataBufferTerm {$$ = $2;} 98 ; 99 100 OptionalByteConstExpr 101 : {$$ = NULL;} 102 | ',' {$$ = NULL;} 103 | ',' ByteConstExpr {$$ = $2;} 104 ; 105 106 OptionalDecodeType 107 : ',' {$$ = NULL;} 108 | ',' DecodeKeyword {$$ = $2;} 109 ; 110 111 OptionalDevicePolarity 112 : ',' {$$ = NULL;} 113 | ',' DevicePolarityKeyword {$$ = $2;} 114 ; 115 116 OptionalDWordConstExpr 117 : {$$ = NULL;} 118 | ',' {$$ = NULL;} 119 | ',' DWordConstExpr {$$ = $2;} 120 ; 121 122 OptionalEndian 123 : ',' {$$ = NULL;} 124 | ',' EndianKeyword {$$ = $2;} 125 ; 126 127 OptionalFlowControl 128 : ',' {$$ = NULL;} 129 | ',' FlowControlKeyword {$$ = $2;} 130 ; 131 132 OptionalIoRestriction 133 : ',' {$$ = NULL;} 134 | ',' IoRestrictionKeyword {$$ = $2;} 135 ; 136 137 OptionalListString 138 : {$$ = TrCreateValuedLeafNode ( 139 PARSEOP_STRING_LITERAL, 140 ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */ 141 | ',' {$$ = TrCreateValuedLeafNode ( 142 PARSEOP_STRING_LITERAL, 143 ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */ 144 | ',' TermArg {$$ = $2;} 145 ; 146 147 OptionalMaxType 148 : ',' {$$ = NULL;} 149 | ',' MaxKeyword {$$ = $2;} 150 ; 151 152 OptionalMemType 153 : ',' {$$ = NULL;} 154 | ',' MemTypeKeyword {$$ = $2;} 155 ; 156 157 OptionalMinType 158 : ',' {$$ = NULL;} 159 | ',' MinKeyword {$$ = $2;} 160 ; 161 162 OptionalNameString 163 : {$$ = NULL;} 164 | ',' {$$ = NULL;} 165 | ',' NameString {$$ = $2;} 166 ; 167 168 OptionalNameString_Last 169 : {$$ = NULL;} 170 | ',' {$$ = NULL;} 171 | ',' NameString {$$ = $2;} 172 ; 173 174 OptionalNameString_First 175 : {$$ = TrCreateLeafNode ( 176 PARSEOP_ZERO);} 177 | NameString {$$ = $1;} 178 ; 179 180 OptionalObjectTypeKeyword 181 : {$$ = TrCreateLeafNode ( 182 PARSEOP_OBJECTTYPE_UNK);} 183 | ',' ObjectTypeKeyword {$$ = $2;} 184 ; 185 186 OptionalParityType 187 : ',' {$$ = NULL;} 188 | ',' ParityTypeKeyword {$$ = $2;} 189 ; 190 191 OptionalQWordConstExpr 192 : {$$ = NULL;} 193 | ',' {$$ = NULL;} 194 | ',' QWordConstExpr {$$ = $2;} 195 ; 196 197 OptionalRangeType 198 : ',' {$$ = NULL;} 199 | ',' RangeTypeKeyword {$$ = $2;} 200 ; 201 202 OptionalReadWriteKeyword 203 : {$$ = TrCreateLeafNode ( 204 PARSEOP_READWRITETYPE_BOTH);} 205 | PARSEOP_READWRITETYPE_BOTH {$$ = TrCreateLeafNode ( 206 PARSEOP_READWRITETYPE_BOTH);} 207 | PARSEOP_READWRITETYPE_READONLY {$$ = TrCreateLeafNode ( 208 PARSEOP_READWRITETYPE_READONLY);} 209 ; 210 211 OptionalResourceType_First 212 : {$$ = TrCreateLeafNode ( 213 PARSEOP_RESOURCETYPE_CONSUMER);} 214 | ResourceTypeKeyword {$$ = $1;} 215 ; 216 217 OptionalResourceType 218 : {$$ = TrCreateLeafNode ( 219 PARSEOP_RESOURCETYPE_CONSUMER);} 220 | ',' {$$ = TrCreateLeafNode ( 221 PARSEOP_RESOURCETYPE_CONSUMER);} 222 | ',' ResourceTypeKeyword {$$ = $2;} 223 ; 224 225 OptionalSlaveMode 226 : ',' {$$ = NULL;} 227 | ',' SlaveModeKeyword {$$ = $2;} 228 ; 229 230 OptionalShareType 231 : {$$ = NULL;} 232 | ',' {$$ = NULL;} 233 | ',' ShareTypeKeyword {$$ = $2;} 234 ; 235 236 OptionalShareType_First 237 : {$$ = NULL;} 238 | ShareTypeKeyword {$$ = $1;} 239 ; 240 241 OptionalStopBits 242 : ',' {$$ = NULL;} 243 | ',' StopBitsKeyword {$$ = $2;} 244 ; 245 246 OptionalStringData 247 : {$$ = NULL;} 248 | ',' {$$ = NULL;} 249 | ',' StringData {$$ = $2;} 250 ; 251 252 OptionalTranslationType_Last 253 : {$$ = NULL;} 254 | ',' {$$ = NULL;} 255 | ',' TranslationKeyword {$$ = $2;} 256 ; 257 258 OptionalType 259 : {$$ = NULL;} 260 | ',' {$$ = NULL;} 261 | ',' TypeKeyword {$$ = $2;} 262 ; 263 264 OptionalType_Last 265 : {$$ = NULL;} 266 | ',' {$$ = NULL;} 267 | ',' TypeKeyword {$$ = $2;} 268 ; 269 270 OptionalWireMode 271 : ',' {$$ = NULL;} 272 | ',' WireModeKeyword {$$ = $2;} 273 ; 274 275 OptionalWordConstExpr 276 : ',' {$$ = NULL;} 277 | ',' WordConstExpr {$$ = $2;} 278 ; 279 280 OptionalXferSize 281 : {$$ = TrCreateValuedLeafNode ( 282 PARSEOP_XFERSIZE_32, 2);} 283 | ',' {$$ = TrCreateValuedLeafNode ( 284 PARSEOP_XFERSIZE_32, 2);} 285 | ',' XferSizeKeyword {$$ = $2;} 286 ; 287