Home | History | Annotate | Line # | Download | only in compiler
aslopcodes.c revision 1.1.1.12
      1       1.1    jruoho /******************************************************************************
      2       1.1    jruoho  *
      3       1.1    jruoho  * Module Name: aslopcode - AML opcode generation
      4       1.1    jruoho  *
      5       1.1    jruoho  *****************************************************************************/
      6       1.1    jruoho 
      7   1.1.1.2    jruoho /*
      8  1.1.1.11  christos  * Copyright (C) 2000 - 2018, Intel Corp.
      9       1.1    jruoho  * All rights reserved.
     10       1.1    jruoho  *
     11   1.1.1.2    jruoho  * Redistribution and use in source and binary forms, with or without
     12   1.1.1.2    jruoho  * modification, are permitted provided that the following conditions
     13   1.1.1.2    jruoho  * are met:
     14   1.1.1.2    jruoho  * 1. Redistributions of source code must retain the above copyright
     15   1.1.1.2    jruoho  *    notice, this list of conditions, and the following disclaimer,
     16   1.1.1.2    jruoho  *    without modification.
     17   1.1.1.2    jruoho  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
     18   1.1.1.2    jruoho  *    substantially similar to the "NO WARRANTY" disclaimer below
     19   1.1.1.2    jruoho  *    ("Disclaimer") and any redistribution must be conditioned upon
     20   1.1.1.2    jruoho  *    including a substantially similar Disclaimer requirement for further
     21   1.1.1.2    jruoho  *    binary redistribution.
     22   1.1.1.2    jruoho  * 3. Neither the names of the above-listed copyright holders nor the names
     23   1.1.1.2    jruoho  *    of any contributors may be used to endorse or promote products derived
     24   1.1.1.2    jruoho  *    from this software without specific prior written permission.
     25   1.1.1.2    jruoho  *
     26   1.1.1.2    jruoho  * Alternatively, this software may be distributed under the terms of the
     27   1.1.1.2    jruoho  * GNU General Public License ("GPL") version 2 as published by the Free
     28   1.1.1.2    jruoho  * Software Foundation.
     29   1.1.1.2    jruoho  *
     30   1.1.1.2    jruoho  * NO WARRANTY
     31   1.1.1.2    jruoho  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     32   1.1.1.2    jruoho  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     33   1.1.1.2    jruoho  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
     34   1.1.1.2    jruoho  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     35   1.1.1.2    jruoho  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     36   1.1.1.2    jruoho  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     37   1.1.1.2    jruoho  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     38   1.1.1.2    jruoho  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     39   1.1.1.2    jruoho  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     40   1.1.1.2    jruoho  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     41   1.1.1.2    jruoho  * POSSIBILITY OF SUCH DAMAGES.
     42   1.1.1.2    jruoho  */
     43       1.1    jruoho 
     44       1.1    jruoho #include "aslcompiler.h"
     45       1.1    jruoho #include "aslcompiler.y.h"
     46       1.1    jruoho #include "amlcode.h"
     47       1.1    jruoho 
     48       1.1    jruoho #define _COMPONENT          ACPI_COMPILER
     49       1.1    jruoho         ACPI_MODULE_NAME    ("aslopcodes")
     50       1.1    jruoho 
     51       1.1    jruoho 
     52       1.1    jruoho /* Local prototypes */
     53       1.1    jruoho 
     54       1.1    jruoho static void
     55       1.1    jruoho OpcDoAccessAs (
     56       1.1    jruoho     ACPI_PARSE_OBJECT       *Op);
     57       1.1    jruoho 
     58       1.1    jruoho static void
     59   1.1.1.3  christos OpcDoConnection (
     60   1.1.1.3  christos     ACPI_PARSE_OBJECT       *Op);
     61   1.1.1.3  christos 
     62   1.1.1.3  christos static void
     63       1.1    jruoho OpcDoUnicode (
     64       1.1    jruoho     ACPI_PARSE_OBJECT       *Op);
     65       1.1    jruoho 
     66       1.1    jruoho static void
     67       1.1    jruoho OpcDoEisaId (
     68       1.1    jruoho     ACPI_PARSE_OBJECT       *Op);
     69       1.1    jruoho 
     70       1.1    jruoho static void
     71       1.1    jruoho OpcDoUuId (
     72       1.1    jruoho     ACPI_PARSE_OBJECT       *Op);
     73       1.1    jruoho 
     74       1.1    jruoho 
     75       1.1    jruoho /*******************************************************************************
     76       1.1    jruoho  *
     77       1.1    jruoho  * FUNCTION:    OpcAmlOpcodeUpdateWalk
     78       1.1    jruoho  *
     79       1.1    jruoho  * PARAMETERS:  ASL_WALK_CALLBACK
     80       1.1    jruoho  *
     81       1.1    jruoho  * RETURN:      Status
     82       1.1    jruoho  *
     83       1.1    jruoho  * DESCRIPTION: Opcode update walk, ascending callback
     84       1.1    jruoho  *
     85       1.1    jruoho  ******************************************************************************/
     86       1.1    jruoho 
     87       1.1    jruoho ACPI_STATUS
     88       1.1    jruoho OpcAmlOpcodeUpdateWalk (
     89       1.1    jruoho     ACPI_PARSE_OBJECT       *Op,
     90       1.1    jruoho     UINT32                  Level,
     91       1.1    jruoho     void                    *Context)
     92       1.1    jruoho {
     93       1.1    jruoho 
     94       1.1    jruoho     /*
     95       1.1    jruoho      * Handle the Package() case where the actual opcode cannot be determined
     96       1.1    jruoho      * until the PackageLength operand has been folded and minimized.
     97       1.1    jruoho      * (PackageOp versus VarPackageOp)
     98       1.1    jruoho      *
     99       1.1    jruoho      * This is (as of ACPI 3.0) the only case where the AML opcode can change
    100       1.1    jruoho      * based upon the value of a parameter.
    101       1.1    jruoho      *
    102       1.1    jruoho      * The parser always inserts a VarPackage opcode, which can possibly be
    103       1.1    jruoho      * optimized to a Package opcode.
    104       1.1    jruoho      */
    105       1.1    jruoho     if (Op->Asl.ParseOpcode == PARSEOP_VAR_PACKAGE)
    106       1.1    jruoho     {
    107       1.1    jruoho         OpnDoPackage (Op);
    108       1.1    jruoho     }
    109       1.1    jruoho 
    110       1.1    jruoho     return (AE_OK);
    111       1.1    jruoho }
    112       1.1    jruoho 
    113       1.1    jruoho 
    114       1.1    jruoho /*******************************************************************************
    115       1.1    jruoho  *
    116       1.1    jruoho  * FUNCTION:    OpcAmlOpcodeWalk
    117       1.1    jruoho  *
    118       1.1    jruoho  * PARAMETERS:  ASL_WALK_CALLBACK
    119       1.1    jruoho  *
    120       1.1    jruoho  * RETURN:      Status
    121       1.1    jruoho  *
    122       1.1    jruoho  * DESCRIPTION: Parse tree walk to generate both the AML opcodes and the AML
    123       1.1    jruoho  *              operands.
    124       1.1    jruoho  *
    125       1.1    jruoho  ******************************************************************************/
    126       1.1    jruoho 
    127       1.1    jruoho ACPI_STATUS
    128       1.1    jruoho OpcAmlOpcodeWalk (
    129       1.1    jruoho     ACPI_PARSE_OBJECT       *Op,
    130       1.1    jruoho     UINT32                  Level,
    131       1.1    jruoho     void                    *Context)
    132       1.1    jruoho {
    133       1.1    jruoho 
    134  1.1.1.12  christos     AslGbl_TotalParseNodes++;
    135       1.1    jruoho 
    136       1.1    jruoho     OpcGenerateAmlOpcode (Op);
    137       1.1    jruoho     OpnGenerateAmlOperands (Op);
    138       1.1    jruoho     return (AE_OK);
    139       1.1    jruoho }
    140       1.1    jruoho 
    141       1.1    jruoho 
    142       1.1    jruoho /*******************************************************************************
    143       1.1    jruoho  *
    144       1.1    jruoho  * FUNCTION:    OpcGetIntegerWidth
    145       1.1    jruoho  *
    146       1.1    jruoho  * PARAMETERS:  Op          - DEFINITION BLOCK op
    147       1.1    jruoho  *
    148       1.1    jruoho  * RETURN:      none
    149       1.1    jruoho  *
    150       1.1    jruoho  * DESCRIPTION: Extract integer width from the table revision
    151       1.1    jruoho  *
    152       1.1    jruoho  ******************************************************************************/
    153       1.1    jruoho 
    154       1.1    jruoho void
    155       1.1    jruoho OpcGetIntegerWidth (
    156       1.1    jruoho     ACPI_PARSE_OBJECT       *Op)
    157       1.1    jruoho {
    158       1.1    jruoho     ACPI_PARSE_OBJECT       *Child;
    159       1.1    jruoho 
    160       1.1    jruoho 
    161       1.1    jruoho     if (!Op)
    162       1.1    jruoho     {
    163       1.1    jruoho         return;
    164       1.1    jruoho     }
    165       1.1    jruoho 
    166  1.1.1.12  christos     if (AslGbl_RevisionOverride)
    167       1.1    jruoho     {
    168  1.1.1.12  christos         AcpiUtSetIntegerWidth (AslGbl_RevisionOverride);
    169       1.1    jruoho     }
    170       1.1    jruoho     else
    171       1.1    jruoho     {
    172       1.1    jruoho         Child = Op->Asl.Child;
    173       1.1    jruoho         Child = Child->Asl.Next;
    174       1.1    jruoho         Child = Child->Asl.Next;
    175       1.1    jruoho 
    176       1.1    jruoho         /* Use the revision to set the integer width */
    177       1.1    jruoho 
    178       1.1    jruoho         AcpiUtSetIntegerWidth ((UINT8) Child->Asl.Value.Integer);
    179       1.1    jruoho     }
    180       1.1    jruoho }
    181       1.1    jruoho 
    182       1.1    jruoho 
    183       1.1    jruoho /*******************************************************************************
    184       1.1    jruoho  *
    185       1.1    jruoho  * FUNCTION:    OpcSetOptimalIntegerSize
    186       1.1    jruoho  *
    187       1.1    jruoho  * PARAMETERS:  Op        - A parse tree node
    188       1.1    jruoho  *
    189   1.1.1.3  christos  * RETURN:      Integer width, in bytes. Also sets the node AML opcode to the
    190       1.1    jruoho  *              optimal integer AML prefix opcode.
    191       1.1    jruoho  *
    192   1.1.1.3  christos  * DESCRIPTION: Determine the optimal AML encoding of an integer. All leading
    193       1.1    jruoho  *              zeros can be truncated to squeeze the integer into the
    194       1.1    jruoho  *              minimal number of AML bytes.
    195       1.1    jruoho  *
    196       1.1    jruoho  ******************************************************************************/
    197       1.1    jruoho 
    198       1.1    jruoho UINT32
    199       1.1    jruoho OpcSetOptimalIntegerSize (
    200       1.1    jruoho     ACPI_PARSE_OBJECT       *Op)
    201       1.1    jruoho {
    202       1.1    jruoho 
    203       1.1    jruoho #if 0
    204       1.1    jruoho     /*
    205       1.1    jruoho      * TBD: - we don't want to optimize integers in the block header, but the
    206       1.1    jruoho      * code below does not work correctly.
    207       1.1    jruoho      */
    208       1.1    jruoho     if (Op->Asl.Parent &&
    209       1.1    jruoho         Op->Asl.Parent->Asl.Parent &&
    210   1.1.1.7  christos        (Op->Asl.Parent->Asl.Parent->Asl.ParseOpcode == PARSEOP_DEFINITION_BLOCK))
    211       1.1    jruoho     {
    212   1.1.1.3  christos         return (0);
    213       1.1    jruoho     }
    214       1.1    jruoho #endif
    215       1.1    jruoho 
    216       1.1    jruoho     /*
    217       1.1    jruoho      * Check for the special AML integers first - Zero, One, Ones.
    218       1.1    jruoho      * These are single-byte opcodes that are the smallest possible
    219       1.1    jruoho      * representation of an integer.
    220       1.1    jruoho      *
    221       1.1    jruoho      * This optimization is optional.
    222       1.1    jruoho      */
    223  1.1.1.12  christos     if (AslGbl_IntegerOptimizationFlag)
    224       1.1    jruoho     {
    225       1.1    jruoho         switch (Op->Asl.Value.Integer)
    226       1.1    jruoho         {
    227       1.1    jruoho         case 0:
    228       1.1    jruoho 
    229       1.1    jruoho             Op->Asl.AmlOpcode = AML_ZERO_OP;
    230       1.1    jruoho             AslError (ASL_OPTIMIZATION, ASL_MSG_INTEGER_OPTIMIZATION,
    231       1.1    jruoho                 Op, "Zero");
    232   1.1.1.3  christos             return (1);
    233       1.1    jruoho 
    234       1.1    jruoho         case 1:
    235       1.1    jruoho 
    236       1.1    jruoho             Op->Asl.AmlOpcode = AML_ONE_OP;
    237       1.1    jruoho             AslError (ASL_OPTIMIZATION, ASL_MSG_INTEGER_OPTIMIZATION,
    238       1.1    jruoho                 Op, "One");
    239   1.1.1.3  christos             return (1);
    240       1.1    jruoho 
    241       1.1    jruoho         case ACPI_UINT32_MAX:
    242       1.1    jruoho 
    243       1.1    jruoho             /* Check for table integer width (32 or 64) */
    244       1.1    jruoho 
    245       1.1    jruoho             if (AcpiGbl_IntegerByteWidth == 4)
    246       1.1    jruoho             {
    247       1.1    jruoho                 Op->Asl.AmlOpcode = AML_ONES_OP;
    248       1.1    jruoho                 AslError (ASL_OPTIMIZATION, ASL_MSG_INTEGER_OPTIMIZATION,
    249       1.1    jruoho                     Op, "Ones");
    250   1.1.1.3  christos                 return (1);
    251       1.1    jruoho             }
    252       1.1    jruoho             break;
    253       1.1    jruoho 
    254       1.1    jruoho         case ACPI_UINT64_MAX:
    255       1.1    jruoho 
    256       1.1    jruoho             /* Check for table integer width (32 or 64) */
    257       1.1    jruoho 
    258       1.1    jruoho             if (AcpiGbl_IntegerByteWidth == 8)
    259       1.1    jruoho             {
    260       1.1    jruoho                 Op->Asl.AmlOpcode = AML_ONES_OP;
    261       1.1    jruoho                 AslError (ASL_OPTIMIZATION, ASL_MSG_INTEGER_OPTIMIZATION,
    262       1.1    jruoho                     Op, "Ones");
    263   1.1.1.3  christos                 return (1);
    264       1.1    jruoho             }
    265       1.1    jruoho             break;
    266       1.1    jruoho 
    267       1.1    jruoho         default:
    268   1.1.1.3  christos 
    269       1.1    jruoho             break;
    270       1.1    jruoho         }
    271       1.1    jruoho     }
    272       1.1    jruoho 
    273       1.1    jruoho     /* Find the best fit using the various AML integer prefixes */
    274       1.1    jruoho 
    275       1.1    jruoho     if (Op->Asl.Value.Integer <= ACPI_UINT8_MAX)
    276       1.1    jruoho     {
    277       1.1    jruoho         Op->Asl.AmlOpcode = AML_BYTE_OP;
    278   1.1.1.3  christos         return (1);
    279       1.1    jruoho     }
    280   1.1.1.7  christos 
    281       1.1    jruoho     if (Op->Asl.Value.Integer <= ACPI_UINT16_MAX)
    282       1.1    jruoho     {
    283       1.1    jruoho         Op->Asl.AmlOpcode = AML_WORD_OP;
    284   1.1.1.3  christos         return (2);
    285       1.1    jruoho     }
    286   1.1.1.7  christos 
    287       1.1    jruoho     if (Op->Asl.Value.Integer <= ACPI_UINT32_MAX)
    288       1.1    jruoho     {
    289       1.1    jruoho         Op->Asl.AmlOpcode = AML_DWORD_OP;
    290   1.1.1.3  christos         return (4);
    291       1.1    jruoho     }
    292   1.1.1.9  christos     else /* 64-bit integer */
    293       1.1    jruoho     {
    294       1.1    jruoho         if (AcpiGbl_IntegerByteWidth == 4)
    295       1.1    jruoho         {
    296       1.1    jruoho             AslError (ASL_WARNING, ASL_MSG_INTEGER_LENGTH,
    297       1.1    jruoho                 Op, NULL);
    298       1.1    jruoho 
    299  1.1.1.12  christos             if (!AslGbl_IgnoreErrors)
    300       1.1    jruoho             {
    301       1.1    jruoho                 /* Truncate the integer to 32-bit */
    302   1.1.1.9  christos 
    303   1.1.1.9  christos                 Op->Asl.Value.Integer &= ACPI_UINT32_MAX;
    304   1.1.1.9  christos 
    305   1.1.1.9  christos                 /* Now set the optimal integer size */
    306   1.1.1.9  christos 
    307   1.1.1.9  christos                 return (OpcSetOptimalIntegerSize (Op));
    308       1.1    jruoho             }
    309       1.1    jruoho         }
    310       1.1    jruoho 
    311       1.1    jruoho         Op->Asl.AmlOpcode = AML_QWORD_OP;
    312   1.1.1.3  christos         return (8);
    313       1.1    jruoho     }
    314       1.1    jruoho }
    315       1.1    jruoho 
    316       1.1    jruoho 
    317       1.1    jruoho /*******************************************************************************
    318       1.1    jruoho  *
    319       1.1    jruoho  * FUNCTION:    OpcDoAccessAs
    320       1.1    jruoho  *
    321       1.1    jruoho  * PARAMETERS:  Op        - Parse node
    322       1.1    jruoho  *
    323       1.1    jruoho  * RETURN:      None
    324       1.1    jruoho  *
    325       1.1    jruoho  * DESCRIPTION: Implement the ACCESS_AS ASL keyword.
    326       1.1    jruoho  *
    327       1.1    jruoho  ******************************************************************************/
    328       1.1    jruoho 
    329       1.1    jruoho static void
    330       1.1    jruoho OpcDoAccessAs (
    331       1.1    jruoho     ACPI_PARSE_OBJECT       *Op)
    332       1.1    jruoho {
    333   1.1.1.3  christos     ACPI_PARSE_OBJECT       *TypeOp;
    334   1.1.1.3  christos     ACPI_PARSE_OBJECT       *AttribOp;
    335   1.1.1.3  christos     ACPI_PARSE_OBJECT       *LengthOp;
    336   1.1.1.3  christos     UINT8                   Attribute;
    337       1.1    jruoho 
    338       1.1    jruoho 
    339       1.1    jruoho     Op->Asl.AmlOpcodeLength = 1;
    340   1.1.1.3  christos     TypeOp = Op->Asl.Child;
    341       1.1    jruoho 
    342       1.1    jruoho     /* First child is the access type */
    343       1.1    jruoho 
    344   1.1.1.3  christos     TypeOp->Asl.AmlOpcode = AML_RAW_DATA_BYTE;
    345   1.1.1.3  christos     TypeOp->Asl.ParseOpcode = PARSEOP_RAW_DATA;
    346       1.1    jruoho 
    347       1.1    jruoho     /* Second child is the optional access attribute */
    348       1.1    jruoho 
    349   1.1.1.3  christos     AttribOp = TypeOp->Asl.Next;
    350   1.1.1.3  christos     if (AttribOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG)
    351   1.1.1.3  christos     {
    352   1.1.1.3  christos         AttribOp->Asl.Value.Integer = 0;
    353   1.1.1.3  christos     }
    354   1.1.1.7  christos 
    355   1.1.1.3  christos     AttribOp->Asl.AmlOpcode = AML_RAW_DATA_BYTE;
    356   1.1.1.3  christos     AttribOp->Asl.ParseOpcode = PARSEOP_RAW_DATA;
    357   1.1.1.3  christos 
    358   1.1.1.3  christos     /* Only a few AccessAttributes support AccessLength */
    359   1.1.1.3  christos 
    360   1.1.1.3  christos     Attribute = (UINT8) AttribOp->Asl.Value.Integer;
    361  1.1.1.12  christos     if ((Attribute != AML_FIELD_ATTRIB_BYTES) &&
    362   1.1.1.3  christos         (Attribute != AML_FIELD_ATTRIB_RAW_BYTES) &&
    363  1.1.1.12  christos         (Attribute != AML_FIELD_ATTRIB_RAW_PROCESS_BYTES))
    364   1.1.1.3  christos     {
    365   1.1.1.3  christos         return;
    366   1.1.1.3  christos     }
    367   1.1.1.3  christos 
    368   1.1.1.3  christos     Op->Asl.AmlOpcode = AML_FIELD_EXT_ACCESS_OP;
    369   1.1.1.3  christos 
    370   1.1.1.3  christos     /*
    371   1.1.1.3  christos      * Child of Attributes is the AccessLength (required for Multibyte,
    372   1.1.1.3  christos      * RawBytes, RawProcess.)
    373   1.1.1.3  christos      */
    374   1.1.1.3  christos     LengthOp = AttribOp->Asl.Child;
    375   1.1.1.3  christos     if (!LengthOp)
    376   1.1.1.3  christos     {
    377   1.1.1.3  christos         return;
    378   1.1.1.3  christos     }
    379   1.1.1.3  christos 
    380   1.1.1.3  christos     /* TBD: probably can remove */
    381   1.1.1.3  christos 
    382   1.1.1.3  christos     if (LengthOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG)
    383   1.1.1.3  christos     {
    384   1.1.1.3  christos         LengthOp->Asl.Value.Integer = 16;
    385   1.1.1.3  christos     }
    386   1.1.1.3  christos 
    387   1.1.1.3  christos     LengthOp->Asl.AmlOpcode = AML_RAW_DATA_BYTE;
    388   1.1.1.3  christos     LengthOp->Asl.ParseOpcode = PARSEOP_RAW_DATA;
    389   1.1.1.3  christos }
    390   1.1.1.3  christos 
    391   1.1.1.3  christos 
    392   1.1.1.3  christos /*******************************************************************************
    393   1.1.1.3  christos  *
    394   1.1.1.3  christos  * FUNCTION:    OpcDoConnection
    395   1.1.1.3  christos  *
    396   1.1.1.3  christos  * PARAMETERS:  Op        - Parse node
    397   1.1.1.3  christos  *
    398   1.1.1.3  christos  * RETURN:      None
    399   1.1.1.3  christos  *
    400   1.1.1.3  christos  * DESCRIPTION: Implement the Connection ASL keyword.
    401   1.1.1.3  christos  *
    402   1.1.1.3  christos  ******************************************************************************/
    403   1.1.1.3  christos 
    404   1.1.1.3  christos static void
    405   1.1.1.3  christos OpcDoConnection (
    406   1.1.1.3  christos     ACPI_PARSE_OBJECT       *Op)
    407   1.1.1.3  christos {
    408   1.1.1.3  christos     ASL_RESOURCE_NODE       *Rnode;
    409   1.1.1.3  christos     ACPI_PARSE_OBJECT       *BufferOp;
    410   1.1.1.3  christos     ACPI_PARSE_OBJECT       *BufferLengthOp;
    411   1.1.1.3  christos     ACPI_PARSE_OBJECT       *BufferDataOp;
    412   1.1.1.4  christos     ASL_RESOURCE_INFO       Info;
    413   1.1.1.3  christos     UINT8                   State;
    414   1.1.1.3  christos 
    415   1.1.1.3  christos 
    416   1.1.1.3  christos     Op->Asl.AmlOpcodeLength = 1;
    417   1.1.1.3  christos 
    418   1.1.1.3  christos     if (Op->Asl.Child->Asl.AmlOpcode == AML_INT_NAMEPATH_OP)
    419   1.1.1.3  christos     {
    420   1.1.1.3  christos         return;
    421   1.1.1.3  christos     }
    422   1.1.1.3  christos 
    423   1.1.1.3  christos     BufferOp = Op->Asl.Child;
    424   1.1.1.3  christos     BufferLengthOp = BufferOp->Asl.Child;
    425   1.1.1.3  christos     BufferDataOp = BufferLengthOp->Asl.Next;
    426   1.1.1.3  christos 
    427   1.1.1.4  christos     Info.DescriptorTypeOp = BufferDataOp->Asl.Next;
    428   1.1.1.4  christos     Info.CurrentByteOffset = 0;
    429   1.1.1.3  christos     State = ACPI_RSTATE_NORMAL;
    430   1.1.1.4  christos     Rnode = RsDoOneResourceDescriptor (&Info, &State);
    431   1.1.1.3  christos     if (!Rnode)
    432       1.1    jruoho     {
    433   1.1.1.3  christos         return; /* error */
    434       1.1    jruoho     }
    435   1.1.1.3  christos 
    436   1.1.1.3  christos     /*
    437   1.1.1.3  christos      * Transform the nodes into the following
    438   1.1.1.3  christos      *
    439   1.1.1.3  christos      * Op           -> AML_BUFFER_OP
    440   1.1.1.3  christos      * First Child  -> BufferLength
    441   1.1.1.3  christos      * Second Child -> Descriptor Buffer (raw byte data)
    442   1.1.1.3  christos      */
    443   1.1.1.7  christos     BufferOp->Asl.ParseOpcode = PARSEOP_BUFFER;
    444   1.1.1.7  christos     BufferOp->Asl.AmlOpcode = AML_BUFFER_OP;
    445  1.1.1.10  christos     BufferOp->Asl.CompileFlags = OP_AML_PACKAGE | OP_IS_RESOURCE_DESC;
    446   1.1.1.3  christos     UtSetParseOpName (BufferOp);
    447   1.1.1.3  christos 
    448   1.1.1.7  christos     BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER;
    449   1.1.1.3  christos     BufferLengthOp->Asl.Value.Integer = Rnode->BufferLength;
    450   1.1.1.3  christos     (void) OpcSetOptimalIntegerSize (BufferLengthOp);
    451   1.1.1.3  christos     UtSetParseOpName (BufferLengthOp);
    452   1.1.1.3  christos 
    453   1.1.1.7  christos     BufferDataOp->Asl.ParseOpcode = PARSEOP_RAW_DATA;
    454   1.1.1.7  christos     BufferDataOp->Asl.AmlOpcode = AML_RAW_DATA_CHAIN;
    455   1.1.1.7  christos     BufferDataOp->Asl.AmlOpcodeLength = 0;
    456   1.1.1.7  christos     BufferDataOp->Asl.AmlLength = Rnode->BufferLength;
    457   1.1.1.7  christos     BufferDataOp->Asl.Value.Buffer = (UINT8 *) Rnode;
    458   1.1.1.3  christos     UtSetParseOpName (BufferDataOp);
    459       1.1    jruoho }
    460       1.1    jruoho 
    461       1.1    jruoho 
    462       1.1    jruoho /*******************************************************************************
    463       1.1    jruoho  *
    464       1.1    jruoho  * FUNCTION:    OpcDoUnicode
    465       1.1    jruoho  *
    466       1.1    jruoho  * PARAMETERS:  Op        - Parse node
    467       1.1    jruoho  *
    468       1.1    jruoho  * RETURN:      None
    469       1.1    jruoho  *
    470       1.1    jruoho  * DESCRIPTION: Implement the UNICODE ASL "macro".  Convert the input string
    471   1.1.1.3  christos  *              to a unicode buffer. There is no Unicode AML opcode.
    472       1.1    jruoho  *
    473       1.1    jruoho  * Note:  The Unicode string is 16 bits per character, no leading signature,
    474       1.1    jruoho  *        with a 16-bit terminating NULL.
    475       1.1    jruoho  *
    476       1.1    jruoho  ******************************************************************************/
    477       1.1    jruoho 
    478       1.1    jruoho static void
    479       1.1    jruoho OpcDoUnicode (
    480       1.1    jruoho     ACPI_PARSE_OBJECT       *Op)
    481       1.1    jruoho {
    482       1.1    jruoho     ACPI_PARSE_OBJECT       *InitializerOp;
    483       1.1    jruoho     UINT32                  Length;
    484       1.1    jruoho     UINT32                  Count;
    485       1.1    jruoho     UINT32                  i;
    486       1.1    jruoho     UINT8                   *AsciiString;
    487       1.1    jruoho     UINT16                  *UnicodeString;
    488       1.1    jruoho     ACPI_PARSE_OBJECT       *BufferLengthOp;
    489       1.1    jruoho 
    490       1.1    jruoho 
    491       1.1    jruoho     /* Change op into a buffer object */
    492       1.1    jruoho 
    493  1.1.1.10  christos     Op->Asl.CompileFlags &= ~OP_COMPILE_TIME_CONST;
    494       1.1    jruoho     Op->Asl.ParseOpcode = PARSEOP_BUFFER;
    495       1.1    jruoho     UtSetParseOpName (Op);
    496       1.1    jruoho 
    497       1.1    jruoho     /* Buffer Length is first, followed by the string */
    498       1.1    jruoho 
    499       1.1    jruoho     BufferLengthOp = Op->Asl.Child;
    500       1.1    jruoho     InitializerOp = BufferLengthOp->Asl.Next;
    501       1.1    jruoho 
    502       1.1    jruoho     AsciiString = (UINT8 *) InitializerOp->Asl.Value.String;
    503       1.1    jruoho 
    504       1.1    jruoho     /* Create a new buffer for the Unicode string */
    505       1.1    jruoho 
    506       1.1    jruoho     Count = strlen (InitializerOp->Asl.Value.String) + 1;
    507       1.1    jruoho     Length = Count * sizeof (UINT16);
    508       1.1    jruoho     UnicodeString = UtLocalCalloc (Length);
    509       1.1    jruoho 
    510       1.1    jruoho     /* Convert to Unicode string (including null terminator) */
    511       1.1    jruoho 
    512       1.1    jruoho     for (i = 0; i < Count; i++)
    513       1.1    jruoho     {
    514       1.1    jruoho         UnicodeString[i] = (UINT16) AsciiString[i];
    515       1.1    jruoho     }
    516       1.1    jruoho 
    517       1.1    jruoho     /*
    518       1.1    jruoho      * Just set the buffer size node to be the buffer length, regardless
    519       1.1    jruoho      * of whether it was previously an integer or a default_arg placeholder
    520       1.1    jruoho      */
    521   1.1.1.7  christos     BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER;
    522   1.1.1.7  christos     BufferLengthOp->Asl.AmlOpcode = AML_DWORD_OP;
    523       1.1    jruoho     BufferLengthOp->Asl.Value.Integer = Length;
    524       1.1    jruoho     UtSetParseOpName (BufferLengthOp);
    525       1.1    jruoho 
    526       1.1    jruoho     (void) OpcSetOptimalIntegerSize (BufferLengthOp);
    527       1.1    jruoho 
    528       1.1    jruoho     /* The Unicode string is a raw data buffer */
    529       1.1    jruoho 
    530   1.1.1.7  christos     InitializerOp->Asl.Value.Buffer = (UINT8 *) UnicodeString;
    531   1.1.1.7  christos     InitializerOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
    532   1.1.1.7  christos     InitializerOp->Asl.AmlLength = Length;
    533   1.1.1.7  christos     InitializerOp->Asl.ParseOpcode = PARSEOP_RAW_DATA;
    534   1.1.1.7  christos     InitializerOp->Asl.Child = NULL;
    535       1.1    jruoho     UtSetParseOpName (InitializerOp);
    536       1.1    jruoho }
    537       1.1    jruoho 
    538       1.1    jruoho 
    539       1.1    jruoho /*******************************************************************************
    540       1.1    jruoho  *
    541       1.1    jruoho  * FUNCTION:    OpcDoEisaId
    542       1.1    jruoho  *
    543       1.1    jruoho  * PARAMETERS:  Op        - Parse node
    544       1.1    jruoho  *
    545       1.1    jruoho  * RETURN:      None
    546       1.1    jruoho  *
    547   1.1.1.3  christos  * DESCRIPTION: Convert a string EISA ID to numeric representation. See the
    548   1.1.1.3  christos  *              Pnp BIOS Specification for details. Here is an excerpt:
    549       1.1    jruoho  *
    550       1.1    jruoho  *              A seven character ASCII representation of the product
    551   1.1.1.3  christos  *              identifier compressed into a 32-bit identifier. The seven
    552       1.1    jruoho  *              character ID consists of a three character manufacturer code,
    553       1.1    jruoho  *              a three character hexadecimal product identifier, and a one
    554   1.1.1.3  christos  *              character hexadecimal revision number. The manufacturer code
    555       1.1    jruoho  *              is a 3 uppercase character code that is compressed into 3 5-bit
    556       1.1    jruoho  *              values as follows:
    557       1.1    jruoho  *                  1) Find hex ASCII value for each letter
    558       1.1    jruoho  *                  2) Subtract 40h from each ASCII value
    559   1.1.1.3  christos  *                  3) Retain 5 least significant bits for each letter by
    560       1.1    jruoho  *                     discarding upper 3 bits because they are always 0.
    561       1.1    jruoho  *                  4) Compressed code = concatenate 0 and the 3 5-bit values
    562       1.1    jruoho  *
    563       1.1    jruoho  *              The format of the compressed product identifier is as follows:
    564       1.1    jruoho  *              Byte 0: Bit 7       - Reserved (0)
    565       1.1    jruoho  *                      Bits 6-2:   - 1st character of compressed mfg code
    566       1.1    jruoho  *                      Bits 1-0    - Upper 2 bits of 2nd character of mfg code
    567       1.1    jruoho  *              Byte 1: Bits 7-5    - Lower 3 bits of 2nd character of mfg code
    568       1.1    jruoho  *                      Bits 4-0    - 3rd character of mfg code
    569       1.1    jruoho  *              Byte 2: Bits 7-4    - 1st hex digit of product number
    570       1.1    jruoho  *                      Bits 3-0    - 2nd hex digit of product number
    571       1.1    jruoho  *              Byte 3: Bits 7-4    - 3st hex digit of product number
    572       1.1    jruoho  *                      Bits 3-0    - Hex digit of the revision number
    573       1.1    jruoho  *
    574       1.1    jruoho  ******************************************************************************/
    575       1.1    jruoho 
    576       1.1    jruoho static void
    577       1.1    jruoho OpcDoEisaId (
    578       1.1    jruoho     ACPI_PARSE_OBJECT       *Op)
    579       1.1    jruoho {
    580       1.1    jruoho     UINT32                  EisaId = 0;
    581       1.1    jruoho     UINT32                  BigEndianId;
    582       1.1    jruoho     char                    *InString;
    583       1.1    jruoho     ACPI_STATUS             Status = AE_OK;
    584       1.1    jruoho     UINT32                  i;
    585       1.1    jruoho 
    586       1.1    jruoho 
    587       1.1    jruoho     InString = (char *) Op->Asl.Value.String;
    588       1.1    jruoho 
    589       1.1    jruoho     /*
    590       1.1    jruoho      * The EISAID string must be exactly 7 characters and of the form
    591       1.1    jruoho      * "UUUXXXX" -- 3 uppercase letters and 4 hex digits (e.g., "PNP0001")
    592       1.1    jruoho      */
    593   1.1.1.6  christos     if (strlen (InString) != 7)
    594       1.1    jruoho     {
    595       1.1    jruoho         Status = AE_BAD_PARAMETER;
    596       1.1    jruoho     }
    597       1.1    jruoho     else
    598       1.1    jruoho     {
    599       1.1    jruoho         /* Check all 7 characters for correct format */
    600       1.1    jruoho 
    601       1.1    jruoho         for (i = 0; i < 7; i++)
    602       1.1    jruoho         {
    603       1.1    jruoho             /* First 3 characters must be uppercase letters */
    604       1.1    jruoho 
    605       1.1    jruoho             if (i < 3)
    606       1.1    jruoho             {
    607       1.1    jruoho                 if (!isupper ((int) InString[i]))
    608       1.1    jruoho                 {
    609       1.1    jruoho                     Status = AE_BAD_PARAMETER;
    610       1.1    jruoho                 }
    611       1.1    jruoho             }
    612       1.1    jruoho 
    613       1.1    jruoho             /* Last 4 characters must be hex digits */
    614       1.1    jruoho 
    615       1.1    jruoho             else if (!isxdigit ((int) InString[i]))
    616       1.1    jruoho             {
    617       1.1    jruoho                 Status = AE_BAD_PARAMETER;
    618       1.1    jruoho             }
    619       1.1    jruoho         }
    620       1.1    jruoho     }
    621       1.1    jruoho 
    622       1.1    jruoho     if (ACPI_FAILURE (Status))
    623       1.1    jruoho     {
    624       1.1    jruoho         AslError (ASL_ERROR, ASL_MSG_INVALID_EISAID, Op, Op->Asl.Value.String);
    625       1.1    jruoho     }
    626       1.1    jruoho     else
    627       1.1    jruoho     {
    628       1.1    jruoho         /* Create ID big-endian first (bits are contiguous) */
    629       1.1    jruoho 
    630       1.1    jruoho         BigEndianId =
    631   1.1.1.2    jruoho             (UINT32) ((UINT8) (InString[0] - 0x40)) << 26 |
    632   1.1.1.2    jruoho             (UINT32) ((UINT8) (InString[1] - 0x40)) << 21 |
    633   1.1.1.2    jruoho             (UINT32) ((UINT8) (InString[2] - 0x40)) << 16 |
    634       1.1    jruoho 
    635   1.1.1.4  christos             (AcpiUtAsciiCharToHex (InString[3])) << 12 |
    636   1.1.1.4  christos             (AcpiUtAsciiCharToHex (InString[4])) << 8  |
    637   1.1.1.4  christos             (AcpiUtAsciiCharToHex (InString[5])) << 4  |
    638   1.1.1.4  christos              AcpiUtAsciiCharToHex (InString[6]);
    639       1.1    jruoho 
    640       1.1    jruoho         /* Swap to little-endian to get final ID (see function header) */
    641       1.1    jruoho 
    642       1.1    jruoho         EisaId = AcpiUtDwordByteSwap (BigEndianId);
    643       1.1    jruoho     }
    644       1.1    jruoho 
    645       1.1    jruoho     /*
    646       1.1    jruoho      * Morph the Op into an integer, regardless of whether there
    647       1.1    jruoho      * was an error in the EISAID string
    648       1.1    jruoho      */
    649       1.1    jruoho     Op->Asl.Value.Integer = EisaId;
    650       1.1    jruoho 
    651  1.1.1.10  christos     Op->Asl.CompileFlags &= ~OP_COMPILE_TIME_CONST;
    652       1.1    jruoho     Op->Asl.ParseOpcode = PARSEOP_INTEGER;
    653       1.1    jruoho     (void) OpcSetOptimalIntegerSize (Op);
    654       1.1    jruoho 
    655       1.1    jruoho     /* Op is now an integer */
    656       1.1    jruoho 
    657       1.1    jruoho     UtSetParseOpName (Op);
    658       1.1    jruoho }
    659       1.1    jruoho 
    660       1.1    jruoho 
    661       1.1    jruoho /*******************************************************************************
    662       1.1    jruoho  *
    663   1.1.1.3  christos  * FUNCTION:    OpcDoUuId
    664       1.1    jruoho  *
    665   1.1.1.5  christos  * PARAMETERS:  Op                  - Parse node
    666       1.1    jruoho  *
    667       1.1    jruoho  * RETURN:      None
    668       1.1    jruoho  *
    669       1.1    jruoho  * DESCRIPTION: Convert UUID string to 16-byte buffer
    670       1.1    jruoho  *
    671       1.1    jruoho  ******************************************************************************/
    672       1.1    jruoho 
    673       1.1    jruoho static void
    674       1.1    jruoho OpcDoUuId (
    675       1.1    jruoho     ACPI_PARSE_OBJECT       *Op)
    676       1.1    jruoho {
    677       1.1    jruoho     char                    *InString;
    678   1.1.1.4  christos     UINT8                   *Buffer;
    679       1.1    jruoho     ACPI_STATUS             Status = AE_OK;
    680       1.1    jruoho     ACPI_PARSE_OBJECT       *NewOp;
    681       1.1    jruoho 
    682       1.1    jruoho 
    683   1.1.1.5  christos     InString = ACPI_CAST_PTR (char, Op->Asl.Value.String);
    684       1.1    jruoho     Buffer = UtLocalCalloc (16);
    685       1.1    jruoho 
    686   1.1.1.2    jruoho     Status = AuValidateUuid (InString);
    687       1.1    jruoho     if (ACPI_FAILURE (Status))
    688       1.1    jruoho     {
    689       1.1    jruoho         AslError (ASL_ERROR, ASL_MSG_INVALID_UUID, Op, Op->Asl.Value.String);
    690       1.1    jruoho     }
    691   1.1.1.2    jruoho     else
    692       1.1    jruoho     {
    693   1.1.1.4  christos         AcpiUtConvertStringToUuid (InString, Buffer);
    694       1.1    jruoho     }
    695       1.1    jruoho 
    696       1.1    jruoho     /* Change Op to a Buffer */
    697       1.1    jruoho 
    698       1.1    jruoho     Op->Asl.ParseOpcode = PARSEOP_BUFFER;
    699       1.1    jruoho     Op->Common.AmlOpcode = AML_BUFFER_OP;
    700       1.1    jruoho 
    701       1.1    jruoho     /* Disable further optimization */
    702       1.1    jruoho 
    703  1.1.1.10  christos     Op->Asl.CompileFlags &= ~OP_COMPILE_TIME_CONST;
    704       1.1    jruoho     UtSetParseOpName (Op);
    705       1.1    jruoho 
    706       1.1    jruoho     /* Child node is the buffer length */
    707       1.1    jruoho 
    708  1.1.1.10  christos     NewOp = TrAllocateOp (PARSEOP_INTEGER);
    709       1.1    jruoho 
    710   1.1.1.7  christos     NewOp->Asl.AmlOpcode = AML_BYTE_OP;
    711       1.1    jruoho     NewOp->Asl.Value.Integer = 16;
    712   1.1.1.7  christos     NewOp->Asl.Parent = Op;
    713       1.1    jruoho 
    714       1.1    jruoho     Op->Asl.Child = NewOp;
    715       1.1    jruoho     Op = NewOp;
    716       1.1    jruoho 
    717       1.1    jruoho     /* Peer to the child is the raw buffer data */
    718       1.1    jruoho 
    719  1.1.1.10  christos     NewOp = TrAllocateOp (PARSEOP_RAW_DATA);
    720   1.1.1.7  christos     NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
    721   1.1.1.7  christos     NewOp->Asl.AmlLength = 16;
    722   1.1.1.7  christos     NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer);
    723   1.1.1.7  christos     NewOp->Asl.Parent = Op->Asl.Parent;
    724       1.1    jruoho 
    725       1.1    jruoho     Op->Asl.Next = NewOp;
    726       1.1    jruoho }
    727       1.1    jruoho 
    728       1.1    jruoho 
    729       1.1    jruoho /*******************************************************************************
    730       1.1    jruoho  *
    731       1.1    jruoho  * FUNCTION:    OpcGenerateAmlOpcode
    732       1.1    jruoho  *
    733   1.1.1.5  christos  * PARAMETERS:  Op                  - Parse node
    734       1.1    jruoho  *
    735       1.1    jruoho  * RETURN:      None
    736       1.1    jruoho  *
    737       1.1    jruoho  * DESCRIPTION: Generate the AML opcode associated with the node and its
    738   1.1.1.3  christos  *              parse (lex/flex) keyword opcode. Essentially implements
    739       1.1    jruoho  *              a mapping between the parse opcodes and the actual AML opcodes.
    740       1.1    jruoho  *
    741       1.1    jruoho  ******************************************************************************/
    742       1.1    jruoho 
    743       1.1    jruoho void
    744       1.1    jruoho OpcGenerateAmlOpcode (
    745       1.1    jruoho     ACPI_PARSE_OBJECT       *Op)
    746       1.1    jruoho {
    747       1.1    jruoho     UINT16                  Index;
    748       1.1    jruoho 
    749       1.1    jruoho 
    750       1.1    jruoho     Index = (UINT16) (Op->Asl.ParseOpcode - ASL_PARSE_OPCODE_BASE);
    751       1.1    jruoho 
    752       1.1    jruoho     Op->Asl.AmlOpcode     = AslKeywordMapping[Index].AmlOpcode;
    753       1.1    jruoho     Op->Asl.AcpiBtype     = AslKeywordMapping[Index].AcpiBtype;
    754       1.1    jruoho     Op->Asl.CompileFlags |= AslKeywordMapping[Index].Flags;
    755       1.1    jruoho 
    756       1.1    jruoho     if (!Op->Asl.Value.Integer)
    757       1.1    jruoho     {
    758       1.1    jruoho         Op->Asl.Value.Integer = AslKeywordMapping[Index].Value;
    759       1.1    jruoho     }
    760       1.1    jruoho 
    761       1.1    jruoho     /* Special handling for some opcodes */
    762       1.1    jruoho 
    763       1.1    jruoho     switch (Op->Asl.ParseOpcode)
    764       1.1    jruoho     {
    765       1.1    jruoho     case PARSEOP_INTEGER:
    766       1.1    jruoho         /*
    767       1.1    jruoho          * Set the opcode based on the size of the integer
    768       1.1    jruoho          */
    769       1.1    jruoho         (void) OpcSetOptimalIntegerSize (Op);
    770       1.1    jruoho         break;
    771       1.1    jruoho 
    772       1.1    jruoho     case PARSEOP_OFFSET:
    773       1.1    jruoho 
    774       1.1    jruoho         Op->Asl.AmlOpcodeLength = 1;
    775       1.1    jruoho         break;
    776       1.1    jruoho 
    777       1.1    jruoho     case PARSEOP_ACCESSAS:
    778       1.1    jruoho 
    779       1.1    jruoho         OpcDoAccessAs (Op);
    780       1.1    jruoho         break;
    781       1.1    jruoho 
    782   1.1.1.3  christos     case PARSEOP_CONNECTION:
    783   1.1.1.3  christos 
    784   1.1.1.3  christos         OpcDoConnection (Op);
    785   1.1.1.3  christos         break;
    786   1.1.1.3  christos 
    787       1.1    jruoho     case PARSEOP_EISAID:
    788       1.1    jruoho 
    789       1.1    jruoho         OpcDoEisaId (Op);
    790       1.1    jruoho         break;
    791       1.1    jruoho 
    792   1.1.1.5  christos     case PARSEOP_PRINTF:
    793   1.1.1.5  christos 
    794   1.1.1.5  christos         OpcDoPrintf (Op);
    795   1.1.1.5  christos         break;
    796   1.1.1.5  christos 
    797   1.1.1.5  christos     case PARSEOP_FPRINTF:
    798   1.1.1.5  christos 
    799   1.1.1.5  christos         OpcDoFprintf (Op);
    800   1.1.1.5  christos         break;
    801   1.1.1.5  christos 
    802   1.1.1.5  christos     case PARSEOP_TOPLD:
    803   1.1.1.5  christos 
    804   1.1.1.5  christos         OpcDoPld (Op);
    805   1.1.1.5  christos         break;
    806   1.1.1.5  christos 
    807       1.1    jruoho     case PARSEOP_TOUUID:
    808       1.1    jruoho 
    809       1.1    jruoho         OpcDoUuId (Op);
    810       1.1    jruoho         break;
    811       1.1    jruoho 
    812       1.1    jruoho     case PARSEOP_UNICODE:
    813       1.1    jruoho 
    814       1.1    jruoho         OpcDoUnicode (Op);
    815       1.1    jruoho         break;
    816       1.1    jruoho 
    817       1.1    jruoho     case PARSEOP_INCLUDE:
    818       1.1    jruoho 
    819  1.1.1.12  christos         AslGbl_HasIncludeFiles = TRUE;
    820       1.1    jruoho         break;
    821       1.1    jruoho 
    822   1.1.1.3  christos     case PARSEOP_TIMER:
    823   1.1.1.3  christos 
    824   1.1.1.3  christos         if (AcpiGbl_IntegerBitWidth == 32)
    825   1.1.1.3  christos         {
    826   1.1.1.3  christos             AslError (ASL_REMARK, ASL_MSG_TRUNCATION, Op, NULL);
    827   1.1.1.3  christos         }
    828   1.1.1.3  christos         break;
    829   1.1.1.3  christos 
    830       1.1    jruoho     default:
    831   1.1.1.3  christos 
    832       1.1    jruoho         /* Nothing to do for other opcodes */
    833   1.1.1.3  christos 
    834       1.1    jruoho         break;
    835       1.1    jruoho     }
    836       1.1    jruoho 
    837       1.1    jruoho     return;
    838       1.1    jruoho }
    839