2 /******************************************************************************
4 * Module Name: aslcompiler.l - Flex/lex input file
6 *****************************************************************************/
9 * Copyright (C) 2000 - 2013, 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.
45 #include "aslcompiler.h"
46 #include "aslcompiler.y.h"
50 YYSTYPE AslCompilerlval;
53 * Generation: Use the following command line:
55 * flex.exe -PAslCompiler -i -o$(InputPath).c $(InputPath)
57 * -i: Scanner must be case-insensitive
60 #define _COMPONENT ACPI_COMPILER
61 ACPI_MODULE_NAME ("aslscanner")
64 /* Local prototypes */
67 AslDoLineDirective (void);
73 AslDoCommentType2 (void);
76 AslDoStringLiteral (void);
82 /*! [Begin] no source code translation */
87 LeadNameChar [A-Za-z_]
89 HexDigitChar [A-Fa-f0-9]
94 NameSeg1 {LeadNameChar}{NameChar}
95 NameSeg2 {LeadNameChar}{NameChar}{NameChar}
96 NameSeg3 {LeadNameChar}{NameChar}{NameChar}{NameChar}
97 NameSeg {LeadNameChar}|{NameSeg1}|{NameSeg2}|{NameSeg3}
99 NameString {RootChar}|{RootChar}{NamePath}|[\^]+{NamePath}|{NonEmptyNamePath}
100 NamePath {NonEmptyNamePath}?
101 NonEmptyNamePath {NameSeg}{NamePathTail}*
102 NamePathTail [.]{NameSeg}
108 [\n] { count (0); } /* Handle files with both LF and CR/LF */
109 [\r] { count (0); } /* termination on both Unix and Windows */
113 "/*" { if (!AslDoComment ()) yyterminate (); }
114 "//" { if (!AslDoCommentType2 ()) yyterminate (); }
116 "\"" { if (AslDoStringLiteral ()) return (PARSEOP_STRING_LITERAL); else yyterminate (); }
117 ";" { count (0); return(';'); }
120 0[xX]{HexDigitChar}+ |
121 {DigitChar}+ { AslCompilerlval.i = UtDoConstant ((char *) AslCompilertext);
122 count (1); return (PARSEOP_INTEGER); }
124 "Include" { count (1); return (PARSEOP_INCLUDE); }
125 "External" { count (1); return (PARSEOP_EXTERNAL); }
128 * The #line directive is emitted by the preprocessor and handled
129 * here in the main iASL lexer - simply set the line number and
130 * optionally the current filename.
132 "#line" { AslDoLineDirective ();}
135 /****************************************************************************
139 ****************************************************************************/
141 "AccessAs" { count (1); return (PARSEOP_ACCESSAS); }
142 "Acquire" { count (3); return (PARSEOP_ACQUIRE); }
143 "Add" { count (3); return (PARSEOP_ADD); }
144 "Alias" { count (2); return (PARSEOP_ALIAS); }
145 "And" { count (3); return (PARSEOP_AND); }
146 "BankField" { count (2); return (PARSEOP_BANKFIELD); }
147 "Break" { count (3); return (PARSEOP_BREAK); }
148 "BreakPoint" { count (3); return (PARSEOP_BREAKPOINT); }
149 "Buffer" { count (1); return (PARSEOP_BUFFER); }
150 "Case" { count (3); return (PARSEOP_CASE); }
151 "Concatenate" { count (3); return (PARSEOP_CONCATENATE); }
152 "ConcatenateResTemplate" { count (3); return (PARSEOP_CONCATENATERESTEMPLATE); }
153 "CondRefOf" { count (3); return (PARSEOP_CONDREFOF); }
154 "Connection" { count (2); return (PARSEOP_CONNECTION); }
155 "Continue" { count (3); return (PARSEOP_CONTINUE); }
156 "CopyObject" { count (3); return (PARSEOP_COPYOBJECT); }
157 "CreateBitField" { count (2); return (PARSEOP_CREATEBITFIELD); }
158 "CreateByteField" { count (2); return (PARSEOP_CREATEBYTEFIELD); }
159 "CreateDWordField" { count (2); return (PARSEOP_CREATEDWORDFIELD); }
160 "CreateField" { count (2); return (PARSEOP_CREATEFIELD); }
161 "CreateQWordField" { count (2); return (PARSEOP_CREATEQWORDFIELD); }
162 "CreateWordField" { count (2); return (PARSEOP_CREATEWORDFIELD); }
163 "DataTableRegion" { count (2); return (PARSEOP_DATATABLEREGION); }
164 "Debug" { count (1); return (PARSEOP_DEBUG); }
165 "Decrement" { count (3); return (PARSEOP_DECREMENT); }
166 "Default" { count (3); return (PARSEOP_DEFAULT); }
167 "DefinitionBlock" { count (1); return (PARSEOP_DEFINITIONBLOCK); }
168 "DeRefOf" { count (3); return (PARSEOP_DEREFOF); }
169 "Device" { count (2); return (PARSEOP_DEVICE); }
170 "Divide" { count (3); return (PARSEOP_DIVIDE); }
171 "Eisaid" { count (1); return (PARSEOP_EISAID); }
172 "Else" { count (3); return (PARSEOP_ELSE); }
173 "ElseIf" { count (3); return (PARSEOP_ELSEIF); }
174 "Event" { count (2); return (PARSEOP_EVENT); }
175 "Fatal" { count (3); return (PARSEOP_FATAL); }
176 "Field" { count (2); return (PARSEOP_FIELD); }
177 "FindSetLeftBit" { count (3); return (PARSEOP_FINDSETLEFTBIT); }
178 "FindSetRightBit" { count (3); return (PARSEOP_FINDSETRIGHTBIT); }
179 "FromBcd" { count (3); return (PARSEOP_FROMBCD); }
180 "Function" { count (2); return (PARSEOP_FUNCTION); }
181 "If" { count (3); return (PARSEOP_IF); }
182 "Increment" { count (3); return (PARSEOP_INCREMENT); }
183 "Index" { count (3); return (PARSEOP_INDEX); }
184 "IndexField" { count (2); return (PARSEOP_INDEXFIELD); }
185 "LAnd" { count (3); return (PARSEOP_LAND); }
186 "LEqual" { count (3); return (PARSEOP_LEQUAL); }
187 "LGreater" { count (3); return (PARSEOP_LGREATER); }
188 "LGreaterEqual" { count (3); return (PARSEOP_LGREATEREQUAL); }
189 "LLess" { count (3); return (PARSEOP_LLESS); }
190 "LLessEqual" { count (3); return (PARSEOP_LLESSEQUAL); }
191 "LNot" { count (3); return (PARSEOP_LNOT); }
192 "LNotEqual" { count (3); return (PARSEOP_LNOTEQUAL); }
193 "Load" { count (3); return (PARSEOP_LOAD); }
194 "LoadTable" { count (3); return (PARSEOP_LOADTABLE); }
195 "LOr" { count (3); return (PARSEOP_LOR); }
196 "Match" { count (3); return (PARSEOP_MATCH); }
197 "Method" { count (2); return (PARSEOP_METHOD); }
198 "Mid" { count (3); return (PARSEOP_MID); }
199 "Mod" { count (3); return (PARSEOP_MOD); }
200 "Multiply" { count (3); return (PARSEOP_MULTIPLY); }
201 "Mutex" { count (2); return (PARSEOP_MUTEX); }
202 "Name" { count (2); return (PARSEOP_NAME); }
203 "NAnd" { count (3); return (PARSEOP_NAND); }
204 "Noop" { if (!AcpiGbl_IgnoreNoopOperator) {count (3); return (PARSEOP_NOOP);} }
205 "NOr" { count (3); return (PARSEOP_NOR); }
206 "Not" { count (3); return (PARSEOP_NOT); }
207 "Notify" { count (3); return (PARSEOP_NOTIFY); }
208 "ObjectType" { count (3); return (PARSEOP_OBJECTTYPE); }
209 "Offset" { count (1); return (PARSEOP_OFFSET); }
210 "One" { count (1); return (PARSEOP_ONE); }
211 "Ones" { count (1); return (PARSEOP_ONES); }
212 "OperationRegion" { count (2); return (PARSEOP_OPERATIONREGION); }
213 "Or" { count (3); return (PARSEOP_OR); }
214 "Package" { count (1); return (PARSEOP_PACKAGE); }
215 "PowerResource" { count (2); return (PARSEOP_POWERRESOURCE); }
216 "Processor" { count (2); return (PARSEOP_PROCESSOR); }
217 "RefOf" { count (3); return (PARSEOP_REFOF); }
218 "Release" { count (3); return (PARSEOP_RELEASE); }
219 "Reset" { count (3); return (PARSEOP_RESET); }
220 "Return" { count (3); return (PARSEOP_RETURN); }
221 "Revision" { count (1); return (PARSEOP_REVISION); }
222 "Scope" { count (2); return (PARSEOP_SCOPE); }
223 "ShiftLeft" { count (3); return (PARSEOP_SHIFTLEFT); }
224 "ShiftRight" { count (3); return (PARSEOP_SHIFTRIGHT); }
225 "Signal" { count (3); return (PARSEOP_SIGNAL); }
226 "SizeOf" { count (3); return (PARSEOP_SIZEOF); }
227 "Sleep" { count (3); return (PARSEOP_SLEEP); }
228 "Stall" { count (3); return (PARSEOP_STALL); }
229 "Store" { count (3); return (PARSEOP_STORE); }
230 "Subtract" { count (3); return (PARSEOP_SUBTRACT); }
231 "Switch" { count (3); return (PARSEOP_SWITCH); }
232 "ThermalZone" { count (2); return (PARSEOP_THERMALZONE); }
233 "Timer" { count (3); return (PARSEOP_TIMER); }
234 "ToBcd" { count (3); return (PARSEOP_TOBCD); }
235 "ToBuffer" { count (3); return (PARSEOP_TOBUFFER); }
236 "ToDecimalString" { count (3); return (PARSEOP_TODECIMALSTRING); }
237 "ToHexString" { count (3); return (PARSEOP_TOHEXSTRING); }
238 "ToInteger" { count (3); return (PARSEOP_TOINTEGER); }
239 "ToString" { count (3); return (PARSEOP_TOSTRING); }
240 "ToUuid" { count (1); return (PARSEOP_TOUUID); }
241 "Unicode" { count (1); return (PARSEOP_UNICODE); }
242 "Unload" { count (3); return (PARSEOP_UNLOAD); }
243 "Wait" { count (3); return (PARSEOP_WAIT); }
244 "While" { count (3); return (PARSEOP_WHILE); }
245 "XOr" { count (3); return (PARSEOP_XOR); }
246 "Zero" { count (1); return (PARSEOP_ZERO); }
248 /* Control method arguments and locals */
250 "Arg0" { count (1); return (PARSEOP_ARG0); }
251 "Arg1" { count (1); return (PARSEOP_ARG1); }
252 "Arg2" { count (1); return (PARSEOP_ARG2); }
253 "Arg3" { count (1); return (PARSEOP_ARG3); }
254 "Arg4" { count (1); return (PARSEOP_ARG4); }
255 "Arg5" { count (1); return (PARSEOP_ARG5); }
256 "Arg6" { count (1); return (PARSEOP_ARG6); }
257 "Local0" { count (1); return (PARSEOP_LOCAL0); }
258 "Local1" { count (1); return (PARSEOP_LOCAL1); }
259 "Local2" { count (1); return (PARSEOP_LOCAL2); }
260 "Local3" { count (1); return (PARSEOP_LOCAL3); }
261 "Local4" { count (1); return (PARSEOP_LOCAL4); }
262 "Local5" { count (1); return (PARSEOP_LOCAL5); }
263 "Local6" { count (1); return (PARSEOP_LOCAL6); }
264 "Local7" { count (1); return (PARSEOP_LOCAL7); }
267 /****************************************************************************
269 * Resource Descriptor macros
271 ****************************************************************************/
273 "ResourceTemplate" { count (1); return (PARSEOP_RESOURCETEMPLATE); }
274 "RawDataBuffer" { count (1); return (PARSEOP_DATABUFFER); }
276 "DMA" { count (1); return (PARSEOP_DMA); }
277 "DWordIO" { count (1); return (PARSEOP_DWORDIO); }
278 "DWordMemory" { count (1); return (PARSEOP_DWORDMEMORY); }
279 "DWordSpace" { count (1); return (PARSEOP_DWORDSPACE); }
280 "EndDependentFn" { count (1); return (PARSEOP_ENDDEPENDENTFN); }
281 "ExtendedIO" { count (1); return (PARSEOP_EXTENDEDIO); }
282 "ExtendedMemory" { count (1); return (PARSEOP_EXTENDEDMEMORY); }
283 "ExtendedSpace" { count (1); return (PARSEOP_EXTENDEDSPACE); }
284 "FixedDma" { count (1); return (PARSEOP_FIXEDDMA); }
285 "FixedIO" { count (1); return (PARSEOP_FIXEDIO); }
286 "GpioInt" { count (1); return (PARSEOP_GPIO_INT); }
287 "GpioIo" { count (1); return (PARSEOP_GPIO_IO); }
288 "I2cSerialBus" { count (1); return (PARSEOP_I2C_SERIALBUS); }
289 "Interrupt" { count (1); return (PARSEOP_INTERRUPT); }
290 "IO" { count (1); return (PARSEOP_IO); }
291 "IRQ" { count (1); return (PARSEOP_IRQ); }
292 "IRQNoFlags" { count (1); return (PARSEOP_IRQNOFLAGS); }
293 "Memory24" { count (1); return (PARSEOP_MEMORY24); }
294 "Memory32" { count (1); return (PARSEOP_MEMORY32); }
295 "Memory32Fixed" { count (1); return (PARSEOP_MEMORY32FIXED); }
296 "QWordIO" { count (1); return (PARSEOP_QWORDIO); }
297 "QWordMemory" { count (1); return (PARSEOP_QWORDMEMORY); }
298 "QWordSpace" { count (1); return (PARSEOP_QWORDSPACE); }
299 "Register" { count (1); return (PARSEOP_REGISTER); }
300 "SpiSerialBus" { count (1); return (PARSEOP_SPI_SERIALBUS); }
301 "StartDependentFn" { count (1); return (PARSEOP_STARTDEPENDENTFN); }
302 "StartDependentFnNoPri" { count (1); return (PARSEOP_STARTDEPENDENTFN_NOPRI); }
303 "UartSerialBus" { count (1); return (PARSEOP_UART_SERIALBUS); }
304 "VendorLong" { count (1); return (PARSEOP_VENDORLONG); }
305 "VendorShort" { count (1); return (PARSEOP_VENDORSHORT); }
306 "WordBusNumber" { count (1); return (PARSEOP_WORDBUSNUMBER); }
307 "WordIO" { count (1); return (PARSEOP_WORDIO); }
308 "WordSpace" { count (1); return (PARSEOP_WORDSPACE); }
311 /****************************************************************************
313 * Keywords used as arguments to ASL operators and macros
315 ****************************************************************************/
317 /* AccessAttribKeyword: Serial Bus Attributes (ACPI 5.0) */
319 "AttribQuick" { count (0); return (PARSEOP_ACCESSATTRIB_QUICK); }
320 "AttribSendReceive" { count (0); return (PARSEOP_ACCESSATTRIB_SND_RCV); }
321 "AttribByte" { count (0); return (PARSEOP_ACCESSATTRIB_BYTE); }
322 "AttribWord" { count (0); return (PARSEOP_ACCESSATTRIB_WORD); }
323 "AttribBlock" { count (0); return (PARSEOP_ACCESSATTRIB_BLOCK); }
324 "AttribProcessCall" { count (0); return (PARSEOP_ACCESSATTRIB_WORD_CALL); }
325 "AttribBlockProcessCall" { count (0); return (PARSEOP_ACCESSATTRIB_BLOCK_CALL); }
327 /* AccessAttribKeyword: Legacy synonyms for above (pre-ACPI 5.0) */
329 "SMBQuick" { count (0); return (PARSEOP_ACCESSATTRIB_QUICK); }
330 "SMBSendReceive" { count (0); return (PARSEOP_ACCESSATTRIB_SND_RCV); }
331 "SMBByte" { count (0); return (PARSEOP_ACCESSATTRIB_BYTE); }
332 "SMBWord" { count (0); return (PARSEOP_ACCESSATTRIB_WORD); }
333 "SMBBlock" { count (0); return (PARSEOP_ACCESSATTRIB_BLOCK); }
334 "SMBProcessCall" { count (0); return (PARSEOP_ACCESSATTRIB_WORD_CALL); }
335 "SMBBlockProcessCall" { count (0); return (PARSEOP_ACCESSATTRIB_BLOCK_CALL); }
337 /* AccessTypeKeyword: Field Access Types */
339 "AnyAcc" { count (0); return (PARSEOP_ACCESSTYPE_ANY); }
340 "ByteAcc" { count (0); return (PARSEOP_ACCESSTYPE_BYTE); }
341 "WordAcc" { count (0); return (PARSEOP_ACCESSTYPE_WORD); }
342 "DWordAcc" { count (0); return (PARSEOP_ACCESSTYPE_DWORD); }
343 "QWordAcc" { count (0); return (PARSEOP_ACCESSTYPE_QWORD); }
344 "BufferAcc" { count (0); return (PARSEOP_ACCESSTYPE_BUF); }
346 /* AddressingModeKeyword: Mode - Resource Descriptors (ACPI 5.0) */
348 "AddressingMode7Bit" { count (0); return (PARSEOP_ADDRESSINGMODE_7BIT); }
349 "AddressingMode10Bit" { count (0); return (PARSEOP_ADDRESSINGMODE_10BIT); }
351 /* AddressKeyword: ACPI memory range types */
353 "AddressRangeMemory" { count (0); return (PARSEOP_ADDRESSTYPE_MEMORY); }
354 "AddressRangeReserved" { count (0); return (PARSEOP_ADDRESSTYPE_RESERVED); }
355 "AddressRangeNVS" { count (0); return (PARSEOP_ADDRESSTYPE_NVS); }
356 "AddressRangeACPI" { count (0); return (PARSEOP_ADDRESSTYPE_ACPI); }
358 /* BusMasterKeyword: DMA Bus Mastering */
360 "BusMaster" { count (0); return (PARSEOP_BUSMASTERTYPE_MASTER); }
361 "NotBusMaster" { count (0); return (PARSEOP_BUSMASTERTYPE_NOTMASTER); }
363 /* ByteLengthKeyword: Bits per Byte - Resource Descriptors (ACPI 5.0) */
365 "DataBitsFive" { count (0); return (PARSEOP_BITSPERBYTE_FIVE); }
366 "DataBitsSix" { count (0); return (PARSEOP_BITSPERBYTE_SIX); }
367 "DataBitsSeven" { count (0); return (PARSEOP_BITSPERBYTE_SEVEN); }
368 "DataBitsEight" { count (0); return (PARSEOP_BITSPERBYTE_EIGHT); }
369 "DataBitsNine" { count (0); return (PARSEOP_BITSPERBYTE_NINE); }
371 /* ClockPhaseKeyword: Resource Descriptors (ACPI 5.0) */
373 "ClockPhaseFirst" { count (0); return (PARSEOP_CLOCKPHASE_FIRST); }
374 "ClockPhaseSecond" { count (0); return (PARSEOP_CLOCKPHASE_SECOND); }
376 /* ClockPolarityKeyword: Resource Descriptors (ACPI 5.0) */
378 "ClockPolarityLow" { count (0); return (PARSEOP_CLOCKPOLARITY_LOW); }
379 "ClockPolarityHigh" { count (0); return (PARSEOP_CLOCKPOLARITY_HIGH); }
381 /* DecodeKeyword: Type of Memory Decoding - Resource Descriptors */
383 "PosDecode" { count (0); return (PARSEOP_DECODETYPE_POS); }
384 "SubDecode" { count (0); return (PARSEOP_DECODETYPE_SUB); }
386 /* DmaTypeKeyword: DMA Types - DMA Resource Descriptor */
388 "Compatibility" { count (0); return (PARSEOP_DMATYPE_COMPATIBILITY); }
389 "TypeA" { count (0); return (PARSEOP_DMATYPE_A); }
390 "TypeB" { count (0); return (PARSEOP_DMATYPE_B); }
391 "TypeF" { count (0); return (PARSEOP_DMATYPE_F); }
393 /* EndianKeyword: Endian type - Resource Descriptor (ACPI 5.0) */
395 "LittleEndian" { count (0); return (PARSEOP_ENDIAN_LITTLE); }
396 "BigEndian" { count (0); return (PARSEOP_ENDIAN_BIG); }
398 /* ExtendedAttribKeyword: Bus attributes, AccessAs operator (ACPI 5.0) */
400 "AttribBytes" { count (0); return (PARSEOP_ACCESSATTRIB_MULTIBYTE); }
401 "AttribRawBytes" { count (0); return (PARSEOP_ACCESSATTRIB_RAW_BYTES); }
402 "AttribRawProcessBytes" { count (0); return (PARSEOP_ACCESSATTRIB_RAW_PROCESS); }
404 /* FlowControlKeyword: Resource Descriptors (ACPI 5.0) */
406 "FlowControlHardware" { count (0); return (PARSEOP_FLOWCONTROL_HW); }
407 "FlowControlNone" { count (0); return (PARSEOP_FLOWCONTROL_NONE); }
408 "FlowControlXon" { count (0); return (PARSEOP_FLOWCONTROL_SW); }
410 /* InterruptLevelKeyword: Interrupt Active Types */
412 "ActiveBoth" { count (0); return (PARSEOP_INTLEVEL_ACTIVEBOTH); }
413 "ActiveHigh" { count (0); return (PARSEOP_INTLEVEL_ACTIVEHIGH); }
414 "ActiveLow" { count (0); return (PARSEOP_INTLEVEL_ACTIVELOW); }
416 /* InterruptTypeKeyword: Interrupt Types */
418 "Edge" { count (0); return (PARSEOP_INTTYPE_EDGE); }
419 "Level" { count (0); return (PARSEOP_INTTYPE_LEVEL); }
421 /* IoDecodeKeyword: Type of Memory Decoding - Resource Descriptors */
423 "Decode10" { count (0); return (PARSEOP_IODECODETYPE_10); }
424 "Decode16" { count (0); return (PARSEOP_IODECODETYPE_16); }
426 /* IoRestrictionKeyword: I/O Restriction - GPIO Resource Descriptors (ACPI 5.0) */
428 "IoRestrictionNone" { count (0); return (PARSEOP_IORESTRICT_NONE); }
429 "IoRestrictionInputOnly" { count (0); return (PARSEOP_IORESTRICT_IN); }
430 "IoRestrictionOutputOnly" { count (0); return (PARSEOP_IORESTRICT_OUT); }
431 "IoRestrictionNoneAndPreserve" { count (0); return (PARSEOP_IORESTRICT_PRESERVE); }
433 /* LockRuleKeyword: Global Lock use for Field Operator */
435 "Lock" { count (0); return (PARSEOP_LOCKRULE_LOCK); }
436 "NoLock" { count (0); return (PARSEOP_LOCKRULE_NOLOCK); }
438 /* MatchOpKeyword: Types for Match Operator */
440 "MTR" { count (0); return (PARSEOP_MATCHTYPE_MTR); }
441 "MEQ" { count (0); return (PARSEOP_MATCHTYPE_MEQ); }
442 "MLE" { count (0); return (PARSEOP_MATCHTYPE_MLE); }
443 "MLT" { count (0); return (PARSEOP_MATCHTYPE_MLT); }
444 "MGE" { count (0); return (PARSEOP_MATCHTYPE_MGE); }
445 "MGT" { count (0); return (PARSEOP_MATCHTYPE_MGT); }
447 /* MaxKeyword: Max Range Type - Resource Descriptors */
449 "MaxFixed" { count (0); return (PARSEOP_MAXTYPE_FIXED); }
450 "MaxNotFixed" { count (0); return (PARSEOP_MAXTYPE_NOTFIXED); }
452 /* MemTypeKeyword: Memory Types - Resource Descriptors */
454 "Cacheable" { count (0); return (PARSEOP_MEMTYPE_CACHEABLE); }
455 "WriteCombining" { count (0); return (PARSEOP_MEMTYPE_WRITECOMBINING); }
456 "Prefetchable" { count (0); return (PARSEOP_MEMTYPE_PREFETCHABLE); }
457 "NonCacheable" { count (0); return (PARSEOP_MEMTYPE_NONCACHEABLE); }
459 /* MinKeyword: Min Range Type - Resource Descriptors */
461 "MinFixed" { count (0); return (PARSEOP_MINTYPE_FIXED); }
462 "MinNotFixed" { count (0); return (PARSEOP_MINTYPE_NOTFIXED); }
464 /* ObjectTypeKeyword: ACPI Object Types */
466 "UnknownObj" { count (0); return (PARSEOP_OBJECTTYPE_UNK); }
467 "IntObj" { count (0); return (PARSEOP_OBJECTTYPE_INT); }
468 "StrObj" { count (0); return (PARSEOP_OBJECTTYPE_STR); }
469 "BuffObj" { count (0); return (PARSEOP_OBJECTTYPE_BUF); }
470 "PkgObj" { count (0); return (PARSEOP_OBJECTTYPE_PKG); }
471 "FieldUnitObj" { count (0); return (PARSEOP_OBJECTTYPE_FLD); }
472 "DeviceObj" { count (0); return (PARSEOP_OBJECTTYPE_DEV); }
473 "EventObj" { count (0); return (PARSEOP_OBJECTTYPE_EVT); }
474 "MethodObj" { count (0); return (PARSEOP_OBJECTTYPE_MTH); }
475 "MutexObj" { count (0); return (PARSEOP_OBJECTTYPE_MTX); }
476 "OpRegionObj" { count (0); return (PARSEOP_OBJECTTYPE_OPR); }
477 "PowerResObj" { count (0); return (PARSEOP_OBJECTTYPE_POW); }
478 "ProcessorObj" { count (0); return (PARSEOP_OBJECTTYPE_PRO); }
479 "ThermalZoneObj" { count (0); return (PARSEOP_OBJECTTYPE_THZ); }
480 "BuffFieldObj" { count (0); return (PARSEOP_OBJECTTYPE_BFF); }
481 "DDBHandleObj" { count (0); return (PARSEOP_OBJECTTYPE_DDB); }
483 /* ParityKeyword: Resource Descriptors (ACPI 5.0) */
485 "ParityTypeSpace" { count (0); return (PARSEOP_PARITYTYPE_SPACE); }
486 "ParityTypeMark" { count (0); return (PARSEOP_PARITYTYPE_MARK); }
487 "ParityTypeOdd" { count (0); return (PARSEOP_PARITYTYPE_ODD); }
488 "ParityTypeEven" { count (0); return (PARSEOP_PARITYTYPE_EVEN); }
489 "ParityTypeNone" { count (0); return (PARSEOP_PARITYTYPE_NONE); }
491 /* PinConfigKeyword: Pin Configuration - GPIO Resource Descriptors (ACPI 5.0) */
493 "PullDefault" { count (0); return (PARSEOP_PIN_PULLDEFAULT); }
494 "PullUp" { count (0); return (PARSEOP_PIN_PULLUP); }
495 "PullDown" { count (0); return (PARSEOP_PIN_PULLDOWN); }
496 "PullNone" { count (0); return (PARSEOP_PIN_NOPULL); }
498 /* PolarityKeyword: Resource Descriptors (ACPI 5.0) */
500 "PolarityLow" { count (0); return (PARSEOP_DEVICEPOLARITY_LOW); }
501 "PolarityHigh" { count (0); return (PARSEOP_DEVICEPOLARITY_HIGH); }
503 /* RangeTypeKeyword: I/O Range Types - Resource Descriptors */
505 "ISAOnlyRanges" { count (0); return (PARSEOP_RANGETYPE_ISAONLY); }
506 "NonISAOnlyRanges" { count (0); return (PARSEOP_RANGETYPE_NONISAONLY); }
507 "EntireRange" { count (0); return (PARSEOP_RANGETYPE_ENTIRE); }
509 /* ReadWriteKeyword: Memory Access Types - Resource Descriptors */
511 "ReadWrite" { count (0); return (PARSEOP_READWRITETYPE_BOTH); }
512 "ReadOnly" { count (0); return (PARSEOP_READWRITETYPE_READONLY); }
514 /* RegionSpaceKeyword: Operation Region Address Space Types */
516 "SystemIO" { count (0); return (PARSEOP_REGIONSPACE_IO); }
517 "SystemMemory" { count (0); return (PARSEOP_REGIONSPACE_MEM); }
518 "PCI_Config" { count (0); return (PARSEOP_REGIONSPACE_PCI); }
519 "EmbeddedControl" { count (0); return (PARSEOP_REGIONSPACE_EC); }
520 "SMBus" { count (0); return (PARSEOP_REGIONSPACE_SMBUS); }
521 "SystemCMOS" { count (0); return (PARSEOP_REGIONSPACE_CMOS); }
522 "PciBarTarget" { count (0); return (PARSEOP_REGIONSPACE_PCIBAR); }
523 "IPMI" { count (0); return (PARSEOP_REGIONSPACE_IPMI); }
524 "GeneralPurposeIo" { count (0); return (PARSEOP_REGIONSPACE_GPIO); } /* ACPI 5.0 */
525 "GenericSerialBus" { count (0); return (PARSEOP_REGIONSPACE_GSBUS); } /* ACPI 5.0 */
526 "PCC" { count (0); return (PARSEOP_REGIONSPACE_PCC); } /* ACPI 5.0 */
527 "FFixedHW" { count (0); return (PARSEOP_REGIONSPACE_FFIXEDHW); }
529 /* ResourceTypeKeyword: Resource Usage - Resource Descriptors */
531 "ResourceConsumer" { count (0); return (PARSEOP_RESOURCETYPE_CONSUMER); }
532 "ResourceProducer" { count (0); return (PARSEOP_RESOURCETYPE_PRODUCER); }
534 /* SerializeRuleKeyword: Control Method Serialization */
536 "Serialized" { count (0); return (PARSEOP_SERIALIZERULE_SERIAL); }
537 "NotSerialized" { count (0); return (PARSEOP_SERIALIZERULE_NOTSERIAL); }
539 /* ShareTypeKeyword: Interrupt Sharing - Resource Descriptors */
541 "Shared" { count (0); return (PARSEOP_SHARETYPE_SHARED); }
542 "Exclusive" { count (0); return (PARSEOP_SHARETYPE_EXCLUSIVE); }
543 "SharedAndWake" { count (0); return (PARSEOP_SHARETYPE_SHAREDWAKE); } /* ACPI 5.0 */
544 "ExclusiveAndWake" { count (0); return (PARSEOP_SHARETYPE_EXCLUSIVEWAKE); } /* ACPI 5.0 */
546 /* SlaveModeKeyword: Resource Descriptors (ACPI 5.0) */
548 "ControllerInitiated" { count (0); return (PARSEOP_SLAVEMODE_CONTROLLERINIT); }
549 "DeviceInitiated" { count (0); return (PARSEOP_SLAVEMODE_DEVICEINIT); }
551 /* StopBitsKeyword: Resource Descriptors (ACPI 5.0) */
553 "StopBitsOne" { count (0); return (PARSEOP_STOPBITS_ONE); }
554 "StopBitsOnePlusHalf" { count (0); return (PARSEOP_STOPBITS_ONEPLUSHALF); }
555 "StopBitsTwo" { count (0); return (PARSEOP_STOPBITS_TWO); }
556 "StopBitsZero" { count (0); return (PARSEOP_STOPBITS_ZERO); }
558 /* TransferWidthKeyword: DMA Widths - Fixed DMA Resource Descriptor (ACPI 5.0) */
560 "Width8bit" { count (0); return (PARSEOP_XFERSIZE_8); }
561 "Width16bit" { count (0); return (PARSEOP_XFERSIZE_16); }
562 "Width32bit" { count (0); return (PARSEOP_XFERSIZE_32); }
563 "Width64bit" { count (0); return (PARSEOP_XFERSIZE_64); }
564 "Width128bit" { count (0); return (PARSEOP_XFERSIZE_128); }
565 "Width256bit" { count (0); return (PARSEOP_XFERSIZE_256); }
567 /* TranslationKeyword: Translation Density Types - Resource Descriptors */
569 "SparseTranslation" { count (0); return (PARSEOP_TRANSLATIONTYPE_SPARSE); }
570 "DenseTranslation" { count (0); return (PARSEOP_TRANSLATIONTYPE_DENSE); }
572 /* TypeKeyword: Translation Types - Resource Descriptors */
574 "TypeTranslation" { count (0); return (PARSEOP_TYPE_TRANSLATION); }
575 "TypeStatic" { count (0); return (PARSEOP_TYPE_STATIC); }
577 /* UpdateRuleKeyword: Field Update Rules */
579 "Preserve" { count (0); return (PARSEOP_UPDATERULE_PRESERVE); }
580 "WriteAsOnes" { count (0); return (PARSEOP_UPDATERULE_ONES); }
581 "WriteAsZeros" { count (0); return (PARSEOP_UPDATERULE_ZEROS); }
583 /* WireModeKeyword: SPI Wire Mode - Resource Descriptors (ACPI 5.0) */
585 "FourWireMode" { count (0); return (PARSEOP_WIREMODE_FOUR); }
586 "ThreeWireMode" { count (0); return (PARSEOP_WIREMODE_THREE); }
588 /* XferTypeKeyword: DMA Transfer Types */
590 "Transfer8" { count (0); return (PARSEOP_XFERTYPE_8); }
591 "Transfer8_16" { count (0); return (PARSEOP_XFERTYPE_8_16); }
592 "Transfer16" { count (0); return (PARSEOP_XFERTYPE_16); }
594 /* Predefined compiler names */
596 "__DATE__" { count (0); return (PARSEOP___DATE__); }
597 "__FILE__" { count (0); return (PARSEOP___FILE__); }
598 "__LINE__" { count (0); return (PARSEOP___LINE__); }
599 "__PATH__" { count (0); return (PARSEOP___PATH__); }
602 "{" { count (0); return('{'); }
603 "}" { count (0); return('}'); }
604 "," { count (0); return(','); }
605 "(" { count (0); return('('); }
606 ")" { count (0); return(')'); }
610 s=malloc (ACPI_NAME_SIZE + 1);
611 if (strcmp (AslCompilertext, "\\"))
614 AcpiUtStrupr (AslCompilertext);
616 memcpy (s, AslCompilertext, strlen (AslCompilertext));
617 AslCompilerlval.s = s;
618 DbgPrint (ASL_PARSE_OUTPUT, "NameSeg: %s\n", s);
619 return (PARSEOP_NAMESEG); }
621 {NameString} { char *s;
623 s=malloc (strlen (AslCompilertext)+1);
624 AcpiUtStrupr (AslCompilertext);
625 strcpy (s, AslCompilertext);
626 s[strlen (AslCompilertext)] = 0;
627 AslCompilerlval.s = s;
628 DbgPrint (ASL_PARSE_OUTPUT, "NameString: %s\n", s);
629 return (PARSEOP_NAMESTRING); }
633 AslCompilererror ("Parse error, expecting ASL keyword or name");}
637 "Invalid character (0x%2.2X), expecting ASL keyword or name",
639 AslCompilererror (MsgBuffer);}
641 <<EOF>> { if (AslPopInputFileStack ())
644 return (PARSEOP_INCLUDE_END);};
648 /*! [End] no source code translation !*/
651 * Bring in the scanner support routines
653 #include "aslsupport.l"