FreeBSD/sys/contrib/dev/acpica/common/adisasm.c
/******************************************************************************
 *
 * FUNCTION:    AdReparseOneTable
 *
 * PARAMETERS:  Table               - Raw AML table
 *              File                - Pointer for the input file
 *              OwnerId             - ID for this table
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Reparse a table that has already been loaded. Used to
 *              integrate information about external control methods.
 *              These methods may have been previously parsed incorrectly.
 *
 *****************************************************************************/
AdReparseOneTable
PARAMETERS:  Table               - Raw AML table
File                - Pointer for the input file
OwnerId             - ID for this table

Status

Reparse a table that has already been loaded. Used to
integrate information about external control methods.
These methods may have been previously parsed incorrectly.
AdReparseOneTable PARAMETERS : Table - Raw AML table File - Pointer for the input file OwnerId - ID for this table Status Reparse a table that has already been loaded . Used to integrate information about external control methods . These methods may have been previously parsed incorrectly .
static ACPI_STATUS
AdReparseOneTable (
    ACPI_TABLE_HEADER       *Table,
    FILE                    *File,
    ACPI_OWNER_ID           OwnerId)
{
    ACPI_STATUS             Status;
    fprintf (stderr,
        "\nFound %u external control methods, "
        "reparsing with new information\n",
        AcpiDmGetExternalMethodCount ());
    AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot);
    AcpiGbl_ParseOpRoot = NULL;
    AcpiNsDeleteNamespaceSubtree (AcpiGbl_RootNode);
    AcpiGbl_RootNode                    = NULL;
    AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
    AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
    AcpiGbl_RootNodeStruct.Type         = ACPI_TYPE_DEVICE;
    AcpiGbl_RootNodeStruct.Parent       = NULL;
    AcpiGbl_RootNodeStruct.Child        = NULL;
    AcpiGbl_RootNodeStruct.Peer         = NULL;
    AcpiGbl_RootNodeStruct.Object       = NULL;
    AcpiGbl_RootNodeStruct.Flags        = 0;
    Status = AcpiNsRootInitialize ();
    if (ACPI_FAILURE (Status))
    {
        return (Status);
    }
    AcpiDmAddExternalsToNamespace ();
    Status = AdParseTable (Table, NULL, FALSE, FALSE);
    if (ACPI_FAILURE (Status))
    {
        AcpiOsPrintf ("Could not parse ACPI tables, %s\n",
            AcpiFormatException (Status));
        return (Status);
    }
    AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot,
        AcpiGbl_RootNode, OwnerId);
    AcpiDmCrossReferenceNamespace (AcpiGbl_ParseOpRoot,
        AcpiGbl_RootNode, OwnerId);
    if (AslCompilerdebug)
    {
        AcpiOsPrintf ("/**** After second load and resource conversion\n");
        if (File)
        {
            NsSetupNamespaceListing (File);
            NsDisplayNamespace ();
        }
        AcpiOsPrintf ("*****/\n");
        AcpiDmDumpTree (AcpiGbl_ParseOpRoot);
    }
    return (AE_OK);
}
static ACPI_STATUS AdReparseOneTable ( ACPI_TABLE_HEADER * Table , FILE * File , ACPI_OWNER_ID OwnerId ) { ACPI_STATUS Status ; fprintf ( stderr , " \n " " \n " , AcpiDmGetExternalMethodCount ( ) ) ; AcpiPsDeleteParseTree ( AcpiGbl_ParseOpRoot ) ; AcpiGbl_ParseOpRoot = NULL ; AcpiNsDeleteNamespaceSubtree ( AcpiGbl_RootNode ) ; AcpiGbl_RootNode = NULL ; AcpiGbl_RootNodeStruct . Name . Integer = ACPI_ROOT_NAME ; AcpiGbl_RootNodeStruct . DescriptorType = ACPI_DESC_TYPE_NAMED ; AcpiGbl_RootNodeStruct . Type = ACPI_TYPE_DEVICE ; AcpiGbl_RootNodeStruct . Parent = NULL ; AcpiGbl_RootNodeStruct . Child = NULL ; AcpiGbl_RootNodeStruct . Peer = NULL ; AcpiGbl_RootNodeStruct . Object = NULL ; AcpiGbl_RootNodeStruct . Flags = 0 ; Status = AcpiNsRootInitialize ( ) ; if ( ACPI_FAILURE ( Status ) ) { return ( Status ) ; } AcpiDmAddExternalsToNamespace ( ) ; Status = AdParseTable ( Table , NULL , FALSE , FALSE ) ; if ( ACPI_FAILURE ( Status ) ) { AcpiOsPrintf ( " \n " , AcpiFormatException ( Status ) ) ; return ( Status ) ; } AcpiDmFinishNamespaceLoad ( AcpiGbl_ParseOpRoot , AcpiGbl_RootNode , OwnerId ) ; AcpiDmCrossReferenceNamespace ( AcpiGbl_ParseOpRoot , AcpiGbl_RootNode , OwnerId ) ; if ( AslCompilerdebug ) { AcpiOsPrintf ( " \n " ) ; if ( File ) { NsSetupNamespaceListing ( File ) ; NsDisplayNamespace ( ) ; } AcpiOsPrintf ( " \n " ) ; AcpiDmDumpTree ( AcpiGbl_ParseOpRoot ) ; } return ( AE_OK ) ; }
FUNCTION:    AdReparseOneTable
 PARAMETERS:  Table               - Raw AML table
              File                - Pointer for the input file
              OwnerId             - ID for this table
FUNCTION : AdReparseOneTable PARAMETERS : Table - Raw AML table File - Pointer for the input file OwnerId - ID for this table
/* Reparse, rebuild namespace */ /* New namespace, add the external definitions first */ /* Parse the table again. No need to reload it, however */ /* Cross reference the namespace again */ /* Debug output - namespace and parse tree */