mfd: wm8350-i2c: Make sure the i2c regmap functions are compiled
[linux/fpc-iii.git] / arch / s390 / include / asm / ctl_reg.h
blobdebfda33d1f86d88a8b3bce89e6b23962c643489
1 /*
2 * Copyright IBM Corp. 1999, 2009
4 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
5 */
7 #ifndef __ASM_CTL_REG_H
8 #define __ASM_CTL_REG_H
10 #ifdef CONFIG_64BIT
12 #define __ctl_load(array, low, high) ({ \
13 typedef struct { char _[sizeof(array)]; } addrtype; \
14 asm volatile( \
15 " lctlg %1,%2,%0\n" \
16 : : "Q" (*(addrtype *)(&array)), \
17 "i" (low), "i" (high)); \
20 #define __ctl_store(array, low, high) ({ \
21 typedef struct { char _[sizeof(array)]; } addrtype; \
22 asm volatile( \
23 " stctg %1,%2,%0\n" \
24 : "=Q" (*(addrtype *)(&array)) \
25 : "i" (low), "i" (high)); \
28 #else /* CONFIG_64BIT */
30 #define __ctl_load(array, low, high) ({ \
31 typedef struct { char _[sizeof(array)]; } addrtype; \
32 asm volatile( \
33 " lctl %1,%2,%0\n" \
34 : : "Q" (*(addrtype *)(&array)), \
35 "i" (low), "i" (high)); \
38 #define __ctl_store(array, low, high) ({ \
39 typedef struct { char _[sizeof(array)]; } addrtype; \
40 asm volatile( \
41 " stctl %1,%2,%0\n" \
42 : "=Q" (*(addrtype *)(&array)) \
43 : "i" (low), "i" (high)); \
46 #endif /* CONFIG_64BIT */
48 #define __ctl_set_bit(cr, bit) ({ \
49 unsigned long __dummy; \
50 __ctl_store(__dummy, cr, cr); \
51 __dummy |= 1UL << (bit); \
52 __ctl_load(__dummy, cr, cr); \
55 #define __ctl_clear_bit(cr, bit) ({ \
56 unsigned long __dummy; \
57 __ctl_store(__dummy, cr, cr); \
58 __dummy &= ~(1UL << (bit)); \
59 __ctl_load(__dummy, cr, cr); \
62 #ifdef CONFIG_SMP
64 extern void smp_ctl_set_bit(int cr, int bit);
65 extern void smp_ctl_clear_bit(int cr, int bit);
66 #define ctl_set_bit(cr, bit) smp_ctl_set_bit(cr, bit)
67 #define ctl_clear_bit(cr, bit) smp_ctl_clear_bit(cr, bit)
69 #else
71 #define ctl_set_bit(cr, bit) __ctl_set_bit(cr, bit)
72 #define ctl_clear_bit(cr, bit) __ctl_clear_bit(cr, bit)
74 #endif /* CONFIG_SMP */
76 #endif /* __ASM_CTL_REG_H */