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 X-Patchwork-Id: 50605 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5FD86214B3 for ; Thu, 2 Jul 2015 23:48:53 +0000 (UTC) Received: by wiwz6 with SMTP id z6sf27688182wiw.0 for ; Thu, 02 Jul 2015 16:48:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=z3kDqAaTokKvHndFVRxmrWbLWaa42ua3jwAbY1UbMHQ=; b=k+53s01DauVlgIhvcf8EGGCGTwSHdKve7wYdcLWVNM25Lu1GPi25p3OC4jpXMMWu/M 99cgsI/AM7492D0lVrBeMs7zx7bEJ/VoJnWc2YpyYP+/+J2A5Bop0KVsm8S9P0uawzwH 3JIuoIyLimxW4B397erMudZ8uI31oqtCsKPhzW3lUr7enipOIqyUy+I+M18Ww/ooLz3L p73l4L+1iIQO/v2QSjnnOYMNQc/V7sSfH6usVvofH5AXw+cLziSnddo5w4hSVbqm/icp 7NkG5fZjg+rPOnuVrKQn+B2N8WTuPso6huZAy+1wInwlbQc//ycE7PjbH8Y7FAnVoimR W8YQ== X-Gm-Message-State: ALoCoQmHIdqgRm5HcvV+iLAKvh55Dlu+qsyC1aes/Ygy4NUpDHBwCHmRCGEJC2QxkimFVb9NR9wH X-Received: by 10.180.216.12 with SMTP id om12mr5919068wic.1.1435880932729; Thu, 02 Jul 2015 16:48:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.194 with SMTP id v2ls455614lag.59.gmail; Thu, 02 Jul 2015 16:48:52 -0700 (PDT) X-Received: by 10.152.20.138 with SMTP id n10mr9720566lae.115.1435880932248; Thu, 02 Jul 2015 16:48:52 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id oh3si5747444lbb.45.2015.07.02.16.48.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Jul 2015 16:48:52 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by lagx9 with SMTP id x9so70704808lag.1 for ; Thu, 02 Jul 2015 16:48:52 -0700 (PDT) X-Received: by 10.112.219.70 with SMTP id pm6mr32363286lbc.41.1435880932114; Thu, 02 Jul 2015 16:48:52 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp794434lbb; Thu, 2 Jul 2015 16:48:50 -0700 (PDT) X-Received: by 10.50.147.10 with SMTP id tg10mr47569973igb.36.1435880930415; Thu, 02 Jul 2015 16:48:50 -0700 (PDT) Received: from mail-ig0-f182.google.com (mail-ig0-f182.google.com. [209.85.213.182]) by mx.google.com with ESMTPS id g7si7529943icr.86.2015.07.02.16.48.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Jul 2015 16:48:50 -0700 (PDT) Received-SPF: pass (google.com: domain of al.stone@linaro.org designates 209.85.213.182 as permitted sender) client-ip=209.85.213.182; Received: by igrv9 with SMTP id v9so107226649igr.1 for ; Thu, 02 Jul 2015 16:48:49 -0700 (PDT) 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 Cc: rjw@rjwysocki.net, lenb@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, tglx@linutronix.de, jason@lakedaemon.net, linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, linaro-kernel@lists.linaro.org, patches@linaro.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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: al.stone@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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;