-#define ctrl_inb(addr) sh64_in8(addr)
-#define ctrl_inw(addr) sh64_in16(addr)
-#define ctrl_inl(addr) sh64_in32(addr)
-
-#define ctrl_outb(b, addr) sh64_out8(b, addr)
-#define ctrl_outw(b, addr) sh64_out16(b, addr)
-#define ctrl_outl(b, addr) sh64_out32(b, addr)
-
-unsigned long inb(unsigned long port);
-unsigned long inw(unsigned long port);
-unsigned long inl(unsigned long port);
-void outb(unsigned long value, unsigned long port);
-void outw(unsigned long value, unsigned long port);
-void outl(unsigned long value, unsigned long port);
+#define ctrl_inb(addr) sh64_in8(ioport_map(addr, 1))
+#define ctrl_inw(addr) sh64_in16(ioport_map(addr, 2))
+#define ctrl_inl(addr) sh64_in32(ioport_map(addr, 4))
+
+#define ctrl_outb(b, addr) sh64_out8(b, ioport_map(addr, 1))
+#define ctrl_outw(b, addr) sh64_out16(b, ioport_map(addr, 2))
+#define ctrl_outl(b, addr) sh64_out32(b, ioport_map(addr, 4))
+
+#define ioread8(addr) sh64_in8(addr)
+#define ioread16(addr) sh64_in16(addr)
+#define ioread32(addr) sh64_in32(addr)
+#define iowrite8(b, addr) sh64_out8(b, addr)
+#define iowrite16(b, addr) sh64_out16(b, addr)
+#define iowrite32(b, addr) sh64_out32(b, addr)
+
+#define inb(addr) ctrl_inb(addr)
+#define inw(addr) ctrl_inw(addr)
+#define inl(addr) ctrl_inl(addr)
+#define outb(b, addr) ctrl_outb(b, addr)
+#define outw(b, addr) ctrl_outw(b, addr)
+#define outl(b, addr) ctrl_outl(b, addr)
+
+void outsw(unsigned long port, const void *addr, unsigned long count);
+void insw(unsigned long port, void *addr, unsigned long count);
+void outsl(unsigned long port, const void *addr, unsigned long count);
+void insl(unsigned long port, void *addr, unsigned long count);
+
+#define __raw_readb readb
+#define __raw_readw readw
+#define __raw_readl readl
+#define __raw_writeb writeb
+#define __raw_writew writew
+#define __raw_writel writel
+
+void memcpy_toio(void __iomem *to, const void *from, long count);
+void memcpy_fromio(void *to, void __iomem *from, long count);