Re: endiannes of the kernel

Giuliano Pochini (pochini@denise.shiny.it)
Thu, 29 Jul 1999 13:26:14 CEST


>I am porting Linux to a controller board using the Hitachi SH4 CPU.
This
>CPU can operate in either big-endian mode or little-endian mode. Since
I
>have control over the hardware and software, I can choose either one
>freely. Is there any advantage to choosing one over the other for the
Linux
>kernel? Or should I choose based on other requirements?

You should use little-endian mode il the CPU you compile for is l-e,
and b-e if the CPU is b-e.
Otherwise make a ramdom choice and use [b|l]e[16|32|64]_to_cpu() macros
to convert numbers on-the-fly at runtime, but the code gets longer and
slower.

Bye.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/