Don't try to read the RSDP structure or RSDT/XSDT tables from memory with the -c option. These are now provided as files in /sysfs, and this allows acpidump to function when /dev/mem is not available, which is the case when booted in UEFI secure boot mode, and also for ARM servers.
Signed-off-by: Roy Franz roy.franz@linaro.org ---
This produces almost the same output with/without the "-c" option, with the /sysfs files being used with "-c", with the following differences: * Table address are 0x0 with -c, since we don't get them from the sysfs files * the tables are listed in a different order.
This has been tested against the following Linux patch which is being submitted upstream: https://lists.linaro.org/pipermail/linaro-acpi/2015-May/004549.html
source/os_specific/service_layers/oslinuxtbl.c | 87 +++++++++++++------------- 1 file changed, 43 insertions(+), 44 deletions(-)
diff --git a/source/os_specific/service_layers/oslinuxtbl.c b/source/os_specific/service_layers/oslinuxtbl.c index e090a3c..95cc674 100644 --- a/source/os_specific/service_layers/oslinuxtbl.c +++ b/source/os_specific/service_layers/oslinuxtbl.c @@ -686,70 +686,69 @@ OslTableInitialize ( return (AE_OK); }
+ if (!Gbl_DumpCustomizedTables) + { /* Get RSDP from memory */
- Status = OslLoadRsdp (); - if (ACPI_FAILURE (Status)) - { - return (Status); - } + Status = OslLoadRsdp (); + if (ACPI_FAILURE (Status)) + { + return (Status); + }
- /* Get XSDT from memory */ + /* Get XSDT from memory */
- if (Gbl_Rsdp.Revision && !Gbl_DoNotDumpXsdt) - { - if (Gbl_Xsdt) + if (Gbl_Rsdp.Revision && !Gbl_DoNotDumpXsdt) { - free (Gbl_Xsdt); - Gbl_Xsdt = NULL; + if (Gbl_Xsdt) + { + free (Gbl_Xsdt); + Gbl_Xsdt = NULL; + } + + Gbl_Revision = 2; + Status = OslGetBiosTable (ACPI_SIG_XSDT, 0, + ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Xsdt), &Address); + if (ACPI_FAILURE (Status)) + { + return (Status); + } }
- Gbl_Revision = 2; - Status = OslGetBiosTable (ACPI_SIG_XSDT, 0, - ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Xsdt), &Address); - if (ACPI_FAILURE (Status)) + /* Get RSDT from memory */ + + if (Gbl_Rsdp.RsdtPhysicalAddress) { - return (Status); + if (Gbl_Rsdt) + { + free (Gbl_Rsdt); + Gbl_Rsdt = NULL; + } + + Status = OslGetBiosTable (ACPI_SIG_RSDT, 0, + ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Rsdt), &Address); + if (ACPI_FAILURE (Status)) + { + return (Status); + } } - }
- /* Get RSDT from memory */ + /* Get FADT from memory */
- if (Gbl_Rsdp.RsdtPhysicalAddress) - { - if (Gbl_Rsdt) + if (Gbl_Fadt) { - free (Gbl_Rsdt); - Gbl_Rsdt = NULL; + free (Gbl_Fadt); + Gbl_Fadt = NULL; }
- Status = OslGetBiosTable (ACPI_SIG_RSDT, 0, - ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Rsdt), &Address); + Status = OslGetBiosTable (ACPI_SIG_FADT, 0, + ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Fadt), &Gbl_FadtAddress); if (ACPI_FAILURE (Status)) { return (Status); } - }
- /* Get FADT from memory */ - - if (Gbl_Fadt) - { - free (Gbl_Fadt); - Gbl_Fadt = NULL; - } - - Status = OslGetBiosTable (ACPI_SIG_FADT, 0, - ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Fadt), &Gbl_FadtAddress); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - - if (!Gbl_DumpCustomizedTables) - { /* Add mandatory tables to global table list first */ - Status = OslAddTableToList (ACPI_RSDP_NAME, 0); if (ACPI_FAILURE (Status)) {