From mboxrd@z Thu Jan 1 00:00:00 1970 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 A5F4EC433EF for ; Thu, 27 Jan 2022 16:13:20 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5gOzYvLZAS1JHj8pS2AnMGY/LzSMAUCkWw8fUB1D2Is=; b=m7qT0bIRvkqmAV XIzopwez1HY5vQp92ZuOIT+P/E4hN1KnO0E9/ymGAPQ40gwTBCKRVprVkwNAfZVJtVphwggfWYR7T qx7y/tLtWTzKwnLeRfT3LxSm/s74QpMX4EhgBfqFgjR6rUEZkY79xizPe2h0POy6QvQCKor+A83ua s28NmuGWOAcY1qRnHvwhvoNx2LErBOqYm6oY1f8ltOZa86ccoSoBt4m7WRWy8UVUnw7l3kP3Sv0pH ZHTEjDpzlJyHrWe3He7VU2xnzEU0I8lh1ji3DdbDckQEXfdGsBZmHY23373m+60xnGItelNwmM9t+ UPx7Xyp3vd3mP6rqxcoA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nD7Na-00GPgP-GQ; Thu, 27 Jan 2022 16:12:10 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nD7NX-00GPfw-6i for linux-arm-kernel@lists.infradead.org; Thu, 27 Jan 2022 16:12:08 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1D1A71063; Thu, 27 Jan 2022 08:12:06 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.14.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C98013F766; Thu, 27 Jan 2022 08:12:04 -0800 (PST) Date: Thu, 27 Jan 2022 16:11:52 +0000 From: Mark Rutland To: Andre Przywara Cc: linux-arm-kernel@lists.infradead.org, broonie@kernel.org, jaxson.han@arm.com, robin.murphy@arm.com, vladimir.murzin@arm.com, wei.chen@arm.com Subject: Re: [bootwrapper PATCH v3 04/15] Add bit-field macros Message-ID: References: <20220125150057.3936090-1-mark.rutland@arm.com> <20220125150057.3936090-5-mark.rutland@arm.com> <20220126150312.56b6f536@donnerap.cambridge.arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220126150312.56b6f536@donnerap.cambridge.arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220127_081207_312318_749AB0A0 X-CRM114-Status: GOOD ( 16.87 ) 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 On Wed, Jan 26, 2022 at 03:03:12PM +0000, Andre Przywara wrote: > On Tue, 25 Jan 2022 15:00:46 +0000 > Mark Rutland wrote: > > > Arm architectural documentation typically defines bit-fields as > > `[msb,lsb]` and single-bit fields as `[bit]`. For clarity it would be > > helpful if we could define fields in the same way. > > > > Add helpers so that we can do so, along with helper to extract/insert > > bit-field values. > > > > There should be no functional change as a result of this patch. > > > > Signed-off-by: Mark Rutland > > I extracted the code and checked the examples, see below. > > +/* > > + * Define a contiguous mask of bits with `msb` as the most significant bit and > > + * `lsb` as the least significant bit. The `msb` value must be greater than or > > + * equal to `lsb`. > > + * > > + * For example: > > + * - BITS(63, 63) is 0x8000000000000000 > > + * - BITS(63, 0) is 0xFFFFFFFFFFFFFFFF > > + * - BITS(0, 0) is 0x0000000000000001 > > + * - BITS(49, 17) is 0x0001FFFFFFFE0000 > > This should be 0x0003fffffffe0000, in real life and with the below > implementation. So just a comment fix. Good spot; I'll fix that up. > The rest of the examples checked out, so with that fixed: > > Reviewed-by: Andre Przywara Thanks! Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel