Home | History | Annotate | Line # | Download | only in compiler
aslhelpers.y revision 1.1
      1  1.1  christos NoEcho('
      2  1.1  christos /******************************************************************************
      3  1.1  christos  *
      4  1.1  christos  * Module Name: aslhelpers.y - helper and option terms
      5  1.1  christos  *
      6  1.1  christos  *****************************************************************************/
      7  1.1  christos 
      8  1.1  christos /*
      9  1.1  christos  * Copyright (C) 2000 - 2016, Intel Corp.
     10  1.1  christos  * All rights reserved.
     11  1.1  christos  *
     12  1.1  christos  * Redistribution and use in source and binary forms, with or without
     13  1.1  christos  * modification, are permitted provided that the following conditions
     14  1.1  christos  * are met:
     15  1.1  christos  * 1. Redistributions of source code must retain the above copyright
     16  1.1  christos  *    notice, this list of conditions, and the following disclaimer,
     17  1.1  christos  *    without modification.
     18  1.1  christos  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
     19  1.1  christos  *    substantially similar to the "NO WARRANTY" disclaimer below
     20  1.1  christos  *    ("Disclaimer") and any redistribution must be conditioned upon
     21  1.1  christos  *    including a substantially similar Disclaimer requirement for further
     22  1.1  christos  *    binary redistribution.
     23  1.1  christos  * 3. Neither the names of the above-listed copyright holders nor the names
     24  1.1  christos  *    of any contributors may be used to endorse or promote products derived
     25  1.1  christos  *    from this software without specific prior written permission.
     26  1.1  christos  *
     27  1.1  christos  * Alternatively, this software may be distributed under the terms of the
     28  1.1  christos  * GNU General Public License ("GPL") version 2 as published by the Free
     29  1.1  christos  * Software Foundation.
     30  1.1  christos  *
     31  1.1  christos  * NO WARRANTY
     32  1.1  christos  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     33  1.1  christos  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     34  1.1  christos  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
     35  1.1  christos  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     36  1.1  christos  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     37  1.1  christos  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     38  1.1  christos  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     39  1.1  christos  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     40  1.1  christos  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     41  1.1  christos  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     42  1.1  christos  * POSSIBILITY OF SUCH DAMAGES.
     43  1.1  christos  */
     44  1.1  christos 
     45  1.1  christos ')
     46  1.1  christos 
     47  1.1  christos 
     48  1.1  christos /*******************************************************************************
     49  1.1  christos  *
     50  1.1  christos  * ASL Helper Terms
     51  1.1  christos  *
     52  1.1  christos  ******************************************************************************/
     53  1.1  christos 
     54  1.1  christos OptionalBusMasterKeyword
     55  1.1  christos     : ','                                   {$$ = TrCreateLeafNode (
     56  1.1  christos                                                 PARSEOP_BUSMASTERTYPE_MASTER);}
     57  1.1  christos     | ',' PARSEOP_BUSMASTERTYPE_MASTER      {$$ = TrCreateLeafNode (
     58  1.1  christos                                                 PARSEOP_BUSMASTERTYPE_MASTER);}
     59  1.1  christos     | ',' PARSEOP_BUSMASTERTYPE_NOTMASTER   {$$ = TrCreateLeafNode (
     60  1.1  christos                                                 PARSEOP_BUSMASTERTYPE_NOTMASTER);}
     61  1.1  christos     ;
     62  1.1  christos 
     63  1.1  christos OptionalAccessAttribTerm
     64  1.1  christos     :                               {$$ = NULL;}
     65  1.1  christos     | ','                           {$$ = NULL;}
     66  1.1  christos     | ',' ByteConstExpr             {$$ = $2;}
     67  1.1  christos     | ',' AccessAttribKeyword       {$$ = $2;}
     68  1.1  christos     ;
     69  1.1  christos 
     70  1.1  christos OptionalAccessSize
     71  1.1  christos     :                               {$$ = TrCreateValuedLeafNode (
     72  1.1  christos                                         PARSEOP_BYTECONST, 0);}
     73  1.1  christos     | ','                           {$$ = TrCreateValuedLeafNode (
     74  1.1  christos                                         PARSEOP_BYTECONST, 0);}
     75  1.1  christos     | ',' ByteConstExpr             {$$ = $2;}
     76  1.1  christos     ;
     77  1.1  christos 
     78  1.1  christos OptionalAddressingMode
     79  1.1  christos     : ','                           {$$ = NULL;}
     80  1.1  christos     | ',' AddressingModeKeyword     {$$ = $2;}
     81  1.1  christos     ;
     82  1.1  christos 
     83  1.1  christos OptionalAddressRange
     84  1.1  christos     :                               {$$ = NULL;}
     85  1.1  christos     | ','                           {$$ = NULL;}
     86  1.1  christos     | ',' AddressKeyword            {$$ = $2;}
     87  1.1  christos     ;
     88  1.1  christos 
     89  1.1  christos OptionalBitsPerByte
     90  1.1  christos     : ','                           {$$ = NULL;}
     91  1.1  christos     | ',' BitsPerByteKeyword        {$$ = $2;}
     92  1.1  christos     ;
     93  1.1  christos 
     94  1.1  christos OptionalBuffer_Last
     95  1.1  christos     :                               {$$ = NULL;}
     96  1.1  christos     | ','                           {$$ = NULL;}
     97  1.1  christos     | ',' RawDataBufferTerm         {$$ = $2;}
     98  1.1  christos     ;
     99  1.1  christos 
    100  1.1  christos OptionalByteConstExpr
    101  1.1  christos     :                               {$$ = NULL;}
    102  1.1  christos     | ','                           {$$ = NULL;}
    103  1.1  christos     | ',' ByteConstExpr             {$$ = $2;}
    104  1.1  christos     ;
    105  1.1  christos 
    106  1.1  christos OptionalDecodeType
    107  1.1  christos     : ','                           {$$ = NULL;}
    108  1.1  christos     | ',' DecodeKeyword             {$$ = $2;}
    109  1.1  christos     ;
    110  1.1  christos 
    111  1.1  christos OptionalDevicePolarity
    112  1.1  christos     : ','                           {$$ = NULL;}
    113  1.1  christos     | ',' DevicePolarityKeyword     {$$ = $2;}
    114  1.1  christos     ;
    115  1.1  christos 
    116  1.1  christos OptionalDWordConstExpr
    117  1.1  christos     :                               {$$ = NULL;}
    118  1.1  christos     | ','                           {$$ = NULL;}
    119  1.1  christos     | ',' DWordConstExpr            {$$ = $2;}
    120  1.1  christos     ;
    121  1.1  christos 
    122  1.1  christos OptionalEndian
    123  1.1  christos     : ','                           {$$ = NULL;}
    124  1.1  christos     | ',' EndianKeyword             {$$ = $2;}
    125  1.1  christos     ;
    126  1.1  christos 
    127  1.1  christos OptionalFlowControl
    128  1.1  christos     : ','                           {$$ = NULL;}
    129  1.1  christos     | ',' FlowControlKeyword        {$$ = $2;}
    130  1.1  christos     ;
    131  1.1  christos 
    132  1.1  christos OptionalIoRestriction
    133  1.1  christos     : ','                           {$$ = NULL;}
    134  1.1  christos     | ',' IoRestrictionKeyword      {$$ = $2;}
    135  1.1  christos     ;
    136  1.1  christos 
    137  1.1  christos OptionalListString
    138  1.1  christos     :                               {$$ = TrCreateValuedLeafNode (
    139  1.1  christos                                         PARSEOP_STRING_LITERAL,
    140  1.1  christos                                         ACPI_TO_INTEGER (""));}   /* Placeholder is a NULL string */
    141  1.1  christos     | ','                           {$$ = TrCreateValuedLeafNode (
    142  1.1  christos                                         PARSEOP_STRING_LITERAL,
    143  1.1  christos                                         ACPI_TO_INTEGER (""));}   /* Placeholder is a NULL string */
    144  1.1  christos     | ',' TermArg                   {$$ = $2;}
    145  1.1  christos     ;
    146  1.1  christos 
    147  1.1  christos OptionalMaxType
    148  1.1  christos     : ','                           {$$ = NULL;}
    149  1.1  christos     | ',' MaxKeyword                {$$ = $2;}
    150  1.1  christos     ;
    151  1.1  christos 
    152  1.1  christos OptionalMemType
    153  1.1  christos     : ','                           {$$ = NULL;}
    154  1.1  christos     | ',' MemTypeKeyword            {$$ = $2;}
    155  1.1  christos     ;
    156  1.1  christos 
    157  1.1  christos OptionalMinType
    158  1.1  christos     : ','                           {$$ = NULL;}
    159  1.1  christos     | ',' MinKeyword                {$$ = $2;}
    160  1.1  christos     ;
    161  1.1  christos 
    162  1.1  christos OptionalNameString
    163  1.1  christos     :                               {$$ = NULL;}
    164  1.1  christos     | ','                           {$$ = NULL;}
    165  1.1  christos     | ',' NameString                {$$ = $2;}
    166  1.1  christos     ;
    167  1.1  christos 
    168  1.1  christos OptionalNameString_Last
    169  1.1  christos     :                               {$$ = NULL;}
    170  1.1  christos     | ','                           {$$ = NULL;}
    171  1.1  christos     | ',' NameString                {$$ = $2;}
    172  1.1  christos     ;
    173  1.1  christos 
    174  1.1  christos OptionalNameString_First
    175  1.1  christos     :                               {$$ = TrCreateLeafNode (
    176  1.1  christos                                         PARSEOP_ZERO);}
    177  1.1  christos     | NameString                    {$$ = $1;}
    178  1.1  christos     ;
    179  1.1  christos 
    180  1.1  christos OptionalObjectTypeKeyword
    181  1.1  christos     :                               {$$ = TrCreateLeafNode (
    182  1.1  christos                                         PARSEOP_OBJECTTYPE_UNK);}
    183  1.1  christos     | ',' ObjectTypeKeyword         {$$ = $2;}
    184  1.1  christos     ;
    185  1.1  christos 
    186  1.1  christos OptionalParityType
    187  1.1  christos     : ','                           {$$ = NULL;}
    188  1.1  christos     | ',' ParityTypeKeyword         {$$ = $2;}
    189  1.1  christos     ;
    190  1.1  christos 
    191  1.1  christos OptionalQWordConstExpr
    192  1.1  christos     :                               {$$ = NULL;}
    193  1.1  christos     | ','                           {$$ = NULL;}
    194  1.1  christos     | ',' QWordConstExpr            {$$ = $2;}
    195  1.1  christos     ;
    196  1.1  christos 
    197  1.1  christos OptionalRangeType
    198  1.1  christos     : ','                           {$$ = NULL;}
    199  1.1  christos     | ',' RangeTypeKeyword          {$$ = $2;}
    200  1.1  christos     ;
    201  1.1  christos 
    202  1.1  christos OptionalReadWriteKeyword
    203  1.1  christos     :                                   {$$ = TrCreateLeafNode (
    204  1.1  christos                                             PARSEOP_READWRITETYPE_BOTH);}
    205  1.1  christos     | PARSEOP_READWRITETYPE_BOTH        {$$ = TrCreateLeafNode (
    206  1.1  christos                                             PARSEOP_READWRITETYPE_BOTH);}
    207  1.1  christos     | PARSEOP_READWRITETYPE_READONLY    {$$ = TrCreateLeafNode (
    208  1.1  christos                                             PARSEOP_READWRITETYPE_READONLY);}
    209  1.1  christos     ;
    210  1.1  christos 
    211  1.1  christos OptionalResourceType_First
    212  1.1  christos     :                               {$$ = TrCreateLeafNode (
    213  1.1  christos                                         PARSEOP_RESOURCETYPE_CONSUMER);}
    214  1.1  christos     | ResourceTypeKeyword           {$$ = $1;}
    215  1.1  christos     ;
    216  1.1  christos 
    217  1.1  christos OptionalResourceType
    218  1.1  christos     :                               {$$ = TrCreateLeafNode (
    219  1.1  christos                                         PARSEOP_RESOURCETYPE_CONSUMER);}
    220  1.1  christos     | ','                           {$$ = TrCreateLeafNode (
    221  1.1  christos                                         PARSEOP_RESOURCETYPE_CONSUMER);}
    222  1.1  christos     | ',' ResourceTypeKeyword       {$$ = $2;}
    223  1.1  christos     ;
    224  1.1  christos 
    225  1.1  christos OptionalSlaveMode
    226  1.1  christos     : ','                           {$$ = NULL;}
    227  1.1  christos     | ',' SlaveModeKeyword          {$$ = $2;}
    228  1.1  christos     ;
    229  1.1  christos 
    230  1.1  christos OptionalShareType
    231  1.1  christos     :                               {$$ = NULL;}
    232  1.1  christos     | ','                           {$$ = NULL;}
    233  1.1  christos     | ',' ShareTypeKeyword          {$$ = $2;}
    234  1.1  christos     ;
    235  1.1  christos 
    236  1.1  christos OptionalShareType_First
    237  1.1  christos     :                               {$$ = NULL;}
    238  1.1  christos     | ShareTypeKeyword              {$$ = $1;}
    239  1.1  christos     ;
    240  1.1  christos 
    241  1.1  christos OptionalStopBits
    242  1.1  christos     : ','                           {$$ = NULL;}
    243  1.1  christos     | ',' StopBitsKeyword           {$$ = $2;}
    244  1.1  christos     ;
    245  1.1  christos 
    246  1.1  christos OptionalStringData
    247  1.1  christos     :                               {$$ = NULL;}
    248  1.1  christos     | ','                           {$$ = NULL;}
    249  1.1  christos     | ',' StringData                {$$ = $2;}
    250  1.1  christos     ;
    251  1.1  christos 
    252  1.1  christos OptionalTranslationType_Last
    253  1.1  christos     :                               {$$ = NULL;}
    254  1.1  christos     | ','                           {$$ = NULL;}
    255  1.1  christos     | ',' TranslationKeyword        {$$ = $2;}
    256  1.1  christos     ;
    257  1.1  christos 
    258  1.1  christos OptionalType
    259  1.1  christos     :                               {$$ = NULL;}
    260  1.1  christos     | ','                           {$$ = NULL;}
    261  1.1  christos     | ',' TypeKeyword               {$$ = $2;}
    262  1.1  christos     ;
    263  1.1  christos 
    264  1.1  christos OptionalType_Last
    265  1.1  christos     :                               {$$ = NULL;}
    266  1.1  christos     | ','                           {$$ = NULL;}
    267  1.1  christos     | ',' TypeKeyword               {$$ = $2;}
    268  1.1  christos     ;
    269  1.1  christos 
    270  1.1  christos OptionalWireMode
    271  1.1  christos     : ','                           {$$ = NULL;}
    272  1.1  christos     | ',' WireModeKeyword           {$$ = $2;}
    273  1.1  christos     ;
    274  1.1  christos 
    275  1.1  christos OptionalWordConstExpr
    276  1.1  christos     : ','                           {$$ = NULL;}
    277  1.1  christos     | ',' WordConstExpr             {$$ = $2;}
    278  1.1  christos     ;
    279  1.1  christos 
    280  1.1  christos OptionalXferSize
    281  1.1  christos     :                               {$$ = TrCreateValuedLeafNode (
    282  1.1  christos                                         PARSEOP_XFERSIZE_32, 2);}
    283  1.1  christos     | ','                           {$$ = TrCreateValuedLeafNode (
    284  1.1  christos                                         PARSEOP_XFERSIZE_32, 2);}
    285  1.1  christos     | ',' XferSizeKeyword           {$$ = $2;}
    286  1.1  christos     ;
    287