summaryrefslogtreecommitdiff
path: root/arch/s390/include/asm/ctlreg.h
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2023-09-11 22:39:58 +0300
committerVasily Gorbik <gor@linux.ibm.com>2023-09-19 14:26:56 +0300
commit8d5e98f8d6b11dd0e61323ece3b7ccceea55c281 (patch)
tree7e0ff091fc8130648550fc2dfb147df93b8960af /arch/s390/include/asm/ctlreg.h
parenta74e4fc168d284e1e4e7296f8cf4b884035ebd45 (diff)
downloadlinux-8d5e98f8d6b11dd0e61323ece3b7ccceea55c281.tar.xz
s390/ctlreg: add local and system prefix to some functions
Add local and system prefix to some functions to clarify they change control register contents on either the local CPU or the on all CPUs. This results in the following API: Two defines which load and save multiple control registers. The defines correlate with the following C prototypes: void __local_ctl_load(unsigned long *, unsigned int cr_low, unsigned int cr_high); void __local_ctl_store(unsigned long *, unsigned int cr_low, unsigned int cr_high); Two functions which locally set or clear one bit for a specified control register: void local_ctl_set_bit(unsigned int cr, unsigned int bit); void local_ctl_clear_bit(unsigned int cr, unsigned int bit); Two functions which set or clear one bit for a specified control register on all CPUs: void system_ctl_set_bit(unsigned int cr, unsigned int bit); void system_ctl_clear_bit(unsigend int cr, unsigned int bit); Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@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.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/arch/s390/include/asm/ctlreg.h b/arch/s390/include/asm/ctlreg.h
index 0b55a1bb3113..09d35ab3d1ce 100644
--- a/arch/s390/include/asm/ctlreg.h
+++ b/arch/s390/include/asm/ctlreg.h
@@ -35,7 +35,7 @@
#include <linux/bug.h>
-#define __ctl_load(array, low, high) do { \
+#define __local_ctl_load(array, low, high) do { \
struct addrtype { \
char _[sizeof(array)]; \
}; \
@@ -53,7 +53,7 @@
: "memory"); \
} while (0)
-#define __ctl_store(array, low, high) do { \
+#define __local_ctl_store(array, low, high) do { \
struct addrtype { \
char _[sizeof(array)]; \
}; \
@@ -69,36 +69,36 @@
: [_low] "i" (low), [_high] "i" (high)); \
} while (0)
-static __always_inline void __ctl_set_bit(unsigned int cr, unsigned int bit)
+static __always_inline void local_ctl_set_bit(unsigned int cr, unsigned int bit)
{
unsigned long reg;
- __ctl_store(reg, cr, cr);
+ __local_ctl_store(reg, cr, cr);
reg |= 1UL << bit;
- __ctl_load(reg, cr, cr);
+ __local_ctl_load(reg, cr, cr);
}
-static __always_inline void __ctl_clear_bit(unsigned int cr, unsigned int bit)
+static __always_inline void local_ctl_clear_bit(unsigned int cr, unsigned int bit)
{
unsigned long reg;
- __ctl_store(reg, cr, cr);
+ __local_ctl_store(reg, cr, cr);
reg &= ~(1UL << bit);
- __ctl_load(reg, cr, cr);
+ __local_ctl_load(reg, cr, cr);
}
-void ctlreg_lock(void);
-void ctlreg_unlock(void);
-void ctl_set_clear_bit(int cr, int bit, bool set);
+void system_ctlreg_lock(void);
+void system_ctlreg_unlock(void);
+void system_ctl_set_clear_bit(unsigned int cr, unsigned int bit, bool set);
-static inline void ctl_set_bit(int cr, int bit)
+static inline void system_ctl_set_bit(unsigned int cr, unsigned int bit)
{
- ctl_set_clear_bit(cr, bit, true);
+ system_ctl_set_clear_bit(cr, bit, true);
}
-static inline void ctl_clear_bit(int cr, int bit)
+static inline void system_ctl_clear_bit(unsigned int cr, unsigned int bit)
{
- ctl_set_clear_bit(cr, bit, false);
+ system_ctl_set_clear_bit(cr, bit, false);
}
union ctlreg0 {