aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/iomap.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/iomap.c b/lib/iomap.c
index 5e74390852b0..55689c5d3379 100644
--- a/lib/iomap.c
+++ b/lib/iomap.c
@@ -58,13 +58,23 @@ unsigned int fastcall ioread16(void __iomem *addr)
58{ 58{
59 IO_COND(addr, return inw(port), return readw(addr)); 59 IO_COND(addr, return inw(port), return readw(addr));
60} 60}
61unsigned int fastcall ioread16be(void __iomem *addr)
62{
63 IO_COND(addr, return inw(port), return be16_to_cpu(__raw_readw(addr)));
64}
61unsigned int fastcall ioread32(void __iomem *addr) 65unsigned int fastcall ioread32(void __iomem *addr)
62{ 66{
63 IO_COND(addr, return inl(port), return readl(addr)); 67 IO_COND(addr, return inl(port), return readl(addr));
64} 68}
69unsigned int fastcall ioread32be(void __iomem *addr)
70{
71 IO_COND(addr, return inl(port), return be32_to_cpu(__raw_readl(addr)));
72}
65EXPORT_SYMBOL(ioread8); 73EXPORT_SYMBOL(ioread8);
66EXPORT_SYMBOL(ioread16); 74EXPORT_SYMBOL(ioread16);
75EXPORT_SYMBOL(ioread16be);
67EXPORT_SYMBOL(ioread32); 76EXPORT_SYMBOL(ioread32);
77EXPORT_SYMBOL(ioread32be);
68 78
69void fastcall iowrite8(u8 val, void __iomem *addr) 79void fastcall iowrite8(u8 val, void __iomem *addr)
70{ 80{
@@ -74,13 +84,23 @@ void fastcall iowrite16(u16 val, void __iomem *addr)
74{ 84{
75 IO_COND(addr, outw(val,port), writew(val, addr)); 85 IO_COND(addr, outw(val,port), writew(val, addr));
76} 86}
87void fastcall iowrite16be(u16 val, void __iomem *addr)
88{
89 IO_COND(addr, outw(val,port), __raw_writew(cpu_to_be16(val), addr));
90}
77void fastcall iowrite32(u32 val, void __iomem *addr) 91void fastcall iowrite32(u32 val, void __iomem *addr)
78{ 92{
79 IO_COND(addr, outl(val,port), writel(val, addr)); 93 IO_COND(addr, outl(val,port), writel(val, addr));
80} 94}
95void fastcall iowrite32be(u32 val, void __iomem *addr)
96{
97 IO_COND(addr, outl(val,port), __raw_writel(cpu_to_be32(val), addr));
98}
81EXPORT_SYMBOL(iowrite8); 99EXPORT_SYMBOL(iowrite8);
82EXPORT_SYMBOL(iowrite16); 100EXPORT_SYMBOL(iowrite16);
101EXPORT_SYMBOL(iowrite16be);
83EXPORT_SYMBOL(iowrite32); 102EXPORT_SYMBOL(iowrite32);
103EXPORT_SYMBOL(iowrite32be);
84 104
85/* 105/*
86 * These are the "repeat MMIO read/write" functions. 106 * These are the "repeat MMIO read/write" functions.