diff options
| author | Ingo Molnar <mingo@kernel.org> | 2018-06-26 10:02:41 +0300 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2018-06-26 10:02:41 +0300 |
| commit | f446474889c06883a3879faa0896e2359e812a6b (patch) | |
| tree | 95634685d56dd532d1e9b73fbd07ca389296911b /arch/arm64/include/asm/sysreg.h | |
| parent | 01bdee64f9cf8e15f998bf52789ed9d0ebdfa621 (diff) | |
| parent | 6f0d349d922ba44e4348a17a78ea51b7135965b1 (diff) | |
| download | linux-f446474889c06883a3879faa0896e2359e812a6b.tar.xz | |
Merge branch 'linus' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/arm64/include/asm/sysreg.h')
| -rw-r--r-- | arch/arm64/include/asm/sysreg.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index 6171178075dc..a8f84812c6e8 100644 --- a/arch/arm64/include/asm/sysreg.h +++ b/arch/arm64/include/asm/sysreg.h @@ -728,6 +728,17 @@ asm( asm volatile("msr_s " __stringify(r) ", %x0" : : "rZ" (__val)); \ } while (0) +/* + * Modify bits in a sysreg. Bits in the clear mask are zeroed, then bits in the + * set mask are set. Other bits are left as-is. + */ +#define sysreg_clear_set(sysreg, clear, set) do { \ + u64 __scs_val = read_sysreg(sysreg); \ + u64 __scs_new = (__scs_val & ~(u64)(clear)) | (set); \ + if (__scs_new != __scs_val) \ + write_sysreg(__scs_new, sysreg); \ +} while (0) + static inline void config_sctlr_el1(u32 clear, u32 set) { u32 val; |
