Unconditionally set pcb_current_pmap. WIP versions of the code

previously committed cleared pcb_current_pmap prior to changing
the region registers, but that was removed before committing.
Since we don't normally (at all?) pass a NULL pointer, the bug
was mostly harmless. Fix it while I'm here...

I'm here because we need to have data serialization after writing
to the region registers. Not doing so was likely the cause of the
hangs we were experiencing. General exceptions in cpu_switch may
also be caused by the lack of serialization.

Approved by: re (blanket)
This commit is contained in:
Marcel Moolenaar 2003-05-19 06:05:30 +00:00
parent dc0bde0f18
commit a75b99ea2d

View file

@ -2558,8 +2558,9 @@ pmap_switch(pmap_t pm)
(pm->pm_rid[i] << 8)|(PAGE_SHIFT << 2)|1);
}
atomic_set_32(&pm->pm_active, PCPU_GET(cpumask));
PCPU_SET(current_pmap, pm);
}
PCPU_SET(current_pmap, pm);
__asm __volatile("srlz.d");
return (prevpm);
}