diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2014-06-27 19:10:35 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2014-06-27 19:10:35 +0000 |
commit | e599b42ef5047e5546af949d87d2cfd2e17062b0 (patch) | |
tree | eeef1a6644e518893667349342fa66f9f0249fec /source/components/tables/tbdata.c | |
parent | 6b8f78e0a6a7880856440b372097482adb326592 (diff) | |
download | src-test2-e599b42ef5047e5546af949d87d2cfd2e17062b0.tar.gz src-test2-e599b42ef5047e5546af949d87d2cfd2e17062b0.zip |
Notes
Diffstat (limited to 'source/components/tables/tbdata.c')
-rw-r--r-- | source/components/tables/tbdata.c | 65 |
1 files changed, 52 insertions, 13 deletions
diff --git a/source/components/tables/tbdata.c b/source/components/tables/tbdata.c index 549c5551bcb1..e0c5f3ae4bb1 100644 --- a/source/components/tables/tbdata.c +++ b/source/components/tables/tbdata.c @@ -352,7 +352,43 @@ AcpiTbInvalidateTable ( /****************************************************************************** * - * FUNCTION: AcpiTbVerifyTable + * FUNCTION: AcpiTbValidateTempTable + * + * PARAMETERS: TableDesc - Table descriptor + * + * RETURN: Status + * + * DESCRIPTION: This function is called to validate the table, the returned + * table descriptor is in "VALIDATED" state. + * + *****************************************************************************/ + +ACPI_STATUS +AcpiTbValidateTempTable ( + ACPI_TABLE_DESC *TableDesc) +{ + + if (!TableDesc->Pointer && !AcpiGbl_VerifyTableChecksum) + { + /* + * Only validates the header of the table. + * Note that Length contains the size of the mapping after invoking + * this work around, this value is required by + * AcpiTbReleaseTempTable(). + * We can do this because in AcpiInitTableDescriptor(), the Length + * field of the installed descriptor is filled with the actual + * table length obtaining from the table header. + */ + TableDesc->Length = sizeof (ACPI_TABLE_HEADER); + } + + return (AcpiTbValidateTable (TableDesc)); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiTbVerifyTempTable * * PARAMETERS: TableDesc - Table descriptor * Signature - Table signature to verify @@ -365,19 +401,19 @@ AcpiTbInvalidateTable ( *****************************************************************************/ ACPI_STATUS -AcpiTbVerifyTable ( +AcpiTbVerifyTempTable ( ACPI_TABLE_DESC *TableDesc, char *Signature) { ACPI_STATUS Status = AE_OK; - ACPI_FUNCTION_TRACE (TbVerifyTable); + ACPI_FUNCTION_TRACE (TbVerifyTempTable); /* Validate the table */ - Status = AcpiTbValidateTable (TableDesc); + Status = AcpiTbValidateTempTable (TableDesc); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (AE_NO_MEMORY); @@ -397,16 +433,19 @@ AcpiTbVerifyTable ( /* Verify the checksum */ - Status = AcpiTbVerifyChecksum (TableDesc->Pointer, TableDesc->Length); - if (ACPI_FAILURE (Status)) + if (AcpiGbl_VerifyTableChecksum) { - ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY, - "%4.4s " ACPI_PRINTF_UINT - " Attempted table install failed", - AcpiUtValidAcpiName (TableDesc->Signature.Ascii) ? - TableDesc->Signature.Ascii : "????", - ACPI_FORMAT_TO_UINT (TableDesc->Address))); - goto InvalidateAndExit; + Status = AcpiTbVerifyChecksum (TableDesc->Pointer, TableDesc->Length); + if (ACPI_FAILURE (Status)) + { + ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY, + "%4.4s " ACPI_PRINTF_UINT + " Attempted table install failed", + AcpiUtValidAcpiName (TableDesc->Signature.Ascii) ? + TableDesc->Signature.Ascii : "????", + ACPI_FORMAT_TO_UINT (TableDesc->Address))); + goto InvalidateAndExit; + } } return_ACPI_STATUS (AE_OK); |