|
@@ -333,3 +333,87 @@ extern inline unsigned int ioread16(void __iomem *addr)
|
|
|
unsigned int ret = IO_CONCAT(__IO_PREFIX,ioread16)(addr);
|
|
|
mb();
|
|
|
return ret;
|
|
|
+}
|
|
|
+
|
|
|
+extern inline void iowrite8(u8 b, void __iomem *addr)
|
|
|
+{
|
|
|
+ IO_CONCAT(__IO_PREFIX,iowrite8)(b, addr);
|
|
|
+ mb();
|
|
|
+}
|
|
|
+
|
|
|
+extern inline void iowrite16(u16 b, void __iomem *addr)
|
|
|
+{
|
|
|
+ IO_CONCAT(__IO_PREFIX,iowrite16)(b, addr);
|
|
|
+ mb();
|
|
|
+}
|
|
|
+
|
|
|
+extern inline u8 inb(unsigned long port)
|
|
|
+{
|
|
|
+ return ioread8(ioport_map(port, 1));
|
|
|
+}
|
|
|
+
|
|
|
+extern inline u16 inw(unsigned long port)
|
|
|
+{
|
|
|
+ return ioread16(ioport_map(port, 2));
|
|
|
+}
|
|
|
+
|
|
|
+extern inline void outb(u8 b, unsigned long port)
|
|
|
+{
|
|
|
+ iowrite8(b, ioport_map(port, 1));
|
|
|
+}
|
|
|
+
|
|
|
+extern inline void outw(u16 b, unsigned long port)
|
|
|
+{
|
|
|
+ iowrite16(b, ioport_map(port, 2));
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
+#if IO_CONCAT(__IO_PREFIX,trivial_io_lq)
|
|
|
+extern inline unsigned int ioread32(void __iomem *addr)
|
|
|
+{
|
|
|
+ unsigned int ret = IO_CONCAT(__IO_PREFIX,ioread32)(addr);
|
|
|
+ mb();
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+
|
|
|
+extern inline void iowrite32(u32 b, void __iomem *addr)
|
|
|
+{
|
|
|
+ IO_CONCAT(__IO_PREFIX,iowrite32)(b, addr);
|
|
|
+ mb();
|
|
|
+}
|
|
|
+
|
|
|
+extern inline u32 inl(unsigned long port)
|
|
|
+{
|
|
|
+ return ioread32(ioport_map(port, 4));
|
|
|
+}
|
|
|
+
|
|
|
+extern inline void outl(u32 b, unsigned long port)
|
|
|
+{
|
|
|
+ iowrite32(b, ioport_map(port, 4));
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
+#if IO_CONCAT(__IO_PREFIX,trivial_rw_bw) == 1
|
|
|
+extern inline u8 __raw_readb(const volatile void __iomem *addr)
|
|
|
+{
|
|
|
+ return IO_CONCAT(__IO_PREFIX,readb)(addr);
|
|
|
+}
|
|
|
+
|
|
|
+extern inline u16 __raw_readw(const volatile void __iomem *addr)
|
|
|
+{
|
|
|
+ return IO_CONCAT(__IO_PREFIX,readw)(addr);
|
|
|
+}
|
|
|
+
|
|
|
+extern inline void __raw_writeb(u8 b, volatile void __iomem *addr)
|
|
|
+{
|
|
|
+ IO_CONCAT(__IO_PREFIX,writeb)(b, addr);
|
|
|
+}
|
|
|
+
|
|
|
+extern inline void __raw_writew(u16 b, volatile void __iomem *addr)
|
|
|
+{
|
|
|
+ IO_CONCAT(__IO_PREFIX,writew)(b, addr);
|
|
|
+}
|
|
|
+
|
|
|
+extern inline u8 readb(const volatile void __iomem *addr)
|
|
|
+{
|
|
|
+ u8 ret = __raw_readb(addr);
|