diff options
Diffstat (limited to 'tables')
-rw-r--r-- | tables/tbfind.c | 2 | ||||
-rw-r--r-- | tables/tbinstal.c | 52 | ||||
-rw-r--r-- | tables/tbutils.c | 15 | ||||
-rw-r--r-- | tables/tbxface.c | 20 |
4 files changed, 46 insertions, 43 deletions
diff --git a/tables/tbfind.c b/tables/tbfind.c index e1c110f4523a..4fd988ef9e8d 100644 --- a/tables/tbfind.c +++ b/tables/tbfind.c @@ -164,7 +164,7 @@ AcpiTbFindTable ( /* Search for the table */ - for (i = 0; i < AcpiGbl_RootTableList.Count; ++i) + for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) { if (ACPI_MEMCMP (&(AcpiGbl_RootTableList.Tables[i].Signature), Header.Signature, ACPI_NAME_SIZE)) diff --git a/tables/tbinstal.c b/tables/tbinstal.c index 78cf164a99ea..2179b6bf7b70 100644 --- a/tables/tbinstal.c +++ b/tables/tbinstal.c @@ -227,7 +227,7 @@ AcpiTbAddTable ( /* Check if table is already registered */ - for (i = 0; i < AcpiGbl_RootTableList.Count; ++i) + for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) { if (!AcpiGbl_RootTableList.Tables[i].Pointer) { @@ -370,7 +370,7 @@ AcpiTbResizeRootTableList ( /* Increase the Table Array size */ Tables = ACPI_ALLOCATE_ZEROED ( - ((ACPI_SIZE) AcpiGbl_RootTableList.Size + + ((ACPI_SIZE) AcpiGbl_RootTableList.MaxTableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT) * sizeof (ACPI_TABLE_DESC)); if (!Tables) @@ -384,7 +384,7 @@ AcpiTbResizeRootTableList ( if (AcpiGbl_RootTableList.Tables) { ACPI_MEMCPY (Tables, AcpiGbl_RootTableList.Tables, - (ACPI_SIZE) AcpiGbl_RootTableList.Size * sizeof (ACPI_TABLE_DESC)); + (ACPI_SIZE) AcpiGbl_RootTableList.MaxTableCount * sizeof (ACPI_TABLE_DESC)); if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED) { @@ -393,7 +393,7 @@ AcpiTbResizeRootTableList ( } AcpiGbl_RootTableList.Tables = Tables; - AcpiGbl_RootTableList.Size += ACPI_ROOT_TABLE_SIZE_INCREMENT; + AcpiGbl_RootTableList.MaxTableCount += ACPI_ROOT_TABLE_SIZE_INCREMENT; AcpiGbl_RootTableList.Flags |= (UINT8) ACPI_ROOT_ORIGIN_ALLOCATED; return_ACPI_STATUS (AE_OK); @@ -423,12 +423,14 @@ AcpiTbStoreTable ( UINT8 Flags, UINT32 *TableIndex) { - ACPI_STATUS Status = AE_OK; + ACPI_STATUS Status; + ACPI_TABLE_DESC *NewTable; /* Ensure that there is room for the table in the Root Table List */ - if (AcpiGbl_RootTableList.Count >= AcpiGbl_RootTableList.Size) + if (AcpiGbl_RootTableList.CurrentTableCount >= + AcpiGbl_RootTableList.MaxTableCount) { Status = AcpiTbResizeRootTableList(); if (ACPI_FAILURE (Status)) @@ -437,21 +439,21 @@ AcpiTbStoreTable ( } } + NewTable = &AcpiGbl_RootTableList.Tables[AcpiGbl_RootTableList.CurrentTableCount]; + /* Initialize added table */ - AcpiGbl_RootTableList.Tables[AcpiGbl_RootTableList.Count].Address = Address; - AcpiGbl_RootTableList.Tables[AcpiGbl_RootTableList.Count].Pointer = Table; - AcpiGbl_RootTableList.Tables[AcpiGbl_RootTableList.Count].Length = Length; - AcpiGbl_RootTableList.Tables[AcpiGbl_RootTableList.Count].OwnerId = 0; - AcpiGbl_RootTableList.Tables[AcpiGbl_RootTableList.Count].Flags = Flags; + NewTable->Address = Address; + NewTable->Pointer = Table; + NewTable->Length = Length; + NewTable->OwnerId = 0; + NewTable->Flags = Flags; - ACPI_MOVE_32_TO_32 ( - &(AcpiGbl_RootTableList.Tables[AcpiGbl_RootTableList.Count].Signature), - Table->Signature); + ACPI_MOVE_32_TO_32 (&NewTable->Signature, Table->Signature); - *TableIndex = AcpiGbl_RootTableList.Count; - AcpiGbl_RootTableList.Count++; - return (Status); + *TableIndex = AcpiGbl_RootTableList.CurrentTableCount; + AcpiGbl_RootTableList.CurrentTableCount++; + return (AE_OK); } @@ -523,7 +525,7 @@ AcpiTbTerminate ( /* Delete the individual tables */ - for (i = 0; i < AcpiGbl_RootTableList.Count; i++) + for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++) { AcpiTbDeleteTable (&AcpiGbl_RootTableList.Tables[i]); } @@ -539,7 +541,7 @@ AcpiTbTerminate ( AcpiGbl_RootTableList.Tables = NULL; AcpiGbl_RootTableList.Flags = 0; - AcpiGbl_RootTableList.Count = 0; + AcpiGbl_RootTableList.CurrentTableCount = 0; ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ACPI Tables freed\n")); (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); @@ -575,7 +577,7 @@ AcpiTbDeleteNamespaceByOwner ( return_ACPI_STATUS (Status); } - if (TableIndex >= AcpiGbl_RootTableList.Count) + if (TableIndex >= AcpiGbl_RootTableList.CurrentTableCount) { /* The table index does not exist */ @@ -634,7 +636,7 @@ AcpiTbAllocateOwnerId ( (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); - if (TableIndex < AcpiGbl_RootTableList.Count) + if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount) { Status = AcpiUtAllocateOwnerId (&(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId)); @@ -668,7 +670,7 @@ AcpiTbReleaseOwnerId ( (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); - if (TableIndex < AcpiGbl_RootTableList.Count) + if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount) { AcpiUtReleaseOwnerId ( &(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId)); @@ -705,7 +707,7 @@ AcpiTbGetOwnerId ( (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); - if (TableIndex < AcpiGbl_RootTableList.Count) + if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount) { *OwnerId = AcpiGbl_RootTableList.Tables[TableIndex].OwnerId; Status = AE_OK; @@ -734,7 +736,7 @@ AcpiTbIsTableLoaded ( (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); - if (TableIndex < AcpiGbl_RootTableList.Count) + if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount) { IsLoaded = (BOOLEAN) (AcpiGbl_RootTableList.Tables[TableIndex].Flags & @@ -766,7 +768,7 @@ AcpiTbSetTableLoadedFlag ( { (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); - if (TableIndex < AcpiGbl_RootTableList.Count) + if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount) { if (IsLoaded) { diff --git a/tables/tbutils.c b/tables/tbutils.c index eb8bc43597d0..100a91d9e511 100644 --- a/tables/tbutils.c +++ b/tables/tbutils.c @@ -184,7 +184,7 @@ AcpiTbTablesLoaded ( void) { - if (AcpiGbl_RootTableList.Count >= 3) + if (AcpiGbl_RootTableList.CurrentTableCount >= 3) { return (TRUE); } @@ -765,14 +765,15 @@ AcpiTbParseRootTable ( * come from the FADT */ TableEntry = ACPI_CAST_PTR (UINT8, Table) + sizeof (ACPI_TABLE_HEADER); - AcpiGbl_RootTableList.Count = 2; + AcpiGbl_RootTableList.CurrentTableCount = 2; /* * Initialize the root table array from the RSDT/XSDT */ for (i = 0; i < TableCount; i++) { - if (AcpiGbl_RootTableList.Count >= AcpiGbl_RootTableList.Size) + if (AcpiGbl_RootTableList.CurrentTableCount >= + AcpiGbl_RootTableList.MaxTableCount) { /* There is no more room in the root table array, attempt resize */ @@ -781,18 +782,18 @@ AcpiTbParseRootTable ( { ACPI_WARNING ((AE_INFO, "Truncating %u table entries!", (unsigned) (TableCount - - (AcpiGbl_RootTableList.Count - 2)))); + (AcpiGbl_RootTableList.CurrentTableCount - 2)))); break; } } /* Get the table physical address (32-bit for RSDT, 64-bit for XSDT) */ - AcpiGbl_RootTableList.Tables[AcpiGbl_RootTableList.Count].Address = + AcpiGbl_RootTableList.Tables[AcpiGbl_RootTableList.CurrentTableCount].Address = AcpiTbGetRootTableEntry (TableEntry, TableEntrySize); TableEntry += TableEntrySize; - AcpiGbl_RootTableList.Count++; + AcpiGbl_RootTableList.CurrentTableCount++; } /* @@ -805,7 +806,7 @@ AcpiTbParseRootTable ( * Complete the initialization of the root table array by examining * the header of each table */ - for (i = 2; i < AcpiGbl_RootTableList.Count; i++) + for (i = 2; i < AcpiGbl_RootTableList.CurrentTableCount; i++) { AcpiTbInstallTable (AcpiGbl_RootTableList.Tables[i].Address, NULL, i); diff --git a/tables/tbxface.c b/tables/tbxface.c index b3e09a0271f6..ba1a026e8688 100644 --- a/tables/tbxface.c +++ b/tables/tbxface.c @@ -150,7 +150,7 @@ AcpiAllocateRootTable ( UINT32 InitialTableCount) { - AcpiGbl_RootTableList.Size = InitialTableCount; + AcpiGbl_RootTableList.MaxTableCount = InitialTableCount; AcpiGbl_RootTableList.Flags = ACPI_ROOT_ALLOW_RESIZE; return (AcpiTbResizeRootTableList ()); @@ -216,7 +216,7 @@ AcpiInitializeTables ( (ACPI_SIZE) InitialTableCount * sizeof (ACPI_TABLE_DESC)); AcpiGbl_RootTableList.Tables = InitialTableArray; - AcpiGbl_RootTableList.Size = InitialTableCount; + AcpiGbl_RootTableList.MaxTableCount = InitialTableCount; AcpiGbl_RootTableList.Flags = ACPI_ROOT_ORIGIN_UNKNOWN; if (AllowResize) { @@ -285,7 +285,7 @@ AcpiReallocateRootTable ( * increment to create the new table size. */ CurrentSize = (ACPI_SIZE) - AcpiGbl_RootTableList.Count * sizeof (ACPI_TABLE_DESC); + AcpiGbl_RootTableList.CurrentTableCount * sizeof (ACPI_TABLE_DESC); NewSize = CurrentSize + (ACPI_ROOT_TABLE_SIZE_INCREMENT * sizeof (ACPI_TABLE_DESC)); @@ -306,8 +306,8 @@ AcpiReallocateRootTable ( * size of the original table list. */ AcpiGbl_RootTableList.Tables = Tables; - AcpiGbl_RootTableList.Size = - AcpiGbl_RootTableList.Count + ACPI_ROOT_TABLE_SIZE_INCREMENT; + AcpiGbl_RootTableList.MaxTableCount = + AcpiGbl_RootTableList.CurrentTableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT; AcpiGbl_RootTableList.Flags = ACPI_ROOT_ORIGIN_ALLOCATED | ACPI_ROOT_ALLOW_RESIZE; @@ -354,7 +354,7 @@ AcpiGetTableHeader ( /* Walk the root table list */ - for (i = 0, j = 0; i < AcpiGbl_RootTableList.Count; i++) + for (i = 0, j = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++) { if (!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), Signature)) @@ -439,7 +439,7 @@ AcpiGetTable ( /* Walk the root table list */ - for (i = 0, j = 0; i < AcpiGbl_RootTableList.Count; i++) + for (i = 0, j = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++) { if (!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), Signature)) @@ -502,7 +502,7 @@ AcpiGetTableByIndex ( /* Validate index */ - if (TableIndex >= AcpiGbl_RootTableList.Count) + if (TableIndex >= AcpiGbl_RootTableList.CurrentTableCount) { (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); return_ACPI_STATUS (AE_BAD_PARAMETER); @@ -559,7 +559,7 @@ AcpiTbLoadNamespace ( * Load the namespace. The DSDT is required, but any SSDT and * PSDT tables are optional. Verify the DSDT. */ - if (!AcpiGbl_RootTableList.Count || + if (!AcpiGbl_RootTableList.CurrentTableCount || !ACPI_COMPARE_NAME ( &(AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Signature), ACPI_SIG_DSDT) || @@ -613,7 +613,7 @@ AcpiTbLoadNamespace ( /* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); - for (i = 0; i < AcpiGbl_RootTableList.Count; ++i) + for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) { if ((!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), ACPI_SIG_SSDT) && |