aboutsummaryrefslogtreecommitdiff
path: root/include/asm-v850/io.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 15:20:36 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 15:20:36 -0700
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-v850/io.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/asm-v850/io.h')
-rw-r--r--include/asm-v850/io.h133
1 files changed, 133 insertions, 0 deletions
diff --git a/include/asm-v850/io.h b/include/asm-v850/io.h
new file mode 100644
index 00000000000..bb5efd1b4b7
--- /dev/null
+++ b/include/asm-v850/io.h
@@ -0,0 +1,133 @@
+/*
+ * include/asm-v850/io.h -- Misc I/O operations
+ *
+ * Copyright (C) 2001,02,03,04 NEC Electronics Corporation
+ * Copyright (C) 2001,02,03,04 Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU General
+ * Public License. See the file COPYING in the main directory of this
+ * archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#ifndef __V850_IO_H__
+#define __V850_IO_H__
+
+#define IO_SPACE_LIMIT 0xFFFFFFFF
+
+#define readb(addr) \
+ ({ unsigned char __v = (*(volatile unsigned char *) (addr)); __v; })
+#define readw(addr) \
+ ({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; })
+#define readl(addr) \
+ ({ unsigned long __v = (*(volatile unsigned long *) (addr)); __v; })
+
+#define readb_relaxed(a) readb(a)
+#define readw_relaxed(a) readw(a)
+#define readl_relaxed(a) readl(a)
+
+#define writeb(b, addr) \
+ (void)((*(volatile unsigned char *) (addr)) = (b))
+#define writew(b, addr) \
+ (void)((*(volatile unsigned short *) (addr)) = (b))
+#define writel(b, addr) \
+ (void)((*(volatile unsigned int *) (addr)) = (b))
+
+#define __raw_readb readb
+#define __raw_readw readw
+#define __raw_readl readl
+#define __raw_writeb writeb
+#define __raw_writew writew
+#define __raw_writel writel
+
+#define inb(addr) readb (addr)
+#define inw(addr) readw (addr)
+#define inl(addr) readl (addr)
+#define outb(x, addr) ((void) writeb (x, addr))
+#define outw(x, addr) ((void) writew (x, addr))
+#define outl(x, addr) ((void) writel (x, addr))
+
+#define inb_p(port) inb((port))
+#define outb_p(val, port) outb((val), (port))
+#define inw_p(port) inw((port))
+#define outw_p(val, port) outw((val), (port))
+#define inl_p(port) inl((port))
+#define outl_p(val, port) outl((val), (port))
+
+static inline void insb (unsigned long port, void *dst, unsigned long count)
+{
+ unsigned char *p = dst;
+ while (count--)
+ *p++ = inb (port);
+}
+static inline void insw (unsigned long port, void *dst, unsigned long count)
+{
+ unsigned short *p = dst;
+ while (count--)
+ *p++ = inw (port);
+}
+static inline void insl (unsigned long port, void *dst, unsigned long count)
+{
+ unsigned long *p = dst;
+ while (count--)
+ *p++ = inl (port);
+}
+
+static inline void
+outsb (unsigned long port, const void *src, unsigned long count)
+{
+ const unsigned char *p = src;
+ while (count--)
+ outb (*p++, port);
+}
+static inline void
+outsw (unsigned long port, const void *src, unsigned long count)
+{
+ const unsigned short *p = src;
+ while (count--)
+ outw (*p++, port);
+}
+static inline void
+outsl (unsigned long port, const void *src, unsigned long count)
+{
+ const unsigned long *p = src;
+ while (count--)
+ outl (*p++, port);
+}
+
+#define iounmap(addr) ((void)0)
+#define ioremap(physaddr, size) (physaddr)
+#define ioremap_nocache(physaddr, size) (physaddr)
+#define ioremap_writethrough(physaddr, size) (physaddr)
+#define ioremap_fullcache(physaddr, size) (physaddr)
+
+#define mmiowb()
+
+#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT)
+#if 0
+/* This is really stupid; don't define it. */
+#define page_to_bus(page) page_to_phys (page)
+#endif
+
+/* Conversion between virtual and physical mappings. */
+#define mm_ptov(addr) ((void *)__phys_to_virt (addr))
+#define mm_vtop(addr) ((unsigned long)__virt_to_phys (addr))
+#define phys_to_virt(addr) ((void *)__phys_to_virt (addr))
+#define virt_to_phys(addr) ((unsigned long)__virt_to_phys (addr))
+
+#define memcpy_fromio(dst, src, len) memcpy (dst, (void *)src, len)
+#define memcpy_toio(dst, src, len) memcpy ((void *)dst, src, len)
+
+/*
+ * Convert a physical pointer to a virtual kernel pointer for /dev/mem
+ * access
+ */
+#define xlate_dev_mem_ptr(p) __va(p)
+
+/*
+ * Convert a virtual cached pointer to an uncached pointer
+ */
+#define xlate_dev_kmem_ptr(p) p
+
+#endif /* __V850_IO_H__ */