diff mbox

[v2,18/23] FADT: add compliance test for the CST_CNT field

Message ID 1455925199-8587-19-git-send-email-al.stone@linaro.org
State New
Headers show

Commit Message

Al Stone Feb. 19, 2016, 11:39 p.m. UTC
Add in a new compliance test to check the C-State control (CST_CNT) field
for the proper values.

Signed-off-by: Al Stone <al.stone@linaro.org>

Acked-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Alex Hung <alex.hung@canonical.com>

---
 src/acpi/fadt/fadt.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

-- 
2.5.0
diff mbox

Patch

diff --git a/src/acpi/fadt/fadt.c b/src/acpi/fadt/fadt.c
index 4254df0..6954e49 100644
--- a/src/acpi/fadt/fadt.c
+++ b/src/acpi/fadt/fadt.c
@@ -1320,6 +1320,28 @@  static void acpi_table_check_fadt_gpe1_blk_len(fwts_framework *fw)
 	}
 }
 
+static void acpi_table_check_fadt_cst_cnt(fwts_framework *fw)
+{
+	if (fadt->cst_cnt == 0) {
+		if (fadt->smi_cmd == 0)
+			fwts_passed(fw,
+				    "FADT SMI CST_CNT command is zero, "
+				    "which is allowed since SMM is not "
+				    "supported.");
+	} else {
+		if (fadt->smi_cmd == 0)
+			fwts_failed(fw, LOG_LEVEL_MEDIUM,
+				    "SMMHasExtraCSTCntCmd",
+				    "FADT SMI CST_CNT command is "
+				    "non-zero, but SMM is not supported.");
+		else
+			fwts_passed(fw, "FADT SMI CST_CNT command is "
+				    "non-zero, and SMM is supported.");
+	}
+
+	return;
+}
+
 static int fadt_test1(fwts_framework *fw)
 {
 	bool passed = true;
@@ -1357,6 +1379,7 @@  static int fadt_test1(fwts_framework *fw)
 		acpi_table_check_fadt_gpe0_blk_len(fw);
 		acpi_table_check_fadt_gpe1_blk_len(fw);
 		fwts_log_info(fw, "FADT GPE1_BASE is %" PRIu8, fadt->gpe1_base);
+		acpi_table_check_fadt_cst_cnt(fw);
 
 		fwts_log_info(fw, "FADT FLUSH_SIZE is %" PRIu16,
 			      fadt->flush_size);