s = splvm();
s = splpmap();
pmap_remove(pm, va, endva)	struct pmap *pm;	vaddr_t va, endva;{	vaddr_t nva;	int vr, vs, s, ctx;	void (*rm)(struct pmap *, vaddr_t, vaddr_t, int, int);	if (pm == NULL)		return;#ifdef DEBUG	if (pmapdebug & PDB_REMOVE)		printf("pmap_remove(%p, 0x%lx, 0x%lx)\n", pm, va, endva);#endif	if (pm == pmap_kernel()) {		/*		 * Removing from kernel address space.		 */		rm = pmap_rmk;	} else {		/*		 * Removing from user address space.		 */		write_user_windows();		rm = pmap_rmu;	}	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);		vs = VA_VSEG(va);		nva = VSTOVA(vr, vs + 1);		if (nva == 0 || nva > endva)			nva = endva;		if (pm->pm_regmap[vr].rg_nsegmap != 0)			(*rm)(pm, va, nva, vr, vs);	}	simple_unlock(&pm->pm_lock);	splx(s);	setcontext(ctx);}