acpiexec: Add testability of deferred table verification

This patch adds testability of deferred table verification mechanism. As
acpiexec uses dynamically allocated root table list from its very early
stage, a change to AcpiReallocateRootTable() is required to allow deferred
table verification mechanism to be triggered in such an environment. Note
that AcpiGbl_EnableTableValidation is still TRUE by default, thus:
1. Developers need to manually set AcpiGbl_EnableTableValidation to FALSE
   for acpiexec to enable this test.
2. For all other OSPMs (Linux, BSDs, etc.), this commit is a no-op.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
This commit is contained in:
Lv Zheng 2017-07-10 10:17:29 +08:00 committed by Zheng
parent 41e7b3575c
commit 04c28c7549
2 changed files with 14 additions and 3 deletions

View File

@ -300,10 +300,13 @@ AcpiReallocateRootTable (
/*
* Only reallocate the root table if the host provided a static buffer
* for the table array in the call to AcpiInitializeTables.
* If there are tables unverified, it is required to reallocate the
* root table list to clean up invalid table entries. Otherwise only
* reallocate the root table list if the host provided a static buffer
* for the table array in the call to AcpiInitializeTables().
*/
if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
if ((AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED) &&
AcpiGbl_EnableTableValidation)
{
return_ACPI_STATUS (AE_SUPPORT);
}

View File

@ -598,6 +598,14 @@ AeInstallTables (
Status = AcpiInitializeTables (NULL, ACPI_MAX_INIT_TABLES, TRUE);
ACPI_CHECK_OK (AcpiInitializeTables, Status);
/*
* The following code is prepared to test the deferred table
* verification mechanism. When AcpiGbl_EnableTableValidation is set
* to FALSE by default, AcpiReallocateRootTable() sets it back to TRUE
* and triggers the deferred table verification mechanism accordingly.
*/
(void) AcpiReallocateRootTable ();
if (AcpiGbl_LoadTestTables)
{
/* Test multiple table/UEFI support. First, get the headers */