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/const.h>
13 #define CR2_GUARDED_STORAGE _BITUL(63 - 59)
15 #define CR14_CHANNEL_REPORT_SUBMASK _BITUL(63 - 35)
16 #define CR14_RECOVERY_SUBMASK _BITUL(63 - 36)
17 #define CR14_DEGRADATION_SUBMASK _BITUL(63 - 37)
18 #define CR14_EXTERNAL_DAMAGE_SUBMASK _BITUL(63 - 38)
19 #define CR14_WARNING_SUBMASK _BITUL(63 - 39)
23 #include <linux/bug.h>
25 #define __ctl_load(array, low, high) do { \
26 typedef struct { char _[sizeof(array)]; } addrtype; \
28 BUILD_BUG_ON(sizeof(addrtype) != (high - low + 1) * sizeof(long));\
32 : "Q" (*(addrtype *)(&array)), "i" (low), "i" (high) \
36 #define __ctl_store(array, low, high) do { \
37 typedef struct { char _[sizeof(array)]; } addrtype; \
39 BUILD_BUG_ON(sizeof(addrtype) != (high - low + 1) * sizeof(long));\
42 : "=Q" (*(addrtype *)(&array)) \
43 : "i" (low), "i" (high)); \
46 static inline void __ctl_set_bit(unsigned int cr
, unsigned int bit
)
50 __ctl_store(reg
, cr
, cr
);
52 __ctl_load(reg
, cr
, cr
);
55 static inline void __ctl_clear_bit(unsigned int cr
, unsigned int bit
)
59 __ctl_store(reg
, cr
, cr
);
61 __ctl_load(reg
, cr
, cr
);
64 void smp_ctl_set_bit(int cr
, int bit
);
65 void smp_ctl_clear_bit(int cr
, int bit
);
71 unsigned long tcx
: 1; /* Transactional-Execution control */
72 unsigned long pifo
: 1; /* Transactional-Execution Program-
73 Interruption-Filtering Override */
76 unsigned long lap
: 1; /* Low-address-protection control */
78 unsigned long edat
: 1; /* Enhanced-DAT-enablement control */
80 unsigned long iep
: 1; /* Instruction-Execution-Protection */
82 unsigned long afp
: 1; /* AFP-register control */
83 unsigned long vx
: 1; /* Vector enablement control */
85 unsigned long sssm
: 1; /* Service signal subclass mask */
94 unsigned long ducto
: 25;
96 unsigned long gse
: 1;
98 unsigned long tds
: 1;
99 unsigned long tdc
: 2;
104 # define ctl_set_bit(cr, bit) smp_ctl_set_bit(cr, bit)
105 # define ctl_clear_bit(cr, bit) smp_ctl_clear_bit(cr, bit)
107 # define ctl_set_bit(cr, bit) __ctl_set_bit(cr, bit)
108 # define ctl_clear_bit(cr, bit) __ctl_clear_bit(cr, bit)
111 #endif /* __ASSEMBLY__ */
112 #endif /* __ASM_CTL_REG_H */