]> err.no Git - linux-2.6/blobdiff - include/asm-powerpc/dcr-native.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux...
[linux-2.6] / include / asm-powerpc / dcr-native.h
index be6c879e8760b11ba3b92de41e39f72622b6fb4f..f8398ce80372ebabaad97f58e5f10caa7dd3bad4 100644 (file)
@@ -82,6 +82,19 @@ static inline void __mtdcri(int base_addr, int base_data, int reg,
        spin_unlock_irqrestore(&dcr_ind_lock, flags);
 }
 
+static inline void __dcri_clrset(int base_addr, int base_data, int reg,
+                                unsigned clr, unsigned set)
+{
+       unsigned long flags;
+       unsigned int val;
+
+       spin_lock_irqsave(&dcr_ind_lock, flags);
+       __mtdcr(base_addr, reg);
+       val = (__mfdcr(base_data) & ~clr) | set;
+       __mtdcr(base_data, val);
+       spin_unlock_irqrestore(&dcr_ind_lock, flags);
+}
+
 #define mfdcri(base, reg)      __mfdcri(DCRN_ ## base ## _CONFIG_ADDR, \
                                         DCRN_ ## base ## _CONFIG_DATA, \
                                         reg)
@@ -90,6 +103,10 @@ static inline void __mtdcri(int base_addr, int base_data, int reg,
                                         DCRN_ ## base ## _CONFIG_DATA, \
                                         reg, data)
 
+#define dcri_clrset(base, reg, clr, set)       __dcri_clrset(DCRN_ ## base ## _CONFIG_ADDR,    \
+                                                             DCRN_ ## base ## _CONFIG_DATA,    \
+                                                             reg, clr, set)
+
 #endif /* __ASSEMBLY__ */
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_DCR_NATIVE_H */