arm64: factor out GPR numbering helpers
authorMark Rutland <mark.rutland@arm.com>
Tue, 19 Oct 2021 16:02:11 +0000 (17:02 +0100)
committerWill Deacon <will@kernel.org>
Thu, 21 Oct 2021 09:45:22 +0000 (10:45 +0100)
commit8ed1b498ada6c5bd9d9f53c59621734551829ec5
tree130b123f23c7ba12dc0a2b818a7ab152a93b3aad
parentae2b2f3384c69a7e4b3ee6fdbc7e1eeaaad3e634
arm64: factor out GPR numbering helpers

In <asm/sysreg.h> we have macros to convert the names of general purpose
registers (GPRs) into integer constants, which we use to manually build
the encoding for `MRS` and `MSR` instructions where we can't rely on the
assembler to do so for us.

In subsequent patches we'll need to map the same GPR names to integer
constants so that we can use this to build metadata for exception
fixups.

So that the we can use the mappings elsewhere, factor out the
definitions into a new <asm/gpr-num.h> header, renaming the definitions
to align with this "GPR num" naming for clarity.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20211019160219.5202-6-mark.rutland@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/gpr-num.h [new file with mode: 0644]
arch/arm64/include/asm/sysreg.h