[PATCH] acpi: fadt: update fadt_dsdt test with x_dsdt field
Alex Hung
alex.hung at canonical.com
Fri Jul 24 02:41:30 UTC 2015
In coming ACPI spec, DSDT pointer should be zero if X_DSDT
is non-zero. Current firmware implementation allows DSDT == X_DSDT.
Therefore, both checks are both valid in FWTS.
Signed-off-by: Alex Hung <alex.hung at canonical.com>
---
src/acpi/fadt/fadt.c | 40 ++++++++++++++++++++++++----------------
1 file changed, 24 insertions(+), 16 deletions(-)
diff --git a/src/acpi/fadt/fadt.c b/src/acpi/fadt/fadt.c
index baa1bf8..abacdb5 100644
--- a/src/acpi/fadt/fadt.c
+++ b/src/acpi/fadt/fadt.c
@@ -123,25 +123,33 @@ static void acpi_table_check_fadt_dsdt(
const fwts_acpi_table_fadt *fadt,
bool *passed)
{
- if (fadt->dsdt == 0) {
- *passed = false;
- fwts_failed(fw, LOG_LEVEL_MEDIUM,
- "FADTDSTNull",
- "FADT DSDT address is null.");
- }
- if (fadt->header.length >= 148) {
- if (fadt->x_dsdt == 0) {
+ if (fadt->header.length < 148) {
+ if (fadt->dsdt == 0) {
*passed = false;
fwts_failed(fw, LOG_LEVEL_MEDIUM,
- "FADTXDSTDNull",
- "FADT X_DSDT address is null.");
- fwts_advice(fw,
- "An ACPI 2.0 FADT is being used however "
- "the 64 bit X_DSDT is null."
- "The kernel will fall back to using "
- "the 32 bit DSDT pointer instead.");
- } else if ((uint64_t)fadt->dsdt != fadt->x_dsdt) {
+ "FADTDSDTNull",
+ "FADT DSDT address is null.");
+ }
+ } else {
+ if (fadt->x_dsdt == 0) {
+ if (fadt->dsdt == 0) {
+ *passed = false;
+ fwts_failed(fw, LOG_LEVEL_MEDIUM,
+ "FADTXDSDTNull",
+ "FADT X_DSDT and DSDT address are null.");
+ } else {
+ *passed = false;
+ fwts_failed(fw, LOG_LEVEL_MEDIUM,
+ "FADTXDSDTNull",
+ "FADT X_DSDT address is null.");
+ fwts_advice(fw,
+ "An ACPI 2.0 FADT is being used however "
+ "the 64 bit X_DSDT is null."
+ "The kernel will fall back to using "
+ "the 32 bit DSDT pointer instead.");
+ }
+ } else if ((uint64_t)fadt->dsdt != fadt->x_dsdt && fadt->dsdt != 0) {
*passed = false;
fwts_failed(fw, LOG_LEVEL_MEDIUM,
"FADT32And64Mismatch",
--
2.1.4
More information about the fwts-devel
mailing list