cvs commit: src/lib/libc/i386/net htonl.S ntohl.S

Ruslan Ermilov ru at FreeBSD.org
Mon Oct 18 11:03:37 PDT 2004


On Mon, Oct 18, 2004 at 10:45:11AM -0700, David O'Brien wrote:
> On Mon, Oct 18, 2004 at 08:35:16PM +0300, Ruslan Ermilov wrote:
> > On Mon, Oct 18, 2004 at 05:19:36PM +0000, David E. O'Brien wrote:
> > > obrien      2004-10-18 17:19:36 UTC
> > >   FreeBSD src repository
> > >   Modified files:
> > >     lib/libc/i386/net    htonl.S ntohl.S 
> > >   Log:
> > >   Sync with sys/i386/include/endian.h: use the single instruction 'bswap'.
> > >   Revision  Changes    Path
> > >   1.10      +4 -0      src/lib/libc/i386/net/htonl.S
> > >   1.10      +4 -0      src/lib/libc/i386/net/ntohl.S
> > :  ENTRY(__htonl)
> > :         movl    4(%esp),%eax
> > : +#ifdef I386_CPU
> > :         xchgb   %al,%ah
> > :         roll    $16,%eax
> > :         xchgb   %al,%ah
> > : +#else
> > : +       bswap   %eax
> > : +#endif
> > :         ret
> > 
> > Ahem, but this makes this code unsuitable for i386.
> 
> Yes.  You missed the discussion in freebsd-current on this?  For
> 6-CURRENT and RELENG_5 running on a real I386 is not supported.
> 
Hmm.  I remember the plan was to decomission the i386 support
only in 6.0-CURRENT, as per sys/i386/conf/NOTES:

# Be sure to disable 'cpu I386_CPU' for SMP kernels.
# I386_CPU is mutually exclusive with the other CPU types.
# I386_CPU is deprecated and will be removed in 6.0-RELEASE.

And

  http://www.freebsd.org/releases/5.2.1R/hardware-i386.html#PROC

says i386 (except 386SX) is still supported.  I recall phk@
looking for the 386DX testers, but I don't remember what was
the result.

If you are burning 6.0-CURRENT bridges already, and this change
is the step in the I386_CPU deprecation direction, why not just
unifdef(1) this libc code, so that the "xchg" is always used?

> > I386_CPU
> > is only defined if kernel config file has "cpu I386_CPU", and
> > this has little relation to libc if at all.
> 
> I know.  Give me some other symbol then we can publish that one should
> add to /etc/make.conf CFLAGS to try to build a userland for an I386.
> "I386_CPU" looks as good a spelling as any and I didn't see any need to
> spell it differently than in the kernel.
> 
You can check for the CPUTYPE="i386" for ${MACHINE_ARCH} == "i386"
in libc/Makefile, and set I386_CPU in CFLAGS in this case.


Cheers,
-- 
Ruslan Ermilov
ru at FreeBSD.org
FreeBSD committer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-all/attachments/20041018/3b4f19d5/attachment.bin


More information about the cvs-all mailing list