From owner-p4-projects@FreeBSD.ORG Sat Dec 13 20:09:20 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B78CA106567D; Sat, 13 Dec 2008 20:09:20 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A5F81065679; Sat, 13 Dec 2008 20:09:20 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 3B3F08FC18; Sat, 13 Dec 2008 20:09:20 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id mBDK8Hg9092309; Sat, 13 Dec 2008 13:08:17 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 13 Dec 2008 13:08:16 -0700 (MST) Message-Id: <20081213.130816.74659290.imp@bsdimp.com> To: hselasky@c2i.net From: Warner Losh In-Reply-To: <200812131005.33499.hselasky@c2i.net> References: <200812122326.mBCNQX6w024511@repoman.freebsd.org> <200812131005.33499.hselasky@c2i.net> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: sam@freebsd.org, perforce@freebsd.org Subject: Re: PERFORCE change 154573 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Dec 2008 20:09:21 -0000 From: Hans Petter Selasky Subject: Re: PERFORCE change 154573 for review Date: Sat, 13 Dec 2008 10:05:32 +0100 > On Saturday 13 December 2008, Sam Leffler wrote: > > http://perforce.freebsd.org/chv.cgi?CH=154573 > > > > Change 154573 by sam@sam_ebb on 2008/12/12 23:25:40 > > > > Checkpoint cambria/ixp435 ehci support: add EHCI_SCFLG_BIGEDESC > > flag to force descriptor contents to be left in big-endian byte > > order intead of little-endian; this is required by the ixp435 > > builtin controllers. > > I would prefer if you could implement this using ifdefs. > > ehcireg.h: > > #ifdef HOST_ENDIAN_BUILD > #undef htole32 > #define htole32 htobe32 > ... > #define EXTERNAL(name) name##_be > #else > #define EXTERNAL(name) name##_le > #endif > > ehci_wrap.c: (new file) > > void > ehci_init(ehci_sc_t *sc) > { > if (force use bigendian) > ehci_init_be(sc); > else > ehci_init_le(sc); > return; > } > > And the same for all other globally exported functions from ehci.c which are > not so many! > > ehci.c: > > void > EXTERNAL(ehci_init)(ehci_sc_t *sc) > { > ... same like before ... > } > > ehci_be.c: > #define HOST_ENDIAN_BUILD > #include This is absoultely the wrong way to implement this. It is so wrong, I don't even know where to begin. Consider this an 'over my dead body' level of objection to this design. Warner