aslhelpers.y revision 1.1.1.5 1 NoEcho('
2 /******************************************************************************
3 *
4 * Module Name: aslhelpers.y - helper and option terms
5 *
6 *****************************************************************************/
7
8 /*
9 * Copyright (C) 2000 - 2018, 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 : ',' {$$ = TrCreateLeafOp (
56 PARSEOP_BUSMASTERTYPE_MASTER);}
57 | ',' PARSEOP_BUSMASTERTYPE_MASTER {$$ = TrCreateLeafOp (
58 PARSEOP_BUSMASTERTYPE_MASTER);}
59 | ',' PARSEOP_BUSMASTERTYPE_NOTMASTER {$$ = TrCreateLeafOp (
60 PARSEOP_BUSMASTERTYPE_NOTMASTER);}
61 ;
62
63 OptionalAccessAttribTerm
64 : {$$ = NULL;}
65 | ',' {$$ = NULL;}
66 | ',' ByteConstExpr {$$ = $2;}
67 | ',' AccessAttribKeyword {$$ = $2;}
68 ;
69
70 OptionalAccessSize
71 : {$$ = TrCreateValuedLeafOp (
72 PARSEOP_BYTECONST, 0);}
73 | ',' {$$ = TrCreateValuedLeafOp (
74 PARSEOP_BYTECONST, 0);}
75 | ',' ByteConstExpr {$$ = $2;}
76 ;
77
78 OptionalAccessTypeKeyword /* Default: AnyAcc */
79 : {$$ = TrCreateLeafOp (
80 PARSEOP_ACCESSTYPE_ANY);}
81 | ',' {$$ = TrCreateLeafOp (
82 PARSEOP_ACCESSTYPE_ANY);}
83 | ',' AccessTypeKeyword {$$ = $2;}
84 ;
85
86 OptionalAddressingMode
87 : ',' {$$ = NULL;}
88 | ',' AddressingModeKeyword {$$ = $2;}
89 ;
90
91 OptionalAddressRange
92 : {$$ = NULL;}
93 | ',' {$$ = NULL;}
94 | ',' AddressKeyword {$$ = $2;}
95 ;
96
97 OptionalBitsPerByte
98 : ',' {$$ = NULL;}
99 | ',' BitsPerByteKeyword {$$ = $2;}
100 ;
101
102 OptionalBuffer_Last
103 : {$$ = NULL;}
104 | ',' {$$ = NULL;}
105 | ',' RawDataBufferTerm {$$ = $2;}
106 ;
107
108 OptionalByteConstExpr
109 : {$$ = NULL;}
110 | ',' {$$ = NULL;}
111 | ',' ByteConstExpr {$$ = $2;}
112 ;
113
114 OptionalDecodeType
115 : ',' {$$ = NULL;}
116 | ',' DecodeKeyword {$$ = $2;}
117 ;
118
119 OptionalDevicePolarity
120 : ',' {$$ = NULL;}
121 | ',' DevicePolarityKeyword {$$ = $2;}
122 ;
123
124 OptionalDWordConstExpr
125 : {$$ = NULL;}
126 | ',' {$$ = NULL;}
127 | ',' DWordConstExpr {$$ = $2;}
128 ;
129
130 OptionalEndian
131 : ',' {$$ = NULL;}
132 | ',' EndianKeyword {$$ = $2;}
133 ;
134
135 OptionalFlowControl
136 : ',' {$$ = NULL;}
137 | ',' FlowControlKeyword {$$ = $2;}
138 ;
139
140 OptionalIoRestriction
141 : ',' {$$ = NULL;}
142 | ',' IoRestrictionKeyword {$$ = $2;}
143 ;
144
145 OptionalListString
146 : {$$ = TrCreateValuedLeafOp (
147 PARSEOP_STRING_LITERAL,
148 ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */
149 | ',' {$$ = TrCreateValuedLeafOp (
150 PARSEOP_STRING_LITERAL,
151 ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */
152 | ',' TermArg {$$ = $2;}
153 ;
154
155 OptionalLockRuleKeyword /* Default: NoLock */
156 : {$$ = TrCreateLeafOp (
157 PARSEOP_LOCKRULE_NOLOCK);}
158 | ',' {$$ = TrCreateLeafOp (
159 PARSEOP_LOCKRULE_NOLOCK);}
160 | ',' LockRuleKeyword {$$ = $2;}
161 ;
162
163 OptionalMaxType
164 : ',' {$$ = NULL;}
165 | ',' MaxKeyword {$$ = $2;}
166 ;
167
168 OptionalMemType
169 : ',' {$$ = NULL;}
170 | ',' MemTypeKeyword {$$ = $2;}
171 ;
172
173 OptionalMinType
174 : ',' {$$ = NULL;}
175 | ',' MinKeyword {$$ = $2;}
176 ;
177
178 OptionalNameString
179 : {$$ = NULL;}
180 | ',' {$$ = NULL;}
181 | ',' NameString {$$ = $2;}
182 ;
183
184 OptionalNameString_Last
185 : {$$ = NULL;}
186 | ',' {$$ = NULL;}
187 | ',' NameString {$$ = $2;}
188 ;
189
190 OptionalNameString_First
191 : {$$ = TrCreateLeafOp (
192 PARSEOP_ZERO);}
193 | NameString {$$ = $1;}
194 ;
195
196 OptionalObjectTypeKeyword
197 : {$$ = TrCreateLeafOp (
198 PARSEOP_OBJECTTYPE_UNK);}
199 | ',' ObjectTypeKeyword {$$ = $2;}
200 ;
201
202 OptionalParityType
203 : ',' {$$ = NULL;}
204 | ',' ParityTypeKeyword {$$ = $2;}
205 ;
206
207 OptionalQWordConstExpr
208 : {$$ = NULL;}
209 | ',' {$$ = NULL;}
210 | ',' QWordConstExpr {$$ = $2;}
211 ;
212
213 OptionalRangeType
214 : ',' {$$ = NULL;}
215 | ',' RangeTypeKeyword {$$ = $2;}
216 ;
217
218 OptionalReadWriteKeyword
219 : {$$ = TrCreateLeafOp (
220 PARSEOP_READWRITETYPE_BOTH);}
221 | PARSEOP_READWRITETYPE_BOTH {$$ = TrCreateLeafOp (
222 PARSEOP_READWRITETYPE_BOTH);}
223 | PARSEOP_READWRITETYPE_READONLY {$$ = TrCreateLeafOp (
224 PARSEOP_READWRITETYPE_READONLY);}
225 ;
226
227 OptionalResourceType_First
228 : {$$ = TrCreateLeafOp (
229 PARSEOP_RESOURCETYPE_CONSUMER);}
230 | ResourceTypeKeyword {$$ = $1;}
231 ;
232
233 OptionalResourceType
234 : {$$ = TrCreateLeafOp (
235 PARSEOP_RESOURCETYPE_CONSUMER);}
236 | ',' {$$ = TrCreateLeafOp (
237 PARSEOP_RESOURCETYPE_CONSUMER);}
238 | ',' ResourceTypeKeyword {$$ = $2;}
239 ;
240
241 /* Same as above except default is producer */
242 OptionalProducerResourceType
243 : {$$ = TrCreateLeafOp (
244 PARSEOP_RESOURCETYPE_PRODUCER);}
245 | ',' {$$ = TrCreateLeafOp (
246 PARSEOP_RESOURCETYPE_PRODUCER);}
247 | ',' ResourceTypeKeyword {$$ = $2;}
248 ;
249
250 OptionalSlaveMode
251 : ',' {$$ = NULL;}
252 | ',' SlaveModeKeyword {$$ = $2;}
253 ;
254
255 OptionalShareType
256 : {$$ = NULL;}
257 | ',' {$$ = NULL;}
258 | ',' ShareTypeKeyword {$$ = $2;}
259 ;
260
261 OptionalShareType_First
262 : {$$ = NULL;}
263 | ShareTypeKeyword {$$ = $1;}
264 ;
265
266 OptionalStopBits
267 : ',' {$$ = NULL;}
268 | ',' StopBitsKeyword {$$ = $2;}
269 ;
270
271 OptionalStringData
272 : {$$ = NULL;}
273 | ',' {$$ = NULL;}
274 | ',' StringData {$$ = $2;}
275 ;
276
277 OptionalSyncLevel /* Default: 0 */
278 : {$$ = TrCreateValuedLeafOp (
279 PARSEOP_BYTECONST, 0);}
280 | ',' {$$ = TrCreateValuedLeafOp (
281 PARSEOP_BYTECONST, 0);}
282 | ',' ByteConstExpr {$$ = $2;}
283 ;
284
285 OptionalTranslationType_Last
286 : {$$ = NULL;}
287 | ',' {$$ = NULL;}
288 | ',' TranslationKeyword {$$ = $2;}
289 ;
290
291 OptionalType
292 : {$$ = NULL;}
293 | ',' {$$ = NULL;}
294 | ',' TypeKeyword {$$ = $2;}
295 ;
296
297 OptionalType_Last
298 : {$$ = NULL;}
299 | ',' {$$ = NULL;}
300 | ',' TypeKeyword {$$ = $2;}
301 ;
302
303 OptionalUpdateRuleKeyword /* Default: Preserve */
304 : {$$ = TrCreateLeafOp (
305 PARSEOP_UPDATERULE_PRESERVE);}
306 | ',' {$$ = TrCreateLeafOp (
307 PARSEOP_UPDATERULE_PRESERVE);}
308 | ',' UpdateRuleKeyword {$$ = $2;}
309 ;
310
311 OptionalWireMode
312 : ',' {$$ = NULL;}
313 | ',' WireModeKeyword {$$ = $2;}
314 ;
315
316 OptionalWordConstExpr
317 : ',' {$$ = NULL;}
318 | ',' WordConstExpr {$$ = $2;}
319 ;
320
321 OptionalXferSize
322 : {$$ = TrCreateValuedLeafOp (
323 PARSEOP_XFERSIZE_32, 2);}
324 | ',' {$$ = TrCreateValuedLeafOp (
325 PARSEOP_XFERSIZE_32, 2);}
326 | ',' XferSizeKeyword {$$ = $2;}
327 ;
328