linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@mandrakesoft.com>
To: jlquinn@us.ibm.com
Cc: linuxppc-dev@lists.linuxppc.org
Subject: Re: readw byte sex?
Date: Tue, 28 Mar 2000 16:15:11 -0500	[thread overview]
Message-ID: <38E120DF.DD47F662@mandrakesoft.com> (raw)
In-Reply-To: 852568B0.00703001.00@D51MTA03.pok.ibm.com


jlquinn@us.ibm.com wrote:
>
> I've seen info about this go by in the past, but wasn't paying careful
> attention...
>
> I'm working on trying to get my Advansys 970UW working under PPC linux
> 2.2.x.  I'm not tackling 2.3.x because I don't think the driver itself is
> up to date with respect to the 2.3 tree, while it is OK for x86 and alpha
> 2.2.x.  I'm having (surprise, surprise) byte swapping problems, which I so
> far am tracing to the following construct and pals:
>
>  x = le16_to_cpu(readw(addr))
>
> Both of these are byteswapping, leaving me with a reversed value, which of
> course causes havoc later.  What's the correct way to do this?  I can't
> find where the exact platform-independent semantics of readw are defined.
>
> Is this a FAQ?

readw is defined as functioning on a little endian PCI bus, so it
already should byte swap for you.

--
Jeff Garzik              | Tact is the ability to tell a man
Building 1024            | he has an open mind when he has a
MandrakeSoft, Inc.       | hole in his head.  (-random fortune)

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

      reply	other threads:[~2000-03-28 21:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-28 20:25 readw byte sex? jlquinn
2000-03-28 21:15 ` Jeff Garzik [this message]

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=38E120DF.DD47F662@mandrakesoft.com \
    --to=jgarzik@mandrakesoft.com \
    --cc=jlquinn@us.ibm.com \
    --cc=linuxppc-dev@lists.linuxppc.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).