Subject: Re: Diaspora, politics, and MI
To: Michael Graff <explorer@flame.org>
From: Chris G Demetriou <Chris_G_Demetriou@ux2.sp.cs.cmu.edu>
List: current-users
Date: 09/18/1996 19:18:46
> I quote from net/bpf_filter.c:
> 
>  *      @(#)bpf_filter.c        8.1 (Berkeley) 6/10/93
>  */
> 
> #include <sys/param.h>
> #include <sys/types.h>
> #include <sys/time.h>
> 
> #ifdef sun
> #include <netinet/in.h>
> #endif
> 
> #if defined(sparc) || defined(mips) || defined(ibm032) || \
>     (defined(__NetBSD__) && !defined(UNALIGNED_ACCESS))
> #define BPF_ALIGN
> #endif
> 
> 
> And I also quote from netns/spp_var.h:
> 
> #ifdef sun
> short xnsCbug;
> #define SSEQ_LT(a,b)    ((xnsCbug = (short)((a)-(b))) < 0)
> #define SSEQ_LEQ(a,b)   ((xnsCbug = (short)((a)-(b))) <= 0)
> #define SSEQ_GT(a,b)    ((xnsCbug = (short)((a)-(b))) > 0)
> #define SSEQ_GEQ(a,b)   ((xnsCbug = (short)((a)-(b))) >= 0)
> #else
> #define SSEQ_LT(a,b)    (((short)((a)-(b))) < 0)
> #define SSEQ_LEQ(a,b)   (((short)((a)-(b))) <= 0)
> #define SSEQ_GT(a,b)    (((short)((a)-(b))) > 0)
> #define SSEQ_GEQ(a,b)   (((short)((a)-(b))) >= 0)
> #endif
> 
> Aren't these somewhat MD, and in MI code?

yeah, and they came from LBL.

If we wanted to make the process of importing new versions of BPF into
the tree harder, we'd have removed them.

Note the:

>     (defined(__NetBSD__) && !defined(UNALIGNED_ACCESS))

bit, which is there so that we don't have to add _more_
machine-dependent brokenness to the code?



Sure, you can find lots of examples.  The point is not to eliminate
machine-dependent hacks in MI code completely, because it can't be
done. The point is to create a minimal number of, to reduce the
number of, and reduce the effect of machine-dependent artifacts in
machine-independent code.

Reworking code in every DMA-using driver for a particular
machine-independent bus type, in order to support a machine-dependent
scheme for dma mapping is _NOT_ in that spirit, and in my opinion
it'd be bloody stupid (as well as counter-productive) to do that in
NetBSD.


chris