On Wed, Nov 16, 2022 at 07:00:23AM -0600, Scott Cheloha wrote:
> On Mon, Nov 14, 2022 at 05:19:17PM +0000, Visa Hankala wrote:
> > I think this clockintr_init() should be in cp0_startclock(). This would
> > let other clock drivers do their own adjusting of the hz variables
> > before clockintr initialization. With this fixed,
> 
> Is the attached the change you envisioned?

Yes, but please remove the #ifdef MULTIPROCESSOR line and its #endif
from cp0_startclock(). The #ifdef'ing is redundant because
CPU_IS_PRIMARY() is short-circuited to value 1 in non-MULTIPROCESSOR
builds and the else branch does not use any MULTIPROCESSOR-only items.

        if (CPU_IS_PRIMARY(ci)) {
                stathz = hz;
                profhz = stathz * 10;
                clockintr_init(CL_RNDSTAT);
        } else {
                s = splhigh();
                nanouptime(&ci->ci_schedstate.spc_runtime);
                splx(s);

                /* try to avoid getting clock interrupts early */
                cp0_set_compare(cp0_get_count() - 1);

                cp0_calibrate(ci);
        }

With the above tweak,

OK visa@

Reply via email to