summaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/ctlreg.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/include/asm/ctlreg.h')
-rw-r--r--arch/s390/include/asm/ctlreg.h24
1 files changed, 14 insertions, 10 deletions
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);
- reg.val |= 1UL << bit;
- local_ctl_load(cr, &reg);
+ 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);
- reg.val &= ~(1UL << bit);
- local_ctl_load(cr, &reg);
+ local_ctl_store(cr, &old);
+ new = old;
+ new.val &= ~(1UL << bit);
+ local_ctl_load(cr, &new);
+ return old;
}
struct lowcore;