Date: Wed, 22 May 2002 12:20:05 -0400 (EDT) From: Andrew Gallatin <gallatin@cs.duke.edu> To: Will Andrews <will@csociety.org> Cc: portmgr@FreeBSD.ORG, re@FreeBSD.ORG, alpha@FreeBSD.ORG Subject: Re: Alpha package building status Message-ID: <15595.50485.663317.862520@moe.cs.duke.edu> 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>
index | next in thread | previous in thread | raw e-mail
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
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15595.50485.663317.862520>
