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