From: Florian Boelstler <euphoria@arcor•de>
To: linuxppc-embedded@ozlabs•org
Subject: Undestanding ioread32() / readl() and friends
Date: Wed, 21 Feb 2007 10:50:58 +0100 [thread overview]
Message-ID: <erh4m0$n83$1@sea.gmane.org> (raw)
Hi,
I just came across include/asm-ppc/io.h, which revealed that ioread32()
maps to readl(), which in turn maps to in_le32() (when CONFIG_APUS and
CONFIG_8260_PCI9 are both not defined).
in_le32() uses a asm instruction lwbrx to do byte swapping.
I don't really get why ioread32() effectively returns a little-endian
value on a big-endian PPCs.
Is this a sort of general rule that ioread32() always returns
little-endian values on all architectures?
BTW, "Linux Device Drivers, 3rd edition" by Corbet et al states that
ioread32() does not perform any endian conversion.
May be they are based on x86...
Thanks,
Florian
next reply other threads:[~2007-02-21 9:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-21 9:50 Florian Boelstler [this message]
2007-02-21 9:56 ` Undestanding ioread32() / readl() and friends Arnd Bergmann
2007-02-21 14:33 ` Florian Boelstler
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='erh4m0$n83$1@sea.gmane.org' \
--to=euphoria@arcor$(echo .)de \
--cc=linuxppc-embedded@ozlabs$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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