[PATCH 5/6] acpi: method: handle ACPICA slack mode gracefully

Colin King colin.king at canonical.com
Tue Jul 9 10:03:16 UTC 2013


From: Colin Ian King <colin.king at canonical.com>

In ACPICA slack mode we should be less pedandtic about
forced integer returns on controls that normally return
nothing.

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/acpi/method/method.c | 16 ++++++++++++++++
 src/acpica/fwts_acpica.c |  9 +++++++++
 2 files changed, 25 insertions(+)

diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
index 6afa864..628ead6 100644
--- a/src/acpi/method/method.c
+++ b/src/acpi/method/method.c
@@ -665,6 +665,22 @@ static void method_test_NULL_return(
 {
 	FWTS_UNUSED(private);
 
+	/*
+	 *  In ACPICA SLACK mode null returns can be actually
+	 *  forced to return ACPI integers. Blame an errata
+	 *  and Windows compatability for this mess.
+	 */
+	if (fw->acpica_mode & FWTS_ACPICA_MODE_SLACK) {
+		if ((buf != NULL) && (buf->Pointer != NULL)) {
+			ACPI_OBJECT *obj = buf->Pointer;
+			if (obj->Type == ACPI_TYPE_INTEGER) {
+				fwts_passed(fw, "%s returned an ACPI_TYPE_INTEGER as expected in slack mode.",
+					name);
+				return;
+			}
+		}
+	}
+
 	if (buf->Length && buf->Pointer) {
 		fwts_failed(fw, LOG_LEVEL_MEDIUM, "MethodShouldReturnNothing", "%s returned values, but was expected to return nothing.", name);
 		fwts_tag_failed(fw, FWTS_TAG_ACPI_METHOD_RETURN);
diff --git a/src/acpica/fwts_acpica.c b/src/acpica/fwts_acpica.c
index ac76e6e..ec85115 100644
--- a/src/acpica/fwts_acpica.c
+++ b/src/acpica/fwts_acpica.c
@@ -209,6 +209,15 @@ static ACPI_STATUS fwts_exception_handler(
 			"ACPICA Exception %s during execution at module level (table load)",
 			exception);
 
+	if (AcpiGbl_IgnoreErrors) {
+		if (AmlStatus != AE_OK) {
+			fwts_log_info(fwts_acpica_fw,
+				"ACPICA Exception override, forcing AE_OK for execption %s",
+				exception);
+			AmlStatus = AE_OK;
+		}
+	}
+
 	return AmlStatus;
 }
 
-- 
1.8.1.2




More information about the fwts-devel mailing list