aslcompiler.l revision 1.6 1 1.1 jruoho %{
2 1.1 jruoho /******************************************************************************
3 1.1 jruoho *
4 1.2 christos * Module Name: aslcompiler.l - Flex/lex input file
5 1.1 jruoho *
6 1.1 jruoho *****************************************************************************/
7 1.1 jruoho
8 1.2 christos /*
9 1.6 christos * Copyright (C) 2000 - 2016, Intel Corp.
10 1.1 jruoho * All rights reserved.
11 1.1 jruoho *
12 1.2 christos * Redistribution and use in source and binary forms, with or without
13 1.2 christos * modification, are permitted provided that the following conditions
14 1.2 christos * are met:
15 1.2 christos * 1. Redistributions of source code must retain the above copyright
16 1.2 christos * notice, this list of conditions, and the following disclaimer,
17 1.2 christos * without modification.
18 1.2 christos * 2. Redistributions in binary form must reproduce at minimum a disclaimer
19 1.2 christos * substantially similar to the "NO WARRANTY" disclaimer below
20 1.2 christos * ("Disclaimer") and any redistribution must be conditioned upon
21 1.2 christos * including a substantially similar Disclaimer requirement for further
22 1.2 christos * binary redistribution.
23 1.2 christos * 3. Neither the names of the above-listed copyright holders nor the names
24 1.2 christos * of any contributors may be used to endorse or promote products derived
25 1.2 christos * from this software without specific prior written permission.
26 1.2 christos *
27 1.2 christos * Alternatively, this software may be distributed under the terms of the
28 1.2 christos * GNU General Public License ("GPL") version 2 as published by the Free
29 1.2 christos * Software Foundation.
30 1.2 christos *
31 1.2 christos * NO WARRANTY
32 1.2 christos * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33 1.2 christos * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34 1.2 christos * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
35 1.2 christos * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36 1.2 christos * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37 1.2 christos * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38 1.2 christos * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 1.2 christos * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
40 1.2 christos * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
41 1.2 christos * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
42 1.2 christos * POSSIBILITY OF SUCH DAMAGES.
43 1.2 christos */
44 1.1 jruoho
45 1.2 christos #include "aslcompiler.h"
46 1.2 christos #include "aslcompiler.y.h"
47 1.1 jruoho
48 1.1 jruoho #include <stdlib.h>
49 1.1 jruoho #include <string.h>
50 1.1 jruoho YYSTYPE AslCompilerlval;
51 1.1 jruoho
52 1.1 jruoho /*
53 1.1 jruoho * Generation: Use the following command line:
54 1.1 jruoho *
55 1.1 jruoho * flex.exe -PAslCompiler -i -o$(InputPath).c $(InputPath)
56 1.1 jruoho *
57 1.1 jruoho * -i: Scanner must be case-insensitive
58 1.1 jruoho */
59 1.1 jruoho
60 1.1 jruoho #define _COMPONENT ACPI_COMPILER
61 1.2 christos ACPI_MODULE_NAME ("aslscanner")
62 1.2 christos
63 1.2 christos
64 1.2 christos /* Local prototypes */
65 1.2 christos
66 1.2 christos static void
67 1.2 christos AslDoLineDirective (void);
68 1.2 christos
69 1.2 christos static char
70 1.2 christos AslDoComment (void);
71 1.2 christos
72 1.2 christos static char
73 1.2 christos AslDoCommentType2 (void);
74 1.2 christos
75 1.2 christos static char
76 1.2 christos AslDoStringLiteral (void);
77 1.2 christos
78 1.2 christos static void
79 1.1 jruoho count (int type);
80 1.2 christos
81 1.1 jruoho
82 1.1 jruoho /*! [Begin] no source code translation */
83 1.1 jruoho
84 1.1 jruoho %}
85 1.2 christos /* Definitions */
86 1.1 jruoho
87 1.1 jruoho LeadNameChar [A-Za-z_]
88 1.1 jruoho DigitChar [0-9]
89 1.1 jruoho HexDigitChar [A-Fa-f0-9]
90 1.1 jruoho RootChar [\\]
91 1.1 jruoho Nothing []
92 1.1 jruoho
93 1.1 jruoho NameChar [A-Za-z_0-9]
94 1.1 jruoho NameSeg1 {LeadNameChar}{NameChar}
95 1.1 jruoho NameSeg2 {LeadNameChar}{NameChar}{NameChar}
96 1.1 jruoho NameSeg3 {LeadNameChar}{NameChar}{NameChar}{NameChar}
97 1.1 jruoho NameSeg {LeadNameChar}|{NameSeg1}|{NameSeg2}|{NameSeg3}
98 1.1 jruoho
99 1.1 jruoho NameString {RootChar}|{RootChar}{NamePath}|[\^]+{NamePath}|{NonEmptyNamePath}
100 1.1 jruoho NamePath {NonEmptyNamePath}?
101 1.1 jruoho NonEmptyNamePath {NameSeg}{NamePathTail}*
102 1.1 jruoho NamePathTail [.]{NameSeg}
103 1.1 jruoho
104 1.1 jruoho %%
105 1.2 christos /* Rules */
106 1.1 jruoho
107 1.1 jruoho [ ] { count (0); }
108 1.1 jruoho [\n] { count (0); } /* Handle files with both LF and CR/LF */
109 1.1 jruoho [\r] { count (0); } /* termination on both Unix and Windows */
110 1.1 jruoho [ \t] { count (0); }
111 1.1 jruoho
112 1.1 jruoho
113 1.3 christos "/*" { if (!AslDoComment ()) {yyterminate ();} }
114 1.3 christos "//" { if (!AslDoCommentType2 ()) {yyterminate ();} }
115 1.1 jruoho
116 1.3 christos "\"" { if (AslDoStringLiteral ()) {return (PARSEOP_STRING_LITERAL);}
117 1.3 christos else {yyterminate ();} }
118 1.2 christos ";" { count (0); return(';'); }
119 1.1 jruoho
120 1.4 christos /* ASL Extension: Standard C operators */
121 1.1 jruoho
122 1.4 christos "~" { count (3); return (PARSEOP_EXP_NOT); }
123 1.4 christos "!" { count (3); return (PARSEOP_EXP_LOGICAL_NOT); }
124 1.4 christos "*" { count (3); return (PARSEOP_EXP_MULTIPLY); }
125 1.4 christos "/" { count (3); return (PARSEOP_EXP_DIVIDE); }
126 1.4 christos "%" { count (3); return (PARSEOP_EXP_MODULO); }
127 1.4 christos "+" { count (3); return (PARSEOP_EXP_ADD); }
128 1.4 christos "-" { count (3); return (PARSEOP_EXP_SUBTRACT); }
129 1.4 christos ">>" { count (3); return (PARSEOP_EXP_SHIFT_RIGHT); }
130 1.4 christos "<<" { count (3); return (PARSEOP_EXP_SHIFT_LEFT); }
131 1.4 christos "<" { count (3); return (PARSEOP_EXP_LESS); }
132 1.4 christos ">" { count (3); return (PARSEOP_EXP_GREATER); }
133 1.4 christos "&" { count (3); return (PARSEOP_EXP_AND); }
134 1.4 christos "<=" { count (3); return (PARSEOP_EXP_LESS_EQUAL); }
135 1.4 christos ">=" { count (3); return (PARSEOP_EXP_GREATER_EQUAL); }
136 1.4 christos "==" { count (3); return (PARSEOP_EXP_EQUAL); }
137 1.4 christos "!=" { count (3); return (PARSEOP_EXP_NOT_EQUAL); }
138 1.4 christos "|" { count (3); return (PARSEOP_EXP_OR); }
139 1.4 christos "&&" { count (3); return (PARSEOP_EXP_LOGICAL_AND); }
140 1.4 christos "||" { count (3); return (PARSEOP_EXP_LOGICAL_OR); }
141 1.4 christos "++" { count (3); return (PARSEOP_EXP_INCREMENT); }
142 1.4 christos "--" { count (3); return (PARSEOP_EXP_DECREMENT); }
143 1.4 christos "^ " { count (3); return (PARSEOP_EXP_XOR); }
144 1.4 christos
145 1.4 christos /* ASL Extension: Standard C assignment operators */
146 1.4 christos
147 1.4 christos "=" { count (3); return (PARSEOP_EXP_EQUALS); }
148 1.4 christos "+=" { count (3); return (PARSEOP_EXP_ADD_EQ); }
149 1.4 christos "-=" { count (3); return (PARSEOP_EXP_SUB_EQ); }
150 1.4 christos "*=" { count (3); return (PARSEOP_EXP_MUL_EQ); }
151 1.4 christos "/=" { count (3); return (PARSEOP_EXP_DIV_EQ); }
152 1.4 christos "%=" { count (3); return (PARSEOP_EXP_MOD_EQ); }
153 1.4 christos "<<=" { count (3); return (PARSEOP_EXP_SHL_EQ); }
154 1.4 christos ">>=" { count (3); return (PARSEOP_EXP_SHR_EQ); }
155 1.4 christos "&=" { count (3); return (PARSEOP_EXP_AND_EQ); }
156 1.4 christos "^=" { count (3); return (PARSEOP_EXP_XOR_EQ); }
157 1.4 christos "|=" { count (3); return (PARSEOP_EXP_OR_EQ); }
158 1.4 christos
159 1.6 christos "[" { count (3); return(PARSEOP_EXP_INDEX_LEFT); }
160 1.6 christos "]" { count (0); return(PARSEOP_EXP_INDEX_RIGHT); }
161 1.6 christos
162 1.4 christos
163 1.4 christos /*
164 1.4 christos * Begin standard ASL grammar
165 1.4 christos */
166 1.1 jruoho 0[xX]{HexDigitChar}+ |
167 1.1 jruoho {DigitChar}+ { AslCompilerlval.i = UtDoConstant ((char *) AslCompilertext);
168 1.1 jruoho count (1); return (PARSEOP_INTEGER); }
169 1.1 jruoho
170 1.1 jruoho "Include" { count (1); return (PARSEOP_INCLUDE); }
171 1.1 jruoho "External" { count (1); return (PARSEOP_EXTERNAL); }
172 1.1 jruoho
173 1.2 christos /*
174 1.2 christos * The #line directive is emitted by the preprocessor and handled
175 1.2 christos * here in the main iASL lexer - simply set the line number and
176 1.2 christos * optionally the current filename.
177 1.2 christos */
178 1.2 christos "#line" { AslDoLineDirective ();}
179 1.1 jruoho
180 1.1 jruoho
181 1.2 christos /****************************************************************************
182 1.2 christos *
183 1.2 christos * Main ASL operators
184 1.2 christos *
185 1.2 christos ****************************************************************************/
186 1.2 christos
187 1.1 jruoho "AccessAs" { count (1); return (PARSEOP_ACCESSAS); }
188 1.2 christos "Acquire" { count (3); return (PARSEOP_ACQUIRE); }
189 1.2 christos "Add" { count (3); return (PARSEOP_ADD); }
190 1.2 christos "Alias" { count (2); return (PARSEOP_ALIAS); }
191 1.2 christos "And" { count (3); return (PARSEOP_AND); }
192 1.1 jruoho "BankField" { count (2); return (PARSEOP_BANKFIELD); }
193 1.2 christos "Break" { count (3); return (PARSEOP_BREAK); }
194 1.2 christos "BreakPoint" { count (3); return (PARSEOP_BREAKPOINT); }
195 1.2 christos "Buffer" { count (1); return (PARSEOP_BUFFER); }
196 1.2 christos "Case" { count (3); return (PARSEOP_CASE); }
197 1.2 christos "Concatenate" { count (3); return (PARSEOP_CONCATENATE); }
198 1.2 christos "ConcatenateResTemplate" { count (3); return (PARSEOP_CONCATENATERESTEMPLATE); }
199 1.2 christos "CondRefOf" { count (3); return (PARSEOP_CONDREFOF); }
200 1.2 christos "Connection" { count (2); return (PARSEOP_CONNECTION); }
201 1.2 christos "Continue" { count (3); return (PARSEOP_CONTINUE); }
202 1.2 christos "CopyObject" { count (3); return (PARSEOP_COPYOBJECT); }
203 1.1 jruoho "CreateBitField" { count (2); return (PARSEOP_CREATEBITFIELD); }
204 1.1 jruoho "CreateByteField" { count (2); return (PARSEOP_CREATEBYTEFIELD); }
205 1.1 jruoho "CreateDWordField" { count (2); return (PARSEOP_CREATEDWORDFIELD); }
206 1.1 jruoho "CreateField" { count (2); return (PARSEOP_CREATEFIELD); }
207 1.1 jruoho "CreateQWordField" { count (2); return (PARSEOP_CREATEQWORDFIELD); }
208 1.1 jruoho "CreateWordField" { count (2); return (PARSEOP_CREATEWORDFIELD); }
209 1.1 jruoho "DataTableRegion" { count (2); return (PARSEOP_DATATABLEREGION); }
210 1.2 christos "Debug" { count (1); return (PARSEOP_DEBUG); }
211 1.2 christos "Decrement" { count (3); return (PARSEOP_DECREMENT); }
212 1.2 christos "Default" { count (3); return (PARSEOP_DEFAULT); }
213 1.6 christos "DefinitionBlock" { count (1); return (PARSEOP_DEFINITION_BLOCK); }
214 1.2 christos "DeRefOf" { count (3); return (PARSEOP_DEREFOF); }
215 1.1 jruoho "Device" { count (2); return (PARSEOP_DEVICE); }
216 1.2 christos "Divide" { count (3); return (PARSEOP_DIVIDE); }
217 1.2 christos "Eisaid" { count (1); return (PARSEOP_EISAID); }
218 1.2 christos "Else" { count (3); return (PARSEOP_ELSE); }
219 1.2 christos "ElseIf" { count (3); return (PARSEOP_ELSEIF); }
220 1.1 jruoho "Event" { count (2); return (PARSEOP_EVENT); }
221 1.2 christos "Fatal" { count (3); return (PARSEOP_FATAL); }
222 1.1 jruoho "Field" { count (2); return (PARSEOP_FIELD); }
223 1.2 christos "FindSetLeftBit" { count (3); return (PARSEOP_FINDSETLEFTBIT); }
224 1.2 christos "FindSetRightBit" { count (3); return (PARSEOP_FINDSETRIGHTBIT); }
225 1.2 christos "FromBcd" { count (3); return (PARSEOP_FROMBCD); }
226 1.1 jruoho "Function" { count (2); return (PARSEOP_FUNCTION); }
227 1.1 jruoho "If" { count (3); return (PARSEOP_IF); }
228 1.1 jruoho "Increment" { count (3); return (PARSEOP_INCREMENT); }
229 1.1 jruoho "Index" { count (3); return (PARSEOP_INDEX); }
230 1.2 christos "IndexField" { count (2); return (PARSEOP_INDEXFIELD); }
231 1.1 jruoho "LAnd" { count (3); return (PARSEOP_LAND); }
232 1.1 jruoho "LEqual" { count (3); return (PARSEOP_LEQUAL); }
233 1.1 jruoho "LGreater" { count (3); return (PARSEOP_LGREATER); }
234 1.1 jruoho "LGreaterEqual" { count (3); return (PARSEOP_LGREATEREQUAL); }
235 1.1 jruoho "LLess" { count (3); return (PARSEOP_LLESS); }
236 1.1 jruoho "LLessEqual" { count (3); return (PARSEOP_LLESSEQUAL); }
237 1.1 jruoho "LNot" { count (3); return (PARSEOP_LNOT); }
238 1.1 jruoho "LNotEqual" { count (3); return (PARSEOP_LNOTEQUAL); }
239 1.2 christos "Load" { count (3); return (PARSEOP_LOAD); }
240 1.1 jruoho "LoadTable" { count (3); return (PARSEOP_LOADTABLE); }
241 1.1 jruoho "LOr" { count (3); return (PARSEOP_LOR); }
242 1.1 jruoho "Match" { count (3); return (PARSEOP_MATCH); }
243 1.2 christos "Method" { count (2); return (PARSEOP_METHOD); }
244 1.1 jruoho "Mid" { count (3); return (PARSEOP_MID); }
245 1.1 jruoho "Mod" { count (3); return (PARSEOP_MOD); }
246 1.1 jruoho "Multiply" { count (3); return (PARSEOP_MULTIPLY); }
247 1.2 christos "Mutex" { count (2); return (PARSEOP_MUTEX); }
248 1.2 christos "Name" { count (2); return (PARSEOP_NAME); }
249 1.1 jruoho "NAnd" { count (3); return (PARSEOP_NAND); }
250 1.2 christos "Noop" { if (!AcpiGbl_IgnoreNoopOperator) {count (3); return (PARSEOP_NOOP);} }
251 1.1 jruoho "NOr" { count (3); return (PARSEOP_NOR); }
252 1.1 jruoho "Not" { count (3); return (PARSEOP_NOT); }
253 1.2 christos "Notify" { count (3); return (PARSEOP_NOTIFY); }
254 1.1 jruoho "ObjectType" { count (3); return (PARSEOP_OBJECTTYPE); }
255 1.2 christos "Offset" { count (1); return (PARSEOP_OFFSET); }
256 1.2 christos "One" { count (1); return (PARSEOP_ONE); }
257 1.2 christos "Ones" { count (1); return (PARSEOP_ONES); }
258 1.2 christos "OperationRegion" { count (2); return (PARSEOP_OPERATIONREGION); }
259 1.1 jruoho "Or" { count (3); return (PARSEOP_OR); }
260 1.2 christos "Package" { count (1); return (PARSEOP_PACKAGE); }
261 1.2 christos "PowerResource" { count (2); return (PARSEOP_POWERRESOURCE); }
262 1.2 christos "Processor" { count (2); return (PARSEOP_PROCESSOR); }
263 1.1 jruoho "RefOf" { count (3); return (PARSEOP_REFOF); }
264 1.2 christos "Release" { count (3); return (PARSEOP_RELEASE); }
265 1.2 christos "Reset" { count (3); return (PARSEOP_RESET); }
266 1.2 christos "Return" { count (3); return (PARSEOP_RETURN); }
267 1.2 christos "Revision" { count (1); return (PARSEOP_REVISION); }
268 1.2 christos "Scope" { count (2); return (PARSEOP_SCOPE); }
269 1.1 jruoho "ShiftLeft" { count (3); return (PARSEOP_SHIFTLEFT); }
270 1.1 jruoho "ShiftRight" { count (3); return (PARSEOP_SHIFTRIGHT); }
271 1.2 christos "Signal" { count (3); return (PARSEOP_SIGNAL); }
272 1.1 jruoho "SizeOf" { count (3); return (PARSEOP_SIZEOF); }
273 1.2 christos "Sleep" { count (3); return (PARSEOP_SLEEP); }
274 1.2 christos "Stall" { count (3); return (PARSEOP_STALL); }
275 1.1 jruoho "Store" { count (3); return (PARSEOP_STORE); }
276 1.1 jruoho "Subtract" { count (3); return (PARSEOP_SUBTRACT); }
277 1.2 christos "Switch" { count (3); return (PARSEOP_SWITCH); }
278 1.2 christos "ThermalZone" { count (2); return (PARSEOP_THERMALZONE); }
279 1.1 jruoho "Timer" { count (3); return (PARSEOP_TIMER); }
280 1.2 christos "ToBcd" { count (3); return (PARSEOP_TOBCD); }
281 1.1 jruoho "ToBuffer" { count (3); return (PARSEOP_TOBUFFER); }
282 1.1 jruoho "ToDecimalString" { count (3); return (PARSEOP_TODECIMALSTRING); }
283 1.1 jruoho "ToHexString" { count (3); return (PARSEOP_TOHEXSTRING); }
284 1.1 jruoho "ToInteger" { count (3); return (PARSEOP_TOINTEGER); }
285 1.1 jruoho "ToString" { count (3); return (PARSEOP_TOSTRING); }
286 1.2 christos "ToUuid" { count (1); return (PARSEOP_TOUUID); }
287 1.2 christos "Unicode" { count (1); return (PARSEOP_UNICODE); }
288 1.2 christos "Unload" { count (3); return (PARSEOP_UNLOAD); }
289 1.1 jruoho "Wait" { count (3); return (PARSEOP_WAIT); }
290 1.2 christos "While" { count (3); return (PARSEOP_WHILE); }
291 1.1 jruoho "XOr" { count (3); return (PARSEOP_XOR); }
292 1.2 christos "Zero" { count (1); return (PARSEOP_ZERO); }
293 1.2 christos
294 1.2 christos /* Control method arguments and locals */
295 1.1 jruoho
296 1.1 jruoho "Arg0" { count (1); return (PARSEOP_ARG0); }
297 1.1 jruoho "Arg1" { count (1); return (PARSEOP_ARG1); }
298 1.1 jruoho "Arg2" { count (1); return (PARSEOP_ARG2); }
299 1.1 jruoho "Arg3" { count (1); return (PARSEOP_ARG3); }
300 1.1 jruoho "Arg4" { count (1); return (PARSEOP_ARG4); }
301 1.1 jruoho "Arg5" { count (1); return (PARSEOP_ARG5); }
302 1.1 jruoho "Arg6" { count (1); return (PARSEOP_ARG6); }
303 1.1 jruoho "Local0" { count (1); return (PARSEOP_LOCAL0); }
304 1.1 jruoho "Local1" { count (1); return (PARSEOP_LOCAL1); }
305 1.1 jruoho "Local2" { count (1); return (PARSEOP_LOCAL2); }
306 1.1 jruoho "Local3" { count (1); return (PARSEOP_LOCAL3); }
307 1.1 jruoho "Local4" { count (1); return (PARSEOP_LOCAL4); }
308 1.1 jruoho "Local5" { count (1); return (PARSEOP_LOCAL5); }
309 1.1 jruoho "Local6" { count (1); return (PARSEOP_LOCAL6); }
310 1.1 jruoho "Local7" { count (1); return (PARSEOP_LOCAL7); }
311 1.1 jruoho
312 1.1 jruoho
313 1.2 christos /****************************************************************************
314 1.2 christos *
315 1.2 christos * Resource Descriptor macros
316 1.2 christos *
317 1.2 christos ****************************************************************************/
318 1.1 jruoho
319 1.1 jruoho "ResourceTemplate" { count (1); return (PARSEOP_RESOURCETEMPLATE); }
320 1.2 christos "RawDataBuffer" { count (1); return (PARSEOP_DATABUFFER); }
321 1.2 christos
322 1.1 jruoho "DMA" { count (1); return (PARSEOP_DMA); }
323 1.1 jruoho "DWordIO" { count (1); return (PARSEOP_DWORDIO); }
324 1.1 jruoho "DWordMemory" { count (1); return (PARSEOP_DWORDMEMORY); }
325 1.1 jruoho "DWordSpace" { count (1); return (PARSEOP_DWORDSPACE); }
326 1.1 jruoho "EndDependentFn" { count (1); return (PARSEOP_ENDDEPENDENTFN); }
327 1.1 jruoho "ExtendedIO" { count (1); return (PARSEOP_EXTENDEDIO); }
328 1.1 jruoho "ExtendedMemory" { count (1); return (PARSEOP_EXTENDEDMEMORY); }
329 1.1 jruoho "ExtendedSpace" { count (1); return (PARSEOP_EXTENDEDSPACE); }
330 1.2 christos "FixedDma" { count (1); return (PARSEOP_FIXEDDMA); }
331 1.1 jruoho "FixedIO" { count (1); return (PARSEOP_FIXEDIO); }
332 1.2 christos "GpioInt" { count (1); return (PARSEOP_GPIO_INT); }
333 1.2 christos "GpioIo" { count (1); return (PARSEOP_GPIO_IO); }
334 1.2 christos "I2cSerialBus" { count (1); return (PARSEOP_I2C_SERIALBUS); }
335 1.1 jruoho "Interrupt" { count (1); return (PARSEOP_INTERRUPT); }
336 1.1 jruoho "IO" { count (1); return (PARSEOP_IO); }
337 1.2 christos "IRQ" { count (1); return (PARSEOP_IRQ); }
338 1.1 jruoho "IRQNoFlags" { count (1); return (PARSEOP_IRQNOFLAGS); }
339 1.1 jruoho "Memory24" { count (1); return (PARSEOP_MEMORY24); }
340 1.2 christos "Memory32" { count (1); return (PARSEOP_MEMORY32); }
341 1.1 jruoho "Memory32Fixed" { count (1); return (PARSEOP_MEMORY32FIXED); }
342 1.1 jruoho "QWordIO" { count (1); return (PARSEOP_QWORDIO); }
343 1.1 jruoho "QWordMemory" { count (1); return (PARSEOP_QWORDMEMORY); }
344 1.1 jruoho "QWordSpace" { count (1); return (PARSEOP_QWORDSPACE); }
345 1.1 jruoho "Register" { count (1); return (PARSEOP_REGISTER); }
346 1.2 christos "SpiSerialBus" { count (1); return (PARSEOP_SPI_SERIALBUS); }
347 1.1 jruoho "StartDependentFn" { count (1); return (PARSEOP_STARTDEPENDENTFN); }
348 1.1 jruoho "StartDependentFnNoPri" { count (1); return (PARSEOP_STARTDEPENDENTFN_NOPRI); }
349 1.2 christos "UartSerialBus" { count (1); return (PARSEOP_UART_SERIALBUS); }
350 1.1 jruoho "VendorLong" { count (1); return (PARSEOP_VENDORLONG); }
351 1.1 jruoho "VendorShort" { count (1); return (PARSEOP_VENDORSHORT); }
352 1.1 jruoho "WordBusNumber" { count (1); return (PARSEOP_WORDBUSNUMBER); }
353 1.1 jruoho "WordIO" { count (1); return (PARSEOP_WORDIO); }
354 1.1 jruoho "WordSpace" { count (1); return (PARSEOP_WORDSPACE); }
355 1.1 jruoho
356 1.1 jruoho
357 1.2 christos /****************************************************************************
358 1.2 christos *
359 1.2 christos * Keywords used as arguments to ASL operators and macros
360 1.2 christos *
361 1.2 christos ****************************************************************************/
362 1.2 christos
363 1.2 christos /* AccessAttribKeyword: Serial Bus Attributes (ACPI 5.0) */
364 1.2 christos
365 1.2 christos "AttribQuick" { count (0); return (PARSEOP_ACCESSATTRIB_QUICK); }
366 1.2 christos "AttribSendReceive" { count (0); return (PARSEOP_ACCESSATTRIB_SND_RCV); }
367 1.2 christos "AttribByte" { count (0); return (PARSEOP_ACCESSATTRIB_BYTE); }
368 1.2 christos "AttribWord" { count (0); return (PARSEOP_ACCESSATTRIB_WORD); }
369 1.2 christos "AttribBlock" { count (0); return (PARSEOP_ACCESSATTRIB_BLOCK); }
370 1.2 christos "AttribProcessCall" { count (0); return (PARSEOP_ACCESSATTRIB_WORD_CALL); }
371 1.2 christos "AttribBlockProcessCall" { count (0); return (PARSEOP_ACCESSATTRIB_BLOCK_CALL); }
372 1.1 jruoho
373 1.2 christos /* AccessAttribKeyword: Legacy synonyms for above (pre-ACPI 5.0) */
374 1.1 jruoho
375 1.1 jruoho "SMBQuick" { count (0); return (PARSEOP_ACCESSATTRIB_QUICK); }
376 1.1 jruoho "SMBSendReceive" { count (0); return (PARSEOP_ACCESSATTRIB_SND_RCV); }
377 1.1 jruoho "SMBByte" { count (0); return (PARSEOP_ACCESSATTRIB_BYTE); }
378 1.1 jruoho "SMBWord" { count (0); return (PARSEOP_ACCESSATTRIB_WORD); }
379 1.1 jruoho "SMBBlock" { count (0); return (PARSEOP_ACCESSATTRIB_BLOCK); }
380 1.1 jruoho "SMBProcessCall" { count (0); return (PARSEOP_ACCESSATTRIB_WORD_CALL); }
381 1.1 jruoho "SMBBlockProcessCall" { count (0); return (PARSEOP_ACCESSATTRIB_BLOCK_CALL); }
382 1.1 jruoho
383 1.2 christos /* AccessTypeKeyword: Field Access Types */
384 1.1 jruoho
385 1.2 christos "AnyAcc" { count (0); return (PARSEOP_ACCESSTYPE_ANY); }
386 1.2 christos "ByteAcc" { count (0); return (PARSEOP_ACCESSTYPE_BYTE); }
387 1.2 christos "WordAcc" { count (0); return (PARSEOP_ACCESSTYPE_WORD); }
388 1.2 christos "DWordAcc" { count (0); return (PARSEOP_ACCESSTYPE_DWORD); }
389 1.2 christos "QWordAcc" { count (0); return (PARSEOP_ACCESSTYPE_QWORD); }
390 1.2 christos "BufferAcc" { count (0); return (PARSEOP_ACCESSTYPE_BUF); }
391 1.1 jruoho
392 1.2 christos /* AddressingModeKeyword: Mode - Resource Descriptors (ACPI 5.0) */
393 1.1 jruoho
394 1.2 christos "AddressingMode7Bit" { count (0); return (PARSEOP_ADDRESSINGMODE_7BIT); }
395 1.2 christos "AddressingMode10Bit" { count (0); return (PARSEOP_ADDRESSINGMODE_10BIT); }
396 1.1 jruoho
397 1.2 christos /* AddressKeyword: ACPI memory range types */
398 1.1 jruoho
399 1.2 christos "AddressRangeMemory" { count (0); return (PARSEOP_ADDRESSTYPE_MEMORY); }
400 1.2 christos "AddressRangeReserved" { count (0); return (PARSEOP_ADDRESSTYPE_RESERVED); }
401 1.2 christos "AddressRangeNVS" { count (0); return (PARSEOP_ADDRESSTYPE_NVS); }
402 1.2 christos "AddressRangeACPI" { count (0); return (PARSEOP_ADDRESSTYPE_ACPI); }
403 1.1 jruoho
404 1.2 christos /* BusMasterKeyword: DMA Bus Mastering */
405 1.1 jruoho
406 1.2 christos "BusMaster" { count (0); return (PARSEOP_BUSMASTERTYPE_MASTER); }
407 1.2 christos "NotBusMaster" { count (0); return (PARSEOP_BUSMASTERTYPE_NOTMASTER); }
408 1.1 jruoho
409 1.2 christos /* ByteLengthKeyword: Bits per Byte - Resource Descriptors (ACPI 5.0) */
410 1.1 jruoho
411 1.2 christos "DataBitsFive" { count (0); return (PARSEOP_BITSPERBYTE_FIVE); }
412 1.2 christos "DataBitsSix" { count (0); return (PARSEOP_BITSPERBYTE_SIX); }
413 1.2 christos "DataBitsSeven" { count (0); return (PARSEOP_BITSPERBYTE_SEVEN); }
414 1.2 christos "DataBitsEight" { count (0); return (PARSEOP_BITSPERBYTE_EIGHT); }
415 1.2 christos "DataBitsNine" { count (0); return (PARSEOP_BITSPERBYTE_NINE); }
416 1.1 jruoho
417 1.2 christos /* ClockPhaseKeyword: Resource Descriptors (ACPI 5.0) */
418 1.1 jruoho
419 1.2 christos "ClockPhaseFirst" { count (0); return (PARSEOP_CLOCKPHASE_FIRST); }
420 1.2 christos "ClockPhaseSecond" { count (0); return (PARSEOP_CLOCKPHASE_SECOND); }
421 1.1 jruoho
422 1.2 christos /* ClockPolarityKeyword: Resource Descriptors (ACPI 5.0) */
423 1.1 jruoho
424 1.2 christos "ClockPolarityLow" { count (0); return (PARSEOP_CLOCKPOLARITY_LOW); }
425 1.2 christos "ClockPolarityHigh" { count (0); return (PARSEOP_CLOCKPOLARITY_HIGH); }
426 1.1 jruoho
427 1.2 christos /* DecodeKeyword: Type of Memory Decoding - Resource Descriptors */
428 1.1 jruoho
429 1.2 christos "PosDecode" { count (0); return (PARSEOP_DECODETYPE_POS); }
430 1.2 christos "SubDecode" { count (0); return (PARSEOP_DECODETYPE_SUB); }
431 1.1 jruoho
432 1.2 christos /* DmaTypeKeyword: DMA Types - DMA Resource Descriptor */
433 1.1 jruoho
434 1.2 christos "Compatibility" { count (0); return (PARSEOP_DMATYPE_COMPATIBILITY); }
435 1.2 christos "TypeA" { count (0); return (PARSEOP_DMATYPE_A); }
436 1.2 christos "TypeB" { count (0); return (PARSEOP_DMATYPE_B); }
437 1.2 christos "TypeF" { count (0); return (PARSEOP_DMATYPE_F); }
438 1.1 jruoho
439 1.2 christos /* EndianKeyword: Endian type - Resource Descriptor (ACPI 5.0) */
440 1.1 jruoho
441 1.2 christos "LittleEndian" { count (0); return (PARSEOP_ENDIAN_LITTLE); }
442 1.2 christos "BigEndian" { count (0); return (PARSEOP_ENDIAN_BIG); }
443 1.1 jruoho
444 1.2 christos /* ExtendedAttribKeyword: Bus attributes, AccessAs operator (ACPI 5.0) */
445 1.1 jruoho
446 1.2 christos "AttribBytes" { count (0); return (PARSEOP_ACCESSATTRIB_MULTIBYTE); }
447 1.2 christos "AttribRawBytes" { count (0); return (PARSEOP_ACCESSATTRIB_RAW_BYTES); }
448 1.2 christos "AttribRawProcessBytes" { count (0); return (PARSEOP_ACCESSATTRIB_RAW_PROCESS); }
449 1.1 jruoho
450 1.2 christos /* FlowControlKeyword: Resource Descriptors (ACPI 5.0) */
451 1.1 jruoho
452 1.2 christos "FlowControlHardware" { count (0); return (PARSEOP_FLOWCONTROL_HW); }
453 1.2 christos "FlowControlNone" { count (0); return (PARSEOP_FLOWCONTROL_NONE); }
454 1.2 christos "FlowControlXon" { count (0); return (PARSEOP_FLOWCONTROL_SW); }
455 1.1 jruoho
456 1.2 christos /* InterruptLevelKeyword: Interrupt Active Types */
457 1.1 jruoho
458 1.2 christos "ActiveBoth" { count (0); return (PARSEOP_INTLEVEL_ACTIVEBOTH); }
459 1.2 christos "ActiveHigh" { count (0); return (PARSEOP_INTLEVEL_ACTIVEHIGH); }
460 1.2 christos "ActiveLow" { count (0); return (PARSEOP_INTLEVEL_ACTIVELOW); }
461 1.1 jruoho
462 1.2 christos /* InterruptTypeKeyword: Interrupt Types */
463 1.1 jruoho
464 1.2 christos "Edge" { count (0); return (PARSEOP_INTTYPE_EDGE); }
465 1.2 christos "Level" { count (0); return (PARSEOP_INTTYPE_LEVEL); }
466 1.1 jruoho
467 1.2 christos /* IoDecodeKeyword: Type of Memory Decoding - Resource Descriptors */
468 1.1 jruoho
469 1.2 christos "Decode10" { count (0); return (PARSEOP_IODECODETYPE_10); }
470 1.2 christos "Decode16" { count (0); return (PARSEOP_IODECODETYPE_16); }
471 1.1 jruoho
472 1.2 christos /* IoRestrictionKeyword: I/O Restriction - GPIO Resource Descriptors (ACPI 5.0) */
473 1.1 jruoho
474 1.2 christos "IoRestrictionNone" { count (0); return (PARSEOP_IORESTRICT_NONE); }
475 1.2 christos "IoRestrictionInputOnly" { count (0); return (PARSEOP_IORESTRICT_IN); }
476 1.2 christos "IoRestrictionOutputOnly" { count (0); return (PARSEOP_IORESTRICT_OUT); }
477 1.2 christos "IoRestrictionNoneAndPreserve" { count (0); return (PARSEOP_IORESTRICT_PRESERVE); }
478 1.1 jruoho
479 1.2 christos /* LockRuleKeyword: Global Lock use for Field Operator */
480 1.1 jruoho
481 1.2 christos "Lock" { count (0); return (PARSEOP_LOCKRULE_LOCK); }
482 1.2 christos "NoLock" { count (0); return (PARSEOP_LOCKRULE_NOLOCK); }
483 1.1 jruoho
484 1.2 christos /* MatchOpKeyword: Types for Match Operator */
485 1.1 jruoho
486 1.2 christos "MTR" { count (0); return (PARSEOP_MATCHTYPE_MTR); }
487 1.2 christos "MEQ" { count (0); return (PARSEOP_MATCHTYPE_MEQ); }
488 1.2 christos "MLE" { count (0); return (PARSEOP_MATCHTYPE_MLE); }
489 1.2 christos "MLT" { count (0); return (PARSEOP_MATCHTYPE_MLT); }
490 1.2 christos "MGE" { count (0); return (PARSEOP_MATCHTYPE_MGE); }
491 1.2 christos "MGT" { count (0); return (PARSEOP_MATCHTYPE_MGT); }
492 1.1 jruoho
493 1.2 christos /* MaxKeyword: Max Range Type - Resource Descriptors */
494 1.1 jruoho
495 1.2 christos "MaxFixed" { count (0); return (PARSEOP_MAXTYPE_FIXED); }
496 1.2 christos "MaxNotFixed" { count (0); return (PARSEOP_MAXTYPE_NOTFIXED); }
497 1.1 jruoho
498 1.2 christos /* MemTypeKeyword: Memory Types - Resource Descriptors */
499 1.1 jruoho
500 1.2 christos "Cacheable" { count (0); return (PARSEOP_MEMTYPE_CACHEABLE); }
501 1.2 christos "WriteCombining" { count (0); return (PARSEOP_MEMTYPE_WRITECOMBINING); }
502 1.2 christos "Prefetchable" { count (0); return (PARSEOP_MEMTYPE_PREFETCHABLE); }
503 1.2 christos "NonCacheable" { count (0); return (PARSEOP_MEMTYPE_NONCACHEABLE); }
504 1.1 jruoho
505 1.2 christos /* MinKeyword: Min Range Type - Resource Descriptors */
506 1.1 jruoho
507 1.2 christos "MinFixed" { count (0); return (PARSEOP_MINTYPE_FIXED); }
508 1.2 christos "MinNotFixed" { count (0); return (PARSEOP_MINTYPE_NOTFIXED); }
509 1.1 jruoho
510 1.2 christos /* ObjectTypeKeyword: ACPI Object Types */
511 1.1 jruoho
512 1.2 christos "UnknownObj" { count (0); return (PARSEOP_OBJECTTYPE_UNK); }
513 1.2 christos "IntObj" { count (0); return (PARSEOP_OBJECTTYPE_INT); }
514 1.2 christos "StrObj" { count (0); return (PARSEOP_OBJECTTYPE_STR); }
515 1.2 christos "BuffObj" { count (0); return (PARSEOP_OBJECTTYPE_BUF); }
516 1.2 christos "PkgObj" { count (0); return (PARSEOP_OBJECTTYPE_PKG); }
517 1.2 christos "FieldUnitObj" { count (0); return (PARSEOP_OBJECTTYPE_FLD); }
518 1.2 christos "DeviceObj" { count (0); return (PARSEOP_OBJECTTYPE_DEV); }
519 1.2 christos "EventObj" { count (0); return (PARSEOP_OBJECTTYPE_EVT); }
520 1.2 christos "MethodObj" { count (0); return (PARSEOP_OBJECTTYPE_MTH); }
521 1.2 christos "MutexObj" { count (0); return (PARSEOP_OBJECTTYPE_MTX); }
522 1.2 christos "OpRegionObj" { count (0); return (PARSEOP_OBJECTTYPE_OPR); }
523 1.2 christos "PowerResObj" { count (0); return (PARSEOP_OBJECTTYPE_POW); }
524 1.2 christos "ProcessorObj" { count (0); return (PARSEOP_OBJECTTYPE_PRO); }
525 1.2 christos "ThermalZoneObj" { count (0); return (PARSEOP_OBJECTTYPE_THZ); }
526 1.2 christos "BuffFieldObj" { count (0); return (PARSEOP_OBJECTTYPE_BFF); }
527 1.2 christos "DDBHandleObj" { count (0); return (PARSEOP_OBJECTTYPE_DDB); }
528 1.1 jruoho
529 1.2 christos /* ParityKeyword: Resource Descriptors (ACPI 5.0) */
530 1.1 jruoho
531 1.2 christos "ParityTypeSpace" { count (0); return (PARSEOP_PARITYTYPE_SPACE); }
532 1.2 christos "ParityTypeMark" { count (0); return (PARSEOP_PARITYTYPE_MARK); }
533 1.2 christos "ParityTypeOdd" { count (0); return (PARSEOP_PARITYTYPE_ODD); }
534 1.2 christos "ParityTypeEven" { count (0); return (PARSEOP_PARITYTYPE_EVEN); }
535 1.2 christos "ParityTypeNone" { count (0); return (PARSEOP_PARITYTYPE_NONE); }
536 1.1 jruoho
537 1.2 christos /* PinConfigKeyword: Pin Configuration - GPIO Resource Descriptors (ACPI 5.0) */
538 1.1 jruoho
539 1.2 christos "PullDefault" { count (0); return (PARSEOP_PIN_PULLDEFAULT); }
540 1.2 christos "PullUp" { count (0); return (PARSEOP_PIN_PULLUP); }
541 1.2 christos "PullDown" { count (0); return (PARSEOP_PIN_PULLDOWN); }
542 1.2 christos "PullNone" { count (0); return (PARSEOP_PIN_NOPULL); }
543 1.1 jruoho
544 1.2 christos /* PolarityKeyword: Resource Descriptors (ACPI 5.0) */
545 1.1 jruoho
546 1.2 christos "PolarityLow" { count (0); return (PARSEOP_DEVICEPOLARITY_LOW); }
547 1.2 christos "PolarityHigh" { count (0); return (PARSEOP_DEVICEPOLARITY_HIGH); }
548 1.1 jruoho
549 1.2 christos /* RangeTypeKeyword: I/O Range Types - Resource Descriptors */
550 1.1 jruoho
551 1.2 christos "ISAOnlyRanges" { count (0); return (PARSEOP_RANGETYPE_ISAONLY); }
552 1.2 christos "NonISAOnlyRanges" { count (0); return (PARSEOP_RANGETYPE_NONISAONLY); }
553 1.2 christos "EntireRange" { count (0); return (PARSEOP_RANGETYPE_ENTIRE); }
554 1.1 jruoho
555 1.2 christos /* ReadWriteKeyword: Memory Access Types - Resource Descriptors */
556 1.1 jruoho
557 1.2 christos "ReadWrite" { count (0); return (PARSEOP_READWRITETYPE_BOTH); }
558 1.2 christos "ReadOnly" { count (0); return (PARSEOP_READWRITETYPE_READONLY); }
559 1.1 jruoho
560 1.2 christos /* RegionSpaceKeyword: Operation Region Address Space Types */
561 1.1 jruoho
562 1.2 christos "SystemIO" { count (0); return (PARSEOP_REGIONSPACE_IO); }
563 1.2 christos "SystemMemory" { count (0); return (PARSEOP_REGIONSPACE_MEM); }
564 1.2 christos "PCI_Config" { count (0); return (PARSEOP_REGIONSPACE_PCI); }
565 1.2 christos "EmbeddedControl" { count (0); return (PARSEOP_REGIONSPACE_EC); }
566 1.2 christos "SMBus" { count (0); return (PARSEOP_REGIONSPACE_SMBUS); }
567 1.2 christos "SystemCMOS" { count (0); return (PARSEOP_REGIONSPACE_CMOS); }
568 1.2 christos "PciBarTarget" { count (0); return (PARSEOP_REGIONSPACE_PCIBAR); }
569 1.2 christos "IPMI" { count (0); return (PARSEOP_REGIONSPACE_IPMI); }
570 1.2 christos "GeneralPurposeIo" { count (0); return (PARSEOP_REGIONSPACE_GPIO); } /* ACPI 5.0 */
571 1.2 christos "GenericSerialBus" { count (0); return (PARSEOP_REGIONSPACE_GSBUS); } /* ACPI 5.0 */
572 1.2 christos "PCC" { count (0); return (PARSEOP_REGIONSPACE_PCC); } /* ACPI 5.0 */
573 1.2 christos "FFixedHW" { count (0); return (PARSEOP_REGIONSPACE_FFIXEDHW); }
574 1.1 jruoho
575 1.2 christos /* ResourceTypeKeyword: Resource Usage - Resource Descriptors */
576 1.1 jruoho
577 1.2 christos "ResourceConsumer" { count (0); return (PARSEOP_RESOURCETYPE_CONSUMER); }
578 1.2 christos "ResourceProducer" { count (0); return (PARSEOP_RESOURCETYPE_PRODUCER); }
579 1.1 jruoho
580 1.2 christos /* SerializeRuleKeyword: Control Method Serialization */
581 1.1 jruoho
582 1.2 christos "Serialized" { count (0); return (PARSEOP_SERIALIZERULE_SERIAL); }
583 1.2 christos "NotSerialized" { count (0); return (PARSEOP_SERIALIZERULE_NOTSERIAL); }
584 1.1 jruoho
585 1.2 christos /* ShareTypeKeyword: Interrupt Sharing - Resource Descriptors */
586 1.1 jruoho
587 1.2 christos "Shared" { count (0); return (PARSEOP_SHARETYPE_SHARED); }
588 1.2 christos "Exclusive" { count (0); return (PARSEOP_SHARETYPE_EXCLUSIVE); }
589 1.2 christos "SharedAndWake" { count (0); return (PARSEOP_SHARETYPE_SHAREDWAKE); } /* ACPI 5.0 */
590 1.2 christos "ExclusiveAndWake" { count (0); return (PARSEOP_SHARETYPE_EXCLUSIVEWAKE); } /* ACPI 5.0 */
591 1.1 jruoho
592 1.2 christos /* SlaveModeKeyword: Resource Descriptors (ACPI 5.0) */
593 1.1 jruoho
594 1.2 christos "ControllerInitiated" { count (0); return (PARSEOP_SLAVEMODE_CONTROLLERINIT); }
595 1.2 christos "DeviceInitiated" { count (0); return (PARSEOP_SLAVEMODE_DEVICEINIT); }
596 1.1 jruoho
597 1.2 christos /* StopBitsKeyword: Resource Descriptors (ACPI 5.0) */
598 1.1 jruoho
599 1.2 christos "StopBitsOne" { count (0); return (PARSEOP_STOPBITS_ONE); }
600 1.2 christos "StopBitsOnePlusHalf" { count (0); return (PARSEOP_STOPBITS_ONEPLUSHALF); }
601 1.2 christos "StopBitsTwo" { count (0); return (PARSEOP_STOPBITS_TWO); }
602 1.2 christos "StopBitsZero" { count (0); return (PARSEOP_STOPBITS_ZERO); }
603 1.1 jruoho
604 1.2 christos /* TransferWidthKeyword: DMA Widths - Fixed DMA Resource Descriptor (ACPI 5.0) */
605 1.1 jruoho
606 1.2 christos "Width8bit" { count (0); return (PARSEOP_XFERSIZE_8); }
607 1.2 christos "Width16bit" { count (0); return (PARSEOP_XFERSIZE_16); }
608 1.2 christos "Width32bit" { count (0); return (PARSEOP_XFERSIZE_32); }
609 1.2 christos "Width64bit" { count (0); return (PARSEOP_XFERSIZE_64); }
610 1.2 christos "Width128bit" { count (0); return (PARSEOP_XFERSIZE_128); }
611 1.2 christos "Width256bit" { count (0); return (PARSEOP_XFERSIZE_256); }
612 1.1 jruoho
613 1.2 christos /* TranslationKeyword: Translation Density Types - Resource Descriptors */
614 1.1 jruoho
615 1.2 christos "SparseTranslation" { count (0); return (PARSEOP_TRANSLATIONTYPE_SPARSE); }
616 1.2 christos "DenseTranslation" { count (0); return (PARSEOP_TRANSLATIONTYPE_DENSE); }
617 1.1 jruoho
618 1.2 christos /* TypeKeyword: Translation Types - Resource Descriptors */
619 1.1 jruoho
620 1.2 christos "TypeTranslation" { count (0); return (PARSEOP_TYPE_TRANSLATION); }
621 1.2 christos "TypeStatic" { count (0); return (PARSEOP_TYPE_STATIC); }
622 1.1 jruoho
623 1.2 christos /* UpdateRuleKeyword: Field Update Rules */
624 1.1 jruoho
625 1.2 christos "Preserve" { count (0); return (PARSEOP_UPDATERULE_PRESERVE); }
626 1.2 christos "WriteAsOnes" { count (0); return (PARSEOP_UPDATERULE_ONES); }
627 1.2 christos "WriteAsZeros" { count (0); return (PARSEOP_UPDATERULE_ZEROS); }
628 1.1 jruoho
629 1.2 christos /* WireModeKeyword: SPI Wire Mode - Resource Descriptors (ACPI 5.0) */
630 1.1 jruoho
631 1.2 christos "FourWireMode" { count (0); return (PARSEOP_WIREMODE_FOUR); }
632 1.2 christos "ThreeWireMode" { count (0); return (PARSEOP_WIREMODE_THREE); }
633 1.1 jruoho
634 1.2 christos /* XferTypeKeyword: DMA Transfer Types */
635 1.1 jruoho
636 1.2 christos "Transfer8" { count (0); return (PARSEOP_XFERTYPE_8); }
637 1.2 christos "Transfer8_16" { count (0); return (PARSEOP_XFERTYPE_8_16); }
638 1.2 christos "Transfer16" { count (0); return (PARSEOP_XFERTYPE_16); }
639 1.1 jruoho
640 1.4 christos /* ToPld macro */
641 1.4 christos
642 1.4 christos "ToPLD" { count (0); return (PARSEOP_TOPLD); }
643 1.4 christos
644 1.4 christos "PLD_Revision" { count (0); return (PARSEOP_PLD_REVISION); }
645 1.4 christos "PLD_IgnoreColor" { count (0); return (PARSEOP_PLD_IGNORECOLOR); }
646 1.4 christos "PLD_Red" { count (0); return (PARSEOP_PLD_RED); }
647 1.4 christos "PLD_Green" { count (0); return (PARSEOP_PLD_GREEN); }
648 1.4 christos "PLD_Blue" { count (0); return (PARSEOP_PLD_BLUE); }
649 1.4 christos "PLD_Width" { count (0); return (PARSEOP_PLD_WIDTH); }
650 1.4 christos "PLD_Height" { count (0); return (PARSEOP_PLD_HEIGHT); }
651 1.4 christos "PLD_UserVisible" { count (0); return (PARSEOP_PLD_USERVISIBLE); }
652 1.4 christos "PLD_Dock" { count (0); return (PARSEOP_PLD_DOCK); }
653 1.4 christos "PLD_Lid" { count (0); return (PARSEOP_PLD_LID); }
654 1.4 christos "PLD_Panel" { count (0); return (PARSEOP_PLD_PANEL); }
655 1.4 christos "PLD_VerticalPosition" { count (0); return (PARSEOP_PLD_VERTICALPOSITION); }
656 1.4 christos "PLD_HorizontalPosition" { count (0); return (PARSEOP_PLD_HORIZONTALPOSITION); }
657 1.4 christos "PLD_Shape" { count (0); return (PARSEOP_PLD_SHAPE); }
658 1.4 christos "PLD_GroupOrientation" { count (0); return (PARSEOP_PLD_GROUPORIENTATION); }
659 1.4 christos "PLD_GroupToken" { count (0); return (PARSEOP_PLD_GROUPTOKEN); }
660 1.4 christos "PLD_GroupPosition" { count (0); return (PARSEOP_PLD_GROUPPOSITION); }
661 1.4 christos "PLD_Bay" { count (0); return (PARSEOP_PLD_BAY); }
662 1.4 christos "PLD_Ejectable" { count (0); return (PARSEOP_PLD_EJECTABLE); }
663 1.4 christos "PLD_EjectRequired" { count (0); return (PARSEOP_PLD_EJECTREQUIRED); }
664 1.4 christos "PLD_CabinetNumber" { count (0); return (PARSEOP_PLD_CABINETNUMBER); }
665 1.4 christos "PLD_CardCageNumber" { count (0); return (PARSEOP_PLD_CARDCAGENUMBER); }
666 1.4 christos "PLD_Reference" { count (0); return (PARSEOP_PLD_REFERENCE); }
667 1.4 christos "PLD_Rotation" { count (0); return (PARSEOP_PLD_ROTATION); }
668 1.4 christos "PLD_Order" { count (0); return (PARSEOP_PLD_ORDER); }
669 1.4 christos "PLD_Reserved" { count (0); return (PARSEOP_PLD_RESERVED); }
670 1.4 christos "PLD_VerticalOffset" { count (0); return (PARSEOP_PLD_VERTICALOFFSET); }
671 1.4 christos "PLD_HorizontalOffset" { count (0); return (PARSEOP_PLD_HORIZONTALOFFSET); }
672 1.4 christos
673 1.4 christos
674 1.4 christos /* printf debug macros */
675 1.4 christos "printf" { count (0); return (PARSEOP_PRINTF); }
676 1.4 christos "fprintf" { count (0); return (PARSEOP_FPRINTF); }
677 1.4 christos
678 1.2 christos /* Predefined compiler names */
679 1.1 jruoho
680 1.2 christos "__DATE__" { count (0); return (PARSEOP___DATE__); }
681 1.2 christos "__FILE__" { count (0); return (PARSEOP___FILE__); }
682 1.2 christos "__LINE__" { count (0); return (PARSEOP___LINE__); }
683 1.2 christos "__PATH__" { count (0); return (PARSEOP___PATH__); }
684 1.1 jruoho
685 1.1 jruoho
686 1.2 christos "{" { count (0); return('{'); }
687 1.2 christos "}" { count (0); return('}'); }
688 1.2 christos "," { count (0); return(','); }
689 1.2 christos "(" { count (0); return('('); }
690 1.2 christos ")" { count (0); return(')'); }
691 1.1 jruoho
692 1.2 christos {NameSeg} { char *s;
693 1.2 christos count (0);
694 1.3 christos s=UtStringCacheCalloc (ACPI_NAME_SIZE + 1);
695 1.2 christos if (strcmp (AslCompilertext, "\\"))
696 1.2 christos {
697 1.2 christos strcpy (s, "____");
698 1.2 christos AcpiUtStrupr (AslCompilertext);
699 1.2 christos }
700 1.2 christos memcpy (s, AslCompilertext, strlen (AslCompilertext));
701 1.2 christos AslCompilerlval.s = s;
702 1.2 christos DbgPrint (ASL_PARSE_OUTPUT, "NameSeg: %s\n", s);
703 1.2 christos return (PARSEOP_NAMESEG); }
704 1.1 jruoho
705 1.2 christos {NameString} { char *s;
706 1.2 christos count (0);
707 1.3 christos s=UtStringCacheCalloc (strlen (AslCompilertext)+1);
708 1.2 christos AcpiUtStrupr (AslCompilertext);
709 1.2 christos strcpy (s, AslCompilertext);
710 1.2 christos AslCompilerlval.s = s;
711 1.2 christos DbgPrint (ASL_PARSE_OUTPUT, "NameString: %s\n", s);
712 1.2 christos return (PARSEOP_NAMESTRING); }
713 1.1 jruoho
714 1.2 christos . { count (1);
715 1.5 christos if (isprint ((unsigned int) *AslCompilertext))
716 1.5 christos {
717 1.5 christos snprintf (MsgBuffer, sizeof(MsgBuffer),
718 1.5 christos "Invalid character (%c), expecting ASL keyword or name",
719 1.5 christos *AslCompilertext);
720 1.5 christos }
721 1.5 christos else
722 1.5 christos {
723 1.5 christos snprintf (MsgBuffer, sizeof(MsgBuffer),
724 1.5 christos "Invalid character (0x%2.2X), expecting ASL keyword or name",
725 1.5 christos *AslCompilertext);
726 1.5 christos }
727 1.2 christos AslCompilererror (MsgBuffer);}
728 1.1 jruoho
729 1.2 christos <<EOF>> { if (AslPopInputFileStack ())
730 1.3 christos {yyterminate();}
731 1.2 christos else
732 1.3 christos {return (PARSEOP_INCLUDE_END);} };
733 1.1 jruoho
734 1.2 christos %%
735 1.1 jruoho
736 1.2 christos /*! [End] no source code translation !*/
737 1.1 jruoho
738 1.2 christos /*
739 1.2 christos * Bring in the scanner support routines
740 1.2 christos */
741 1.2 christos #include "aslsupport.l"
742