summaryrefslogtreecommitdiffstats
path: root/include/asm-ppc/io.h
diff options
context:
space:
mode:
authorVitaly Bordug <vbordug@ru.mvista.com>2006-01-15 15:30:29 +0100
committerPaul Mackerras <paulus@samba.org>2006-01-20 06:13:29 +0100
commit0ce928e1b2ad4309fae6c4324b9e9e433fbf62a2 (patch)
tree774811b3bba02ac53292c56cc0be0d144e616044 /include/asm-ppc/io.h
parent[PATCH] powerpc: Updated Initial MPC8540 ADS port with OF Flat Dev (diff)
downloadlinux-0ce928e1b2ad4309fae6c4324b9e9e433fbf62a2.tar.xz
linux-0ce928e1b2ad4309fae6c4324b9e9e433fbf62a2.zip
[PATCH] ppc32 8xx: Added setbitsXX/clrbitsXX macro for read-modify-write operations
This adds setbitsXX/clrbitsXX macro for read-modify-write operations and converts the 8xx core and drivers to use them. Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com> Signed-off-by: Marcelo Tosatti <marcelo.tosatti@cyclades.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-ppc/io.h')
-rw-r--r--include/asm-ppc/io.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index df9cf6ed189d..b919d8fb7d98 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -575,4 +575,11 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
*/
#define xlate_dev_kmem_ptr(p) p
+/* access ports */
+#define setbits32(_addr, _v) out_be32((_addr), in_be32(_addr) | (_v))
+#define clrbits32(_addr, _v) out_be32((_addr), in_be32(_addr) & ~(_v))
+
+#define setbits16(_addr, _v) out_be16((_addr), in_be16(_addr) | (_v))
+#define clrbits16(_addr, _v) out_be16((_addr), in_be16(_addr) & ~(_v))
+
#endif /* __KERNEL__ */