[PATCH 2/2] Add ACPI 1.0 RSDP test to make sure RSDT field isn't null
Alex Hung
alex.hung at canonical.com
Tue Nov 14 04:47:44 UTC 2017
From: Chris Goldsworthy <goldswo at amazon.com>
Given that a RSDP follows ACPI 1.0, perform a test to ensure that
the RSDT address field is not null. The addition of this test
ensures that there are tests for each RSDP field for any ACPI
specification.
Signed-off-by: Christopher Goldsworthy <goldswo at amazon.de>
---
src/acpi/rsdp/rsdp.c | 21 +++++--
test.patch | 170 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/src/acpi/rsdp/rsdp.c b/src/acpi/rsdp/rsdp.c
index 2f537be..0fcb430 100644
--- a/src/acpi/rsdp/rsdp.c
+++ b/src/acpi/rsdp/rsdp.c
@@ -115,11 +115,24 @@ static int rsdp_test1(fwts_framework *fw)
"RSDP: revision is %" PRIu8 ", expected "
"value to be 0 or 2.", rsdp->revision);
- /* all proceeding tests involve fields which are only
- * defined in ACPI specifications 2.0 and greater, skip
- * if ACPI version is 1.0 */
- if (rsdp->revision == 0)
+ /* check if RSDP follows ACPI 1.0 - if so, make sure rsdt_address
+ * is not null. */
+ if (rsdp->revision == 0) {
+ if (rsdp->rsdt_address != 0)
+ fwts_passed(fw,
+ "RSDP: RSDP follows ACPI 1.0 "
+ "and RsdtAddress is set.");
+ else
+ fwts_failed(fw, LOG_LEVEL_MEDIUM,
+ "RSDPNullRSDTPointer",
+ "RSDP: RSDP follows ACPI 1.0, but "
+ "RsdtAddress isn't set.");
+
+ /* all proceeding tests involve fields which are only
+ * defined in ACPI specifications 2.0 and greater, skip
+ * if ACPI version is 1.0 */
return FWTS_OK;
+ }
/* whether RSDT or XSDT depends arch */
if (rsdp->rsdt_address == 0 && rsdp->xsdt_address == 0)
--
2.10.1 (Apple Git-78)
More information about the fwts-devel
mailing list