On Sun, Mar 15, 2020 at 11:38:03AM +1100, matthew green wrote:
> "Andrew Doran" writes:
> > Module Name:        src
> > Committed By:       ad
> > Date:               Sat Mar 14 13:34:44 UTC 2020
> > 
> > Modified Files:
> >     src/sys/arch/sparc/sparc: intr.c
> > 
> > Log Message:
> > sparc cpu_intr_p(): try to work around l_cpu not being set early on by
> > using curcpu().
> 
> ah, good idea.  this will involve one fewer deref, curcpu()
> is mapped at a fixed address, so it might even be faster now
> than it used to be.

Oh, hm..  Given that it's a fixed address is there a way the compiler can
screw this up in the face of a kernel preemption (theoretical right now for
sparc*)?  I don't think so..  None of the fanciness is required then.

bool
cpu_intr_p(void)
{

        return curcpu()->ci_idepth != 0;
}

Andrew

Reply via email to