mirror of
https://github.com/acpica/acpica/
synced 2025-02-25 01:44:33 +03:00
Clarify/rename some root table descriptor fields.
Original fields were not very descriptive and led to maintenance problems. New fields should help to understand the existing code.
This commit is contained in:
parent
752d13e806
commit
66525d7384
@ -282,8 +282,8 @@ AdInitialize (
|
||||
|
||||
/* Setup the Table Manager (cheat - there is no RSDT) */
|
||||
|
||||
AcpiGbl_RootTableList.Size = 1;
|
||||
AcpiGbl_RootTableList.Count = 0;
|
||||
AcpiGbl_RootTableList.MaxTableCount = 1;
|
||||
AcpiGbl_RootTableList.CurrentTableCount = 0;
|
||||
AcpiGbl_RootTableList.Tables = LocalTables;
|
||||
|
||||
return (Status);
|
||||
@ -1156,7 +1156,7 @@ AdParseTable (
|
||||
|
||||
/* If LoadTable is FALSE, we are parsing the last loaded table */
|
||||
|
||||
TableIndex = AcpiGbl_RootTableList.Count - 1;
|
||||
TableIndex = AcpiGbl_RootTableList.CurrentTableCount - 1;
|
||||
|
||||
/* Pass 2 */
|
||||
|
||||
|
@ -675,7 +675,7 @@ AcpiDbDisplayTableInfo (
|
||||
|
||||
/* Walk the entire root table list */
|
||||
|
||||
for (i = 0; i < AcpiGbl_RootTableList.Count; i++)
|
||||
for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
|
||||
{
|
||||
TableDesc = &AcpiGbl_RootTableList.Tables[i];
|
||||
AcpiOsPrintf ("%d ", i);
|
||||
|
@ -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))
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
@ -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) &&
|
||||
|
@ -216,11 +216,10 @@ ACPI_NAME AcpiGbl_TraceMethodName;
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* AcpiGbl_RootTableList is the master list of ACPI tables found in the
|
||||
* RSDT/XSDT.
|
||||
*
|
||||
* AcpiGbl_RootTableList is the master list of ACPI tables that were
|
||||
* found in the RSDT/XSDT.
|
||||
*/
|
||||
ACPI_EXTERN ACPI_INTERNAL_RSDT AcpiGbl_RootTableList;
|
||||
ACPI_EXTERN ACPI_TABLE_LIST AcpiGbl_RootTableList;
|
||||
ACPI_EXTERN ACPI_TABLE_FACS *AcpiGbl_FACS;
|
||||
|
||||
/* These addresses are calculated from the FADT Event Block addresses */
|
||||
|
@ -307,16 +307,16 @@ typedef struct acpi_namespace_node
|
||||
#define ANOBJ_IS_REFERENCED 0x80 /* iASL only: Object was referenced */
|
||||
|
||||
|
||||
/* One internal RSDT for table management */
|
||||
/* Internal ACPI table management - master table list */
|
||||
|
||||
typedef struct acpi_internal_rsdt
|
||||
typedef struct acpi_table_list
|
||||
{
|
||||
ACPI_TABLE_DESC *Tables;
|
||||
UINT32 Count;
|
||||
UINT32 Size;
|
||||
ACPI_TABLE_DESC *Tables; /* Table descriptor array */
|
||||
UINT32 CurrentTableCount; /* Tables currently in the array */
|
||||
UINT32 MaxTableCount; /* Max tables array will hold */
|
||||
UINT8 Flags;
|
||||
|
||||
} ACPI_INTERNAL_RSDT;
|
||||
} ACPI_TABLE_LIST;
|
||||
|
||||
/* Flags for above */
|
||||
|
||||
|
@ -310,7 +310,6 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
|
||||
{"ACPI_INTEGER_OVERLAY", SRC_TYPE_STRUCT},
|
||||
{"ACPI_INTEGRITY_INFO", SRC_TYPE_STRUCT},
|
||||
{"ACPI_INTERFACE_INFO", SRC_TYPE_STRUCT},
|
||||
{"ACPI_INTERNAL_RSDT", SRC_TYPE_STRUCT},
|
||||
{"ACPI_INTERPRETER_MODE", SRC_TYPE_SIMPLE},
|
||||
{"ACPI_IO_ADDRESS", SRC_TYPE_SIMPLE},
|
||||
{"ACPI_IO_ATTRIBUTE", SRC_TYPE_STRUCT},
|
||||
|
Loading…
x
Reference in New Issue
Block a user