Home | History | Annotate | Line # | Download | only in compiler
aslhelpers.y revision 1.1.1.4.2.2
      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.1.4.2.2    martin  * Copyright (C) 2000 - 2020, 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.1.3  christos     : ','                                   {$$ = TrCreateLeafOp (
     56          1.1  christos                                                 PARSEOP_BUSMASTERTYPE_MASTER);}
     57      1.1.1.3  christos     | ',' PARSEOP_BUSMASTERTYPE_MASTER      {$$ = TrCreateLeafOp (
     58          1.1  christos                                                 PARSEOP_BUSMASTERTYPE_MASTER);}
     59      1.1.1.3  christos     | ',' PARSEOP_BUSMASTERTYPE_NOTMASTER   {$$ = TrCreateLeafOp (
     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.1.3  christos     :                               {$$ = TrCreateValuedLeafOp (
     72          1.1  christos                                         PARSEOP_BYTECONST, 0);}
     73      1.1.1.3  christos     | ','                           {$$ = TrCreateValuedLeafOp (
     74          1.1  christos                                         PARSEOP_BYTECONST, 0);}
     75          1.1  christos     | ',' ByteConstExpr             {$$ = $2;}
     76          1.1  christos     ;
     77          1.1  christos 
     78  1.1.1.4.2.1  christos OptionalAccessTypeKeyword   /* Default: AnyAcc */
     79  1.1.1.4.2.1  christos     :                               {$$ = TrCreateLeafOp (
     80  1.1.1.4.2.1  christos                                         PARSEOP_ACCESSTYPE_ANY);}
     81  1.1.1.4.2.1  christos     | ','                           {$$ = TrCreateLeafOp (
     82  1.1.1.4.2.1  christos                                         PARSEOP_ACCESSTYPE_ANY);}
     83  1.1.1.4.2.1  christos     | ',' AccessTypeKeyword         {$$ = $2;}
     84  1.1.1.4.2.1  christos     ;
     85  1.1.1.4.2.1  christos 
     86          1.1  christos OptionalAddressingMode
     87          1.1  christos     : ','                           {$$ = NULL;}
     88          1.1  christos     | ',' AddressingModeKeyword     {$$ = $2;}
     89          1.1  christos     ;
     90          1.1  christos 
     91          1.1  christos OptionalAddressRange
     92          1.1  christos     :                               {$$ = NULL;}
     93          1.1  christos     | ','                           {$$ = NULL;}
     94          1.1  christos     | ',' AddressKeyword            {$$ = $2;}
     95          1.1  christos     ;
     96          1.1  christos 
     97          1.1  christos OptionalBitsPerByte
     98          1.1  christos     : ','                           {$$ = NULL;}
     99          1.1  christos     | ',' BitsPerByteKeyword        {$$ = $2;}
    100          1.1  christos     ;
    101          1.1  christos 
    102          1.1  christos OptionalBuffer_Last
    103          1.1  christos     :                               {$$ = NULL;}
    104          1.1  christos     | ','                           {$$ = NULL;}
    105          1.1  christos     | ',' RawDataBufferTerm         {$$ = $2;}
    106          1.1  christos     ;
    107          1.1  christos 
    108          1.1  christos OptionalByteConstExpr
    109          1.1  christos     :                               {$$ = NULL;}
    110          1.1  christos     | ','                           {$$ = NULL;}
    111          1.1  christos     | ',' ByteConstExpr             {$$ = $2;}
    112          1.1  christos     ;
    113          1.1  christos 
    114          1.1  christos OptionalDecodeType
    115          1.1  christos     : ','                           {$$ = NULL;}
    116          1.1  christos     | ',' DecodeKeyword             {$$ = $2;}
    117          1.1  christos     ;
    118          1.1  christos 
    119          1.1  christos OptionalDevicePolarity
    120          1.1  christos     : ','                           {$$ = NULL;}
    121          1.1  christos     | ',' DevicePolarityKeyword     {$$ = $2;}
    122          1.1  christos     ;
    123          1.1  christos 
    124          1.1  christos OptionalDWordConstExpr
    125          1.1  christos     :                               {$$ = NULL;}
    126          1.1  christos     | ','                           {$$ = NULL;}
    127          1.1  christos     | ',' DWordConstExpr            {$$ = $2;}
    128          1.1  christos     ;
    129          1.1  christos 
    130          1.1  christos OptionalEndian
    131          1.1  christos     : ','                           {$$ = NULL;}
    132          1.1  christos     | ',' EndianKeyword             {$$ = $2;}
    133          1.1  christos     ;
    134          1.1  christos 
    135          1.1  christos OptionalFlowControl
    136          1.1  christos     : ','                           {$$ = NULL;}
    137          1.1  christos     | ',' FlowControlKeyword        {$$ = $2;}
    138          1.1  christos     ;
    139          1.1  christos 
    140          1.1  christos OptionalIoRestriction
    141          1.1  christos     : ','                           {$$ = NULL;}
    142          1.1  christos     | ',' IoRestrictionKeyword      {$$ = $2;}
    143          1.1  christos     ;
    144          1.1  christos 
    145          1.1  christos OptionalListString
    146      1.1.1.3  christos     :                               {$$ = TrCreateValuedLeafOp (
    147          1.1  christos                                         PARSEOP_STRING_LITERAL,
    148          1.1  christos                                         ACPI_TO_INTEGER (""));}   /* Placeholder is a NULL string */
    149      1.1.1.3  christos     | ','                           {$$ = TrCreateValuedLeafOp (
    150          1.1  christos                                         PARSEOP_STRING_LITERAL,
    151          1.1  christos                                         ACPI_TO_INTEGER (""));}   /* Placeholder is a NULL string */
    152          1.1  christos     | ',' TermArg                   {$$ = $2;}
    153          1.1  christos     ;
    154          1.1  christos 
    155  1.1.1.4.2.1  christos OptionalLockRuleKeyword     /* Default: NoLock */
    156  1.1.1.4.2.1  christos     :                               {$$ = TrCreateLeafOp (
    157  1.1.1.4.2.1  christos                                         PARSEOP_LOCKRULE_NOLOCK);}
    158  1.1.1.4.2.1  christos     | ','                           {$$ = TrCreateLeafOp (
    159  1.1.1.4.2.1  christos                                         PARSEOP_LOCKRULE_NOLOCK);}
    160  1.1.1.4.2.1  christos     | ',' LockRuleKeyword           {$$ = $2;}
    161  1.1.1.4.2.1  christos     ;
    162  1.1.1.4.2.1  christos 
    163          1.1  christos OptionalMaxType
    164          1.1  christos     : ','                           {$$ = NULL;}
    165          1.1  christos     | ',' MaxKeyword                {$$ = $2;}
    166          1.1  christos     ;
    167          1.1  christos 
    168          1.1  christos OptionalMemType
    169          1.1  christos     : ','                           {$$ = NULL;}
    170          1.1  christos     | ',' MemTypeKeyword            {$$ = $2;}
    171          1.1  christos     ;
    172          1.1  christos 
    173          1.1  christos OptionalMinType
    174          1.1  christos     : ','                           {$$ = NULL;}
    175          1.1  christos     | ',' MinKeyword                {$$ = $2;}
    176          1.1  christos     ;
    177          1.1  christos 
    178          1.1  christos OptionalNameString
    179          1.1  christos     :                               {$$ = NULL;}
    180          1.1  christos     | ','                           {$$ = NULL;}
    181          1.1  christos     | ',' NameString                {$$ = $2;}
    182          1.1  christos     ;
    183          1.1  christos 
    184          1.1  christos OptionalNameString_Last
    185          1.1  christos     :                               {$$ = NULL;}
    186          1.1  christos     | ','                           {$$ = NULL;}
    187          1.1  christos     | ',' NameString                {$$ = $2;}
    188          1.1  christos     ;
    189          1.1  christos 
    190          1.1  christos OptionalNameString_First
    191      1.1.1.3  christos     :                               {$$ = TrCreateLeafOp (
    192          1.1  christos                                         PARSEOP_ZERO);}
    193          1.1  christos     | NameString                    {$$ = $1;}
    194          1.1  christos     ;
    195          1.1  christos 
    196          1.1  christos OptionalObjectTypeKeyword
    197      1.1.1.3  christos     :                               {$$ = TrCreateLeafOp (
    198          1.1  christos                                         PARSEOP_OBJECTTYPE_UNK);}
    199          1.1  christos     | ',' ObjectTypeKeyword         {$$ = $2;}
    200          1.1  christos     ;
    201          1.1  christos 
    202          1.1  christos OptionalParityType
    203          1.1  christos     : ','                           {$$ = NULL;}
    204          1.1  christos     | ',' ParityTypeKeyword         {$$ = $2;}
    205          1.1  christos     ;
    206          1.1  christos 
    207          1.1  christos OptionalQWordConstExpr
    208          1.1  christos     :                               {$$ = NULL;}
    209          1.1  christos     | ','                           {$$ = NULL;}
    210          1.1  christos     | ',' QWordConstExpr            {$$ = $2;}
    211          1.1  christos     ;
    212          1.1  christos 
    213          1.1  christos OptionalRangeType
    214          1.1  christos     : ','                           {$$ = NULL;}
    215          1.1  christos     | ',' RangeTypeKeyword          {$$ = $2;}
    216          1.1  christos     ;
    217          1.1  christos 
    218          1.1  christos OptionalReadWriteKeyword
    219      1.1.1.3  christos     :                                   {$$ = TrCreateLeafOp (
    220          1.1  christos                                             PARSEOP_READWRITETYPE_BOTH);}
    221      1.1.1.3  christos     | PARSEOP_READWRITETYPE_BOTH        {$$ = TrCreateLeafOp (
    222          1.1  christos                                             PARSEOP_READWRITETYPE_BOTH);}
    223      1.1.1.3  christos     | PARSEOP_READWRITETYPE_READONLY    {$$ = TrCreateLeafOp (
    224          1.1  christos                                             PARSEOP_READWRITETYPE_READONLY);}
    225          1.1  christos     ;
    226          1.1  christos 
    227          1.1  christos OptionalResourceType_First
    228      1.1.1.3  christos     :                               {$$ = TrCreateLeafOp (
    229          1.1  christos                                         PARSEOP_RESOURCETYPE_CONSUMER);}
    230          1.1  christos     | ResourceTypeKeyword           {$$ = $1;}
    231          1.1  christos     ;
    232          1.1  christos 
    233          1.1  christos OptionalResourceType
    234      1.1.1.3  christos     :                               {$$ = TrCreateLeafOp (
    235          1.1  christos                                         PARSEOP_RESOURCETYPE_CONSUMER);}
    236      1.1.1.3  christos     | ','                           {$$ = TrCreateLeafOp (
    237          1.1  christos                                         PARSEOP_RESOURCETYPE_CONSUMER);}
    238          1.1  christos     | ',' ResourceTypeKeyword       {$$ = $2;}
    239          1.1  christos     ;
    240          1.1  christos 
    241      1.1.1.3  christos /* Same as above except default is producer */
    242      1.1.1.3  christos OptionalProducerResourceType
    243      1.1.1.3  christos     :                               {$$ = TrCreateLeafOp (
    244      1.1.1.3  christos                                         PARSEOP_RESOURCETYPE_PRODUCER);}
    245      1.1.1.3  christos     | ','                           {$$ = TrCreateLeafOp (
    246      1.1.1.3  christos                                         PARSEOP_RESOURCETYPE_PRODUCER);}
    247      1.1.1.3  christos     | ',' ResourceTypeKeyword       {$$ = $2;}
    248      1.1.1.3  christos     ;
    249      1.1.1.3  christos 
    250          1.1  christos OptionalSlaveMode
    251          1.1  christos     : ','                           {$$ = NULL;}
    252          1.1  christos     | ',' SlaveModeKeyword          {$$ = $2;}
    253          1.1  christos     ;
    254          1.1  christos 
    255          1.1  christos OptionalShareType
    256          1.1  christos     :                               {$$ = NULL;}
    257          1.1  christos     | ','                           {$$ = NULL;}
    258          1.1  christos     | ',' ShareTypeKeyword          {$$ = $2;}
    259          1.1  christos     ;
    260          1.1  christos 
    261          1.1  christos OptionalShareType_First
    262          1.1  christos     :                               {$$ = NULL;}
    263          1.1  christos     | ShareTypeKeyword              {$$ = $1;}
    264          1.1  christos     ;
    265          1.1  christos 
    266          1.1  christos OptionalStopBits
    267          1.1  christos     : ','                           {$$ = NULL;}
    268          1.1  christos     | ',' StopBitsKeyword           {$$ = $2;}
    269          1.1  christos     ;
    270          1.1  christos 
    271          1.1  christos OptionalStringData
    272          1.1  christos     :                               {$$ = NULL;}
    273          1.1  christos     | ','                           {$$ = NULL;}
    274          1.1  christos     | ',' StringData                {$$ = $2;}
    275          1.1  christos     ;
    276          1.1  christos 
    277  1.1.1.4.2.1  christos OptionalSyncLevel           /* Default: 0 */
    278  1.1.1.4.2.1  christos     :                               {$$ = TrCreateValuedLeafOp (
    279  1.1.1.4.2.1  christos                                         PARSEOP_BYTECONST, 0);}
    280  1.1.1.4.2.1  christos     | ','                           {$$ = TrCreateValuedLeafOp (
    281  1.1.1.4.2.1  christos                                         PARSEOP_BYTECONST, 0);}
    282  1.1.1.4.2.1  christos     | ',' ByteConstExpr             {$$ = $2;}
    283  1.1.1.4.2.1  christos     ;
    284  1.1.1.4.2.1  christos 
    285          1.1  christos OptionalTranslationType_Last
    286          1.1  christos     :                               {$$ = NULL;}
    287          1.1  christos     | ','                           {$$ = NULL;}
    288          1.1  christos     | ',' TranslationKeyword        {$$ = $2;}
    289          1.1  christos     ;
    290          1.1  christos 
    291          1.1  christos OptionalType
    292          1.1  christos     :                               {$$ = NULL;}
    293          1.1  christos     | ','                           {$$ = NULL;}
    294          1.1  christos     | ',' TypeKeyword               {$$ = $2;}
    295          1.1  christos     ;
    296          1.1  christos 
    297          1.1  christos OptionalType_Last
    298          1.1  christos     :                               {$$ = NULL;}
    299          1.1  christos     | ','                           {$$ = NULL;}
    300          1.1  christos     | ',' TypeKeyword               {$$ = $2;}
    301          1.1  christos     ;
    302          1.1  christos 
    303  1.1.1.4.2.1  christos OptionalUpdateRuleKeyword   /* Default: Preserve */
    304  1.1.1.4.2.1  christos     :                               {$$ = TrCreateLeafOp (
    305  1.1.1.4.2.1  christos                                         PARSEOP_UPDATERULE_PRESERVE);}
    306  1.1.1.4.2.1  christos     | ','                           {$$ = TrCreateLeafOp (
    307  1.1.1.4.2.1  christos                                         PARSEOP_UPDATERULE_PRESERVE);}
    308  1.1.1.4.2.1  christos     | ',' UpdateRuleKeyword         {$$ = $2;}
    309  1.1.1.4.2.1  christos     ;
    310  1.1.1.4.2.1  christos 
    311          1.1  christos OptionalWireMode
    312          1.1  christos     : ','                           {$$ = NULL;}
    313          1.1  christos     | ',' WireModeKeyword           {$$ = $2;}
    314          1.1  christos     ;
    315          1.1  christos 
    316          1.1  christos OptionalWordConstExpr
    317          1.1  christos     : ','                           {$$ = NULL;}
    318          1.1  christos     | ',' WordConstExpr             {$$ = $2;}
    319          1.1  christos     ;
    320          1.1  christos 
    321          1.1  christos OptionalXferSize
    322      1.1.1.3  christos     :                               {$$ = TrCreateValuedLeafOp (
    323          1.1  christos                                         PARSEOP_XFERSIZE_32, 2);}
    324      1.1.1.3  christos     | ','                           {$$ = TrCreateValuedLeafOp (
    325          1.1  christos                                         PARSEOP_XFERSIZE_32, 2);}
    326          1.1  christos     | ',' XferSizeKeyword           {$$ = $2;}
    327          1.1  christos     ;
    328