linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Guillaume Laurès" <guillaume.laures@noos.fr>
Cc: <linuxppc-dev@lists.linuxppc.org>
Subject: Re: another endianness issue...
Date: Sun, 24 Jun 2001 16:50:42 +0200	[thread overview]
Message-ID: <20010624145042.30340@smtp.wanadoo.fr> (raw)
In-Reply-To: <3B35F23B.5030003@noos.fr>


>Is it correct ?
>And where can I find the cpu_to_le32() and le32_to_cpu() declaration or
>a guide on how to use them ?

If you use readl/writel, you don't need to byteswap as it's done for
you by those functions. If you used readb/writeb, then you are reading
bytes, swapping has no meaning.

Also, don't hard code 0x0002, better #define a constant, it makes the
code more readable.

cpu_to_le32/le32_to_cpu() are necessary if you are either not using
readx/writex accessors, or when storing datas in memory that the
controller will read directly (bus master)

Ben.


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

  reply	other threads:[~2001-06-24 14:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3B2E747A.6090607@noos.fr>
     [not found] ` <01061823464800.00690@reality.internal>
     [not found]   ` <3B2F0871.2070304@noos.fr>
     [not found]     ` <0106192003070C.00609@reality.internal>
2001-06-22 17:12       ` getting the 8600 to boot 2.4.5 Guillaume Laurès
2001-06-24  9:54         ` Michel Lanners
2001-06-24 11:39           ` Takashi Oe
2001-06-23  9:29       ` another endianness issue Guillaume Laurès
2001-06-23 18:19         ` Timothy A. Seufert
2001-06-23 18:33           ` Hollis
2001-06-23 23:22             ` Benjamin Herrenschmidt
2001-06-24 13:59           ` Guillaume Laurès
2001-06-24 14:50             ` Benjamin Herrenschmidt [this message]
2001-06-24 14:52             ` Geert Uytterhoeven
2001-06-24 22:49             ` Dan Malek

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=20010624145042.30340@smtp.wanadoo.fr \
    --to=benh@kernel.crashing.org \
    --cc=guillaume.laures@noos.fr \
    --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).