kernel/acpica/compiler/cvparser.c
/*******************************************************************************
 *
 * FUNCTION:    CvInitFileTree
 *
 * PARAMETERS:  Table      - input table
 *              AmlStart   - Address of the starting point of the AML.
 *              AmlLength  - Length of the AML file.
 *
 * RETURN:      None
 *
 * DESCRIPTION: Initialize the file dependency tree by scanning the AML.
 *              This is referred as ASL_CV_INIT_FILETREE.
 *
 ******************************************************************************/
CvInitFileTree
PARAMETERS:  Table      - input table
AmlStart   - Address of the starting point of the AML.
AmlLength  - Length of the AML file.

None

Initialize the file dependency tree by scanning the AML.
This is referred as ASL_CV_INIT_FILETREE.
CvInitFileTree PARAMETERS : Table - input table AmlStart - Address of the starting point of the AML . AmlLength - Length of the AML file . None Initialize the file dependency tree by scanning the AML . This is referred as ASL_CV_INIT_FILETREE .
void
CvInitFileTree (
    ACPI_TABLE_HEADER       *Table,
    UINT8                   *AmlStart,
    UINT32                  AmlLength)
{
    UINT8                   *TreeAml;
    UINT8                   *FileEnd;
    char                    *Filename = NULL;
    char                    *PreviousFilename = NULL;
    char                    *ParentFilename = NULL;
    char                    *ChildFilename = NULL;
    if (!Gbl_CaptureComments)
    {
        return;
    }
    CvDbgPrint ("AmlLength: %x\n", AmlLength);
    CvDbgPrint ("AmlStart:  %p\n", AmlStart);
    CvDbgPrint ("AmlEnd?:   %p\n", AmlStart+AmlLength);
    AcpiGbl_FileTreeRoot = AcpiOsAcquireObject (AcpiGbl_FileCache);
    AcpiGbl_FileTreeRoot->FileStart = (char *)(AmlStart);
    AcpiGbl_FileTreeRoot->FileEnd = (char *)(AmlStart + Table->Length);
    AcpiGbl_FileTreeRoot->Next = NULL;
    AcpiGbl_FileTreeRoot->Parent = NULL;
    AcpiGbl_FileTreeRoot->Filename = (char *)(AmlStart+2);
    AcpiGbl_FileTreeRoot->File = AcpiGbl_OutputFile;
    AcpiGbl_FileTreeRoot->IncludeWritten = TRUE;
    Filename = NULL;
    AcpiGbl_CurrentFilename = (char *)(AmlStart+2);
    AcpiGbl_RootFilename    = (char *)(AmlStart+2);
    TreeAml = AmlStart;
    FileEnd = AmlStart + AmlLength;
    while (TreeAml <= FileEnd)
    {
        if ((*TreeAml == AML_COMMENT_OP) &&
            (*(TreeAml +1) == FILENAME_COMMENT) &&
            (CvIsFilename ((char *)(TreeAml +2))))
        {
            CvDbgPrint ("A9 and a 08 file\n");
            PreviousFilename = Filename;
            Filename = (char *) (TreeAml +2);
            CvAddToFileTree (Filename, PreviousFilename);
            ChildFilename = Filename;
            CvDbgPrint ("%s\n", Filename);
        }
        else if ((*TreeAml == AML_COMMENT_OP) &&
            (*(TreeAml +1) == PARENTFILENAME_COMMENT) &&
            (CvIsFilename ((char *)(TreeAml +2))))
        {
            CvDbgPrint ("A9 and a 09 file\n");
            ParentFilename = (char *)(TreeAml +2);
            CvSetFileParent (ChildFilename, ParentFilename);
            CvDbgPrint ("%s\n", ParentFilename);
        }
        ++TreeAml;
    }
}
void CvInitFileTree ( ACPI_TABLE_HEADER * Table , UINT8 * AmlStart , UINT32 AmlLength ) { UINT8 * TreeAml ; UINT8 * FileEnd ; char * Filename = NULL ; char * PreviousFilename = NULL ; char * ParentFilename = NULL ; char * ChildFilename = NULL ; if ( ! Gbl_CaptureComments ) { return ; } CvDbgPrint ( " \n " , AmlLength ) ; CvDbgPrint ( " \n " , AmlStart ) ; CvDbgPrint ( " \n " , AmlStart + AmlLength ) ; AcpiGbl_FileTreeRoot = AcpiOsAcquireObject ( AcpiGbl_FileCache ) ; AcpiGbl_FileTreeRoot -> FileStart = ( char * ) ( AmlStart ) ; AcpiGbl_FileTreeRoot -> FileEnd = ( char * ) ( AmlStart + Table -> Length ) ; AcpiGbl_FileTreeRoot -> Next = NULL ; AcpiGbl_FileTreeRoot -> Parent = NULL ; AcpiGbl_FileTreeRoot -> Filename = ( char * ) ( AmlStart + 2 ) ; AcpiGbl_FileTreeRoot -> File = AcpiGbl_OutputFile ; AcpiGbl_FileTreeRoot -> IncludeWritten = TRUE ; Filename = NULL ; AcpiGbl_CurrentFilename = ( char * ) ( AmlStart + 2 ) ; AcpiGbl_RootFilename = ( char * ) ( AmlStart + 2 ) ; TreeAml = AmlStart ; FileEnd = AmlStart + AmlLength ; while ( TreeAml <= FileEnd ) { if ( ( * TreeAml == AML_COMMENT_OP ) && ( * ( TreeAml + 1 ) == FILENAME_COMMENT ) && ( CvIsFilename ( ( char * ) ( TreeAml + 2 ) ) ) ) { CvDbgPrint ( " \n " ) ; PreviousFilename = Filename ; Filename = ( char * ) ( TreeAml + 2 ) ; CvAddToFileTree ( Filename , PreviousFilename ) ; ChildFilename = Filename ; CvDbgPrint ( " \n " , Filename ) ; } else if ( ( * TreeAml == AML_COMMENT_OP ) && ( * ( TreeAml + 1 ) == PARENTFILENAME_COMMENT ) && ( CvIsFilename ( ( char * ) ( TreeAml + 2 ) ) ) ) { CvDbgPrint ( " \n " ) ; ParentFilename = ( char * ) ( TreeAml + 2 ) ; CvSetFileParent ( ChildFilename , ParentFilename ) ; CvDbgPrint ( " \n " , ParentFilename ) ; } ++ TreeAml ; } }
FUNCTION:    CvInitFileTree
 PARAMETERS:  Table      - input table
              AmlStart   - Address of the starting point of the AML.
FUNCTION : CvInitFileTree PARAMETERS : Table - input table AmlStart - Address of the starting point of the AML .
/* Set the root file to the current open file */ /*
     * Set this to true because we dont need to output
     * an include statement for the topmost file
     */ /*
         * Make sure that this filename contains all printable characters
         * and a .dsl extension at the end. If not, then it must be some
         * raw data that doesn't outline a filename.
         */