From patchwork Thu Jul 2 23:48:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: al.stone@linaro.org X-Patchwork-Id: 6712421 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C50489F2F0 for ; Thu, 2 Jul 2015 23:59:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EA43E20747 for ; Thu, 2 Jul 2015 23:59:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 15DFD2073F for ; Thu, 2 Jul 2015 23:59:20 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZAoM0-000528-VT; Thu, 02 Jul 2015 23:57:16 +0000 Received: from mail-ie0-f179.google.com ([209.85.223.179]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZAoLK-0004zb-C1 for linux-arm-kernel@lists.infradead.org; Thu, 02 Jul 2015 23:56:34 +0000 Received: by iecuq6 with SMTP id uq6so67129047iec.2 for ; Thu, 02 Jul 2015 16:56:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=z3kDqAaTokKvHndFVRxmrWbLWaa42ua3jwAbY1UbMHQ=; b=l0Vlqq7xt6yYOVdiYbOBawnIJbA7VqXOjRVWX1KcDeqFXub+5t1W+ASSPY4pE4OPxV hd+fEzhJ5VmdanaCbkgHCUN/rTNI6QUbkOoHwiMy/d6n4z94etoiFeWFzn2ysKGAZqaj 8ILGjNL298ZSkXMMeran3UnSvC1DqvV6+wmMvdmNLZe9slrK4l5VpEyHRjZ0Ey3M8peA ta3MSfUJFnjqSWdZQkA7RrDAzbNlp4bXmZpZD2lhr+gREgIaZzo61pdxeoqOrSmNNGdb lsmh5DwA2dQsbX070heygECrNYN2BLDH8wFAW282k/1rrCn9zeMrkGzTk40htVT5ENje JnRA== X-Gm-Message-State: ALoCoQk2Meu8JeK+Eqs5k+5TmmRQf9HR3h4QSGUz0bpwVtn59+4/1l7oVSOiw9sGrh5BPzej3jx4 X-Received: by 10.50.79.129 with SMTP id j1mr45222814igx.12.1435880929595; Thu, 02 Jul 2015 16:48:49 -0700 (PDT) Received: from fidelio.ahs3.com (c-50-134-239-249.hsd1.co.comcast.net. [50.134.239.249]) by smtp.googlemail.com with ESMTPSA id h2sm6550906igv.2.2015.07.02.16.48.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Jul 2015 16:48:48 -0700 (PDT) From: Al Stone To: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 1/3] ACPI : introduce macros for using the ACPI specification version Date: Thu, 2 Jul 2015 17:48:34 -0600 Message-Id: <1435880916-2153-2-git-send-email-al.stone@linaro.org> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1435880916-2153-1-git-send-email-al.stone@linaro.org> References: <1435880916-2153-1-git-send-email-al.stone@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150702_165634_452346_A2154305 X-CRM114-Status: GOOD ( 12.27 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linaro-kernel@lists.linaro.org, jason@lakedaemon.net, linaro-acpi@lists.linaro.org, catalin.marinas@arm.com, patches@linaro.org, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, will.deacon@arm.com, tglx@linutronix.de, lenb@kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add the __ACPI_FADT_SPEC_VERSION() helper macro to build a proper version number from a major and minor revision number. Add also macros that use the helper to construct the current version from the values in the FADT (i.e., ACPI_FADT_SPEC_VERSION) and both the 5.1 and 6.0 versions. These macros are added in order to simplify retrieving and comparing ACPI specification version numbers, since this is becoming a more frequent need. In particular, there are some architectures that require at least a certain version of the spec, and there are differences in some structure sizes that have changed with recent versions but can only be tracked by spec version number. Fixes: aeb823bbacc2 (ACPICA: ACPI 6.0: Add changes for FADT table.) Signed-off-by: Al Stone --- include/linux/acpi.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/acpi.h b/include/linux/acpi.h index c471dfc..0e525e8 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -48,6 +48,16 @@ #include #include +#define __ACPI_FADT_SPEC_VERSION(major, minor) \ + ((unsigned int)major << 8 | (unsigned int)minor) + +#define ACPI_FADT_SPEC_VERSION \ + __ACPI_FADT_SPEC_VERSION(acpi_gbl_FADT.header.revision, \ + acpi_gbl_FADT.minor_revision) + +#define ACPI_FADT_SPEC_VERSION_51 __ACPI_FADT_SPEC_VERSION(5, 1) +#define ACPI_FADT_SPEC_VERSION_60 __ACPI_FADT_SPEC_VERSION(6, 0) + static inline acpi_handle acpi_device_handle(struct acpi_device *adev) { return adev ? adev->handle : NULL;