1 From a.othieno@bluewin.ch Tue Oct 11 07:50:21 2005
2 From: Arthur Othieno <a.othieno@bluewin.ch>
3 Subject: Big-endian I/O memory accessors.
4 Date: Tue, 11 Oct 2005 07:50:21 +1000
7 From: Arthur Othieno <a.othieno@bluewin.ch>
9 I/O memory accessors. Big endian version. For those busses/devices
10 that do export big-endian I/O memory.
12 Of notable relevance/reference:
14 http://lwn.net/Articles/132804/
15 http://ozlabs.org/pipermail/linuxppc-embedded/2005-August/019798.html
16 http://ozlabs.org/pipermail/linuxppc-embedded/2005-August/019752.html
18 Signed-off-by: Arthur Othieno <a.othieno@bluewin.ch>
23 A similar patch for ppc64 made it upstream with your big ppc64 merge.
24 This one is still sitting in http://patchwork.ozlabs.org/linuxppc/
25 and didn't make it with the ppc32 equivalent. Thanks.
28 include/asm-ppc/io.h | 20 ++++++++++++++++++++
29 1 file changed, 20 insertions(+)
33 Index: linux-2.6.24.7/include/asm-ppc/io.h
34 ===================================================================
35 --- linux-2.6.24.7.orig/include/asm-ppc/io.h
36 +++ linux-2.6.24.7/include/asm-ppc/io.h
37 @@ -413,11 +413,21 @@ static inline unsigned int ioread16(void
41 +static inline unsigned int ioread16be(void __iomem *addr)
43 + return in_be16(addr);
46 static inline unsigned int ioread32(void __iomem *addr)
51 +static inline unsigned int ioread32be(void __iomem *addr)
53 + return in_be32(addr);
56 static inline void iowrite8(u8 val, void __iomem *addr)
59 @@ -428,11 +438,21 @@ static inline void iowrite16(u16 val, vo
63 +static inline void iowrite16be(u16 val, void __iomem *addr)
65 + out_be16(addr, val);
68 static inline void iowrite32(u32 val, void __iomem *addr)
73 +static inline void iowrite32be(u32 val, void __iomem *addr)
75 + out_be32(addr, val);
78 static inline void ioread8_rep(void __iomem *addr, void *dst, unsigned long count)
80 _insb(addr, dst, count);