Home | History | Annotate | Line # | Download | only in compiler
cvparser.c revision 1.1.1.8
      1      1.1  christos /******************************************************************************
      2      1.1  christos  *
      3      1.1  christos  * Module Name: cvparser - Converter functions that are called from the AML
      4      1.1  christos  *                         parser.
      5      1.1  christos  *
      6      1.1  christos  *****************************************************************************/
      7      1.1  christos 
      8      1.1  christos /*
      9  1.1.1.8  christos  * 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 #include "aslcompiler.h"
     46      1.1  christos #include "acparser.h"
     47      1.1  christos #include "acdispat.h"
     48      1.1  christos #include "amlcode.h"
     49      1.1  christos #include "acinterp.h"
     50      1.1  christos #include "acdisasm.h"
     51      1.1  christos #include "acconvert.h"
     52      1.1  christos 
     53      1.1  christos 
     54      1.1  christos /* local prototypes */
     55      1.1  christos 
     56      1.1  christos static BOOLEAN
     57      1.1  christos CvCommentExists (
     58      1.1  christos     UINT8                   *Address);
     59      1.1  christos 
     60      1.1  christos static BOOLEAN
     61      1.1  christos CvIsFilename (
     62      1.1  christos     char                   *Filename);
     63      1.1  christos 
     64      1.1  christos static ACPI_FILE_NODE*
     65      1.1  christos CvFileAddressLookup(
     66      1.1  christos     char                    *Address,
     67      1.1  christos     ACPI_FILE_NODE          *Head);
     68      1.1  christos 
     69      1.1  christos static void
     70      1.1  christos CvAddToFileTree (
     71      1.1  christos     char                    *Filename,
     72      1.1  christos     char                    *PreviousFilename);
     73      1.1  christos 
     74      1.1  christos static void
     75      1.1  christos CvSetFileParent (
     76      1.1  christos     char                    *ChildFile,
     77      1.1  christos     char                    *ParentFile);
     78      1.1  christos 
     79      1.1  christos 
     80      1.1  christos /*******************************************************************************
     81      1.1  christos  *
     82      1.1  christos  * FUNCTION:    CvIsFilename
     83      1.1  christos  *
     84      1.1  christos  * PARAMETERS:  filename - input filename
     85      1.1  christos  *
     86      1.1  christos  * RETURN:      BOOLEAN - TRUE if all characters are between 0x20 and 0x7f
     87      1.1  christos  *
     88      1.1  christos  * DESCRIPTION: Take a given char * and see if it contains all printable
     89      1.1  christos  *              characters. If all characters have hexvalues 20-7f and ends with
     90      1.1  christos  *              .dsl, we will assume that it is a proper filename.
     91      1.1  christos  *
     92      1.1  christos  ******************************************************************************/
     93      1.1  christos 
     94      1.1  christos static BOOLEAN
     95      1.1  christos CvIsFilename (
     96      1.1  christos     char                    *Filename)
     97      1.1  christos {
     98      1.1  christos     UINT64                  Length = strlen(Filename);
     99      1.1  christos     char                    *FileExt = Filename + Length - 4;
    100  1.1.1.2  christos     UINT64                  i;
    101      1.1  christos 
    102      1.1  christos 
    103      1.1  christos     if ((Length > 4) && AcpiUtStricmp (FileExt, ".dsl"))
    104      1.1  christos     {
    105  1.1.1.2  christos         return (FALSE);
    106      1.1  christos     }
    107      1.1  christos 
    108      1.1  christos     for(i = 0; i<Length; ++i)
    109      1.1  christos     {
    110  1.1.1.2  christos         if (!isprint ((int) Filename[i]))
    111      1.1  christos         {
    112  1.1.1.2  christos             return (FALSE);
    113      1.1  christos         }
    114      1.1  christos     }
    115  1.1.1.2  christos 
    116  1.1.1.2  christos     return (TRUE);
    117      1.1  christos }
    118      1.1  christos 
    119      1.1  christos 
    120      1.1  christos /*******************************************************************************
    121      1.1  christos  *
    122      1.1  christos  * FUNCTION:    CvInitFileTree
    123      1.1  christos  *
    124      1.1  christos  * PARAMETERS:  Table      - input table
    125  1.1.1.8  christos  *              RootFile   - Output file that defines the DefinitionBlock
    126      1.1  christos  *
    127  1.1.1.2  christos  * RETURN:      None
    128      1.1  christos  *
    129      1.1  christos  * DESCRIPTION: Initialize the file dependency tree by scanning the AML.
    130      1.1  christos  *              This is referred as ASL_CV_INIT_FILETREE.
    131      1.1  christos  *
    132      1.1  christos  ******************************************************************************/
    133      1.1  christos 
    134      1.1  christos void
    135      1.1  christos CvInitFileTree (
    136      1.1  christos     ACPI_TABLE_HEADER       *Table,
    137  1.1.1.8  christos     FILE                    *RootFile)
    138      1.1  christos {
    139      1.1  christos     UINT8                   *TreeAml;
    140      1.1  christos     UINT8                   *FileEnd;
    141      1.1  christos     char                    *Filename = NULL;
    142      1.1  christos     char                    *PreviousFilename = NULL;
    143      1.1  christos     char                    *ParentFilename = NULL;
    144      1.1  christos     char                    *ChildFilename = NULL;
    145  1.1.1.8  christos     UINT8                   *AmlStart;
    146  1.1.1.8  christos     UINT32                  AmlLength;
    147      1.1  christos 
    148      1.1  christos 
    149  1.1.1.4  christos     if (!AcpiGbl_CaptureComments)
    150      1.1  christos     {
    151      1.1  christos         return;
    152      1.1  christos     }
    153      1.1  christos 
    154  1.1.1.8  christos 
    155  1.1.1.8  christos     AmlLength = Table->Length - sizeof (ACPI_TABLE_HEADER);
    156  1.1.1.8  christos     AmlStart = ((UINT8 *) Table + sizeof (ACPI_TABLE_HEADER));
    157  1.1.1.8  christos 
    158      1.1  christos     CvDbgPrint ("AmlLength: %x\n", AmlLength);
    159      1.1  christos     CvDbgPrint ("AmlStart:  %p\n", AmlStart);
    160  1.1.1.8  christos     CvDbgPrint ("AmlEnd:    %p\n", AmlStart+AmlLength);
    161      1.1  christos 
    162      1.1  christos     AcpiGbl_FileTreeRoot = AcpiOsAcquireObject (AcpiGbl_FileCache);
    163  1.1.1.2  christos 
    164      1.1  christos     AcpiGbl_FileTreeRoot->FileStart = (char *)(AmlStart);
    165      1.1  christos     AcpiGbl_FileTreeRoot->FileEnd = (char *)(AmlStart + Table->Length);
    166      1.1  christos     AcpiGbl_FileTreeRoot->Next = NULL;
    167      1.1  christos     AcpiGbl_FileTreeRoot->Parent = NULL;
    168      1.1  christos     AcpiGbl_FileTreeRoot->Filename = (char *)(AmlStart+2);
    169      1.1  christos 
    170      1.1  christos     /* Set the root file to the current open file */
    171      1.1  christos 
    172  1.1.1.8  christos     AcpiGbl_FileTreeRoot->File = RootFile;
    173      1.1  christos 
    174      1.1  christos     /*
    175  1.1.1.6  christos      * Set this to true because we don't need to output
    176      1.1  christos      * an include statement for the topmost file
    177      1.1  christos      */
    178      1.1  christos     AcpiGbl_FileTreeRoot->IncludeWritten = TRUE;
    179      1.1  christos     Filename = NULL;
    180      1.1  christos     AcpiGbl_CurrentFilename = (char *)(AmlStart+2);
    181      1.1  christos     AcpiGbl_RootFilename    = (char *)(AmlStart+2);
    182      1.1  christos 
    183      1.1  christos     TreeAml = AmlStart;
    184      1.1  christos     FileEnd = AmlStart + AmlLength;
    185      1.1  christos 
    186      1.1  christos     while (TreeAml <= FileEnd)
    187      1.1  christos     {
    188      1.1  christos         /*
    189      1.1  christos          * Make sure that this filename contains all printable characters
    190      1.1  christos          * and a .dsl extension at the end. If not, then it must be some
    191      1.1  christos          * raw data that doesn't outline a filename.
    192      1.1  christos          */
    193      1.1  christos         if ((*TreeAml == AML_COMMENT_OP) &&
    194  1.1.1.2  christos             (*(TreeAml +1) == FILENAME_COMMENT) &&
    195  1.1.1.2  christos             (CvIsFilename ((char *)(TreeAml +2))))
    196      1.1  christos         {
    197      1.1  christos             CvDbgPrint ("A9 and a 08 file\n");
    198      1.1  christos             PreviousFilename = Filename;
    199  1.1.1.2  christos             Filename = (char *) (TreeAml +2);
    200  1.1.1.2  christos 
    201      1.1  christos             CvAddToFileTree (Filename, PreviousFilename);
    202      1.1  christos             ChildFilename = Filename;
    203      1.1  christos             CvDbgPrint ("%s\n", Filename);
    204      1.1  christos         }
    205      1.1  christos         else if ((*TreeAml == AML_COMMENT_OP) &&
    206  1.1.1.2  christos             (*(TreeAml +1) == PARENTFILENAME_COMMENT) &&
    207  1.1.1.2  christos             (CvIsFilename ((char *)(TreeAml +2))))
    208      1.1  christos         {
    209      1.1  christos             CvDbgPrint ("A9 and a 09 file\n");
    210  1.1.1.2  christos             ParentFilename = (char *)(TreeAml +2);
    211      1.1  christos             CvSetFileParent (ChildFilename, ParentFilename);
    212      1.1  christos             CvDbgPrint ("%s\n", ParentFilename);
    213      1.1  christos         }
    214  1.1.1.2  christos 
    215      1.1  christos         ++TreeAml;
    216      1.1  christos     }
    217      1.1  christos }
    218      1.1  christos 
    219      1.1  christos 
    220      1.1  christos /*******************************************************************************
    221      1.1  christos  *
    222      1.1  christos  * FUNCTION:    CvClearOpComments
    223      1.1  christos  *
    224      1.1  christos  * PARAMETERS:  Op -- clear all comments within this Op
    225      1.1  christos  *
    226  1.1.1.2  christos  * RETURN:      None
    227      1.1  christos  *
    228      1.1  christos  * DESCRIPTION: Clear all converter-related fields of the given Op.
    229      1.1  christos  *              This is referred as ASL_CV_CLEAR_OP_COMMENTS.
    230      1.1  christos  *
    231      1.1  christos  ******************************************************************************/
    232      1.1  christos 
    233      1.1  christos void
    234      1.1  christos CvClearOpComments (
    235      1.1  christos     ACPI_PARSE_OBJECT       *Op)
    236      1.1  christos {
    237  1.1.1.2  christos 
    238      1.1  christos     Op->Common.InlineComment     = NULL;
    239      1.1  christos     Op->Common.EndNodeComment    = NULL;
    240      1.1  christos     Op->Common.NameComment       = NULL;
    241      1.1  christos     Op->Common.CommentList       = NULL;
    242      1.1  christos     Op->Common.EndBlkComment     = NULL;
    243      1.1  christos     Op->Common.CloseBraceComment = NULL;
    244      1.1  christos     Op->Common.CvFilename        = NULL;
    245      1.1  christos     Op->Common.CvParentFilename  = NULL;
    246      1.1  christos }
    247      1.1  christos 
    248      1.1  christos 
    249      1.1  christos /*******************************************************************************
    250      1.1  christos  *
    251      1.1  christos  * FUNCTION:    CvCommentExists
    252      1.1  christos  *
    253  1.1.1.2  christos  * PARAMETERS:  Address - check if this address appears in the list
    254      1.1  christos  *
    255      1.1  christos  * RETURN:      BOOLEAN - TRUE if the address exists.
    256      1.1  christos  *
    257  1.1.1.2  christos  * DESCRIPTION: Look at the pointer address and check if this appears in the
    258  1.1.1.2  christos  *              list of all addresses. If it exists in the list, return TRUE
    259      1.1  christos  *              if it exists. Otherwise add to the list and return FALSE.
    260      1.1  christos  *
    261      1.1  christos  ******************************************************************************/
    262      1.1  christos 
    263      1.1  christos static BOOLEAN
    264      1.1  christos CvCommentExists (
    265      1.1  christos     UINT8                    *Address)
    266      1.1  christos {
    267      1.1  christos     ACPI_COMMENT_ADDR_NODE   *Current = AcpiGbl_CommentAddrListHead;
    268      1.1  christos     UINT8                    Option;
    269      1.1  christos 
    270      1.1  christos 
    271      1.1  christos     if (!Address)
    272      1.1  christos     {
    273      1.1  christos         return (FALSE);
    274      1.1  christos     }
    275  1.1.1.2  christos 
    276      1.1  christos     Option = *(Address + 1);
    277      1.1  christos 
    278      1.1  christos     /*
    279  1.1.1.2  christos      * FILENAME_COMMENT and PARENTFILENAME_COMMENT are not treated as
    280  1.1.1.2  christos      * comments. They serve as markers for where the file starts and ends.
    281      1.1  christos      */
    282  1.1.1.2  christos     if ((Option == FILENAME_COMMENT) ||
    283  1.1.1.2  christos         (Option == PARENTFILENAME_COMMENT))
    284      1.1  christos     {
    285      1.1  christos        return (FALSE);
    286      1.1  christos     }
    287      1.1  christos 
    288      1.1  christos     if (!Current)
    289      1.1  christos     {
    290      1.1  christos         AcpiGbl_CommentAddrListHead =
    291      1.1  christos             AcpiOsAcquireObject (AcpiGbl_RegCommentCache);
    292      1.1  christos         AcpiGbl_CommentAddrListHead->Addr = Address;
    293      1.1  christos         AcpiGbl_CommentAddrListHead->Next = NULL;
    294      1.1  christos         return (FALSE);
    295      1.1  christos     }
    296      1.1  christos     else
    297      1.1  christos     {
    298      1.1  christos         while (Current)
    299      1.1  christos         {
    300      1.1  christos             if (Current->Addr != Address)
    301      1.1  christos             {
    302      1.1  christos                 Current = Current->Next;
    303      1.1  christos             }
    304      1.1  christos             else
    305      1.1  christos             {
    306      1.1  christos                 return (TRUE);
    307      1.1  christos             }
    308      1.1  christos         }
    309      1.1  christos 
    310      1.1  christos         /*
    311  1.1.1.2  christos          * If the execution gets to this point, it means that this
    312  1.1.1.2  christos          * address does not exists in the list. Add this address to the
    313      1.1  christos          * beginning of the list.
    314      1.1  christos          */
    315      1.1  christos         Current = AcpiGbl_CommentAddrListHead;
    316      1.1  christos         AcpiGbl_CommentAddrListHead =
    317      1.1  christos             AcpiOsAcquireObject (AcpiGbl_RegCommentCache);
    318  1.1.1.2  christos 
    319      1.1  christos         AcpiGbl_CommentAddrListHead->Addr = Address;
    320      1.1  christos         AcpiGbl_CommentAddrListHead->Next = Current;
    321      1.1  christos         return (FALSE);
    322      1.1  christos     }
    323      1.1  christos }
    324      1.1  christos 
    325      1.1  christos 
    326      1.1  christos /*******************************************************************************
    327      1.1  christos  *
    328      1.1  christos  * FUNCTION:    CvFilenameExists
    329      1.1  christos  *
    330      1.1  christos  * PARAMETERS:  Filename        - filename to search
    331      1.1  christos  *
    332      1.1  christos  * RETURN:      ACPI_FILE_NODE - a pointer to a file node
    333      1.1  christos  *
    334      1.1  christos  * DESCRIPTION: Look for the given filename in the file dependency tree.
    335      1.1  christos  *              Returns the file node if it exists, returns NULL if it does not.
    336      1.1  christos  *
    337      1.1  christos  ******************************************************************************/
    338      1.1  christos 
    339      1.1  christos ACPI_FILE_NODE*
    340      1.1  christos CvFilenameExists(
    341      1.1  christos     char                    *Filename,
    342      1.1  christos     ACPI_FILE_NODE          *Head)
    343      1.1  christos {
    344      1.1  christos     ACPI_FILE_NODE          *Current = Head;
    345      1.1  christos 
    346      1.1  christos 
    347  1.1.1.2  christos     if (!Filename)
    348  1.1.1.2  christos     {
    349  1.1.1.2  christos         return (NULL);
    350  1.1.1.2  christos     }
    351  1.1.1.2  christos 
    352      1.1  christos     while (Current)
    353      1.1  christos     {
    354      1.1  christos         if (!AcpiUtStricmp (Current->Filename, Filename))
    355      1.1  christos         {
    356      1.1  christos             return (Current);
    357      1.1  christos         }
    358  1.1.1.2  christos 
    359      1.1  christos         Current = Current->Next;
    360      1.1  christos     }
    361      1.1  christos     return (NULL);
    362      1.1  christos }
    363      1.1  christos 
    364      1.1  christos 
    365      1.1  christos /*******************************************************************************
    366      1.1  christos  *
    367      1.1  christos  * FUNCTION:    CvFileAddressLookup
    368      1.1  christos  *
    369      1.1  christos  * PARAMETERS:  Address        - address to look up
    370      1.1  christos  *              Head           - file dependency tree
    371      1.1  christos  *
    372  1.1.1.2  christos  * RETURN:      ACPI_FILE_NODE - pointer to a file node containing the address
    373      1.1  christos  *
    374      1.1  christos  * DESCRIPTION: Look for the given address in the file dependency tree.
    375      1.1  christos  *              Returns the first file node where the given address is within
    376      1.1  christos  *              the file node's starting and ending address.
    377      1.1  christos  *
    378      1.1  christos  ******************************************************************************/
    379      1.1  christos 
    380  1.1.1.2  christos static ACPI_FILE_NODE *
    381      1.1  christos CvFileAddressLookup(
    382      1.1  christos     char                    *Address,
    383      1.1  christos     ACPI_FILE_NODE          *Head)
    384      1.1  christos {
    385      1.1  christos     ACPI_FILE_NODE          *Current = Head;
    386      1.1  christos 
    387      1.1  christos 
    388      1.1  christos     while (Current)
    389      1.1  christos     {
    390      1.1  christos         if ((Address >= Current->FileStart) &&
    391      1.1  christos             (Address < Current->FileEnd ||
    392      1.1  christos             !Current->FileEnd))
    393      1.1  christos         {
    394      1.1  christos             return (Current);
    395      1.1  christos         }
    396  1.1.1.2  christos 
    397      1.1  christos         Current = Current->Next;
    398      1.1  christos     }
    399      1.1  christos 
    400      1.1  christos     return (NULL);
    401      1.1  christos }
    402      1.1  christos 
    403      1.1  christos 
    404      1.1  christos /*******************************************************************************
    405      1.1  christos  *
    406      1.1  christos  * FUNCTION:    CvLabelFileNode
    407      1.1  christos  *
    408      1.1  christos  * PARAMETERS:  Op
    409      1.1  christos  *
    410      1.1  christos  * RETURN:      None
    411      1.1  christos  *
    412      1.1  christos  * DESCRIPTION: Takes a given parse op, looks up its Op->Common.Aml field
    413  1.1.1.6  christos  *              within the file tree and fills in appropriate file information
    414      1.1  christos  *              from a matching node within the tree.
    415      1.1  christos  *              This is referred as ASL_CV_LABEL_FILENODE.
    416      1.1  christos  *
    417      1.1  christos  ******************************************************************************/
    418      1.1  christos 
    419      1.1  christos void
    420      1.1  christos CvLabelFileNode(
    421      1.1  christos     ACPI_PARSE_OBJECT       *Op)
    422      1.1  christos {
    423      1.1  christos     ACPI_FILE_NODE          *Node;
    424      1.1  christos 
    425      1.1  christos 
    426      1.1  christos     if (!Op)
    427      1.1  christos     {
    428      1.1  christos         return;
    429      1.1  christos     }
    430      1.1  christos 
    431  1.1.1.2  christos     Node = CvFileAddressLookup ((char *)
    432  1.1.1.2  christos         Op->Common.Aml, AcpiGbl_FileTreeRoot);
    433      1.1  christos     if (!Node)
    434      1.1  christos     {
    435      1.1  christos        return;
    436      1.1  christos     }
    437      1.1  christos 
    438      1.1  christos     Op->Common.CvFilename = Node->Filename;
    439      1.1  christos     if (Node->Parent)
    440      1.1  christos     {
    441      1.1  christos         Op->Common.CvParentFilename = Node->Parent->Filename;
    442      1.1  christos     }
    443      1.1  christos     else
    444      1.1  christos     {
    445      1.1  christos         Op->Common.CvParentFilename = Node->Filename;
    446      1.1  christos     }
    447      1.1  christos }
    448      1.1  christos 
    449      1.1  christos 
    450      1.1  christos /*******************************************************************************
    451      1.1  christos  *
    452      1.1  christos  * FUNCTION:    CvAddToFileTree
    453      1.1  christos  *
    454      1.1  christos  * PARAMETERS:  Filename          - Address containing the name of the current
    455      1.1  christos  *                                  filename
    456      1.1  christos  *              PreviousFilename  - Address containing the name of the previous
    457      1.1  christos  *                                  filename
    458      1.1  christos  *
    459  1.1.1.2  christos  * RETURN:      None
    460      1.1  christos  *
    461      1.1  christos  * DESCRIPTION: Add this filename to the AcpiGbl_FileTree if it does not exist.
    462      1.1  christos  *
    463      1.1  christos  ******************************************************************************/
    464      1.1  christos 
    465      1.1  christos static void
    466      1.1  christos CvAddToFileTree (
    467      1.1  christos     char                    *Filename,
    468      1.1  christos     char                    *PreviousFilename)
    469      1.1  christos {
    470      1.1  christos     ACPI_FILE_NODE          *Node;
    471      1.1  christos 
    472      1.1  christos 
    473      1.1  christos     if (!AcpiUtStricmp(Filename, AcpiGbl_RootFilename) &&
    474      1.1  christos         PreviousFilename)
    475      1.1  christos     {
    476      1.1  christos         Node = CvFilenameExists (PreviousFilename, AcpiGbl_FileTreeRoot);
    477      1.1  christos         if (Node)
    478      1.1  christos         {
    479      1.1  christos             /*
    480      1.1  christos              * Set the end point of the PreviousFilename to the address
    481      1.1  christos              * of Filename.
    482      1.1  christos              */
    483      1.1  christos             Node->FileEnd = Filename;
    484      1.1  christos         }
    485      1.1  christos     }
    486      1.1  christos     else if (!AcpiUtStricmp(Filename, AcpiGbl_RootFilename) &&
    487      1.1  christos              !PreviousFilename)
    488      1.1  christos     {
    489      1.1  christos         return;
    490      1.1  christos     }
    491      1.1  christos 
    492      1.1  christos     Node = CvFilenameExists (Filename, AcpiGbl_FileTreeRoot);
    493      1.1  christos     if (Node && PreviousFilename)
    494      1.1  christos     {
    495      1.1  christos         /*
    496  1.1.1.2  christos          * Update the end of the previous file and all of their parents'
    497  1.1.1.2  christos          * ending addresses. This is done to ensure that parent file
    498  1.1.1.2  christos          * ranges extend to the end of their childrens' files.
    499      1.1  christos          */
    500      1.1  christos         Node = CvFilenameExists (PreviousFilename, AcpiGbl_FileTreeRoot);
    501      1.1  christos         if (Node && (Node->FileEnd < Filename))
    502      1.1  christos         {
    503      1.1  christos             Node->FileEnd = Filename;
    504      1.1  christos             Node = Node->Parent;
    505      1.1  christos             while (Node)
    506      1.1  christos             {
    507      1.1  christos                 if (Node->FileEnd < Filename)
    508      1.1  christos                 {
    509      1.1  christos                     Node->FileEnd = Filename;
    510      1.1  christos                 }
    511  1.1.1.2  christos 
    512      1.1  christos                 Node = Node->Parent;
    513      1.1  christos             }
    514      1.1  christos         }
    515      1.1  christos     }
    516      1.1  christos     else
    517      1.1  christos     {
    518      1.1  christos         Node = AcpiGbl_FileTreeRoot;
    519      1.1  christos         AcpiGbl_FileTreeRoot = AcpiOsAcquireObject (AcpiGbl_FileCache);
    520  1.1.1.2  christos 
    521      1.1  christos         AcpiGbl_FileTreeRoot->Next = Node;
    522      1.1  christos         AcpiGbl_FileTreeRoot->Parent = NULL;
    523      1.1  christos         AcpiGbl_FileTreeRoot->Filename = Filename;
    524      1.1  christos         AcpiGbl_FileTreeRoot->FileStart = Filename;
    525      1.1  christos         AcpiGbl_FileTreeRoot->IncludeWritten = FALSE;
    526      1.1  christos         AcpiGbl_FileTreeRoot->File = fopen(Filename, "w+");
    527      1.1  christos 
    528      1.1  christos         /*
    529      1.1  christos          * If we can't open the file, we need to abort here before we
    530      1.1  christos          * accidentally write to a NULL file.
    531      1.1  christos          */
    532      1.1  christos         if (!AcpiGbl_FileTreeRoot->File)
    533      1.1  christos         {
    534      1.1  christos             /* delete the .xxx file */
    535      1.1  christos 
    536      1.1  christos             FlDeleteFile (ASL_FILE_AML_OUTPUT);
    537  1.1.1.5  christos             sprintf (AslGbl_MsgBuffer, "\"%s\" - %s", Filename, strerror (errno));
    538  1.1.1.2  christos             AslCommonError (ASL_ERROR, ASL_MSG_OPEN, 0, 0, 0, 0,
    539  1.1.1.5  christos                 NULL, AslGbl_MsgBuffer);
    540      1.1  christos             AslAbort ();
    541      1.1  christos         }
    542      1.1  christos     }
    543      1.1  christos }
    544      1.1  christos 
    545      1.1  christos 
    546      1.1  christos /*******************************************************************************
    547      1.1  christos  *
    548      1.1  christos  * FUNCTION:    CvSetFileParent
    549      1.1  christos  *
    550      1.1  christos  * PARAMETERS:  ChildFile  - contains the filename of the child file
    551      1.1  christos  *              ParentFile - contains the filename of the parent file.
    552      1.1  christos  *
    553  1.1.1.2  christos  * RETURN:      None
    554      1.1  christos  *
    555  1.1.1.2  christos  * DESCRIPTION: Point the parent pointer of the Child to the node that
    556      1.1  christos  *              corresponds with the parent file node.
    557      1.1  christos  *
    558      1.1  christos  ******************************************************************************/
    559      1.1  christos 
    560      1.1  christos static void
    561      1.1  christos CvSetFileParent (
    562      1.1  christos     char                    *ChildFile,
    563      1.1  christos     char                    *ParentFile)
    564      1.1  christos {
    565      1.1  christos     ACPI_FILE_NODE          *Child;
    566      1.1  christos     ACPI_FILE_NODE          *Parent;
    567      1.1  christos 
    568      1.1  christos 
    569      1.1  christos     Child  = CvFilenameExists (ChildFile, AcpiGbl_FileTreeRoot);
    570      1.1  christos     Parent = CvFilenameExists (ParentFile, AcpiGbl_FileTreeRoot);
    571  1.1.1.2  christos 
    572      1.1  christos     if (Child && Parent)
    573      1.1  christos     {
    574      1.1  christos         Child->Parent = Parent;
    575      1.1  christos 
    576      1.1  christos         while (Child->Parent)
    577      1.1  christos         {
    578      1.1  christos             if (Child->Parent->FileEnd < Child->FileStart)
    579      1.1  christos             {
    580      1.1  christos                 Child->Parent->FileEnd = Child->FileStart;
    581      1.1  christos             }
    582  1.1.1.2  christos 
    583      1.1  christos             Child = Child->Parent;
    584      1.1  christos         }
    585      1.1  christos     }
    586      1.1  christos }
    587      1.1  christos 
    588      1.1  christos 
    589      1.1  christos /*******************************************************************************
    590      1.1  christos  *
    591      1.1  christos  * FUNCTION:    CvCaptureCommentsOnly
    592      1.1  christos  *
    593      1.1  christos  * PARAMETERS:  ParserState         - A parser state object
    594      1.1  christos  *
    595  1.1.1.2  christos  * RETURN:      None
    596      1.1  christos  *
    597  1.1.1.2  christos  * DESCRIPTION: Look at the aml that the parser state is pointing to,
    598      1.1  christos  *              capture any AML_COMMENT_OP and it's arguments and increment the
    599      1.1  christos  *              aml pointer past the comment. Comments are transferred to parse
    600      1.1  christos  *              nodes through CvTransferComments() as well as
    601      1.1  christos  *              AcpiPsBuildNamedOp().
    602      1.1  christos  *              This is referred as ASL_CV_CAPTURE_COMMENTS_ONLY.
    603      1.1  christos  *
    604      1.1  christos  ******************************************************************************/
    605      1.1  christos 
    606      1.1  christos void
    607      1.1  christos CvCaptureCommentsOnly (
    608      1.1  christos     ACPI_PARSE_STATE        *ParserState)
    609      1.1  christos {
    610      1.1  christos     UINT8                   *Aml = ParserState->Aml;
    611      1.1  christos     UINT16                  Opcode = (UINT16) ACPI_GET8 (Aml);
    612      1.1  christos     UINT32                  Length = 0;
    613  1.1.1.3  christos     UINT8                   CommentOption;
    614      1.1  christos     BOOLEAN                 StdDefBlockFlag = FALSE;
    615      1.1  christos     ACPI_COMMENT_NODE       *CommentNode;
    616      1.1  christos     ACPI_FILE_NODE          *FileNode;
    617      1.1  christos 
    618      1.1  christos 
    619  1.1.1.4  christos     if (!AcpiGbl_CaptureComments ||
    620      1.1  christos         Opcode != AML_COMMENT_OP)
    621      1.1  christos     {
    622      1.1  christos        return;
    623      1.1  christos     }
    624      1.1  christos 
    625      1.1  christos     while (Opcode == AML_COMMENT_OP)
    626      1.1  christos     {
    627      1.1  christos         CvDbgPrint ("comment aml address: %p\n", Aml);
    628      1.1  christos 
    629      1.1  christos         if (CvCommentExists(ParserState->Aml))
    630      1.1  christos         {
    631      1.1  christos             CvDbgPrint ("Avoiding capturing an existing comment.\n");
    632      1.1  christos         }
    633      1.1  christos         else
    634      1.1  christos         {
    635  1.1.1.2  christos             CommentOption = *(Aml +1);
    636      1.1  christos 
    637  1.1.1.2  christos             /*
    638  1.1.1.2  christos              * Increment past the comment option and point the
    639  1.1.1.2  christos              * appropriate char pointers
    640  1.1.1.2  christos              */
    641      1.1  christos             Aml += 2;
    642      1.1  christos 
    643  1.1.1.2  christos             /* Found a comment. Now, set pointers to these comments. */
    644      1.1  christos 
    645      1.1  christos             switch (CommentOption)
    646      1.1  christos             {
    647      1.1  christos                 case STD_DEFBLK_COMMENT:
    648      1.1  christos 
    649      1.1  christos                     StdDefBlockFlag = TRUE;
    650      1.1  christos 
    651  1.1.1.2  christos                     /*
    652  1.1.1.2  christos                      * Add to a linked list of nodes. This list will be
    653  1.1.1.2  christos                      * taken by the parse node created next.
    654  1.1.1.2  christos                      */
    655  1.1.1.2  christos                     CommentNode = AcpiOsAcquireObject (
    656  1.1.1.2  christos                         AcpiGbl_RegCommentCache);
    657      1.1  christos                     CommentNode->Comment = ACPI_CAST_PTR (char, Aml);
    658      1.1  christos                     CommentNode->Next = NULL;
    659      1.1  christos 
    660      1.1  christos                     if (!AcpiGbl_DefBlkCommentListHead)
    661      1.1  christos                     {
    662      1.1  christos                         AcpiGbl_DefBlkCommentListHead = CommentNode;
    663      1.1  christos                         AcpiGbl_DefBlkCommentListTail = CommentNode;
    664      1.1  christos                     }
    665      1.1  christos                     else
    666      1.1  christos                     {
    667      1.1  christos                         AcpiGbl_DefBlkCommentListTail->Next = CommentNode;
    668  1.1.1.2  christos                         AcpiGbl_DefBlkCommentListTail =
    669  1.1.1.2  christos                             AcpiGbl_DefBlkCommentListTail->Next;
    670      1.1  christos                     }
    671      1.1  christos                     break;
    672      1.1  christos 
    673      1.1  christos                 case STANDARD_COMMENT:
    674      1.1  christos 
    675      1.1  christos                     CvDbgPrint ("found regular comment.\n");
    676      1.1  christos 
    677  1.1.1.2  christos                     /*
    678  1.1.1.2  christos                      * Add to a linked list of nodes. This list will be
    679  1.1.1.2  christos                      * taken by the parse node created next.
    680  1.1.1.2  christos                      */
    681  1.1.1.2  christos                     CommentNode = AcpiOsAcquireObject (
    682  1.1.1.2  christos                         AcpiGbl_RegCommentCache);
    683      1.1  christos                     CommentNode->Comment = ACPI_CAST_PTR (char, Aml);
    684      1.1  christos                     CommentNode->Next    = NULL;
    685      1.1  christos 
    686      1.1  christos                     if (!AcpiGbl_RegCommentListHead)
    687      1.1  christos                     {
    688      1.1  christos                         AcpiGbl_RegCommentListHead = CommentNode;
    689      1.1  christos                         AcpiGbl_RegCommentListTail = CommentNode;
    690      1.1  christos                     }
    691      1.1  christos                     else
    692      1.1  christos                     {
    693      1.1  christos                         AcpiGbl_RegCommentListTail->Next = CommentNode;
    694  1.1.1.2  christos                         AcpiGbl_RegCommentListTail =
    695  1.1.1.2  christos                             AcpiGbl_RegCommentListTail->Next;
    696      1.1  christos                     }
    697      1.1  christos                     break;
    698      1.1  christos 
    699      1.1  christos                 case ENDBLK_COMMENT:
    700      1.1  christos 
    701      1.1  christos                     CvDbgPrint ("found endblk comment.\n");
    702      1.1  christos 
    703  1.1.1.2  christos                     /* Add to a linked list of nodes. This will be
    704  1.1.1.2  christos                      * taken by the next created parse node.
    705  1.1.1.2  christos                      */
    706  1.1.1.2  christos                     CommentNode = AcpiOsAcquireObject (
    707  1.1.1.2  christos                         AcpiGbl_RegCommentCache);
    708      1.1  christos                     CommentNode->Comment = ACPI_CAST_PTR (char, Aml);
    709      1.1  christos                     CommentNode->Next    = NULL;
    710      1.1  christos 
    711      1.1  christos                     if (!AcpiGbl_EndBlkCommentListHead)
    712      1.1  christos                     {
    713      1.1  christos                         AcpiGbl_EndBlkCommentListHead = CommentNode;
    714      1.1  christos                         AcpiGbl_EndBlkCommentListTail = CommentNode;
    715      1.1  christos                     }
    716      1.1  christos                     else
    717      1.1  christos                     {
    718      1.1  christos                         AcpiGbl_EndBlkCommentListTail->Next = CommentNode;
    719  1.1.1.2  christos                         AcpiGbl_EndBlkCommentListTail =
    720  1.1.1.2  christos                             AcpiGbl_EndBlkCommentListTail->Next;
    721      1.1  christos                     }
    722      1.1  christos                     break;
    723      1.1  christos 
    724      1.1  christos                 case INLINE_COMMENT:
    725      1.1  christos 
    726      1.1  christos                     CvDbgPrint ("found inline comment.\n");
    727  1.1.1.2  christos                     AcpiGbl_CurrentInlineComment =
    728  1.1.1.2  christos                         ACPI_CAST_PTR (char, Aml);
    729      1.1  christos                     break;
    730      1.1  christos 
    731      1.1  christos                 case ENDNODE_COMMENT:
    732      1.1  christos 
    733      1.1  christos                     CvDbgPrint ("found EndNode comment.\n");
    734  1.1.1.2  christos                     AcpiGbl_CurrentEndNodeComment =
    735  1.1.1.2  christos                         ACPI_CAST_PTR (char, Aml);
    736      1.1  christos                     break;
    737      1.1  christos 
    738      1.1  christos                 case CLOSE_BRACE_COMMENT:
    739      1.1  christos 
    740      1.1  christos                     CvDbgPrint ("found close brace comment.\n");
    741  1.1.1.2  christos                     AcpiGbl_CurrentCloseBraceComment =
    742  1.1.1.2  christos                         ACPI_CAST_PTR (char, Aml);
    743      1.1  christos                     break;
    744      1.1  christos 
    745      1.1  christos                 case END_DEFBLK_COMMENT:
    746      1.1  christos 
    747  1.1.1.2  christos                     CvDbgPrint ("Found comment that belongs after"
    748  1.1.1.2  christos                         " the } for a definition block.\n");
    749  1.1.1.2  christos                     AcpiGbl_CurrentScope->Common.CloseBraceComment =
    750  1.1.1.2  christos                         ACPI_CAST_PTR (char, Aml);
    751      1.1  christos                     break;
    752      1.1  christos 
    753      1.1  christos                 case FILENAME_COMMENT:
    754      1.1  christos 
    755  1.1.1.2  christos                     CvDbgPrint ("Found a filename: %s\n",
    756  1.1.1.2  christos                         ACPI_CAST_PTR (char, Aml));
    757  1.1.1.2  christos                     FileNode = CvFilenameExists (
    758  1.1.1.2  christos                         ACPI_CAST_PTR (char, Aml), AcpiGbl_FileTreeRoot);
    759      1.1  christos 
    760      1.1  christos                     /*
    761      1.1  christos                      * If there is an INCLUDE_COMMENT followed by a
    762      1.1  christos                      * FILENAME_COMMENT, then the INCLUDE_COMMENT is a comment
    763      1.1  christos                      * that is emitted before the #include for the file.
    764      1.1  christos                      * We will save the IncludeComment within the FileNode
    765      1.1  christos                      * associated with this FILENAME_COMMENT.
    766      1.1  christos                      */
    767      1.1  christos                     if (FileNode && AcpiGbl_IncCommentListHead)
    768      1.1  christos                     {
    769      1.1  christos                         FileNode->IncludeComment = AcpiGbl_IncCommentListHead;
    770      1.1  christos                         AcpiGbl_IncCommentListHead = NULL;
    771      1.1  christos                         AcpiGbl_IncCommentListTail = NULL;
    772      1.1  christos                     }
    773      1.1  christos                     break;
    774      1.1  christos 
    775      1.1  christos                 case PARENTFILENAME_COMMENT:
    776      1.1  christos                     CvDbgPrint ("    Found a parent filename.\n");
    777      1.1  christos                     break;
    778      1.1  christos 
    779      1.1  christos                 case INCLUDE_COMMENT:
    780      1.1  christos 
    781      1.1  christos                     /*
    782      1.1  christos                      * Add to a linked list. This list will be taken by the
    783      1.1  christos                      * parse node created next. See the FILENAME_COMMENT case
    784      1.1  christos                      * for more details
    785      1.1  christos                      */
    786  1.1.1.2  christos                     CommentNode = AcpiOsAcquireObject (
    787  1.1.1.2  christos                         AcpiGbl_RegCommentCache);
    788      1.1  christos                     CommentNode->Comment = ACPI_CAST_PTR (char, Aml);
    789      1.1  christos                     CommentNode->Next = NULL;
    790      1.1  christos 
    791      1.1  christos                     if (!AcpiGbl_IncCommentListHead)
    792      1.1  christos                     {
    793      1.1  christos                         AcpiGbl_IncCommentListHead = CommentNode;
    794      1.1  christos                         AcpiGbl_IncCommentListTail = CommentNode;
    795      1.1  christos                     }
    796      1.1  christos                     else
    797      1.1  christos                     {
    798      1.1  christos                         AcpiGbl_IncCommentListTail->Next = CommentNode;
    799  1.1.1.2  christos                         AcpiGbl_IncCommentListTail =
    800  1.1.1.2  christos                             AcpiGbl_IncCommentListTail->Next;
    801      1.1  christos                     }
    802      1.1  christos 
    803  1.1.1.2  christos                     CvDbgPrint ("Found a include comment: %s\n",
    804  1.1.1.2  christos                         CommentNode->Comment);
    805      1.1  christos                     break;
    806      1.1  christos 
    807      1.1  christos                 default:
    808      1.1  christos 
    809      1.1  christos                     /* Not a valid comment option. Revert the AML */
    810      1.1  christos 
    811      1.1  christos                     goto DefBlock;
    812      1.1  christos 
    813  1.1.1.2  christos             } /* End switch statement */
    814      1.1  christos 
    815  1.1.1.2  christos         } /* End else */
    816      1.1  christos 
    817  1.1.1.2  christos         /* Determine the length and move forward that amount */
    818      1.1  christos 
    819      1.1  christos         Length = 0;
    820      1.1  christos         while (ParserState->Aml[Length])
    821      1.1  christos         {
    822      1.1  christos             Length++;
    823      1.1  christos         }
    824      1.1  christos 
    825      1.1  christos         ParserState->Aml += Length + 1;
    826      1.1  christos 
    827      1.1  christos         /* Peek at the next Opcode. */
    828      1.1  christos 
    829      1.1  christos         Aml = ParserState->Aml;
    830      1.1  christos         Opcode = (UINT16) ACPI_GET8 (Aml);
    831      1.1  christos     }
    832      1.1  christos 
    833      1.1  christos DefBlock:
    834      1.1  christos     if (StdDefBlockFlag)
    835      1.1  christos     {
    836      1.1  christos         /*
    837      1.1  christos          * Give all of its comments to the current scope, which is known as
    838      1.1  christos          * the definition block, since STD_DEFBLK_COMMENT only appears after
    839      1.1  christos          * definition block headers.
    840      1.1  christos          */
    841      1.1  christos         AcpiGbl_CurrentScope->Common.CommentList
    842      1.1  christos             = AcpiGbl_DefBlkCommentListHead;
    843      1.1  christos         AcpiGbl_DefBlkCommentListHead = NULL;
    844      1.1  christos         AcpiGbl_DefBlkCommentListTail = NULL;
    845      1.1  christos     }
    846      1.1  christos }
    847      1.1  christos 
    848      1.1  christos 
    849      1.1  christos /*******************************************************************************
    850      1.1  christos  *
    851      1.1  christos  * FUNCTION:    CvCaptureComments
    852      1.1  christos  *
    853      1.1  christos  * PARAMETERS:  ParserState         - A parser state object
    854      1.1  christos  *
    855  1.1.1.2  christos  * RETURN:      None
    856      1.1  christos  *
    857      1.1  christos  * DESCRIPTION: Wrapper function for CvCaptureCommentsOnly
    858      1.1  christos  *              This is referred as ASL_CV_CAPTURE_COMMENTS.
    859      1.1  christos  *
    860      1.1  christos  ******************************************************************************/
    861      1.1  christos 
    862      1.1  christos void
    863      1.1  christos CvCaptureComments (
    864      1.1  christos     ACPI_WALK_STATE         *WalkState)
    865      1.1  christos {
    866      1.1  christos     UINT8                   *Aml;
    867      1.1  christos     UINT16                  Opcode;
    868      1.1  christos     const ACPI_OPCODE_INFO  *OpInfo;
    869      1.1  christos 
    870      1.1  christos 
    871  1.1.1.4  christos     if (!AcpiGbl_CaptureComments)
    872      1.1  christos     {
    873      1.1  christos         return;
    874      1.1  christos     }
    875      1.1  christos 
    876      1.1  christos     /*
    877  1.1.1.2  christos      * Before parsing, check to see that comments that come directly
    878  1.1.1.2  christos      * after deferred opcodes aren't being processed.
    879      1.1  christos      */
    880      1.1  christos     Aml = WalkState->ParserState.Aml;
    881      1.1  christos     Opcode = (UINT16) ACPI_GET8 (Aml);
    882      1.1  christos     OpInfo = AcpiPsGetOpcodeInfo (Opcode);
    883      1.1  christos 
    884      1.1  christos     if (!(OpInfo->Flags & AML_DEFER) ||
    885      1.1  christos         ((OpInfo->Flags & AML_DEFER) &&
    886      1.1  christos         (WalkState->PassNumber != ACPI_IMODE_LOAD_PASS1)))
    887      1.1  christos     {
    888      1.1  christos         CvCaptureCommentsOnly (&WalkState->ParserState);
    889      1.1  christos         WalkState->Aml = WalkState->ParserState.Aml;
    890      1.1  christos     }
    891      1.1  christos 
    892      1.1  christos }
    893      1.1  christos 
    894      1.1  christos 
    895      1.1  christos /*******************************************************************************
    896      1.1  christos  *
    897      1.1  christos  * FUNCTION:    CvTransferComments
    898      1.1  christos  *
    899  1.1.1.2  christos  * PARAMETERS:  Op                  - Transfer comments to this Op
    900      1.1  christos  *
    901  1.1.1.2  christos  * RETURN:      None
    902      1.1  christos  *
    903  1.1.1.6  christos  * DESCRIPTION: Transfer all of the comments stored in global containers to the
    904      1.1  christos  *              given Op. This will be invoked shortly after the parser creates
    905      1.1  christos  *              a ParseOp.
    906      1.1  christos  *              This is referred as ASL_CV_TRANSFER_COMMENTS.
    907      1.1  christos  *
    908      1.1  christos  ******************************************************************************/
    909      1.1  christos 
    910      1.1  christos void
    911      1.1  christos CvTransferComments (
    912      1.1  christos     ACPI_PARSE_OBJECT       *Op)
    913      1.1  christos {
    914  1.1.1.2  christos 
    915      1.1  christos     Op->Common.InlineComment = AcpiGbl_CurrentInlineComment;
    916      1.1  christos     AcpiGbl_CurrentInlineComment = NULL;
    917      1.1  christos 
    918      1.1  christos     Op->Common.EndNodeComment = AcpiGbl_CurrentEndNodeComment;
    919      1.1  christos     AcpiGbl_CurrentEndNodeComment = NULL;
    920      1.1  christos 
    921      1.1  christos     Op->Common.CloseBraceComment = AcpiGbl_CurrentCloseBraceComment;
    922      1.1  christos     AcpiGbl_CurrentCloseBraceComment = NULL;
    923      1.1  christos 
    924      1.1  christos     Op->Common.CommentList = AcpiGbl_RegCommentListHead;
    925      1.1  christos     AcpiGbl_RegCommentListHead = NULL;
    926      1.1  christos     AcpiGbl_RegCommentListTail = NULL;
    927      1.1  christos 
    928      1.1  christos     Op->Common.EndBlkComment = AcpiGbl_EndBlkCommentListHead;
    929      1.1  christos     AcpiGbl_EndBlkCommentListHead = NULL;
    930      1.1  christos     AcpiGbl_EndBlkCommentListTail = NULL;
    931      1.1  christos }
    932