Home | History | Annotate | Line # | Download | only in compiler
aslresources.y revision 1.1.1.8
      1 NoEcho('
      2 /******************************************************************************
      3  *
      4  * Module Name: aslresources.y - Bison/Yacc production rules for resources
      5  *                             - Keep this file synched with the
      6  *                               CvParseOpBlockType function in cvcompiler.c
      7  *
      8  *****************************************************************************/
      9 
     10 /*
     11  * Copyright (C) 2000 - 2019, Intel Corp.
     12  * All rights reserved.
     13  *
     14  * Redistribution and use in source and binary forms, with or without
     15  * modification, are permitted provided that the following conditions
     16  * are met:
     17  * 1. Redistributions of source code must retain the above copyright
     18  *    notice, this list of conditions, and the following disclaimer,
     19  *    without modification.
     20  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
     21  *    substantially similar to the "NO WARRANTY" disclaimer below
     22  *    ("Disclaimer") and any redistribution must be conditioned upon
     23  *    including a substantially similar Disclaimer requirement for further
     24  *    binary redistribution.
     25  * 3. Neither the names of the above-listed copyright holders nor the names
     26  *    of any contributors may be used to endorse or promote products derived
     27  *    from this software without specific prior written permission.
     28  *
     29  * Alternatively, this software may be distributed under the terms of the
     30  * GNU General Public License ("GPL") version 2 as published by the Free
     31  * Software Foundation.
     32  *
     33  * NO WARRANTY
     34  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     35  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     36  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
     37  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     38  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     39  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     40  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     41  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     42  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     43  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     44  * POSSIBILITY OF SUCH DAMAGES.
     45  */
     46 
     47 ')
     48 
     49 
     50 /*******************************************************************************
     51  *
     52  * ASL Resource Template Terms
     53  *
     54  ******************************************************************************/
     55 
     56 /*
     57  * Note: Create two default nodes to allow conversion to a Buffer AML opcode
     58  * Also, insert the EndTag at the end of the template.
     59  */
     60 ResourceTemplateTerm
     61     : PARSEOP_RESOURCETEMPLATE      {COMMENT_CAPTURE_OFF;}
     62         OptionalParentheses
     63         '{'
     64         ResourceMacroList '}'       {$$ = TrCreateOp (PARSEOP_RESOURCETEMPLATE,4,
     65                                           TrCreateLeafOp (PARSEOP_DEFAULT_ARG),
     66                                           TrCreateLeafOp (PARSEOP_DEFAULT_ARG),
     67                                           $5,
     68                                           TrCreateLeafOp (PARSEOP_ENDTAG));
     69                                      COMMENT_CAPTURE_ON;}
     70     ;
     71 
     72 OptionalParentheses
     73     :                               {$$ = NULL;}
     74     | PARSEOP_OPEN_PAREN
     75         PARSEOP_CLOSE_PAREN         {$$ = NULL;}
     76     ;
     77 
     78 ResourceMacroList
     79     :                               {$$ = NULL;}
     80     | ResourceMacroList
     81         ResourceMacroTerm           {$$ = TrLinkPeerOp ($1,$2);}
     82     ;
     83 
     84 ResourceMacroTerm
     85     : DMATerm                       {}
     86     | DWordIOTerm                   {}
     87     | DWordMemoryTerm               {}
     88     | DWordSpaceTerm                {}
     89     | EndDependentFnTerm            {}
     90     | ExtendedIOTerm                {}
     91     | ExtendedMemoryTerm            {}
     92     | ExtendedSpaceTerm             {}
     93     | FixedDmaTerm                  {}
     94     | FixedIOTerm                   {}
     95     | GpioIntTerm                   {}
     96     | GpioIoTerm                    {}
     97     | I2cSerialBusTerm              {}
     98     | I2cSerialBusTermV2            {}
     99     | InterruptTerm                 {}
    100     | IOTerm                        {}
    101     | IRQNoFlagsTerm                {}
    102     | IRQTerm                       {}
    103     | Memory24Term                  {}
    104     | Memory32FixedTerm             {}
    105     | Memory32Term                  {}
    106     | PinConfigTerm                 {}
    107     | PinFunctionTerm               {}
    108     | PinGroupTerm                  {}
    109     | PinGroupConfigTerm            {}
    110     | PinGroupFunctionTerm          {}
    111     | QWordIOTerm                   {}
    112     | QWordMemoryTerm               {}
    113     | QWordSpaceTerm                {}
    114     | RegisterTerm                  {}
    115     | SpiSerialBusTerm              {}
    116     | SpiSerialBusTermV2            {}
    117     | StartDependentFnNoPriTerm     {}
    118     | StartDependentFnTerm          {}
    119     | UartSerialBusTerm             {}
    120     | UartSerialBusTermV2           {}
    121     | VendorLongTerm                {}
    122     | VendorShortTerm               {}
    123     | WordBusNumberTerm             {}
    124     | WordIOTerm                    {}
    125     | WordSpaceTerm                 {}
    126     ;
    127 
    128 DMATerm
    129     : PARSEOP_DMA
    130         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_DMA);}
    131         DMATypeKeyword
    132         OptionalBusMasterKeyword
    133         ',' XferTypeKeyword
    134         OptionalNameString_Last
    135         PARSEOP_CLOSE_PAREN '{'
    136             ByteList '}'            {$$ = TrLinkOpChildren ($<n>3,5,$4,$5,$7,$8,$11);}
    137     | PARSEOP_DMA
    138         PARSEOP_OPEN_PAREN
    139         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    140     ;
    141 
    142 DWordIOTerm
    143     : PARSEOP_DWORDIO
    144         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_DWORDIO);}
    145         OptionalResourceType_First
    146         OptionalMinType
    147         OptionalMaxType
    148         OptionalDecodeType
    149         OptionalRangeType
    150         ',' DWordConstExpr
    151         ',' DWordConstExpr
    152         ',' DWordConstExpr
    153         ',' DWordConstExpr
    154         ',' DWordConstExpr
    155         OptionalByteConstExpr
    156         OptionalStringData
    157         OptionalNameString
    158         OptionalType
    159         OptionalTranslationType_Last
    160         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,15,
    161                                         $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);}
    162     | PARSEOP_DWORDIO
    163         PARSEOP_OPEN_PAREN
    164         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    165     ;
    166 
    167 DWordMemoryTerm
    168     : PARSEOP_DWORDMEMORY
    169         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_DWORDMEMORY);}
    170         OptionalResourceType_First
    171         OptionalDecodeType
    172         OptionalMinType
    173         OptionalMaxType
    174         OptionalMemType
    175         ',' OptionalReadWriteKeyword
    176         ',' DWordConstExpr
    177         ',' DWordConstExpr
    178         ',' DWordConstExpr
    179         ',' DWordConstExpr
    180         ',' DWordConstExpr
    181         OptionalByteConstExpr
    182         OptionalStringData
    183         OptionalNameString
    184         OptionalAddressRange
    185         OptionalType_Last
    186         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,16,
    187                                         $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24,$25);}
    188     | PARSEOP_DWORDMEMORY
    189         PARSEOP_OPEN_PAREN
    190         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    191     ;
    192 
    193 DWordSpaceTerm
    194     : PARSEOP_DWORDSPACE
    195         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_DWORDSPACE);}
    196         ByteConstExpr               {UtCheckIntegerRange ($4, 0xC0, 0xFF);}
    197         OptionalResourceType
    198         OptionalDecodeType
    199         OptionalMinType
    200         OptionalMaxType
    201         ',' ByteConstExpr
    202         ',' DWordConstExpr
    203         ',' DWordConstExpr
    204         ',' DWordConstExpr
    205         ',' DWordConstExpr
    206         ',' DWordConstExpr
    207         OptionalByteConstExpr
    208         OptionalStringData
    209         OptionalNameString_Last
    210         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,14,
    211                                         $4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);}
    212     | PARSEOP_DWORDSPACE
    213         PARSEOP_OPEN_PAREN
    214         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    215     ;
    216 
    217 EndDependentFnTerm
    218     : PARSEOP_ENDDEPENDENTFN
    219         PARSEOP_OPEN_PAREN
    220         PARSEOP_CLOSE_PAREN         {$$ = TrCreateLeafOp (PARSEOP_ENDDEPENDENTFN);}
    221     | PARSEOP_ENDDEPENDENTFN
    222         PARSEOP_OPEN_PAREN
    223         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    224     ;
    225 
    226 ExtendedIOTerm
    227     : PARSEOP_EXTENDEDIO
    228         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_EXTENDEDIO);}
    229         OptionalResourceType_First
    230         OptionalMinType
    231         OptionalMaxType
    232         OptionalDecodeType
    233         OptionalRangeType
    234         ',' QWordConstExpr
    235         ',' QWordConstExpr
    236         ',' QWordConstExpr
    237         ',' QWordConstExpr
    238         ',' QWordConstExpr
    239         OptionalQWordConstExpr
    240         OptionalNameString
    241         OptionalType
    242         OptionalTranslationType_Last
    243         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,14,
    244                                         $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22);}
    245     | PARSEOP_EXTENDEDIO
    246         PARSEOP_OPEN_PAREN
    247         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    248     ;
    249 
    250 ExtendedMemoryTerm
    251     : PARSEOP_EXTENDEDMEMORY
    252         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_EXTENDEDMEMORY);}
    253         OptionalResourceType_First
    254         OptionalDecodeType
    255         OptionalMinType
    256         OptionalMaxType
    257         OptionalMemType
    258         ',' OptionalReadWriteKeyword
    259         ',' QWordConstExpr
    260         ',' QWordConstExpr
    261         ',' QWordConstExpr
    262         ',' QWordConstExpr
    263         ',' QWordConstExpr
    264         OptionalQWordConstExpr
    265         OptionalNameString
    266         OptionalAddressRange
    267         OptionalType_Last
    268         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,15,
    269                                         $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24);}
    270     | PARSEOP_EXTENDEDMEMORY
    271         PARSEOP_OPEN_PAREN
    272         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    273     ;
    274 
    275 ExtendedSpaceTerm
    276     : PARSEOP_EXTENDEDSPACE PARSEOP_OPEN_PAREN     {$<n>$ = TrCreateLeafOp (PARSEOP_EXTENDEDSPACE);}
    277         ByteConstExpr               {UtCheckIntegerRange ($4, 0xC0, 0xFF);}
    278         OptionalResourceType
    279         OptionalDecodeType
    280         OptionalMinType
    281         OptionalMaxType
    282         ',' ByteConstExpr
    283         ',' QWordConstExpr
    284         ',' QWordConstExpr
    285         ',' QWordConstExpr
    286         ',' QWordConstExpr
    287         ',' QWordConstExpr
    288         OptionalQWordConstExpr
    289         OptionalNameString_Last
    290         PARSEOP_CLOSE_PAREN                         {$$ = TrLinkOpChildren ($<n>3,13,
    291                                         $4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23);}
    292     | PARSEOP_EXTENDEDSPACE
    293         PARSEOP_OPEN_PAREN
    294         error PARSEOP_CLOSE_PAREN                   {$$ = AslDoError(); yyclearin;}
    295     ;
    296 
    297 FixedDmaTerm
    298     : PARSEOP_FIXEDDMA
    299         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_FIXEDDMA);}
    300         WordConstExpr               /* 04: DMA RequestLines */
    301         ',' WordConstExpr           /* 06: DMA Channels */
    302         OptionalXferSize            /* 07: DMA TransferSize */
    303         OptionalNameString          /* 08: DescriptorName */
    304         PARSEOP_CLOSE_PAREN                         {$$ = TrLinkOpChildren ($<n>3,4,$4,$6,$7,$8);}
    305     | PARSEOP_FIXEDDMA
    306         PARSEOP_OPEN_PAREN
    307         error PARSEOP_CLOSE_PAREN                   {$$ = AslDoError(); yyclearin;}
    308     ;
    309 
    310 FixedIOTerm
    311     : PARSEOP_FIXEDIO
    312         PARSEOP_OPEN_PAREN           {$<n>$ = TrCreateLeafOp (PARSEOP_FIXEDIO);}
    313         WordConstExpr
    314         ',' ByteConstExpr
    315         OptionalNameString_Last
    316         PARSEOP_CLOSE_PAREN                         {$$ = TrLinkOpChildren ($<n>3,3,$4,$6,$7);}
    317     | PARSEOP_FIXEDIO
    318         PARSEOP_OPEN_PAREN
    319         error PARSEOP_CLOSE_PAREN                   {$$ = AslDoError(); yyclearin;}
    320     ;
    321 
    322 GpioIntTerm
    323     : PARSEOP_GPIO_INT
    324         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_GPIO_INT);}
    325         InterruptTypeKeyword        /* 04: InterruptType */
    326         ',' InterruptLevel          /* 06: InterruptLevel */
    327         OptionalShareType           /* 07: SharedType */
    328         ',' PinConfigByte           /* 09: PinConfig */
    329         OptionalWordConstExpr       /* 10: DebounceTimeout */
    330         ',' StringData              /* 12: ResourceSource */
    331         OptionalByteConstExpr       /* 13: ResourceSourceIndex */
    332         OptionalResourceType        /* 14: ResourceType */
    333         OptionalNameString          /* 15: DescriptorName */
    334         OptionalBuffer_Last         /* 16: VendorData */
    335         PARSEOP_CLOSE_PAREN '{'
    336             DWordConstExpr '}'      {$$ = TrLinkOpChildren ($<n>3,11,
    337                                         $4,$6,$7,$9,$10,$12,$13,$14,$15,$16,$19);}
    338     | PARSEOP_GPIO_INT
    339         PARSEOP_OPEN_PAREN
    340         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    341     ;
    342 
    343 GpioIoTerm
    344     : PARSEOP_GPIO_IO
    345         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_GPIO_IO);}
    346         OptionalShareType_First     /* 04: SharedType */
    347         ',' PinConfigByte           /* 06: PinConfig */
    348         OptionalWordConstExpr       /* 07: DebounceTimeout */
    349         OptionalWordConstExpr       /* 08: DriveStrength */
    350         OptionalIoRestriction       /* 09: IoRestriction */
    351         ',' StringData              /* 11: ResourceSource */
    352         OptionalByteConstExpr       /* 12: ResourceSourceIndex */
    353         OptionalResourceType        /* 13: ResourceType */
    354         OptionalNameString          /* 14: DescriptorName */
    355         OptionalBuffer_Last         /* 15: VendorData */
    356         PARSEOP_CLOSE_PAREN '{'
    357             DWordList '}'           {$$ = TrLinkOpChildren ($<n>3,11,
    358                                         $4,$6,$7,$8,$9,$11,$12,$13,$14,$15,$18);}
    359     | PARSEOP_GPIO_IO
    360         PARSEOP_OPEN_PAREN
    361         error PARSEOP_CLOSE_PAREN                   {$$ = AslDoError(); yyclearin;}
    362     ;
    363 
    364 I2cSerialBusTerm
    365     : PARSEOP_I2C_SERIALBUS
    366         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_I2C_SERIALBUS);}
    367         WordConstExpr               /* 04: SlaveAddress */
    368         OptionalSlaveMode           /* 05: SlaveMode */
    369         ',' DWordConstExpr          /* 07: ConnectionSpeed */
    370         OptionalAddressingMode      /* 08: AddressingMode */
    371         ',' StringData              /* 10: ResourceSource */
    372         OptionalByteConstExpr       /* 11: ResourceSourceIndex */
    373         OptionalResourceType        /* 12: ResourceType */
    374         OptionalNameString          /* 13: DescriptorName */
    375         OptionalBuffer_Last         /* 14: VendorData */
    376         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,10,
    377                                         $4,$5,$7,$8,$10,$11,$12,$13,
    378                                         TrCreateLeafOp (PARSEOP_DEFAULT_ARG),$14);}
    379     | PARSEOP_I2C_SERIALBUS
    380         PARSEOP_OPEN_PAREN
    381         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    382     ;
    383 
    384 I2cSerialBusTermV2
    385     : PARSEOP_I2C_SERIALBUS_V2
    386         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_I2C_SERIALBUS_V2);}
    387         WordConstExpr               /* 04: SlaveAddress */
    388         OptionalSlaveMode           /* 05: SlaveMode */
    389         ',' DWordConstExpr          /* 07: ConnectionSpeed */
    390         OptionalAddressingMode      /* 08: AddressingMode */
    391         ',' StringData              /* 10: ResourceSource */
    392         OptionalByteConstExpr       /* 11: ResourceSourceIndex */
    393         OptionalResourceType        /* 12: ResourceType */
    394         OptionalNameString          /* 13: DescriptorName */
    395         OptionalShareType           /* 14: Share */
    396         OptionalBuffer_Last         /* 15: VendorData */
    397         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,10,
    398                                         $4,$5,$7,$8,$10,$11,$12,$13,$14,$15);}
    399     | PARSEOP_I2C_SERIALBUS_V2
    400         PARSEOP_OPEN_PAREN
    401         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    402     ;
    403 
    404 InterruptTerm
    405     : PARSEOP_INTERRUPT
    406         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_INTERRUPT);}
    407         OptionalResourceType_First
    408         ',' InterruptTypeKeyword
    409         ',' InterruptLevel
    410         OptionalShareType
    411         OptionalByteConstExpr
    412         OptionalStringData
    413         OptionalNameString_Last
    414         PARSEOP_CLOSE_PAREN '{'
    415             DWordList '}'           {$$ = TrLinkOpChildren ($<n>3,8,
    416                                         $4,$6,$8,$9,$10,$11,$12,$15);}
    417     | PARSEOP_INTERRUPT
    418         PARSEOP_OPEN_PAREN
    419         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    420     ;
    421 
    422 IOTerm
    423     : PARSEOP_IO
    424         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_IO);}
    425         IODecodeKeyword
    426         ',' WordConstExpr
    427         ',' WordConstExpr
    428         ',' ByteConstExpr
    429         ',' ByteConstExpr
    430         OptionalNameString_Last
    431         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);}
    432     | PARSEOP_IO
    433         PARSEOP_OPEN_PAREN
    434         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    435     ;
    436 
    437 IRQNoFlagsTerm
    438     : PARSEOP_IRQNOFLAGS
    439         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_IRQNOFLAGS);}
    440         OptionalNameString_First
    441         PARSEOP_CLOSE_PAREN '{'
    442             ByteList '}'            {$$ = TrLinkOpChildren ($<n>3,2,$4,$7);}
    443     | PARSEOP_IRQNOFLAGS
    444         PARSEOP_OPEN_PAREN
    445         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    446     ;
    447 
    448 IRQTerm
    449     : PARSEOP_IRQ
    450         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_IRQ);}
    451         InterruptTypeKeyword
    452         ',' InterruptLevel
    453         OptionalShareType
    454         OptionalNameString_Last
    455         PARSEOP_CLOSE_PAREN '{'
    456             ByteList '}'            {$$ = TrLinkOpChildren ($<n>3,5,$4,$6,$7,$8,$11);}
    457     | PARSEOP_IRQ
    458         PARSEOP_OPEN_PAREN
    459         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    460     ;
    461 
    462 Memory24Term
    463     : PARSEOP_MEMORY24
    464         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_MEMORY24);}
    465         OptionalReadWriteKeyword
    466         ',' WordConstExpr
    467         ',' WordConstExpr
    468         ',' WordConstExpr
    469         ',' WordConstExpr
    470         OptionalNameString_Last
    471         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);}
    472     | PARSEOP_MEMORY24
    473         PARSEOP_OPEN_PAREN
    474         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    475     ;
    476 
    477 Memory32FixedTerm
    478     : PARSEOP_MEMORY32FIXED
    479         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_MEMORY32FIXED);}
    480         OptionalReadWriteKeyword
    481         ',' DWordConstExpr
    482         ',' DWordConstExpr
    483         OptionalNameString_Last
    484         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,4,$4,$6,$8,$9);}
    485     | PARSEOP_MEMORY32FIXED
    486         PARSEOP_OPEN_PAREN
    487         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    488     ;
    489 
    490 Memory32Term
    491     : PARSEOP_MEMORY32
    492         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_MEMORY32);}
    493         OptionalReadWriteKeyword
    494         ',' DWordConstExpr
    495         ',' DWordConstExpr
    496         ',' DWordConstExpr
    497         ',' DWordConstExpr
    498         OptionalNameString_Last
    499         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);}
    500     | PARSEOP_MEMORY32
    501         PARSEOP_OPEN_PAREN
    502         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    503     ;
    504 
    505 PinConfigTerm
    506     : PARSEOP_PINCONFIG
    507         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_PINCONFIG);}
    508         OptionalShareType_First     /* 04: SharedType */
    509         ',' ByteConstExpr           /* 06: PinConfigType */
    510         ',' DWordConstExpr          /* 08: PinConfigValue */
    511         ',' StringData              /* 10: ResourceSource */
    512         OptionalByteConstExpr       /* 11: ResourceSourceIndex */
    513         OptionalResourceType        /* 12: ResourceType */
    514         OptionalNameString          /* 13: DescriptorName */
    515         OptionalBuffer_Last         /* 14: VendorData */
    516         PARSEOP_CLOSE_PAREN '{'
    517             DWordList '}'           {$$ = TrLinkOpChildren ($<n>3,9,
    518                                         $4,$6,$8,$10,$11,$12,$13,$14,$17);}
    519     | PARSEOP_PINCONFIG
    520         PARSEOP_OPEN_PAREN
    521         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    522     ;
    523 
    524 PinFunctionTerm
    525     : PARSEOP_PINFUNCTION
    526         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_PINFUNCTION);}
    527         OptionalShareType_First     /* 04: SharedType */
    528         ',' PinConfigByte           /* 06: PinConfig */
    529         ',' WordConstExpr           /* 08: FunctionNumber */
    530         ',' StringData              /* 10: ResourceSource */
    531         OptionalByteConstExpr       /* 11: ResourceSourceIndex */
    532         OptionalResourceType        /* 12: ResourceType */
    533         OptionalNameString          /* 13: DescriptorName */
    534         OptionalBuffer_Last         /* 14: VendorData */
    535         PARSEOP_CLOSE_PAREN '{'
    536             DWordList '}'           {$$ = TrLinkOpChildren ($<n>3,9,
    537                                         $4,$6,$8,$10,$11,$12,$13,$14,$17);}
    538     | PARSEOP_PINFUNCTION
    539         PARSEOP_OPEN_PAREN
    540         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    541     ;
    542 
    543 PinGroupTerm
    544     : PARSEOP_PINGROUP
    545         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_PINGROUP);}
    546         StringData                  /* 04: ResourceLabel */
    547         OptionalProducerResourceType /* 05: ResourceType */
    548         OptionalNameString          /* 06: DescriptorName */
    549         OptionalBuffer_Last         /* 07: VendorData */
    550         PARSEOP_CLOSE_PAREN '{'
    551             DWordList '}'           {$$ = TrLinkOpChildren ($<n>3,5,$4,$5,$6,$7,$10);}
    552     | PARSEOP_PINGROUP
    553         PARSEOP_OPEN_PAREN
    554         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    555     ;
    556 
    557 PinGroupConfigTerm
    558     : PARSEOP_PINGROUPCONFIG
    559         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_PINGROUPCONFIG);}
    560         OptionalShareType_First     /* 04: SharedType */
    561         ',' ByteConstExpr           /* 06: PinConfigType */
    562         ',' DWordConstExpr          /* 08: PinConfigValue */
    563         ',' StringData              /* 10: ResourceSource */
    564         OptionalByteConstExpr       /* 11: ResourceSourceIndex */
    565         ',' StringData              /* 13: ResourceSourceLabel */
    566         OptionalResourceType        /* 14: ResourceType */
    567         OptionalNameString          /* 15: DescriptorName */
    568         OptionalBuffer_Last         /* 16: VendorData */
    569         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,9,
    570                                         $4,$6,$8,$10,$11,$13,$14,$15,$16);}
    571     | PARSEOP_PINGROUPCONFIG
    572         PARSEOP_OPEN_PAREN
    573         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    574     ;
    575 
    576 PinGroupFunctionTerm
    577     : PARSEOP_PINGROUPFUNCTION
    578         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_PINGROUPFUNCTION);}
    579         OptionalShareType_First     /* 04: SharedType */
    580         ',' WordConstExpr           /* 06: FunctionNumber */
    581         ',' StringData              /* 08: ResourceSource */
    582         OptionalByteConstExpr       /* 09: ResourceSourceIndex */
    583         ',' StringData              /* 11: ResourceSourceLabel */
    584         OptionalResourceType        /* 12: ResourceType */
    585         OptionalNameString          /* 13: DescriptorName */
    586         OptionalBuffer_Last         /* 14: VendorData */
    587         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,8,
    588                                         $4,$6,$8,$9,$11,$12,$13,$14);}
    589     | PARSEOP_PINGROUPFUNCTION
    590         PARSEOP_OPEN_PAREN
    591         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    592     ;
    593 
    594 QWordIOTerm
    595     : PARSEOP_QWORDIO
    596         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_QWORDIO);}
    597         OptionalResourceType_First
    598         OptionalMinType
    599         OptionalMaxType
    600         OptionalDecodeType
    601         OptionalRangeType
    602         ',' QWordConstExpr
    603         ',' QWordConstExpr
    604         ',' QWordConstExpr
    605         ',' QWordConstExpr
    606         ',' QWordConstExpr
    607         OptionalByteConstExpr
    608         OptionalStringData
    609         OptionalNameString
    610         OptionalType
    611         OptionalTranslationType_Last
    612         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,15,
    613                                         $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);}
    614     | PARSEOP_QWORDIO
    615         PARSEOP_OPEN_PAREN
    616         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    617     ;
    618 
    619 QWordMemoryTerm
    620     : PARSEOP_QWORDMEMORY
    621         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_QWORDMEMORY);}
    622         OptionalResourceType_First
    623         OptionalDecodeType
    624         OptionalMinType
    625         OptionalMaxType
    626         OptionalMemType
    627         ',' OptionalReadWriteKeyword
    628         ',' QWordConstExpr
    629         ',' QWordConstExpr
    630         ',' QWordConstExpr
    631         ',' QWordConstExpr
    632         ',' QWordConstExpr
    633         OptionalByteConstExpr
    634         OptionalStringData
    635         OptionalNameString
    636         OptionalAddressRange
    637         OptionalType_Last
    638         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,16,
    639                                         $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24,$25);}
    640     | PARSEOP_QWORDMEMORY
    641         PARSEOP_OPEN_PAREN
    642         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    643     ;
    644 
    645 QWordSpaceTerm
    646     : PARSEOP_QWORDSPACE
    647         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_QWORDSPACE);}
    648         ByteConstExpr               {UtCheckIntegerRange ($4, 0xC0, 0xFF);}
    649         OptionalResourceType
    650         OptionalDecodeType
    651         OptionalMinType
    652         OptionalMaxType
    653         ',' ByteConstExpr
    654         ',' QWordConstExpr
    655         ',' QWordConstExpr
    656         ',' QWordConstExpr
    657         ',' QWordConstExpr
    658         ',' QWordConstExpr
    659         OptionalByteConstExpr
    660         OptionalStringData
    661         OptionalNameString_Last
    662         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,14,
    663                                         $4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);}
    664     | PARSEOP_QWORDSPACE
    665         PARSEOP_OPEN_PAREN
    666         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    667     ;
    668 
    669 RegisterTerm
    670     : PARSEOP_REGISTER
    671         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_REGISTER);}
    672         AddressSpaceKeyword
    673         ',' ByteConstExpr
    674         ',' ByteConstExpr
    675         ',' QWordConstExpr
    676         OptionalAccessSize
    677         OptionalNameString_Last
    678         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,6,$4,$6,$8,$10,$11,$12);}
    679     | PARSEOP_REGISTER
    680         PARSEOP_OPEN_PAREN
    681         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    682     ;
    683 
    684 SpiSerialBusTerm
    685     : PARSEOP_SPI_SERIALBUS
    686         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_SPI_SERIALBUS);}
    687         WordConstExpr               /* 04: DeviceSelection */
    688         OptionalDevicePolarity      /* 05: DevicePolarity */
    689         OptionalWireMode            /* 06: WireMode */
    690         ',' ByteConstExpr           /* 08: DataBitLength */
    691         OptionalSlaveMode           /* 09: SlaveMode */
    692         ',' DWordConstExpr          /* 11: ConnectionSpeed */
    693         ',' ClockPolarityKeyword    /* 13: ClockPolarity */
    694         ',' ClockPhaseKeyword       /* 15: ClockPhase */
    695         ',' StringData              /* 17: ResourceSource */
    696         OptionalByteConstExpr       /* 18: ResourceSourceIndex */
    697         OptionalResourceType        /* 19: ResourceType */
    698         OptionalNameString          /* 20: DescriptorName */
    699         OptionalBuffer_Last         /* 21: VendorData */
    700         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,14,
    701                                         $4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,
    702                                         TrCreateLeafOp (PARSEOP_DEFAULT_ARG),$21);}
    703     | PARSEOP_SPI_SERIALBUS
    704         PARSEOP_OPEN_PAREN
    705         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    706     ;
    707 
    708 SpiSerialBusTermV2
    709     : PARSEOP_SPI_SERIALBUS_V2
    710         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_SPI_SERIALBUS_V2);}
    711         WordConstExpr               /* 04: DeviceSelection */
    712         OptionalDevicePolarity      /* 05: DevicePolarity */
    713         OptionalWireMode            /* 06: WireMode */
    714         ',' ByteConstExpr           /* 08: DataBitLength */
    715         OptionalSlaveMode           /* 09: SlaveMode */
    716         ',' DWordConstExpr          /* 11: ConnectionSpeed */
    717         ',' ClockPolarityKeyword    /* 13: ClockPolarity */
    718         ',' ClockPhaseKeyword       /* 15: ClockPhase */
    719         ',' StringData              /* 17: ResourceSource */
    720         OptionalByteConstExpr       /* 18: ResourceSourceIndex */
    721         OptionalResourceType        /* 19: ResourceType */
    722         OptionalNameString          /* 20: DescriptorName */
    723         OptionalShareType           /* 21: Share */
    724         OptionalBuffer_Last         /* 22: VendorData */
    725         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,14,
    726                                         $4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,$21,$22);}
    727     | PARSEOP_SPI_SERIALBUS_V2
    728         PARSEOP_OPEN_PAREN
    729         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    730     ;
    731 
    732 StartDependentFnNoPriTerm
    733     : PARSEOP_STARTDEPENDENTFN_NOPRI
    734         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_STARTDEPENDENTFN_NOPRI);}
    735         PARSEOP_CLOSE_PAREN '{'
    736         ResourceMacroList '}'       {$$ = TrLinkOpChildren ($<n>3,1,$6);}
    737     | PARSEOP_STARTDEPENDENTFN_NOPRI
    738         PARSEOP_OPEN_PAREN
    739         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    740     ;
    741 
    742 StartDependentFnTerm
    743     : PARSEOP_STARTDEPENDENTFN
    744         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_STARTDEPENDENTFN);}
    745         ByteConstExpr
    746         ',' ByteConstExpr
    747         PARSEOP_CLOSE_PAREN '{'
    748         ResourceMacroList '}'       {$$ = TrLinkOpChildren ($<n>3,3,$4,$6,$9);}
    749     | PARSEOP_STARTDEPENDENTFN
    750         PARSEOP_OPEN_PAREN
    751         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    752     ;
    753 
    754 UartSerialBusTerm
    755     : PARSEOP_UART_SERIALBUS
    756         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_UART_SERIALBUS);}
    757         DWordConstExpr              /* 04: ConnectionSpeed */
    758         OptionalBitsPerByte         /* 05: BitsPerByte */
    759         OptionalStopBits            /* 06: StopBits */
    760         ',' ByteConstExpr           /* 08: LinesInUse */
    761         OptionalEndian              /* 09: Endianness */
    762         OptionalParityType          /* 10: Parity */
    763         OptionalFlowControl         /* 11: FlowControl */
    764         ',' WordConstExpr           /* 13: Rx BufferSize */
    765         ',' WordConstExpr           /* 15: Tx BufferSize */
    766         ',' StringData              /* 17: ResourceSource */
    767         OptionalByteConstExpr       /* 18: ResourceSourceIndex */
    768         OptionalResourceType        /* 19: ResourceType */
    769         OptionalNameString          /* 20: DescriptorName */
    770         OptionalBuffer_Last         /* 21: VendorData */
    771         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,15,
    772                                         $4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,
    773                                         TrCreateLeafOp (PARSEOP_DEFAULT_ARG),$21);}
    774     | PARSEOP_UART_SERIALBUS
    775         PARSEOP_OPEN_PAREN
    776         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    777     ;
    778 
    779 UartSerialBusTermV2
    780     : PARSEOP_UART_SERIALBUS_V2
    781         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_UART_SERIALBUS_V2);}
    782         DWordConstExpr              /* 04: ConnectionSpeed */
    783         OptionalBitsPerByte         /* 05: BitsPerByte */
    784         OptionalStopBits            /* 06: StopBits */
    785         ',' ByteConstExpr           /* 08: LinesInUse */
    786         OptionalEndian              /* 09: Endianness */
    787         OptionalParityType          /* 10: Parity */
    788         OptionalFlowControl         /* 11: FlowControl */
    789         ',' WordConstExpr           /* 13: Rx BufferSize */
    790         ',' WordConstExpr           /* 15: Tx BufferSize */
    791         ',' StringData              /* 17: ResourceSource */
    792         OptionalByteConstExpr       /* 18: ResourceSourceIndex */
    793         OptionalResourceType        /* 19: ResourceType */
    794         OptionalNameString          /* 20: DescriptorName */
    795         OptionalShareType           /* 21: Share */
    796         OptionalBuffer_Last         /* 22: VendorData */
    797         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,15,
    798                                         $4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,$21,$22);}
    799     | PARSEOP_UART_SERIALBUS_V2
    800         PARSEOP_OPEN_PAREN
    801         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    802     ;
    803 
    804 VendorLongTerm
    805     : PARSEOP_VENDORLONG
    806         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_VENDORLONG);}
    807         OptionalNameString_First
    808         PARSEOP_CLOSE_PAREN '{'
    809             ByteList '}'            {$$ = TrLinkOpChildren ($<n>3,2,$4,$7);}
    810     | PARSEOP_VENDORLONG
    811         PARSEOP_OPEN_PAREN
    812         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    813     ;
    814 
    815 VendorShortTerm
    816     : PARSEOP_VENDORSHORT
    817         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_VENDORSHORT);}
    818         OptionalNameString_First
    819         PARSEOP_CLOSE_PAREN '{'
    820             ByteList '}'            {$$ = TrLinkOpChildren ($<n>3,2,$4,$7);}
    821     | PARSEOP_VENDORSHORT
    822         PARSEOP_OPEN_PAREN
    823         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    824     ;
    825 
    826 WordBusNumberTerm
    827     : PARSEOP_WORDBUSNUMBER
    828         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_WORDBUSNUMBER);}
    829         OptionalResourceType_First
    830         OptionalMinType
    831         OptionalMaxType
    832         OptionalDecodeType
    833         ',' WordConstExpr
    834         ',' WordConstExpr
    835         ',' WordConstExpr
    836         ',' WordConstExpr
    837         ',' WordConstExpr
    838         OptionalByteConstExpr
    839         OptionalStringData
    840         OptionalNameString_Last
    841         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,12,
    842                                         $4,$5,$6,$7,$9,$11,$13,$15,$17,$18,$19,$20);}
    843     | PARSEOP_WORDBUSNUMBER
    844         PARSEOP_OPEN_PAREN
    845         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    846     ;
    847 
    848 WordIOTerm
    849     : PARSEOP_WORDIO
    850         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_WORDIO);}
    851         OptionalResourceType_First
    852         OptionalMinType
    853         OptionalMaxType
    854         OptionalDecodeType
    855         OptionalRangeType
    856         ',' WordConstExpr
    857         ',' WordConstExpr
    858         ',' WordConstExpr
    859         ',' WordConstExpr
    860         ',' WordConstExpr
    861         OptionalByteConstExpr
    862         OptionalStringData
    863         OptionalNameString
    864         OptionalType
    865         OptionalTranslationType_Last
    866         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,15,
    867                                         $4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);}
    868     | PARSEOP_WORDIO
    869         PARSEOP_OPEN_PAREN
    870         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    871     ;
    872 
    873 WordSpaceTerm
    874     : PARSEOP_WORDSPACE
    875         PARSEOP_OPEN_PAREN          {$<n>$ = TrCreateLeafOp (PARSEOP_WORDSPACE);}
    876         ByteConstExpr               {UtCheckIntegerRange ($4, 0xC0, 0xFF);}
    877         OptionalResourceType
    878         OptionalDecodeType
    879         OptionalMinType
    880         OptionalMaxType
    881         ',' ByteConstExpr
    882         ',' WordConstExpr
    883         ',' WordConstExpr
    884         ',' WordConstExpr
    885         ',' WordConstExpr
    886         ',' WordConstExpr
    887         OptionalByteConstExpr
    888         OptionalStringData
    889         OptionalNameString_Last
    890         PARSEOP_CLOSE_PAREN         {$$ = TrLinkOpChildren ($<n>3,14,
    891                                         $4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);}
    892     | PARSEOP_WORDSPACE
    893         PARSEOP_OPEN_PAREN
    894         error PARSEOP_CLOSE_PAREN   {$$ = AslDoError(); yyclearin;}
    895     ;
    896