[PATCH 02/14] acpi: pptt: check flags based on revision (mantis 1870 for ACPI 6.2b)

Alex Hung alex.hung at canonical.com
Fri Feb 8 03:23:02 UTC 2019


Signed-off-by: Alex Hung <alex.hung at canonical.com>
---
 src/acpi/pptt/pptt.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/acpi/pptt/pptt.c b/src/acpi/pptt/pptt.c
index ef1c50e8..e0b7f446 100644
--- a/src/acpi/pptt/pptt.c
+++ b/src/acpi/pptt/pptt.c
@@ -25,6 +25,8 @@
 
 static fwts_acpi_table_info *table;
 
+static uint8_t table_rev;
+
 static int pptt_init(fwts_framework *fw)
 {
 	if (fwts_acpi_find_table(fw, "PPTT", 0, &table) != FWTS_OK) {
@@ -65,7 +67,12 @@ static void pptt_processor_test(fwts_framework *fw, const fwts_acpi_table_pptt_p
 	}
 
 	fwts_acpi_reserved_zero_check(fw, "PPTT", "Reserved", entry->reserved, sizeof(entry->reserved), passed);
-	fwts_acpi_reserved_bits_check(fw, "PPTT", "Flags", entry->flags, sizeof(entry->flags), 2, 31, passed);
+
+	if (table_rev == 1)
+		fwts_acpi_reserved_bits_check(fw, "PPTT", "Flags", entry->flags, sizeof(entry->flags), 2, 31, passed);
+	else if (table_rev == 2)
+		fwts_acpi_reserved_bits_check(fw, "PPTT", "Flags", entry->flags, sizeof(entry->flags), 5, 31, passed);
+
 }
 
 static void pptt_cache_test(fwts_framework *fw, const fwts_acpi_table_pptt_cache *entry, bool *passed)
@@ -112,10 +119,13 @@ static void pptt_id_test(fwts_framework *fw, const fwts_acpi_table_pptt_id *entr
 static int pptt_test1(fwts_framework *fw)
 {
 	fwts_acpi_table_pptt_header *entry;
-	uint32_t offset;
+	fwts_acpi_table_pptt *pptt;
 	bool passed = true;
+	uint32_t offset;
 
 	fwts_log_info_verbatim(fw, "PPTT Processor Properties Topology Table:");
+	pptt = (fwts_acpi_table_pptt *)table->data;
+	table_rev = pptt->header.revision;
 
 	entry = (fwts_acpi_table_pptt_header *) (table->data + sizeof(fwts_acpi_table_pptt));
 	offset = sizeof(fwts_acpi_table_pptt);
-- 
2.17.1




More information about the fwts-devel mailing list