tech-kern archive

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

Re: GNU vs C99 extern inline



On Tue, 19 Apr 2011, David Young wrote:

> > 2. kern/kern_sleepq.c:sleepq_insert()
> >
> >  The only place this is called aside from that file is compat_sa.c so its
> >  probably a gross invasion of the API.
>
> Probably a gross invasion.

considering what to do about this one, I thought to make it static inline
and provide the gross invasion as a compat_sa_sleepq_insert() function
(which effectively changes only the externally visible symbol), eg

static inline sleepq_insert()
{
}

/* do not use this function, it will be removed */
void compat_sa_sleepq_insert()
{
        sleepq_insert();
}

which can then be removed when compat_sa is retired.. ?

> > 3. arch/x86/x86/pmap.c:pmap_reference()
> >
> >  this is the only arch with pmap_reference() function marked inline in
> >  this way. If it is really performance critical then it could be defined
> >  in x86/include/pmap.h directly so that uvm also gains from it
>
> How about making it static inline in the header file?

cannot be static - pmap_reference is declared in a MI way (when not a
macro) in uvm/uvm_pmap.h, then defined in arch specific code. So, it can
be non-inline or a macro but static inline is difficult. Since
pmap_reference on x86 is now just an atomic_inc_uint I proposed (on
port-i386/port-amd64[1]) that it be #defined to that in x86/include/pmap.h

iain

[1] http://mail-index.netbsd.org/port-i386/2011/04/19/msg002384.html


Home | Main Index | Thread Index | Old Index