diff options
Diffstat (limited to 'lib/iomap.c')
-rw-r--r-- | lib/iomap.c | 20 |
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 | } |
61 | unsigned int fastcall ioread16be(void __iomem *addr) | ||
62 | { | ||
63 | IO_COND(addr, return inw(port), return be16_to_cpu(__raw_readw(addr))); | ||
64 | } | ||
61 | unsigned int fastcall ioread32(void __iomem *addr) | 65 | unsigned 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 | } |
69 | unsigned int fastcall ioread32be(void __iomem *addr) | ||
70 | { | ||
71 | IO_COND(addr, return inl(port), return be32_to_cpu(__raw_readl(addr))); | ||
72 | } | ||
65 | EXPORT_SYMBOL(ioread8); | 73 | EXPORT_SYMBOL(ioread8); |
66 | EXPORT_SYMBOL(ioread16); | 74 | EXPORT_SYMBOL(ioread16); |
75 | EXPORT_SYMBOL(ioread16be); | ||
67 | EXPORT_SYMBOL(ioread32); | 76 | EXPORT_SYMBOL(ioread32); |
77 | EXPORT_SYMBOL(ioread32be); | ||
68 | 78 | ||
69 | void fastcall iowrite8(u8 val, void __iomem *addr) | 79 | void 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 | } |
87 | void fastcall iowrite16be(u16 val, void __iomem *addr) | ||
88 | { | ||
89 | IO_COND(addr, outw(val,port), __raw_writew(cpu_to_be16(val), addr)); | ||
90 | } | ||
77 | void fastcall iowrite32(u32 val, void __iomem *addr) | 91 | void 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 | } |
95 | void fastcall iowrite32be(u32 val, void __iomem *addr) | ||
96 | { | ||
97 | IO_COND(addr, outl(val,port), __raw_writel(cpu_to_be32(val), addr)); | ||
98 | } | ||
81 | EXPORT_SYMBOL(iowrite8); | 99 | EXPORT_SYMBOL(iowrite8); |
82 | EXPORT_SYMBOL(iowrite16); | 100 | EXPORT_SYMBOL(iowrite16); |
101 | EXPORT_SYMBOL(iowrite16be); | ||
83 | EXPORT_SYMBOL(iowrite32); | 102 | EXPORT_SYMBOL(iowrite32); |
103 | EXPORT_SYMBOL(iowrite32be); | ||
84 | 104 | ||
85 | /* | 105 | /* |
86 | * These are the "repeat MMIO read/write" functions. | 106 | * These are the "repeat MMIO read/write" functions. |