Any reason why the NetBSD approach to this problem won't work?  IMHO,
the meta-port should drive the derived ports.  The static parts of the
system are radically different between the different mips platforms.

Using the endian.h stuff as an example:

src/sys/arch/arc/include/endian.h is just "#include <sys/endian.h>"
src/sys/arch/arc/include/endian_machdep.h is

#define _BYTE_ORDER _LITTLE_ENDIAN
#include <mips/endian_machdep.h>

and src/sys/arch/mips/include/endian_machdep.h is a bunch of #defines
for assembler.

sys/endian.h looks like:

#define _LITTLE_ENDIAN  1234    /* LSB first: i386, vax */
#define _BIG_ENDIAN     4321    /* MSB first: 68000, ibm, net */
#define _PDP_ENDIAN     3412    /* LSB first in word, MSW first in long */

#include <machine/endian_machdep.h>

...
#include <sys/cdefs.h>
#include <sys/types.h>

typedef u_int32_t       in_addr_t;
typedef u_int16_t       in_port_t;

__BEGIN_DECLS
uint32_t        htonl __P((uint32_t)) __attribute__((__const__));
uint16_t        htons __P((uint16_t)) __attribute__((__const__));
uint32_t        ntohl __P((uint32_t)) __attribute__((__const__));
uint16_t        ntohs __P((uint16_t)) __attribute__((__const__));
__END_DECLS

... (more macros/functions)

In this case, there's very little duplication of effort.

Warner

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to