ACPI_STATUS AcpiTbGetNextTableDescriptor ( UINT32 *TableIndex, ACPI_TABLE_DESC **TableDesc) { ACPI_STATUS Status; UINT32 i; /* Ensure that there is room for the table in the Root Table List */ if (AcpiGbl_RootTableList.CurrentTableCount >= AcpiGbl_RootTableList.MaxTableCount) { Status = AcpiTbResizeRootTableList(); if (ACPI_FAILURE (Status)) { return (Status); } } i = AcpiGbl_RootTableList.CurrentTableCount; AcpiGbl_RootTableList.CurrentTableCount++; if (TableIndex) { *TableIndex = i; } if (TableDesc) { *TableDesc = &AcpiGbl_RootTableList.Tables[i]; } return (AE_OK); }
ACPI_STATUS AcpiAllocateRootTable ( UINT32 InitialTableCount) { AcpiGbl_RootTableList.MaxTableCount = InitialTableCount; AcpiGbl_RootTableList.Flags = ACPI_ROOT_ALLOW_RESIZE; return (AcpiTbResizeRootTableList ()); }
ACPI_STATUS ACPI_INIT_FUNCTION AcpiReallocateRootTable ( void) { ACPI_STATUS Status; UINT32 i; ACPI_FUNCTION_TRACE (AcpiReallocateRootTable); /* * Only reallocate the root table if the host provided a static buffer * for the table array in the call to AcpiInitializeTables. */ if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED) { return_ACPI_STATUS (AE_SUPPORT); } /* * Ensure OS early boot logic, which is required by some hosts. If the * table state is reported to be wrong, developers should fix the * issue by invoking AcpiPutTable() for the reported table during the * early stage. */ for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) { if (AcpiGbl_RootTableList.Tables[i].Pointer) { ACPI_ERROR ((AE_INFO, "Table [%4.4s] is not invalidated during early boot stage", AcpiGbl_RootTableList.Tables[i].Signature.Ascii)); } } AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ALLOW_RESIZE; Status = AcpiTbResizeRootTableList (); return_ACPI_STATUS (Status); }
ACPI_STATUS AcpiTbGetNextRootIndex ( UINT32 *TableIndex) { ACPI_STATUS Status; /* Ensure that there is room for the table in the Root Table List */ if (AcpiGbl_RootTableList.CurrentTableCount >= AcpiGbl_RootTableList.MaxTableCount) { Status = AcpiTbResizeRootTableList(); if (ACPI_FAILURE (Status)) { return (Status); } } *TableIndex = AcpiGbl_RootTableList.CurrentTableCount; AcpiGbl_RootTableList.CurrentTableCount++; return (AE_OK); }
ACPI_STATUS AcpiReallocateRootTable ( void) { ACPI_STATUS Status; ACPI_FUNCTION_TRACE (AcpiReallocateRootTable); /* * Only reallocate the root table if the host provided a static buffer * for the table array in the call to AcpiInitializeTables. */ if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED) { return_ACPI_STATUS (AE_SUPPORT); } AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ALLOW_RESIZE; Status = AcpiTbResizeRootTableList (); return_ACPI_STATUS (Status); }
ACPI_STATUS ACPI_INIT_FUNCTION AcpiReallocateRootTable ( void) { ACPI_STATUS Status; ACPI_TABLE_DESC *TableDesc; UINT32 i, j; ACPI_FUNCTION_TRACE (AcpiReallocateRootTable); /* * If there are tables unverified, it is required to reallocate the * root table list to clean up invalid table entries. Otherwise only * reallocate the root table list if the host provided a static buffer * for the table array in the call to AcpiInitializeTables(). */ if ((AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED) && AcpiGbl_EnableTableValidation) { return_ACPI_STATUS (AE_SUPPORT); } (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); /* * Ensure OS early boot logic, which is required by some hosts. If the * table state is reported to be wrong, developers should fix the * issue by invoking AcpiPutTable() for the reported table during the * early stage. */ for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) { TableDesc = &AcpiGbl_RootTableList.Tables[i]; if (TableDesc->Pointer) { ACPI_ERROR ((AE_INFO, "Table [%4.4s] is not invalidated during early boot stage", TableDesc->Signature.Ascii)); } } if (!AcpiGbl_EnableTableValidation) { /* * Now it's safe to do full table validation. We can do deferred * table initialization here once the flag is set. */ AcpiGbl_EnableTableValidation = TRUE; for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) { TableDesc = &AcpiGbl_RootTableList.Tables[i]; if (!(TableDesc->Flags & ACPI_TABLE_IS_VERIFIED)) { Status = AcpiTbVerifyTempTable (TableDesc, NULL, &j); if (ACPI_FAILURE (Status)) { AcpiTbUninstallTable (TableDesc); } } } } AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ALLOW_RESIZE; Status = AcpiTbResizeRootTableList (); AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ORIGIN_ALLOCATED; (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); return_ACPI_STATUS (Status); }