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/bits.h>
13 #define CR0_CLOCK_COMPARATOR_SIGN BIT(63 - 10)
14 #define CR0_LOW_ADDRESS_PROTECTION BIT(63 - 35)
15 #define CR0_EMERGENCY_SIGNAL_SUBMASK BIT(63 - 49)
16 #define CR0_EXTERNAL_CALL_SUBMASK BIT(63 - 50)
17 #define CR0_CLOCK_COMPARATOR_SUBMASK BIT(63 - 52)
18 #define CR0_CPU_TIMER_SUBMASK BIT(63 - 53)
19 #define CR0_SERVICE_SIGNAL_SUBMASK BIT(63 - 54)
20 #define CR0_UNUSED_56 BIT(63 - 56)
21 #define CR0_INTERRUPT_KEY_SUBMASK BIT(63 - 57)
22 #define CR0_MEASUREMENT_ALERT_SUBMASK BIT(63 - 58)
24 #define CR2_GUARDED_STORAGE BIT(63 - 59)
26 #define CR14_UNUSED_32 BIT(63 - 32)
27 #define CR14_UNUSED_33 BIT(63 - 33)
28 #define CR14_CHANNEL_REPORT_SUBMASK BIT(63 - 35)
29 #define CR14_RECOVERY_SUBMASK BIT(63 - 36)
30 #define CR14_DEGRADATION_SUBMASK BIT(63 - 37)
31 #define CR14_EXTERNAL_DAMAGE_SUBMASK BIT(63 - 38)
32 #define CR14_WARNING_SUBMASK BIT(63 - 39)
36 #include <linux/bug.h>
38 #define __ctl_load(array, low, high) do { \
39 typedef struct { char _[sizeof(array)]; } addrtype; \
41 BUILD_BUG_ON(sizeof(addrtype) != (high - low + 1) * sizeof(long));\
45 : "Q" (*(addrtype *)(&array)), "i" (low), "i" (high) \
49 #define __ctl_store(array, low, high) do { \
50 typedef struct { char _[sizeof(array)]; } addrtype; \
52 BUILD_BUG_ON(sizeof(addrtype) != (high - low + 1) * sizeof(long));\
55 : "=Q" (*(addrtype *)(&array)) \
56 : "i" (low), "i" (high)); \
59 static __always_inline
void __ctl_set_bit(unsigned int cr
, unsigned int bit
)
63 __ctl_store(reg
, cr
, cr
);
65 __ctl_load(reg
, cr
, cr
);
68 static __always_inline
void __ctl_clear_bit(unsigned int cr
, unsigned int bit
)
72 __ctl_store(reg
, cr
, cr
);
74 __ctl_load(reg
, cr
, cr
);
77 void smp_ctl_set_bit(int cr
, int bit
);
78 void smp_ctl_clear_bit(int cr
, int bit
);
84 unsigned long tcx
: 1; /* Transactional-Execution control */
85 unsigned long pifo
: 1; /* Transactional-Execution Program-
86 Interruption-Filtering Override */
89 unsigned long lap
: 1; /* Low-address-protection control */
91 unsigned long edat
: 1; /* Enhanced-DAT-enablement control */
93 unsigned long iep
: 1; /* Instruction-Execution-Protection */
95 unsigned long afp
: 1; /* AFP-register control */
96 unsigned long vx
: 1; /* Vector enablement control */
98 unsigned long sssm
: 1; /* Service signal subclass mask */
107 unsigned long ducto
: 25;
109 unsigned long gse
: 1;
111 unsigned long tds
: 1;
112 unsigned long tdc
: 2;
116 #define ctl_set_bit(cr, bit) smp_ctl_set_bit(cr, bit)
117 #define ctl_clear_bit(cr, bit) smp_ctl_clear_bit(cr, bit)
119 #endif /* __ASSEMBLY__ */
120 #endif /* __ASM_CTL_REG_H */