Subject: Re: why various endian sh3?
To: None <hubert@feyrer.de>
From: None <itojun@iijlab.net>
List: tech-kern
Date: 01/08/2001 19:00:53
>> Modified Files:
>> 	syssrc/sys/arch/sh3/conf: build-sh3.eb build-sh3.el
>Why are we mixing big and little endian on this arch?

	SH3 CPU supports big-endian and little-endian, depending on 
	hardware configuration.  for example,
	- Sega Dreamcase uses little endian
	- Brains mmeye uses big endian
	- evaluation cards support either of, or both of them
	  (jumper pin selects particular endian)

	sys/arch/sh3 is basically a CPU dependent directory (like
	sys/arch/mips).  i've placed cross build script (build-sh3*) into
	sys/arch/sh3/conf, to avoid maintenance cost due to duplicates
	(i could have put these files under sys/arch/dreamcast or whatever,
	but if i did that, we will have the same file in multiple locations)

	the current NetBSD ports use the following:
	- sys/arch/dreamcast is hardwired for little-endian.  MACHINE_ARCH=sh3el
	- sys/arch/mmeye is hardwired for big-endian.  MACHINE_ARCH=sh3eb
	- sys/arch/evbsh3 supports both.  /usr/include/machine/endian_machdep.h
	  selects appropriate one looking at GCC #define symbol
	  (__LITTLE_ENDIAN__).  MACHINE_ARCH is either sh3el or sh3eb.

	(for sys/arch/evbsh3, maybe we'd better split it into two,
	like evbsh3el/evbsh3eb.  it looked too much)

itojun