]> git.baikalelectronics.ru Git - kernel.git/commit
arm64/sysreg: Introduce helpers for access to sysreg fields
authorMark Brown <broonie@kernel.org>
Tue, 3 May 2022 17:02:22 +0000 (18:02 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 4 May 2022 14:30:27 +0000 (15:30 +0100)
commitd6d7bd0581fae092594e768c0a8091aa534b5126
tree02de2b1cbdae3aa337857ac5c2ae7fa89f69e8d7
parent0e63df2d0d54b39e7363398ea63d214be3dfe228
arm64/sysreg: Introduce helpers for access to sysreg fields

The macros we define for the bitfields within sysregs have very regular
names, especially once we switch to automatic generation of those macros.
Take advantage of this to define wrappers around FIELD_PREP() allowing
us to simplify setting values in fields either numerically

   SYS_FIELD_PREP(SCTLR_EL1, TCF0, 0x0)

or using the values of enumerations within the fields

   SYS_FIELD_PREP_ENUM(SCTLR_EL1, TCF0, ASYMM)

Suggested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20220503170233.507788-2-broonie@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/sysreg.h