arm64: Add a facility to turn an ESR syndrome into a sysreg encoding
authorMarc Zyngier <marc.zyngier@arm.com>
Fri, 9 Jun 2017 11:49:30 +0000 (12:49 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Thu, 15 Jun 2017 08:44:57 +0000 (09:44 +0100)
commitd251f67a187c987b391751849c266e44d69bd31c
treee42b2e1631d2750c5ea51fb24a937e2517d07350
parent6f2f10cabe73944488a62df16695c86e20d4c3f9
arm64: Add a facility to turn an ESR syndrome into a sysreg encoding

It is often useful to compare an ESR syndrome reporting the trapping
of a system register with a value matching that system register.

Since encoding both the sysreg and the ESR version seem to be a bit
overkill, let's add a set of macros that convert an ESR value into
the corresponding sysreg encoding.

We handle both AArch32 and AArch64, taking advantage of identical
encodings between system registers and CP15 accessors.

Tested-by: Alexander Graf <agraf@suse.de>
Acked-by: David Daney <david.daney@cavium.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <cdall@linaro.org>
arch/arm64/include/asm/esr.h