diff options
author | Marc Zyngier <maz@kernel.org> | 2024-01-22 18:13:35 +0000 |
---|---|---|
committer | Oliver Upton <oliver.upton@linux.dev> | 2024-02-08 15:12:44 +0000 |
commit | 53eaeb7fbe2702520125ae7d72742362c071a1f2 (patch) | |
tree | 85a279670f55f4579e1cfe5abe0a3ec3669046c7 /arch/arm64/include | |
parent | 6613476e225e090cc9aad49be7fa504e290dd33d (diff) | |
download | linux-stable-53eaeb7fbe2702520125ae7d72742362c071a1f2.tar.gz linux-stable-53eaeb7fbe2702520125ae7d72742362c071a1f2.tar.bz2 linux-stable-53eaeb7fbe2702520125ae7d72742362c071a1f2.zip |
arm64: Add macro to compose a sysreg field value
A common idiom is to compose a tupple (reg, field, val) into
a symbol matching an autogenerated definition.
Add a help performing the concatenation and replace it when
open-coded implementations exist.
Suggested-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20240122181344.258974-2-maz@kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Diffstat (limited to 'arch/arm64/include')
-rw-r--r-- | arch/arm64/include/asm/sysreg.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index c3b19b376c86..9e8999592f3a 100644 --- a/arch/arm64/include/asm/sysreg.h +++ b/arch/arm64/include/asm/sysreg.h @@ -1181,6 +1181,8 @@ par; \ }) +#define SYS_FIELD_VALUE(reg, field, val) reg##_##field##_##val + #define SYS_FIELD_GET(reg, field, val) \ FIELD_GET(reg##_##field##_MASK, val) @@ -1188,7 +1190,8 @@ FIELD_PREP(reg##_##field##_MASK, val) #define SYS_FIELD_PREP_ENUM(reg, field, val) \ - FIELD_PREP(reg##_##field##_MASK, reg##_##field##_##val) + FIELD_PREP(reg##_##field##_MASK, \ + SYS_FIELD_VALUE(reg, field, val)) #endif |