From patchwork Wed Sep 19 17:53:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 185122 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 4CBEF2C0086 for ; Thu, 20 Sep 2012 03:54:06 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TEORI-000378-MO; Wed, 19 Sep 2012 17:51:56 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TEORE-00036O-Lt for fwts-devel@lists.ubuntu.com; Wed, 19 Sep 2012 17:51:52 +0000 Received: from cpc3-craw6-2-0-cust180.croy.cable.virginmedia.com ([77.100.248.181] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1TEOTJ-0007E0-0Q for fwts-devel@lists.ubuntu.com; Wed, 19 Sep 2012 17:54:01 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH 6/8] acpi: method: Add check for SEG Date: Wed, 19 Sep 2012 18:53:55 +0100 Message-Id: <1348077237-3143-7-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1348077237-3143-1-git-send-email-colin.king@canonical.com> References: <1348077237-3143-1-git-send-email-colin.king@canonical.com> X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: fwts-devel-bounces@lists.ubuntu.com Errors-To: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King Signed-off-by: Colin Ian King Acked-by: Keng-Yu Lin Acked-by: Ivan Hu --- src/acpi/method/method.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c index e38b830..0e82801 100644 --- a/src/acpi/method/method.c +++ b/src/acpi/method/method.c @@ -200,7 +200,7 @@ * _SBS 10.1.3 Y * _SCP 11.4.11 Y * _SDD 9.8.3.3.1 N - * _SEG 6.5.6 N + * _SEG 6.5.6 Y * _SHL 10.4.5 N * _SLI 6.2.14 N * _SPD B.4.5 Y @@ -1103,6 +1103,34 @@ static int method_test_DCK(fwts_framework *fw) return FWTS_OK; } +static void method_test_SEG_return( + fwts_framework *fw, + char *name, + ACPI_BUFFER *buf, + ACPI_OBJECT *obj, + void *private) +{ + if (method_check_type(fw, name, buf, ACPI_TYPE_INTEGER) == FWTS_OK) { + if ((obj->Integer.Value & 0xffff0000)) { + fwts_failed(fw, LOG_LEVEL_MEDIUM, + "Method_SEGIllegalReserved", + "_SEG returned value 0x%8.8x and some of the " + "upper 16 reserved bits are set when they " + "should in fact be zero.", + (uint32_t)obj->Integer.Value); + fwts_tag_failed(fw, FWTS_TAG_ACPI_METHOD_RETURN); + } else + fwts_passed(fw, + "_SEG correctly returned sane looking " + "value 0x%8.8x", (uint32_t)obj->Integer.Value); + } +} + +static int method_test_SEG(fwts_framework *fw) +{ + return method_evaluate_method(fw, METHOD_OPTIONAL, "_SEG", + NULL, 0, method_test_SEG_return, "_SEG"); +} /* * Section 7.1 Declaring a Power Resource Object @@ -3124,7 +3152,7 @@ static fwts_framework_minor_test method_tests[] = { /* { method_test_INI, "Check _INI (Initialize)." }, */ /* { method_test_GLK, "Check _GLK (Global Lock)." }, */ /* { method_test_REG, "Check _REG (Region)." }, */ - /* { method_test_SEG, "Check _SEG (Segment)." }, */ + { method_test_SEG, "Check _SEG (Segment)." }, /* Section 7.1 Declaring a Power Resource Object */