From: a.othieno@bluewin.ch (Arthur Othieno)
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] ppc32: Big-endian I/O memory accessors.
Date: Mon, 22 Aug 2005 08:51:46 -0400 [thread overview]
Message-ID: <20050822125146.GA811@mars> (raw)
In-Reply-To: <1124659361.5197.121.camel@gaston>
On Mon, Aug 22, 2005 at 07:22:41AM +1000, Benjamin Herrenschmidt wrote:
> On Sat, 2005-08-20 at 21:16 -0400, Arthur Othieno wrote:
> > I/O memory accessors. Big-endian version. For those busses/devices
> > that do export big-endian I/O memory.
>
> No, that's not correct. You need to use the in_be/out_be variants which
> provide proper memory barriers.
>
> Ben.
Oops. Silly me. Updated patch inline.
Signed-Off-By: Arthur Othieno <a.othieno@bluewin.ch>
io.h | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+)
diff -uprN a/include/asm-ppc/io.h b/include/asm-ppc/io.h
--- a/include/asm-ppc/io.h 2005-08-21 17:49:44.000000000 -0400
+++ b/include/asm-ppc/io.h 2005-08-21 20:29:55.000000000 -0400
@@ -487,11 +487,21 @@ static inline unsigned int ioread16(void
return readw(addr);
}
+static inline unsigned int ioread16be(void __iomem *addr)
+{
+ return in_be16(addr);
+}
+
static inline unsigned int ioread32(void __iomem *addr)
{
return readl(addr);
}
+static inline unsigned int ioread32be(void __iomem *addr)
+{
+ return in_be32(addr);
+}
+
static inline void iowrite8(u8 val, void __iomem *addr)
{
writeb(val, addr);
@@ -502,11 +512,21 @@ static inline void iowrite16(u16 val, vo
writew(val, addr);
}
+static inline void iowrite16be(u16 val, void __iomem *addr)
+{
+ out_be16(addr, val);
+}
+
static inline void iowrite32(u32 val, void __iomem *addr)
{
writel(val, addr);
}
+static inline void iowrite32be(u32 val, void __iomem *addr)
+{
+ out_be32(addr, val);
+}
+
static inline void ioread8_rep(void __iomem *addr, void *dst, unsigned long count)
{
_insb(addr, dst, count);
next prev parent reply other threads:[~2005-08-22 12:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-21 1:16 [PATCH] ppc32: Big-endian I/O memory accessors Arthur Othieno
2005-08-21 21:22 ` Benjamin Herrenschmidt
2005-08-22 12:51 ` Arthur Othieno [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-10-10 21:50 Arthur Othieno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050822125146.GA811@mars \
--to=a.othieno@bluewin.ch \
--cc=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).