Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0C4B2C433F5 for ; Tue, 15 Mar 2022 13:24:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hFCn+b9LICF47vSIKOf3IE0UBQADutv9ZLRVDFQfDXw=; b=IQuAhFT9VAN3Eu 3bWzzvH8DvyCxP/HzINZlHcffOFLJWFCQ48dsNz/x39Y1WrLsWcWCJ7el6o58mM4HR3ioX4kfD7pY /HXIIGXzGV3PJ0JbnusoS9RPVXuBqn7Mit5FcgdhWtDpwBV9Vavd9URCdtm26AzcxXCjIXLeUSI9Y KBjrV1BUjrYznMLttZceGlPiBHhbbN6kQi7Ia4XB/hETdSgam+RWZWR/ODhuJ8IwokKiQwk+Amq9o nCMcoABShLASHv2AvtcbM1orzGwXwZMn3dpCP9DYxkpJhlb2xb6nlFvnR+Deh6+Z8Gghiv1WpQex1 cCAmnrAtdATRP+qOYLSg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nU78p-009A0G-Vx; Tue, 15 Mar 2022 13:23:12 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nU77d-0099Z5-F1 for linux-arm-kernel@lists.infradead.org; Tue, 15 Mar 2022 13:21:59 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 2E1E2CE1A8A; Tue, 15 Mar 2022 13:21:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C26CAC340E8; Tue, 15 Mar 2022 13:21:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647350513; bh=2FGoFZEUlEbv06fmTRozHGIJlUR3Kh7pCWkXjzLqRno=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BXD/dJrt2cE0jetpykyUNXMOLW9pEhiTcWsdMpBwzH+/lFWQULTdCag0VFW8HRgbx 7/NHa/HH5Zz75TPkm5VeD6RCKngcr5QrPCgOU+wKqb2lBL1GXrhiaeptpAMZYQQbXt Wh6qIOeVW1CsksruCSai8L0872bhShRiC4WZs6l/TM0q2ACzB1JeH/TsE5iuc/X0Ke gLm3J4p7w4g99rRhqv79iCbG9NZrhhPSj50qAmTo2O7W2tP1Ta5rS9SofuKgbHCpjy JO5Mx57qvV++6Bfkt2RPUf9VunBbPNDISeN1G7cVDt0XTQ1F1EoZ/C1lFsa+afidCd izvgnOFU2dqMw== From: Mark Brown To: Catalin Marinas , Will Deacon Cc: Mark Rutland , Marc Zyngier , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, Mark Brown Subject: [PATCH v1 4/9] arm64/sysreg: Provide a helper macro for defining sysreg bitmasks Date: Tue, 15 Mar 2022 13:14:48 +0000 Message-Id: <20220315131454.3147205-5-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220315131454.3147205-1-broonie@kernel.org> References: <20220315131454.3147205-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1157; h=from:subject; bh=2FGoFZEUlEbv06fmTRozHGIJlUR3Kh7pCWkXjzLqRno=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBiMJEfUFVXKtkytBe7saHn0Z5DKENku/uJlYXHFMEB l1bk80OJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYjCRHwAKCRAk1otyXVSH0EzIB/ 0Ss1B+IV+W22zrUPStKaMjXmRoB09ET12behTo3uyAq/tRwL5ZxUKRsEHfehFYWOXLea6+WZGGu48B vOAzN+NvudGp9xvy5oIWt33yVxLnQTHD6c6z4WuWt9961mEHED82QMzB4yKOlnG6/TzJYocPZ4p0M4 hb+y9Zy1dyTwHPHM99AL9XsU5duAbk0h7gzG/sE4x8Im9aWwxDy0+Cg4oxfvr+1+ZeVQDNMiDU3Tth saBcZitNHTxlSFWYxY+6AODLIfVdfbdPSTekSo6uJLP1XSWREe8O6cTfxPyYR7VLCRyZgsscmAWo1S q0b5YDPSthZ58xnRHY7LR7gcXwlV1R X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220315_062157_726233_EBB3BE6E X-CRM114-Status: GOOD ( 13.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org To ease the generation of headers for the bitfields in the system registers provide a macro for defining bitfields based on the top and bottom bit. Ideally this should be provided along with the generic BIT() macros however there are a bunch of existing places with such macros including some that actually call their macro BITMASK() so rather than create a dependency on a wider cleanup let's define something local for now, this can be improved later. This also sidesteps the need to consider types other than u64. Signed-off-by: Mark Brown --- arch/arm64/include/asm/sysreg.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index abb1e0502e28..fa2ae02de465 100644 --- a/arch/arm64/include/asm/sysreg.h +++ b/arch/arm64/include/asm/sysreg.h @@ -15,6 +15,8 @@ #include +#define ARM64_SYSREG_BITMASK(h, l) ((BIT(ULL(h)) - BIT(ULL(l))) | BIT(ULL(h))) + /* * ARMv8 ARM reserves the following encoding for system registers: * (Ref: ARMv8 ARM, Section: "System instruction class encoding overview", -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel