2002-06-15 Yoshinori K. Okuji <okuji@enbug.org>

* stage2/fsys_xfs.c (le32): Don't use bswap, but use xchgb and
	roll, because 386 doesn't have bswap. Reported by Frode Vatvedt
	Fjeld <frodef@acm.org>.
This commit is contained in:
okuji 2002-06-15 00:47:08 +00:00
parent c628bca2ae
commit e2a3acbed0
2 changed files with 15 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2002-06-15 Yoshinori K. Okuji <okuji@enbug.org>
* stage2/fsys_xfs.c (le32): Don't use bswap, but use xchgb and
roll, because 386 doesn't have bswap. Reported by Frode Vatvedt
Fjeld <frodef@acm.org>.
2002-06-12 Yoshinori K. Okuji <okuji@enbug.org>
* netboot/main.c (ifconfig): If GW is specified, clear out the

View file

@ -109,7 +109,16 @@ le16 (__uint16_t x)
static inline __const__ __uint32_t
le32 (__uint32_t x)
{
#if 0
/* 386 doesn't have bswap. */
__asm__("bswap %0" : "=r" (x) : "0" (x));
#else
/* This is slower but this works on all x86 architectures. */
__asm__("xchgb %b0, %h0" \
"\n\troll $16, %0" \
"\n\txchgb %b0, %h0" \
: "=q" (x) : "0" (x));
#endif
return x;
}