linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* readw byte sex?
@ 2000-03-28 20:25 jlquinn
  2000-03-28 21:15 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: jlquinn @ 2000-03-28 20:25 UTC (permalink / raw)
  To: linuxppc-dev


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?

Thanks,
Jerry Quinn


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: readw byte sex?
  2000-03-28 20:25 readw byte sex? jlquinn
@ 2000-03-28 21:15 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2000-03-28 21:15 UTC (permalink / raw)
  To: jlquinn; +Cc: linuxppc-dev


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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-03-28 21:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-03-28 20:25 readw byte sex? jlquinn
2000-03-28 21:15 ` Jeff Garzik

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).