2 /******************************************************************************
4 * Module Name: aslhelpers.y - helper and option terms
6 *****************************************************************************/
9 * Copyright (C) 2000 - 2016, Intel Corp.
10 * All rights reserved.
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
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.
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.
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.
48 /*******************************************************************************
52 ******************************************************************************/
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);}
63 OptionalAccessAttribTerm
66 | ',' ByteConstExpr {$$ = $2;}
67 | ',' AccessAttribKeyword {$$ = $2;}
71 : {$$ = TrCreateValuedLeafNode (
72 PARSEOP_BYTECONST, 0);}
73 | ',' {$$ = TrCreateValuedLeafNode (
74 PARSEOP_BYTECONST, 0);}
75 | ',' ByteConstExpr {$$ = $2;}
78 OptionalAddressingMode
80 | ',' AddressingModeKeyword {$$ = $2;}
86 | ',' AddressKeyword {$$ = $2;}
91 | ',' BitsPerByteKeyword {$$ = $2;}
97 | ',' RawDataBufferTerm {$$ = $2;}
100 OptionalByteConstExpr
103 | ',' ByteConstExpr {$$ = $2;}
108 | ',' DecodeKeyword {$$ = $2;}
111 OptionalDevicePolarity
113 | ',' DevicePolarityKeyword {$$ = $2;}
116 OptionalDWordConstExpr
119 | ',' DWordConstExpr {$$ = $2;}
124 | ',' EndianKeyword {$$ = $2;}
129 | ',' FlowControlKeyword {$$ = $2;}
132 OptionalIoRestriction
134 | ',' IoRestrictionKeyword {$$ = $2;}
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;}
149 | ',' MaxKeyword {$$ = $2;}
154 | ',' MemTypeKeyword {$$ = $2;}
159 | ',' MinKeyword {$$ = $2;}
165 | ',' NameString {$$ = $2;}
168 OptionalNameString_Last
171 | ',' NameString {$$ = $2;}
174 OptionalNameString_First
175 : {$$ = TrCreateLeafNode (
177 | NameString {$$ = $1;}
180 OptionalObjectTypeKeyword
181 : {$$ = TrCreateLeafNode (
182 PARSEOP_OBJECTTYPE_UNK);}
183 | ',' ObjectTypeKeyword {$$ = $2;}
188 | ',' ParityTypeKeyword {$$ = $2;}
191 OptionalQWordConstExpr
194 | ',' QWordConstExpr {$$ = $2;}
199 | ',' RangeTypeKeyword {$$ = $2;}
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);}
211 OptionalResourceType_First
212 : {$$ = TrCreateLeafNode (
213 PARSEOP_RESOURCETYPE_CONSUMER);}
214 | ResourceTypeKeyword {$$ = $1;}
218 : {$$ = TrCreateLeafNode (
219 PARSEOP_RESOURCETYPE_CONSUMER);}
220 | ',' {$$ = TrCreateLeafNode (
221 PARSEOP_RESOURCETYPE_CONSUMER);}
222 | ',' ResourceTypeKeyword {$$ = $2;}
227 | ',' SlaveModeKeyword {$$ = $2;}
233 | ',' ShareTypeKeyword {$$ = $2;}
236 OptionalShareType_First
238 | ShareTypeKeyword {$$ = $1;}
243 | ',' StopBitsKeyword {$$ = $2;}
249 | ',' StringData {$$ = $2;}
252 OptionalTranslationType_Last
255 | ',' TranslationKeyword {$$ = $2;}
261 | ',' TypeKeyword {$$ = $2;}
267 | ',' TypeKeyword {$$ = $2;}
272 | ',' WireModeKeyword {$$ = $2;}
275 OptionalWordConstExpr
277 | ',' WordConstExpr {$$ = $2;}
281 : {$$ = TrCreateValuedLeafNode (
282 PARSEOP_XFERSIZE_32, 2);}
283 | ',' {$$ = TrCreateValuedLeafNode (
284 PARSEOP_XFERSIZE_32, 2);}
285 | ',' XferSizeKeyword {$$ = $2;}