2 * Copyright IBM Corp. 1999, 2009
4 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
7 #ifndef __ASM_CTL_REG_H
8 #define __ASM_CTL_REG_H
10 #include <linux/bug.h>
12 #define __ctl_load(array, low, high) { \
13 typedef struct { char _[sizeof(array)]; } addrtype; \
15 BUILD_BUG_ON(sizeof(addrtype) != (high - low + 1) * sizeof(long));\
18 : : "Q" (*(addrtype *)(&array)), "i" (low), "i" (high));\
21 #define __ctl_store(array, low, high) { \
22 typedef struct { char _[sizeof(array)]; } addrtype; \
24 BUILD_BUG_ON(sizeof(addrtype) != (high - low + 1) * sizeof(long));\
27 : "=Q" (*(addrtype *)(&array)) \
28 : "i" (low), "i" (high)); \
31 static inline void __ctl_set_bit(unsigned int cr
, unsigned int bit
)
35 __ctl_store(reg
, cr
, cr
);
37 __ctl_load(reg
, cr
, cr
);
40 static inline void __ctl_clear_bit(unsigned int cr
, unsigned int bit
)
44 __ctl_store(reg
, cr
, cr
);
46 __ctl_load(reg
, cr
, cr
);
49 void smp_ctl_set_bit(int cr
, int bit
);
50 void smp_ctl_clear_bit(int cr
, int bit
);
57 unsigned long lap
: 1; /* Low-address-protection control */
59 unsigned long edat
: 1; /* Enhanced-DAT-enablement control */
61 unsigned long afp
: 1; /* AFP-register control */
62 unsigned long vx
: 1; /* Vector enablement control */
68 # define ctl_set_bit(cr, bit) smp_ctl_set_bit(cr, bit)
69 # define ctl_clear_bit(cr, bit) smp_ctl_clear_bit(cr, bit)
71 # define ctl_set_bit(cr, bit) __ctl_set_bit(cr, bit)
72 # define ctl_clear_bit(cr, bit) __ctl_clear_bit(cr, bit)
75 #endif /* __ASM_CTL_REG_H */