-/* $OpenBSD: pmap.c,v 1.170 2014/12/15 02:24:22 guenther Exp $ */
+/* $OpenBSD: pmap.c,v 1.171 2014/12/17 06:05:52 deraadt Exp $ */
/* $NetBSD: pmap.c,v 1.118 1998/05/19 19:00:18 thorpej Exp $ */
/*
} while (--i > 0);
/* update segment tables */
- simple_lock(&pm->pm_lock); /* what if other cpu takes mmuentry ?? */
if (CTX_USABLE(pm,rp))
setsegmap(VSTOVA(me->me_vreg,me->me_vseg), seginval);
sp->sg_pmeg = seginval;
/* off old pmap chain */
TAILQ_REMOVE(&pm->pm_seglist, me, me_pmchain);
- simple_unlock(&pm->pm_lock);
setcontext4(ctx); /* done with old context */
/* onto new pmap chain; new pmap is already locked, if needed */
}
/* update region tables */
- simple_lock(&pm->pm_lock); /* what if other cpu takes mmuentry ?? */
if (pm->pm_ctx)
setregmap(VRTOVA(me->me_vreg), reginval);
rp->rg_smeg = reginval;
/* off old pmap chain */
TAILQ_REMOVE(&pm->pm_reglist, me, me_pmchain);
- simple_unlock(&pm->pm_lock);
setcontext4(ctx); /* done with old context */
/* onto new pmap chain; new pmap is already locked, if needed */
* Initialize the kernel pmap.
*/
/* kernel_pmap_store.pm_ctxnum = 0; */
- simple_lock_init(&kernel_pmap_store.pm_lock);
kernel_pmap_store.pm_refcount = 1;
#if defined(SUN4_MMU3L)
TAILQ_INIT(&kernel_pmap_store.pm_reglist);
* Initialize the kernel pmap.
*/
/* kernel_pmap_store.pm_ctxnum = 0; */
- simple_lock_init(&kernel_pmap_store.pm_lock);
kernel_pmap_store.pm_refcount = 1;
/*
pm->pm_regstore = urp = malloc(size, M_VMPMAP, M_WAITOK);
qzero((caddr_t)urp, size);
/* pm->pm_ctx = NULL; */
- simple_lock_init(&pm->pm_lock);
pm->pm_refcount = 1;
pm->pm_regmap = urp;
if (pmapdebug & PDB_DESTROY)
printf("pmap_destroy(%p)\n", pm);
#endif
- simple_lock(&pm->pm_lock);
count = --pm->pm_refcount;
- simple_unlock(&pm->pm_lock);
if (count == 0) {
pmap_release(pm);
free(pm, M_VMPMAP, 0);
pmap_reference(pm)
struct pmap *pm;
{
-
- if (pm != NULL) {
- simple_lock(&pm->pm_lock);
+ if (pm != NULL)
pm->pm_refcount++;
- simple_unlock(&pm->pm_lock);
- }
}
/*
ctx = getcontext();
s = splvm(); /* XXX conservative */
- simple_lock(&pm->pm_lock);
for (; va < endva; va = nva) {
/* do one virtual segment at a time */
vr = VA_VREG(va);
if (pm->pm_regmap[vr].rg_nsegmap != 0)
(*rm)(pm, va, nva, vr, vs);
}
- simple_unlock(&pm->pm_lock);
splx(s);
setcontext(ctx);
}
ctx = getcontext();
s = splvm(); /* XXX conservative */
- simple_lock(pm->pm_lock);
for (; va < endva; va = nva) {
/* do one virtual segment at a time */
pmap_rmk(pm, va, nva, vr, vs);
}
- simple_unlock(pm->pm_lock);
splx(s);
setcontext(ctx);
}
write_user_windows();
ctx = getcontext4();
s = splvm();
- simple_lock(&pm->pm_lock);
for (va = sva; va < eva;) {
vr = VA_VREG(va);
}
}
}
- simple_unlock(&pm->pm_lock);
splx(s);
setcontext4(ctx);
}
write_user_windows();
ctx = getcontext4m();
s = splvm();
- simple_lock(&pm->pm_lock);
for (va = sva; va < eva;) {
vr = VA_VREG(va);
setpgt4m(&sp->sg_pte[VA_SUN4M_VPG(va)], npte);
}
}
- simple_unlock(&pm->pm_lock);
splx(s);
setcontext4m(ctx);
}