Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Dec 2002 15:33:42 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Ruslan Ermilov <ru@FreeBSD.ORG>
Cc:        "Greg 'groggy' Lehey" <grog@FreeBSD.ORG>, Terry Lambert <tlambert2@mindspring.com>, Alex <akruijff@dds.nl>, <phk@FreeBSD.ORG>, Johnson David <DavidJohnson@Siemens.com>, <current@FreeBSD.ORG>
Subject:   Re: 80386 out of GENERIC
Message-ID:  <20021218152338.V23575-100000@gamplex.bde.org>
In-Reply-To: <20021217074235.GA95679@sunbay.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 17 Dec 2002, Ruslan Ermilov wrote:

> On Mon, Dec 16, 2002 at 09:05:40AM +1030, Greg 'groggy' Lehey wrote:
> > I suppose it would be a good idea to include an alternatvie i386
> > kernel on the CD-ROM.  There may be a space issue, of course.  How
> > many people participating in this thread have an i386 with at least 12
> > MB of memory and intended to try 5.0 on it?  How many of those don't
> > have a machine to bootstrap off?
> >
> Having only alternative i386 kernel is not enough while userland
> stuff is still compiled for i486.

Er, userland stuff is still compiled for original i386's, modulo bugs.
E.g., in the i386 endian.h:

% #if defined(_KERNEL) && (defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)) && !defined(I386_CPU)
      ^^^^^^^^^^^^^^^
%
% #define __byte_swap_int(x) \
% __extension__ ({ register __uint32_t __X = (x); \
%    __asm ("bswap %0" : "+r" (__X)); \
%    __X; })
% #else
%
% #define __byte_swap_int(x) \
% __extension__ ({ register __uint32_t __X = (x); \
%    __asm ("xchgb %h0, %b0\n\trorl $16, %0\n\txchgb %h0, %b0" \
% 	: "+q" (__X)); \
%    __X; })
% #endif

The _KERNEL part of the ifdef limits the use of the i486 "bswap"
instruction to the kernel, so userland is properly pessimized to support
all x86's.  The other parts of the ifdef properly pessimize modules to
support all x86's (options don't apply to modules so none of the XXX_CPU's
is defined).

So kernels get the full epsilon of optimizations from turning off i386
support, while userland doesn't get any (not counting ones from optimizing
for non-i386 without breaking i386).

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021218152338.V23575-100000>