diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2023-09-11 22:40:08 +0300 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2023-09-19 14:26:57 +0300 |
commit | 305a5551af34e1848d80e095c23e94c985cc4ebc (patch) | |
tree | 6122644dca11c6c8c353274050f658801bbcbebb /arch/s390/include/asm/ctlreg.h | |
parent | 103dde702d698c2e17529550650407a386711cdf (diff) | |
download | linux-305a5551af34e1848d80e095c23e94c985cc4ebc.tar.xz |
s390/ctlreg: add system_ctl_load()
Add system_ctl_load() which can be used to load a value to a control
register system wide.
Refactor system_ctl_set_clear_bit() so it can handle all different
request types, and also rename it to system_ctlreg_modify()
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/ctlreg.h')
-rw-r--r-- | arch/s390/include/asm/ctlreg.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/arch/s390/include/asm/ctlreg.h b/arch/s390/include/asm/ctlreg.h index 1f25601d75a0..6582b1b9b97b 100644 --- a/arch/s390/include/asm/ctlreg.h +++ b/arch/s390/include/asm/ctlreg.h @@ -114,17 +114,28 @@ struct lowcore; void system_ctlreg_lock(void); void system_ctlreg_unlock(void); -void system_ctl_set_clear_bit(unsigned int cr, unsigned int bit, bool set); void system_ctlreg_init_save_area(struct lowcore *lc); +void system_ctlreg_modify(unsigned int cr, unsigned long data, int request); + +enum { + CTLREG_SET_BIT, + CTLREG_CLEAR_BIT, + CTLREG_LOAD, +}; static inline void system_ctl_set_bit(unsigned int cr, unsigned int bit) { - system_ctl_set_clear_bit(cr, bit, true); + system_ctlreg_modify(cr, bit, CTLREG_SET_BIT); } static inline void system_ctl_clear_bit(unsigned int cr, unsigned int bit) { - system_ctl_set_clear_bit(cr, bit, false); + system_ctlreg_modify(cr, bit, CTLREG_CLEAR_BIT); +} + +static inline void system_ctl_load(unsigned int cr, struct ctlreg *reg) +{ + system_ctlreg_modify(cr, reg->val, CTLREG_LOAD); } union ctlreg0 { |