Subject: Re: evbsh3 -> evbsh3{el,bl}
To: None <itojun@iijlab.net>
From: Todd Vierling <tv@wasabisystems.com>
List: port-sh3
Date: 01/03/2001 19:40:05
On Thu, 4 Jan 2001 itojun@iijlab.net wrote:

: >This looks fine to me.  MACHINE_ARCH doesn't necessarily determine directory
: >names -- it mainly needs to distinguish processor basics (endianness, word
: >sizes, etc.).
:
: 	i remember another thing - arch/evbsh3/include/endian_machdep.h goes
: 	a little bit tricky.  is it okay to install endian_machdep_{eb,el}.h
: 	depending on MACHINE_ARCH settings?

I don't see a problem with having one header file containing all
definitions; you would just have "dead" definitions, which isn't damaging.

Note that a gcc CPP_SPEC predefine for endianness would make this much
easier.  You could have:

#ifdef TARGET_BIG_ENDIAN_DEFAULT
#define CPP_SPEC "... %{EL:-D__LITTLE_ENDIAN__} %{!EL:-D__BIG_ENDIAN__} ..."
#else
#define CPP_SPEC "... %{EB:-D__BIG_ENDIAN__} %{!EB:-D__LITTLE_ENDIAN__} ..."
#endif

Then you would know at compile time, without other -D options, which
endianness the compiler will use.  mipse[bl] has something similar, but is
not completely correct in the way it defines MIPSEB and MIPSEL.  :)

-- 
-- Todd Vierling <tv@wasabisystems.com>  *  Wasabi NetBSD:  Run with it.
-- NetBSD 1.5 now available on CD-ROM  --  http://www.wasabisystems.com/