Subject: Re: changing the spinlockmgr() "not used" case
To: Alfred Perlstein <bright@mu.org>
From: Jason R Thorpe <thorpej@wasabisystems.com>
List: tech-kern
Date: 10/17/2001 11:25:38
On Wed, Oct 17, 2001 at 01:15:33PM -0500, Alfred Perlstein wrote:
> > #define spinlockmgr(lkp, flags, intrlk) (0)
> >
> > Using
> >
> > (void)spinlockmgr(args, ...)
> >
> > quells the warning, but I don't want to have to use the (void) prefix
> > (and not for reasons that started another ... "discussion" recently).
> >
> > Is there any other ways around this?
>
> Remove the (0).
No ... because spinlockmgr() is not a "void" function -- it returns a
value.
> Honestly this worries me, the point of a spinlock may be to protect
> a reasource accessed at interrupt time, traditionally kernel spinlocks
> either implicitly mask all interrupts, or take an interrupt mask
> to block (possibly an empty mask if there's no driver interaction).
The NetBSD locking API needs some work -- those of us responsible for
fixing it are well aware of the problems...
Also note that "spinlockmgr" is for read/write spinlocks, not
simple mutexes.
--
-- Jason R. Thorpe <thorpej@wasabisystems.com>