From patchwork Mon Jul 2 12:15:08 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: 168583 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 26EDB2C0099 for ; Mon, 2 Jul 2012 22:15:21 +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 1SlfXE-0003li-0a for incoming@patchwork.ozlabs.org; Mon, 02 Jul 2012 12:15:20 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SlfXB-0003lG-KE for fwts-devel@lists.ubuntu.com; Mon, 02 Jul 2012 12:15:17 +0000 Received: from cpc19-craw6-2-0-cust5.croy.cable.virginmedia.com ([77.102.228.6] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SlfXB-0006jK-HQ for fwts-devel@lists.ubuntu.com; Mon, 02 Jul 2012 12:15:17 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH 2/5] acpi: method: Add new ACPI 5.0 _PRE Date: Mon, 2 Jul 2012 13:15:08 +0100 Message-Id: <1341231311-12557-3-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1341231311-12557-1-git-send-email-colin.king@canonical.com> References: <1341231311-12557-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: Alex Hung Acked-by: Keng-Yu Lin --- src/acpi/method/method.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c index 06fb7de..afe6e75 100644 --- a/src/acpi/method/method.c +++ b/src/acpi/method/method.c @@ -92,6 +92,7 @@ * _PPC 8.4.4.3 N * _PR 5.3.1 N * _PR0 7.2.7 N + * _PRE 7.2.12 Y * _PRS 6.2.11 N * _PRW 7.2.11 N * _PS0 7.2.2 Y @@ -1754,6 +1755,28 @@ static int method_test_PSE(fwts_framework *fw) return method_evaluate_method(fw, METHOD_OPTIONAL, "_PSE", arg, 1, method_test_NULL_return, NULL); } +static void method_test_PRE_return(fwts_framework *fw, char *name, ACPI_BUFFER *buf, ACPI_OBJECT *obj, void *private) +{ + int i; + + if (method_check_type(fw, name, buf, ACPI_TYPE_PACKAGE) != FWTS_OK) + return; + + /* All elements in the package must be references */ + for (i=0; i < obj->Package.Count; i++) { + if (obj->Package.Elements[i].Type != ACPI_TYPE_LOCAL_REFERENCE) { + fwts_failed(fw, LOG_LEVEL_MEDIUM, "Method_PREElementType", + "_PRE package element %d was not a reference.", i); + fwts_tag_failed(fw, FWTS_TAG_ACPI_METHOD_RETURN); + } + } +} + +static int method_test_PRE(fwts_framework *fw) +{ + return method_evaluate_method(fw, METHOD_OPTIONAL, "_PRE", NULL, 0, method_test_PRE_return, NULL); +} + #define method_test_PSx(name) \ static int method_test ## name(fwts_framework *fw) \ { \ @@ -2105,6 +2128,7 @@ static fwts_framework_minor_test method_tests[] = { { method_test_PSE, "Check _PSE (Power State for Enumeration)." }, { method_test_PSW, "Check _PSW (Power State Wake)." }, { method_test_IRC, "Check _IRC (In Rush Current)." }, + { method_test_PRE, "Check _PRE (Power Resources for Enumeration)." }, /* Section 6.3 */ { method_test_EJD, "Check _EJD (Ejection Dependent Device)." },