From owner-freebsd-current Thu Jan 30 9: 7:59 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3F66D37B401; Thu, 30 Jan 2003 09:07:58 -0800 (PST) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4C6A343F3F; Thu, 30 Jan 2003 09:07:57 -0800 (PST) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.6/8.12.3) with ESMTP id h0UH7u1e056350; Thu, 30 Jan 2003 10:07:56 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Thu, 30 Jan 2003 10:07:09 -0700 (MST) Message-Id: <20030130.100709.25156813.imp@bsdimp.com> To: jmallett@FreeBSD.ORG Cc: marcel@xcllnt.net, current@FreeBSD.ORG Subject: Re: Patch to teach config(8) about "platforms". From: "M. Warner Losh" In-Reply-To: <20030128151749.A831@FreeBSD.org> References: <20030128120830.A81856@FreeBSD.org> <20030128225335.GB537@athlon.pn.xcllnt.net> <20030128151749.A831@FreeBSD.org> X-Mailer: Mew version 2.1 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 " src/sys/arch/arc/include/endian_machdep.h is #define _BYTE_ORDER _LITTLE_ENDIAN #include 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 ... #include #include 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 majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message