diff options
author | Heiko Carstens <[email protected]> | 2024-02-03 11:45:06 +0100 |
---|---|---|
committer | Heiko Carstens <[email protected]> | 2024-02-16 14:30:15 +0100 |
commit | f4e3de75d0c4ebe9bbbfef19d7845ee70cb017bd (patch) | |
tree | 0a2fde7fc7d1943631784242226ce9ba5019705f /arch/s390/kernel/fpu.c | |
parent | 88d8136a0896e32fc39f90788eaa5c7bdccc9fb0 (diff) |
s390/fpu: provide and use lfpc, sfpc, and stfpc inline assemblies
Instead of open-coding lfpc, sfpc, and stfpc inline assemblies at
several locations, provide an fpu_* function for each instruction and
use the function instead.
Reviewed-by: Claudio Imbrenda <[email protected]>
Signed-off-by: Heiko Carstens <[email protected]>
Diffstat (limited to 'arch/s390/kernel/fpu.c')
-rw-r--r-- | arch/s390/kernel/fpu.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/arch/s390/kernel/fpu.c b/arch/s390/kernel/fpu.c index f25c54caf32b..6bfd4d0f33e1 100644 --- a/arch/s390/kernel/fpu.c +++ b/arch/s390/kernel/fpu.c @@ -17,10 +17,8 @@ void __kernel_fpu_begin(struct kernel_fpu *state, u32 flags) * in use by the previous context. */ flags &= state->mask; - if (flags & KERNEL_FPC) { - /* Save floating point control */ - asm volatile("stfpc %0" : "=Q" (state->fpc)); - } + if (flags & KERNEL_FPC) + fpu_stfpc(&state->fpc); if (!cpu_has_vx()) { if (flags & KERNEL_VXR_LOW) save_fp_regs(state->fprs); @@ -80,10 +78,8 @@ void __kernel_fpu_end(struct kernel_fpu *state, u32 flags) * current context. */ flags &= state->mask; - if (flags & KERNEL_FPC) { - /* Restore floating-point controls */ - asm volatile("lfpc %0" : : "Q" (state->fpc)); - } + if (flags & KERNEL_FPC) + fpu_lfpc(&state->fpc); if (!cpu_has_vx()) { if (flags & KERNEL_VXR_LOW) load_fp_regs(state->fprs); @@ -176,7 +172,7 @@ void save_fpu_regs(void) state = ¤t->thread.fpu; regs = current->thread.fpu.regs; - asm volatile("stfpc %0" : "=Q" (state->fpc)); + fpu_stfpc(&state->fpc); if (likely(cpu_has_vx())) { asm volatile("lgr 1,%0\n" "VSTM 0,15,0,1\n" |