[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gnumach cleanup Round 4

From: Thomas Bushnell BSG
Subject: Re: Gnumach cleanup Round 4
Date: Mon, 13 Nov 2006 15:49:04 -0800

On Mon, 2006-11-13 at 22:53 +0100, Samuel Thibault wrote:
> Roland McGrath, le Mon 13 Nov 2006 13:43:10 -0800, a écrit :
> > > Roland McGrath, le Sun 12 Nov 2006 16:50:48 -0800, a écrit :
> > > > Decls for copyin et al do not belong in a machine header.
> > > 
> > > Then why simple_lock_pause, spl*, for instance, do?
> > 
> > Users of simple_lock_pause use <kern/lock.h>.
> Ok, but kern/lock.h drags the declaration from i386/i386/lock.h. How are
> copyin et al different?
> > spl* are used only by machine-specific code, I think.
> There are a lot of occurrences in device/ and kern/.

I think Roland is wrong that this is an issue of careful structuring.
Mach has not had this pattern, nor has the BSD kernel source from which
it's structure more or less originated.  It is the pattern that Roland
used for the C library.

However, it is a good principle to apply unless there is an excellent
reason not to.

I think that the reason to prefer them in non-machine-dependent headers
is most importantly to avoid having multiple declarations of the same
things.  If these are functions which many different architectures are
expected to implement, with the same signature, then they should be
declared once, and each architecture had better conform to that.

As for the case of kern/lock.h, the inclusion you are looking at says

#if NCPUS > 1
#include <machine/lock.h>/*XXX*/

The XXX is supposed to flag you that the author of that inclusion
thought it was wrong, but didn't want to deal with the wrongness right
away.  A cleanup should not introduce new XXX tags!  


Attachment: signature.asc
Description: This is a digitally signed message part

reply via email to

[Prev in Thread] Current Thread [Next in Thread]