From owner-freebsd-alpha Wed May 22 9:20:18 2002 Delivered-To: freebsd-alpha@freebsd.org Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by hub.freebsd.org (Postfix) with ESMTP id 68C9B37B406; Wed, 22 May 2002 09:20:06 -0700 (PDT) Received: from moe.cs.duke.edu (moe.cs.duke.edu [152.3.140.74]) by duke.cs.duke.edu (8.9.3/8.9.3) with ESMTP id MAA20775; Wed, 22 May 2002 12:20:05 -0400 (EDT) Received: (gallatin@localhost) by moe.cs.duke.edu (8.8.5/8.6.9) id MAA17662; Wed, 22 May 2002 12:20:05 -0400 (EDT) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15595.50485.663317.862520@moe.cs.duke.edu> Date: Wed, 22 May 2002 12:20:05 -0400 (EDT) To: Will Andrews Cc: portmgr@FreeBSD.ORG, re@FreeBSD.ORG, alpha@FreeBSD.ORG Subject: Re: Alpha package building status In-Reply-To: <20020522161440.GO53809@squall.waterspout.com> References: <1F095B0753FCD411857700010333058A04EEC8BF@waexch1.qgraph.com> <15595.40622.377080.973573@moe.cs.duke.edu> <20020522143405.GN53809@squall.waterspout.com> <15595.49495.889584.825785@moe.cs.duke.edu> <20020522161440.GO53809@squall.waterspout.com> X-Mailer: VM 6.72 under 21.1 (patch 9) "Canyonlands" XEmacs Lucid Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Will Andrews writes: > On Wed, May 22, 2002 at 12:03:35PM -0400, Andrew Gallatin wrote: > > OK. Here it is. > > > > On 4.x only, there are only inline byte swap routines for x86. > > On alpha, they're called htons and htonl. > > > > On 5.x, this is standardized across all platforms, so this fix is only > > for < 5.0 > > Can you embed this fact in the patch itself so I don't have to > hack the Makefile only to apply the patch when OSVERSION < 500000? > If you do that you can commit just the patch itself. (Unless I > am misunderstanding and this patch would not cause problems on 5.0?) You're misunderstanding. The existing patch does different things for 5.x so as to use the standard __bswapSIZE(x) inline for 5.x. So there is already a check for __FreeBSD_version <= 500000. I'm just adding code to the (currently) i386 centric code for 4.x. Since its not clear from the diff, here's the code, with my additions prefaced by "NEW" #if __FreeBSD_version <= 500000 NEW #if defined (__i386__) #define XCHG_SHORT(x) __byte_swap_word(x) #define XCHG_LONG(x) __byte_swap_long(x) NEW #else NEW #define XCHG_SHORT(x) htons(x) NEW #define XCHG_LONG(x) htonl(x) NEW #endif #else #define XCHG_SHORT(x) __bswap16(x) #define XCHG_LONG(x) __bswap32(x) #endif #else Cheers, Drew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message