Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Dec 1997 06:39:40 -0600
From:      Richard Wackerbarth <rkw@dataplex.net>
To:        sos@FreeBSD.dk
Cc:        current@FreeBSD.ORG
Subject:   Re: Vendor-specific processor hacks
Message-ID:  <l03110702b0aeeb6f6463@[208.2.87.4]>
In-Reply-To: <199712060946.KAA04299@sos.freebsd.dk>
References:  <19971205162226.26376@micron.mini.net> from Jonathan Mini at "Dec 5, 97 04:22:26 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
At 3:46 AM -0600 12/6/97, S¯ren Schmidt wrote:
>That's exactly the point, and my standpoint is still that all hacks for a
>given CPU type (I?86_CPU) should be compiled in if one does nothing to
>prevent it.

I agree. The default case should be "all the workarounds are included"

>I dont like another bazillion #ifdefs and stuff just to make a few
>hackers happy, they are knowledgeable enough (or should be) to
>do this by themselves.

I think a problem is in the naming of the #ifdef's.
Right now, things tend to be messy where the tests for "this, that, and
the other, but not something else" have made their way into the code itself.

This is caused by a failure to abstract things.

The fixes should each have their own label. The label should represent
the problem, not the machine that has the problem.

Then, in addition, we should supply a header file that defines the
cpu -> fault matrix.

Why shouldn't we "do it once" rather than expect everyone to reinvent
the same wheel?

The only complication that I see is that we tend to think in the
"HAS_BUG" mode rather than the "DOESNT_NEED_WORKAROUND" mode implied
in the first paragraph.

My proposed attack on this would be to have a hiearchy of filters which
go from the specific to the general.

make -DCOMPILE_FOR_INTEL_P5_90

- - -
#ifdef COMPILE_FOR_INTEL_P5_90
#define CPU_IS_INTEL TRUE
#define CPU_IS_586 TRUE
#define MAY_HAVE_COOTIES TRUE
#endif
- - -
#ifndef CPU_IS_INTEL
#ifndef MAY_HAVE_FOOF_BUG
#define MAY_HAVE_FOOF_BUG FALSE
#endif
#endif
- - -
and finally, in the code

#ifndef MAY_HAVE_COOTIES
#define MAY_HAVE_COOTIES TRUE
#endif
...
#if MAY_HAVE_COOTIES
    code to work around cooties
#endif



Richard Wackerbarth





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