Added FindTable interface

date	2001.12.20.21.05.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 18:57:02 +00:00
parent e98a5eda9d
commit 9e776a0f61

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: tbutils - Table manipulation utilities
* $Revision: 1.43 $
* $Revision: 1.44 $
*
*****************************************************************************/
@ -125,6 +125,67 @@
MODULE_NAME ("tbutils")
/*******************************************************************************
*
* FUNCTION: AcpiTbFindTable
*
* PARAMETERS: Signature - String with ACPI table signature
* OemId - String with the table OEM ID
* OemTableId - String with the OEM Table ID.
*
* RETURN: Status
*
* DESCRIPTION: Find an ACPI table (in the RSDT/XSDT) that matches the
* Signature, OEM ID and OEM Table ID.
*
******************************************************************************/
ACPI_STATUS
AcpiTbFindTable (
NATIVE_CHAR *Signature,
NATIVE_CHAR *OemId,
NATIVE_CHAR *OemTableId,
ACPI_TABLE_HEADER **TablePtr)
{
ACPI_STATUS Status;
ACPI_TABLE_HEADER *Table;
FUNCTION_TRACE ("TbFindTable");
/* Validate string lengths */
if ((STRLEN (Signature) > 4) ||
(STRLEN (OemId) > 6) ||
(STRLEN (OemTableId) > 8))
{
return_ACPI_STATUS (AE_AML_STRING_LIMIT);
}
/* Find the table */
Status = AcpiGetFirmwareTable (Signature, 1,
ACPI_LOGICAL_ADDRESSING, &Table);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/* Check OemId and OemTableId */
if ((OemId[0] && STRCMP (OemId, Table->OemId)) ||
(OemTableId[0] && STRCMP (OemTableId, Table->OemTableId)))
{
return_ACPI_STATUS (AE_AML_NAME_NOT_FOUND);
}
*TablePtr = Table;
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AcpiTbHandleToObject