From: Will Deacon <will.deacon@arm.com>
To: Lorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>
Cc: "linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
Dave P Martin <Dave.Martin@arm.com>,
Catalin Marinas <Catalin.Marinas@arm.com>,
Marc Zyngier <Marc.Zyngier@arm.com>,
Mark Rutland <Mark.Rutland@arm.com>,
Sudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com>,
Russell King <linux@arm.linux.org.uk>,
Colin Cross <ccross@android.com>, Yu Tang <ytang5@marvell.com>,
Zhou Zhu <zzhu3@marvell.com>,
"ksankaran@apm.com" <ksankaran@apm.com>, Loc Ho <lho@apm.com>,
Feng Kan <fkan@apm.com>, Nicolas Pitre <nico@linaro.org>,
Santosh Shilimkar <santosh.shilimkar@ti.com>,
Stephen Boyd <sboyd@codeaurora.org>,
Graeme Gregory <graeme.gregory@linaro.org>,
Hanjun Guo <hanjun.guo@linaro.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>
Subject: Re: [PATCH v2 01/13] arm64: kernel: add MPIDR_EL1 accessors macros
Date: Tue, 15 Oct 2013 11:11:30 +0100 [thread overview]
Message-ID: <20131015101130.GA30411@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <1381748590-14279-2-git-send-email-lorenzo.pieralisi@arm.com>
On Mon, Oct 14, 2013 at 12:02:58PM +0100, Lorenzo Pieralisi wrote:
> In order to simplify access to different affinity levels within the
> MPIDR_EL1 register values, this patch implements some preprocessor
> macros that allow to retrieve the MPIDR_EL1 affinity level value according
> to the level passed as input parameter.
>
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> ---
> arch/arm64/include/asm/cputype.h | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/arch/arm64/include/asm/cputype.h b/arch/arm64/include/asm/cputype.h
> index 5fe138e..2c9e295 100644
> --- a/arch/arm64/include/asm/cputype.h
> +++ b/arch/arm64/include/asm/cputype.h
> @@ -30,6 +30,16 @@
>
> #define MPIDR_HWID_BITMASK 0xff00ffffff
>
> +#define MPIDR_LEVEL_BITS 8
> +#define MPIDR_LEVEL_MASK ((1 << MPIDR_LEVEL_BITS) - 1)
> +
> +#define MPIDR_LEVEL_SHIFT(level) ({ \
> + (level == 3) ? 32 : MPIDR_LEVEL_BITS * level; \
You can avoid the check if you do:
((1 << level) >> 1) << 3)
where that '3' is log2 MPIDR_LEVEL_BITS, so you could factor that out and
redefine MPIDR_LEVEL_BITS in terms of a shift.
Will
next prev parent reply other threads:[~2013-10-15 10:11 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-14 11:02 [PATCH v2 00/13] arm64: suspend/resume implementation Lorenzo Pieralisi
2013-10-14 11:02 ` [PATCH v2 01/13] arm64: kernel: add MPIDR_EL1 accessors macros Lorenzo Pieralisi
2013-10-15 10:11 ` Will Deacon [this message]
2013-10-15 11:43 ` Lorenzo Pieralisi
2013-10-14 11:02 ` [PATCH v2 02/13] arm64: kernel: build MPIDR_EL1 hash function data structure Lorenzo Pieralisi
2013-10-14 11:03 ` [PATCH v2 03/13] arm64: kernel: suspend/resume registers save/restore Lorenzo Pieralisi
2013-10-15 10:59 ` Will Deacon
2013-10-16 8:59 ` Lorenzo Pieralisi
2013-10-14 11:03 ` [PATCH v2 04/13] arm64: kernel: cpu_{suspend/resume} implementation Lorenzo Pieralisi
2013-10-14 11:03 ` [PATCH v2 05/13] arm64: add CPU PM infrastructure selection Lorenzo Pieralisi
2013-10-14 11:03 ` [PATCH v2 06/13] arm64: kernel: implement fpsimd CPU PM notifier Lorenzo Pieralisi
2013-10-14 11:03 ` [PATCH v2 07/13] arm: kvm: implement " Lorenzo Pieralisi
2013-10-14 11:03 ` [PATCH v2 08/13] arm64: kernel: implement debug monitors CPU PM notifiers Lorenzo Pieralisi
2013-10-15 11:27 ` Will Deacon
2013-10-14 11:03 ` [PATCH v2 09/13] arm64: kernel: refactor code to install/uninstall breakpoints Lorenzo Pieralisi
2013-10-14 11:03 ` [PATCH v2 10/13] arm64: kernel: implement HW breakpoints CPU PM notifier Lorenzo Pieralisi
2013-10-14 11:03 ` [PATCH v2 11/13] arm64: enable generic clockevent broadcast Lorenzo Pieralisi
2013-10-17 9:15 ` Daniel Lezcano
2013-10-14 11:03 ` [PATCH v2 12/13] arm64: kernel: add CPU idle call Lorenzo Pieralisi
2013-10-17 9:20 ` Daniel Lezcano
2013-10-14 11:03 ` [PATCH v2 13/13] arm64: add CPU power management menu/entries Lorenzo Pieralisi
2013-10-17 9:21 ` Daniel Lezcano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131015101130.GA30411@mudshark.cambridge.arm.com \
--to=will.deacon@arm.com \
--cc=Catalin.Marinas@arm.com \
--cc=Dave.Martin@arm.com \
--cc=Lorenzo.Pieralisi@arm.com \
--cc=Marc.Zyngier@arm.com \
--cc=Mark.Rutland@arm.com \
--cc=Sudeep.KarkadaNagesha@arm.com \
--cc=ccross@android.com \
--cc=daniel.lezcano@linaro.org \
--cc=fkan@apm.com \
--cc=graeme.gregory@linaro.org \
--cc=hanjun.guo@linaro.org \
--cc=ksankaran@apm.com \
--cc=lho@apm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=nico@linaro.org \
--cc=santosh.shilimkar@ti.com \
--cc=sboyd@codeaurora.org \
--cc=ytang5@marvell.com \
--cc=zzhu3@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).