linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Edelsohn <dje@watson.ibm.com>
To: Hollis R Blanchard <hollis+@andrew.cmu.edu>
Cc: "David W. Patmore" <dwp@bluesteelnet.com>,
	linuxppc-dev@lists.linuxppc.org
Subject: Re: endian-swapping
Date: Fri, 03 Dec 1999 20:56:23 -0500	[thread overview]
Message-ID: <9912040156.AA54326@marc.watson.ibm.com> (raw)
In-Reply-To: Message from Hollis R Blanchard <hollis+@andrew.cmu.edu> of "Fri, 03 Dec 1999 20:13:09 EST." <Pine.LNX.3.96L.991203200537.7714B-100000@unix47.andrew.cmu.edu>


>>>>> Hollis R Blanchard writes:

Hollis> On Fri, 3 Dec 1999, David Edelsohn wrote:
>> 
>> Linux already provides macros like le16_to_cpu(), etc. for this. 

Hollis> For the sake of someone (like me) who doesn't know how to use these, can you
Hollis> give an example?

	See drivers/net/pcnet32.c for one example of its use.  There are
no #ifdef's like NetBSD uses.  le16_to_cpu() is a no-op on LE machines, so
one uses it directly like 

short x = le16_to_cpu(dev_flag);

Hollis> Also, the macros are in which header? I'm having trouble finding them too...

	The macros seem to be included via <asm/bitops.h> which then
include <linux/byteorder/big_endian.h> (for example).

David

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

  reply	other threads:[~1999-12-04  1:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-14  0:55 G4 + Linux + PCI device + x86 driver = 0 David W. Patmore
1999-11-14 11:41 ` Takashi Oe
1999-11-14 23:50 ` Paul Mackerras
1999-11-15  9:33 ` Adrian Cox
1999-12-03 23:00   ` Update: " David W. Patmore
1999-12-04  0:50     ` David Edelsohn
1999-12-04  1:13       ` endian-swapping Hollis R Blanchard
1999-12-04  1:56         ` David Edelsohn [this message]
1999-12-04 19:13         ` endian-swapping Gabriel Paubert
1999-12-04 11:57     ` Update: RE: G4 + Linux + PCI device + x86 driver = 0 Michel Lanners
1999-12-05 19:42       ` Geert Uytterhoeven
1999-12-06  6:51         ` Michel Lanners

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=9912040156.AA54326@marc.watson.ibm.com \
    --to=dje@watson.ibm.com \
    --cc=dwp@bluesteelnet.com \
    --cc=hollis+@andrew.cmu.edu \
    --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).