Header updates, cleanup

date	2005.03.24.22.05.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 18:55:49 +00:00
parent f90fb160c5
commit 3fa4d021e9
4 changed files with 86 additions and 69 deletions

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: tbinstal - ACPI table installation and removal
* $Revision: 1.76 $
* $Revision: 1.77 $
*
*****************************************************************************/
@ -131,6 +131,7 @@
*
* PARAMETERS: Signature - Table signature to match
* TableInfo - Return data
* SearchType - Table type to match (primary/secondary)
*
* RETURN: Status
*
@ -151,9 +152,8 @@ AcpiTbMatchSignature (
ACPI_FUNCTION_TRACE ("TbMatchSignature");
/*
* Search for a signature match among the known table types
*/
/* Search for a signature match among the known table types */
for (i = 0; i < NUM_ACPI_TABLE_TYPES; i++)
{
if (!(AcpiGbl_TableData[i].Flags & SearchType))
@ -242,6 +242,7 @@ AcpiTbInstallTable (
* FUNCTION: AcpiTbRecognizeTable
*
* PARAMETERS: TableInfo - Return value from AcpiTbGetTableBody
* SearchType - Table type to match (primary/secondary)
*
* RETURN: Status
*
@ -339,9 +340,8 @@ AcpiTbInitTableDescriptor (
return_ACPI_STATUS (AE_NO_MEMORY);
}
/*
* Install the table into the global data structure
*/
/* Install the table into the global data structure */
ListHead = &AcpiGbl_TableLists[TableType];
/*
@ -409,7 +409,8 @@ AcpiTbInitTableDescriptor (
TableDesc->AmlStart = (UINT8 *) (TableDesc->Pointer + 1),
TableDesc->AmlLength = (UINT32) (TableDesc->Length -
(UINT32) sizeof (ACPI_TABLE_HEADER));
TableDesc->TableId = AcpiUtAllocateOwnerId (ACPI_OWNER_TYPE_TABLE);
TableDesc->TableId = AcpiUtAllocateOwnerId (
ACPI_OWNER_TYPE_TABLE);
TableDesc->LoadedIntoNamespace = FALSE;
/*

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: tbutils - Table manipulation utilities
* $Revision: 1.63 $
* $Revision: 1.64 $
*
*****************************************************************************/
@ -160,6 +160,7 @@ AcpiTbValidateTableHeader (
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Cannot read table header at %p\n", TableHeader));
return (AE_BAD_ADDRESS);
}
@ -174,6 +175,7 @@ AcpiTbValidateTableHeader (
ACPI_REPORT_WARNING (("Invalid table signature found: [%4.4s]\n",
(char *) &Signature));
ACPI_DUMP_BUFFER (TableHeader, sizeof (ACPI_TABLE_HEADER));
return (AE_BAD_SIGNATURE);
}
@ -188,6 +190,7 @@ AcpiTbValidateTableHeader (
ACPI_REPORT_WARNING (("Invalid table header length (0x%X) found\n",
(UINT32) TableHeader->Length));
ACPI_DUMP_BUFFER (TableHeader, sizeof (ACPI_TABLE_HEADER));
return (AE_BAD_HEADER);
}
@ -228,8 +231,10 @@ AcpiTbVerifyTableChecksum (
if (Checksum)
{
ACPI_REPORT_WARNING (("Invalid checksum in table [%4.4s] (%02X, sum %02X is not zero)\n",
TableHeader->Signature, (UINT32) TableHeader->Checksum, (UINT32) Checksum));
ACPI_REPORT_WARNING ((
"Invalid checksum in table [%4.4s] (%02X, sum %02X is not zero)\n",
TableHeader->Signature, (UINT32) TableHeader->Checksum,
(UINT32) Checksum));
Status = AE_BAD_CHECKSUM;
}
@ -244,7 +249,7 @@ AcpiTbVerifyTableChecksum (
* PARAMETERS: Buffer - Buffer to checksum
* Length - Size of the buffer
*
* RETURNS 8 bit checksum of buffer
* RETURN: 8 bit checksum of buffer
*
* DESCRIPTION: Computes an 8 bit checksum of the buffer(length) and returns it.
*

View File

@ -2,7 +2,7 @@
*
* Module Name: tbxface - Public interfaces to the ACPI subsystem
* ACPI table oriented interfaces
* $Revision: 1.66 $
* $Revision: 1.67 $
*
*****************************************************************************/
@ -157,7 +157,7 @@ AcpiLoadTables (
if (ACPI_FAILURE (Status))
{
ACPI_REPORT_ERROR (("AcpiLoadTables: Could not get RSDP, %s\n",
AcpiFormatException (Status)));
AcpiFormatException (Status)));
goto ErrorExit;
}
@ -169,7 +169,7 @@ AcpiLoadTables (
if (ACPI_FAILURE (Status))
{
ACPI_REPORT_ERROR (("AcpiLoadTables: RSDP Failed validation: %s\n",
AcpiFormatException (Status)));
AcpiFormatException (Status)));
goto ErrorExit;
}
@ -179,7 +179,7 @@ AcpiLoadTables (
if (ACPI_FAILURE (Status))
{
ACPI_REPORT_ERROR (("AcpiLoadTables: Could not load RSDT: %s\n",
AcpiFormatException (Status)));
AcpiFormatException (Status)));
goto ErrorExit;
}
@ -188,21 +188,21 @@ AcpiLoadTables (
Status = AcpiTbGetRequiredTables ();
if (ACPI_FAILURE (Status))
{
ACPI_REPORT_ERROR (("AcpiLoadTables: Error getting required tables (DSDT/FADT/FACS): %s\n",
AcpiFormatException (Status)));
ACPI_REPORT_ERROR ((
"AcpiLoadTables: Error getting required tables (DSDT/FADT/FACS): %s\n",
AcpiFormatException (Status)));
goto ErrorExit;
}
ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "ACPI Tables successfully acquired\n"));
/* Load the namespace from the tables */
Status = AcpiNsLoadNamespace ();
if (ACPI_FAILURE (Status))
{
ACPI_REPORT_ERROR (("AcpiLoadTables: Could not load namespace: %s\n",
AcpiFormatException (Status)));
AcpiFormatException (Status)));
goto ErrorExit;
}
@ -333,7 +333,6 @@ AcpiUnloadTable (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
/* Find all tables of the requested type */
TableDesc = AcpiGbl_TableLists[TableType].Next;
@ -407,7 +406,6 @@ AcpiGetTableHeader (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
/* Get a pointer to the entire table */
Status = AcpiTbGetTablePtr (TableType, Instance, &TblPtr);
@ -416,19 +414,17 @@ AcpiGetTableHeader (
return_ACPI_STATUS (Status);
}
/*
* The function will return a NULL pointer if the table is not loaded
*/
/* The function will return a NULL pointer if the table is not loaded */
if (TblPtr == NULL)
{
return_ACPI_STATUS (AE_NOT_EXIST);
}
/*
* Copy the header to the caller's buffer
*/
/* Copy the header to the caller's buffer */
ACPI_MEMCPY ((void *) OutTableHeader, (void *) TblPtr,
sizeof (ACPI_TABLE_HEADER));
sizeof (ACPI_TABLE_HEADER));
return_ACPI_STATUS (Status);
}
@ -493,7 +489,6 @@ AcpiGetTable (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
/* Get a pointer to the entire table */
Status = AcpiTbGetTablePtr (TableType, Instance, &TblPtr);
@ -515,9 +510,8 @@ AcpiGetTable (
if (TableType == ACPI_TABLE_RSDP)
{
/*
* RSD PTR is the only "table" without a header
*/
/* RSD PTR is the only "table" without a header */
TableLength = sizeof (RSDP_DESCRIPTOR);
}
else

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: tbxfroot - Find the root ACPI table (RSDT)
* $Revision: 1.83 $
* $Revision: 1.84 $
*
*****************************************************************************/
@ -130,7 +130,8 @@
*
* PARAMETERS: Signature - String with ACPI table signature
* OemId - String with the table OEM ID
* OemTableId - String with the OEM Table ID.
* OemTableId - String with the OEM Table ID
* TablePtr - Where the table pointer is returned
*
* RETURN: Status
*
@ -175,7 +176,6 @@ AcpiTbFindTable (
{
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
}
Table = AcpiGbl_DSDT;
}
else
@ -183,7 +183,7 @@ AcpiTbFindTable (
/* Find the table */
Status = AcpiGetFirmwareTable (Signature, 1,
ACPI_LOGICAL_ADDRESSING, &Table);
ACPI_LOGICAL_ADDRESSING, &Table);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@ -192,8 +192,10 @@ AcpiTbFindTable (
/* Check OemId and OemTableId */
if ((OemId[0] && ACPI_STRNCMP (
OemId, Table->OemId, sizeof (Table->OemId))) ||
if ((OemId[0] && ACPI_STRNCMP (
OemId, Table->OemId,
sizeof (Table->OemId))) ||
(OemTableId[0] && ACPI_STRNCMP (
OemTableId, Table->OemTableId,
sizeof (Table->OemTableId))))
@ -203,6 +205,7 @@ AcpiTbFindTable (
ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "Found table [%4.4s]\n",
Table->Signature));
*TablePtr = Table;
return_ACPI_STATUS (AE_OK);
}
@ -415,7 +418,8 @@ AcpiGetFirmwareTable (
Cleanup:
AcpiOsUnmapMemory (RsdtInfo->Pointer, (ACPI_SIZE) RsdtInfo->Pointer->Length);
AcpiOsUnmapMemory (RsdtInfo->Pointer,
(ACPI_SIZE) RsdtInfo->Pointer->Length);
ACPI_MEM_FREE (RsdtInfo);
if (Header)
@ -438,8 +442,8 @@ Cleanup:
*
* FUNCTION: AcpiFindRootPointer
*
* PARAMETERS: **RsdpAddress - Where to place the RSDP address
* Flags - Logical/Physical addressing
* PARAMETERS: Flags - Logical/Physical addressing
* RsdpAddress - Where to place the RSDP address
*
* RETURN: Status, Physical address of the RSDP
*
@ -467,6 +471,7 @@ AcpiFindRootPointer (
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"RSDP structure not found, %s Flags=%X\n",
AcpiFormatException (Status), Flags));
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
}
@ -511,7 +516,8 @@ AcpiTbScanMemoryForRsdp (
{
/* The signature and checksum must both be correct */
if (ACPI_STRNCMP ((char *) MemRover, RSDP_SIG, sizeof (RSDP_SIG)-1) != 0)
if (ACPI_STRNCMP ((char *) MemRover,
RSDP_SIG, sizeof (RSDP_SIG) - 1) != 0)
{
/* No signature match, keep looking */
@ -559,7 +565,7 @@ AcpiTbScanMemoryForRsdp (
*
* FUNCTION: AcpiTbFindRsdp
*
* PARAMETERS: *TableInfo - Where the table info is returned
* PARAMETERS: TableInfo - Where the table info is returned
* Flags - Current memory mode (logical vs.
* physical addressing)
*
@ -592,25 +598,29 @@ AcpiTbFindRsdp (
/*
* Scan supports either 1) Logical addressing or 2) Physical addressing
* Scan supports either logical addressing or physical addressing
*/
if ((Flags & ACPI_MEMORY_MODE) == ACPI_LOGICAL_ADDRESSING)
{
/*
* 1a) Get the location of the EBDA
*/
Status = AcpiOsMapMemory ((ACPI_PHYSICAL_ADDRESS) ACPI_EBDA_PTR_LOCATION,
ACPI_EBDA_PTR_LENGTH, (void *) &TablePtr);
/* 1a) Get the location of the Extended BIOS Data Area (EBDA) */
Status = AcpiOsMapMemory (
(ACPI_PHYSICAL_ADDRESS) ACPI_EBDA_PTR_LOCATION,
ACPI_EBDA_PTR_LENGTH, (void *) &TablePtr);
if (ACPI_FAILURE (Status))
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Could not map memory at %8.8X for length %X\n",
ACPI_EBDA_PTR_LOCATION, ACPI_EBDA_PTR_LENGTH));
return_ACPI_STATUS (Status);
}
ACPI_MOVE_16_TO_32 (&PhysicalAddress, TablePtr);
PhysicalAddress <<= 4; /* Convert segment to physical address */
/* Convert segment part to physical address */
PhysicalAddress <<= 4;
AcpiOsUnmapMemory (TablePtr, ACPI_EBDA_PTR_LENGTH);
/* EBDA present? */
@ -621,18 +631,20 @@ AcpiTbFindRsdp (
* 1b) Search EBDA paragraphs (EBDA is required to be a
* minimum of 1K length)
*/
Status = AcpiOsMapMemory ((ACPI_PHYSICAL_ADDRESS) PhysicalAddress,
ACPI_EBDA_WINDOW_SIZE,
(void *) &TablePtr);
Status = AcpiOsMapMemory (
(ACPI_PHYSICAL_ADDRESS) PhysicalAddress,
ACPI_EBDA_WINDOW_SIZE, (void *) &TablePtr);
if (ACPI_FAILURE (Status))
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Could not map memory at %8.8X for length %X\n",
PhysicalAddress, ACPI_EBDA_WINDOW_SIZE));
return_ACPI_STATUS (Status);
}
MemRover = AcpiTbScanMemoryForRsdp (TablePtr, ACPI_EBDA_WINDOW_SIZE);
MemRover = AcpiTbScanMemoryForRsdp (TablePtr,
ACPI_EBDA_WINDOW_SIZE);
AcpiOsUnmapMemory (TablePtr, ACPI_EBDA_WINDOW_SIZE);
if (MemRover)
@ -641,7 +653,8 @@ AcpiTbFindRsdp (
PhysicalAddress += ACPI_PTR_DIFF (MemRover, TablePtr);
TableInfo->PhysicalAddress = (ACPI_PHYSICAL_ADDRESS) PhysicalAddress;
TableInfo->PhysicalAddress =
(ACPI_PHYSICAL_ADDRESS) PhysicalAddress;
return_ACPI_STATUS (AE_OK);
}
}
@ -649,14 +662,16 @@ AcpiTbFindRsdp (
/*
* 2) Search upper memory: 16-byte boundaries in E0000h-FFFFFh
*/
Status = AcpiOsMapMemory ((ACPI_PHYSICAL_ADDRESS) ACPI_HI_RSDP_WINDOW_BASE,
ACPI_HI_RSDP_WINDOW_SIZE,
(void *) &TablePtr);
Status = AcpiOsMapMemory (
(ACPI_PHYSICAL_ADDRESS) ACPI_HI_RSDP_WINDOW_BASE,
ACPI_HI_RSDP_WINDOW_SIZE, (void *) &TablePtr);
if (ACPI_FAILURE (Status))
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Could not map memory at %8.8X for length %X\n",
ACPI_HI_RSDP_WINDOW_BASE, ACPI_HI_RSDP_WINDOW_SIZE));
return_ACPI_STATUS (Status);
}
@ -667,9 +682,11 @@ AcpiTbFindRsdp (
{
/* Found it, return the physical address */
PhysicalAddress = ACPI_HI_RSDP_WINDOW_BASE + ACPI_PTR_DIFF (MemRover, TablePtr);
PhysicalAddress =
ACPI_HI_RSDP_WINDOW_BASE + ACPI_PTR_DIFF (MemRover, TablePtr);
TableInfo->PhysicalAddress = (ACPI_PHYSICAL_ADDRESS) PhysicalAddress;
TableInfo->PhysicalAddress =
(ACPI_PHYSICAL_ADDRESS) PhysicalAddress;
return_ACPI_STATUS (AE_OK);
}
}
@ -679,9 +696,8 @@ AcpiTbFindRsdp (
*/
else
{
/*
* 1a) Get the location of the EBDA
*/
/* 1a) Get the location of the EBDA */
ACPI_MOVE_16_TO_32 (&PhysicalAddress, ACPI_EBDA_PTR_LOCATION);
PhysicalAddress <<= 4; /* Convert segment to physical address */
@ -693,7 +709,8 @@ AcpiTbFindRsdp (
* 1b) Search EBDA paragraphs (EBDA is required to be a minimum of
* 1K length)
*/
MemRover = AcpiTbScanMemoryForRsdp (ACPI_PHYSADDR_TO_PTR (PhysicalAddress),
MemRover = AcpiTbScanMemoryForRsdp (
ACPI_PHYSADDR_TO_PTR (PhysicalAddress),
ACPI_EBDA_WINDOW_SIZE);
if (MemRover)
{
@ -704,10 +721,10 @@ AcpiTbFindRsdp (
}
}
/*
* 2) Search upper memory: 16-byte boundaries in E0000h-FFFFFh
*/
MemRover = AcpiTbScanMemoryForRsdp (ACPI_PHYSADDR_TO_PTR (ACPI_HI_RSDP_WINDOW_BASE),
/* 2) Search upper memory: 16-byte boundaries in E0000h-FFFFFh */
MemRover = AcpiTbScanMemoryForRsdp (
ACPI_PHYSADDR_TO_PTR (ACPI_HI_RSDP_WINDOW_BASE),
ACPI_HI_RSDP_WINDOW_SIZE);
if (MemRover)
{