From 50ba0232fd5312410f1b65247e774244f89a628e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 18 May 2024 20:50:36 +0200 Subject: Merging upstream version 6.8.9. Signed-off-by: Daniel Baumann --- arch/s390/include/asm/ctlreg.h | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'arch/s390/include/asm/ctlreg.h') diff --git a/arch/s390/include/asm/ctlreg.h b/arch/s390/include/asm/ctlreg.h index 6d4b85f2b5..72a9556d04 100644 --- a/arch/s390/include/asm/ctlreg.h +++ b/arch/s390/include/asm/ctlreg.h @@ -141,22 +141,26 @@ static __always_inline void local_ctl_store(unsigned int cr, struct ctlreg *reg) : [cr] "i" (cr)); } -static __always_inline void local_ctl_set_bit(unsigned int cr, unsigned int bit) +static __always_inline struct ctlreg local_ctl_set_bit(unsigned int cr, unsigned int bit) { - struct ctlreg reg; + struct ctlreg new, old; - local_ctl_store(cr, ®); - reg.val |= 1UL << bit; - local_ctl_load(cr, ®); + local_ctl_store(cr, &old); + new = old; + new.val |= 1UL << bit; + local_ctl_load(cr, &new); + return old; } -static __always_inline void local_ctl_clear_bit(unsigned int cr, unsigned int bit) +static __always_inline struct ctlreg local_ctl_clear_bit(unsigned int cr, unsigned int bit) { - struct ctlreg reg; + struct ctlreg new, old; - local_ctl_store(cr, ®); - reg.val &= ~(1UL << bit); - local_ctl_load(cr, ®); + local_ctl_store(cr, &old); + new = old; + new.val &= ~(1UL << bit); + local_ctl_load(cr, &new); + return old; } struct lowcore; -- cgit v1.2.3