1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright IBM Corp. 1999, 2009
5 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
8 #ifndef __ASM_CTL_REG_H
9 #define __ASM_CTL_REG_H
11 #include <linux/bug.h>
13 #define __ctl_load(array, low, high) do { \
14 typedef struct { char _[sizeof(array)]; } addrtype; \
16 BUILD_BUG_ON(sizeof(addrtype) != (high - low + 1) * sizeof(long));\
20 : "Q" (*(addrtype *)(&array)), "i" (low), "i" (high) \
24 #define __ctl_store(array, low, high) do { \
25 typedef struct { char _[sizeof(array)]; } addrtype; \
27 BUILD_BUG_ON(sizeof(addrtype) != (high - low + 1) * sizeof(long));\
30 : "=Q" (*(addrtype *)(&array)) \
31 : "i" (low), "i" (high)); \
34 static inline void __ctl_set_bit(unsigned int cr
, unsigned int bit
)
38 __ctl_store(reg
, cr
, cr
);
40 __ctl_load(reg
, cr
, cr
);
43 static inline void __ctl_clear_bit(unsigned int cr
, unsigned int bit
)
47 __ctl_store(reg
, cr
, cr
);
49 __ctl_load(reg
, cr
, cr
);
52 void smp_ctl_set_bit(int cr
, int bit
);
53 void smp_ctl_clear_bit(int cr
, int bit
);
60 unsigned long lap
: 1; /* Low-address-protection control */
62 unsigned long edat
: 1; /* Enhanced-DAT-enablement control */
64 unsigned long iep
: 1; /* Instruction-Execution-Protection */
66 unsigned long afp
: 1; /* AFP-register control */
67 unsigned long vx
: 1; /* Vector enablement control */
69 unsigned long sssm
: 1; /* Service signal subclass mask */
75 # define ctl_set_bit(cr, bit) smp_ctl_set_bit(cr, bit)
76 # define ctl_clear_bit(cr, bit) smp_ctl_clear_bit(cr, bit)
78 # define ctl_set_bit(cr, bit) __ctl_set_bit(cr, bit)
79 # define ctl_clear_bit(cr, bit) __ctl_clear_bit(cr, bit)
82 #endif /* __ASM_CTL_REG_H */