linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Gabriel Paubert <paubert@iram.es>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: linas@austin.ibm.com, valvoline <valvoline@vrlteam.org>,
	linuxppc-dev@lists.linuxppc.org
Subject: Re: Broadcom BCM94306
Date: Thu, 15 Jan 2004 12:50:23 +0100	[thread overview]
Message-ID: <20040115115023.GA12001@iram.es> (raw)
In-Reply-To: <70D6BF86-473D-11D8-A8C3-000A95A4DC02@kernel.crashing.org>


On Thu, Jan 15, 2004 at 10:30:21AM +0100, Segher Boessenkool wrote:
>
> On 15-jan-04, at 1:13, linas@austin.ibm.com wrote:
> >totally irrelevent and off-topic, but ... the ppc can (or used
> >to be able to) switch endianess dynamically.  To be more correct,
> >it can run some user-space code that was little endian, by having
> >the kernel set the appropriate bit in the MSR before it ran the
> >app.  I have no idea is the linux kernel saves/restores this bit(s),
> >or if this is still supported on the newest processors.
>
> It can also run supervisor-level code in little endian mode.
>
> The 2.0 PEM still doesn't show this support as optional [look at the
> ILE and LE bits in the MSR], but it does say that "the code sequence
> used to switch from big to little-endian mode may differ among
> processors".
>
> Also note that the 970 does not support wrong^H^H^H^H^Hlittle-endian
> mode
> at all.

BTW, where did you find this? IBM's sites have no real documentation on
the 970, or I was too dumb to find them.

>
> As these bits are in the MSR, and you are supposed to leave alone the
> bits
> that you don't explicitly touch, I suppose the Linux kernel
> saves/restores
> the bits just fine.  But I didn't check whether it actually does, so
> YMMV.


It's more complex than this, because it is pseudo little endian, munging
low address bits. The memory seen as an array of bytes is not invariant
through this transformation for most processors. For example the character
chain "abcdefgh" copied from a kernel buffer through a read call will
look as "hgfedcba" from a little endian application. Bridges have a
"LE" bit to also mung addresses during DMA and PIO transfers.

But this makes it almost impossible to support a mixture of little and
bug endian applications. Indeed the ROM BIOS x86 emulator I wrote a
few years ago runs in big-endian mode and uses {l,st}[hw]brx instructions
to emulate x86 crapitecture.

	Gabriel

P.S.: there is nothing wrong with calling little-endian wrong or
perverted or fucked-up ;-)

file (or written from the kernel
>
>
> Segher
>
>

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

  reply	other threads:[~2004-01-15 11:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-14 16:11 Broadcom BCM94306 valvoline
2004-01-15  0:13 ` linas
2004-01-15  9:30   ` Segher Boessenkool
2004-01-15 11:50     ` Gabriel Paubert [this message]
2004-01-15 13:00       ` Segher Boessenkool
2004-01-15 13:12         ` Sven Luther
2004-01-15 13:18           ` Segher Boessenkool
2004-01-16 19:54         ` Gabriel Paubert
2004-01-16 23:19           ` linas
2004-01-17  3:25           ` Benjamin Herrenschmidt
2004-01-17 18:21           ` Geert Uytterhoeven
2004-01-19 14:11           ` Segher Boessenkool
2004-01-19 22:05             ` Benjamin Herrenschmidt
2004-01-20 18:01               ` Segher Boessenkool
2004-01-21 17:27                 ` Gabriel Paubert
2004-01-15 13:39       ` Colin Leroy
2004-01-16 22:09         ` Gabriel Paubert

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=20040115115023.GA12001@iram.es \
    --to=paubert@iram.es \
    --cc=linas@austin.ibm.com \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --cc=segher@kernel.crashing.org \
    --cc=valvoline@vrlteam.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).