[PATCH] ppc64: Big-endian I/O memory accessors.
Arthur Othieno
a.othieno at bluewin.ch
Mon Aug 22 22:57:23 EST 2005
On Mon, Aug 22, 2005 at 09:16:18AM +1000, Benjamin Herrenschmidt wrote:
> On Sat, 2005-08-20 at 21:48 -0400, Arthur Othieno wrote:
> > I/O memory accessors. Big-endian version. For those busses/devices
> > that do export big-endian I/O memory.
>
> Same comment as the ppc32 ones. You need appropriate memory barriers
> among others. Use in/out_bexx() (look how readl/writel are implemented).
>
> Ben.
Updated patch inline.
Signed-Off-By: Arthur Othieno <a.othieno at bluewin.ch>
iomap.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+)
diff -uprN a/arch/ppc64/kernel/iomap.c b/arch/ppc64/kernel/iomap.c
--- a/arch/ppc64/kernel/iomap.c 2005-08-21 17:48:54.000000000 -0400
+++ b/arch/ppc64/kernel/iomap.c 2005-08-21 20:34:12.000000000 -0400
@@ -22,13 +22,23 @@ unsigned int fastcall ioread16(void __io
{
return readw(addr);
}
+unsigned int fastcall ioread16be(void __iomem *addr)
+{
+ return in_be16(addr);
+}
unsigned int fastcall ioread32(void __iomem *addr)
{
return readl(addr);
}
+unsigned int fastcall ioread32be(void __iomem *addr)
+{
+ return in_be32(addr);
+}
EXPORT_SYMBOL(ioread8);
EXPORT_SYMBOL(ioread16);
+EXPORT_SYMBOL(ioread16be);
EXPORT_SYMBOL(ioread32);
+EXPORT_SYMBOL(ioread32be);
void fastcall iowrite8(u8 val, void __iomem *addr)
{
@@ -38,13 +48,23 @@ void fastcall iowrite16(u16 val, void __
{
writew(val, addr);
}
+void fastcall iowrite16be(u16 val, void __iomem *addr)
+{
+ out_be16(addr, val);
+}
void fastcall iowrite32(u32 val, void __iomem *addr)
{
writel(val, addr);
}
+void fastcall iowrite32be(u32 val, void __iomem *addr)
+{
+ out_be32(addr, val);
+}
EXPORT_SYMBOL(iowrite8);
EXPORT_SYMBOL(iowrite16);
+EXPORT_SYMBOL(iowrite16be);
EXPORT_SYMBOL(iowrite32);
+EXPORT_SYMBOL(iowrite32be);
/*
* These are the "repeat read/write" functions. Note the
More information about the Linuxppc64-dev
mailing list