Make pmap_{,de}activate() take a pointer to a proc.

This commit is contained in:
thorpej 1997-11-04 01:37:01 +00:00
parent 87d5df18e3
commit 15339d7ea8
3 changed files with 27 additions and 19 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.44 1997/09/19 13:54:17 leo Exp $ */
/* $NetBSD: pmap.c,v 1.45 1997/11/04 01:37:01 thorpej Exp $ */
/*
* Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved.
@ -188,7 +188,6 @@ void i386_protection_init __P((void));
void pmap_collect_pv __P((void));
__inline void pmap_remove_pv __P((pmap_t, vm_offset_t, u_int));
__inline void pmap_enter_pv __P((pmap_t, vm_offset_t, u_int));
void pmap_deactivate __P((pmap_t, struct pcb *));
void pmap_remove_all __P((vm_offset_t));
#ifdef NKPDE
@ -711,25 +710,32 @@ pmap_reference(pmap)
simple_unlock(&pmap->pm_lock);
}
/*
* pmap_activate:
*
* Mark that a processor is about to be used by a given pmap.
*/
void
pmap_activate(pmap, pcb)
pmap_t pmap;
struct pcb *pcb;
pmap_activate(p)
struct proc *p;
{
struct pcb *pcb = &p->p_addr->u_pcb;
pmap_t pmap = p->p_vmspace->vm_map.pmap;
if (pmap /*&& pmap->pm_pdchanged */) {
pcb->pcb_cr3 =
pmap_extract(pmap_kernel(), (vm_offset_t)pmap->pm_pdir);
if (pmap == curproc->p_vmspace->vm_map.pmap)
lcr3(pcb->pcb_cr3);
pmap->pm_pdchanged = FALSE;
}
pcb->pcb_cr3 = pmap_extract(pmap_kernel(), (vm_offset_t)pmap->pm_pdir);
if (p == curproc)
lcr3(pcb->pcb_cr3);
pmap->pm_pdchanged = FALSE;
}
/*
* pmap_deactivate:
*
* Mark that a processor is no longer used by a given pmap.
*/
void
pmap_deactivate(pmap, pcb)
pmap_t pmap;
struct pcb *pcb;
pmap_deactivate(p)
struct proc *p;
{
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.64 1997/06/12 23:57:29 thorpej Exp $ */
/* $NetBSD: vm_machdep.c,v 1.65 1997/11/04 01:37:04 thorpej Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
@ -106,7 +106,7 @@ cpu_fork(p1, p2)
/* Sync curpcb (which is presumably p1's PCB) and copy it to p2. */
savectx(curpcb);
*pcb = p1->p_addr->u_pcb;
pmap_activate(p2->p_vmspace->vm_map.pmap, pcb);
pmap_activate(p2);
/*
* Preset these so that gdt_compact() doesn't get confused if called

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.h,v 1.27 1997/10/20 00:45:03 fvdl Exp $ */
/* $NetBSD: pmap.h,v 1.28 1997/11/04 01:37:06 thorpej Exp $ */
/*
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
@ -200,7 +200,9 @@ pmap_phys_address(int ppn)
return i386_ptob(ppn);
}
void pmap_activate __P((pmap_t, struct pcb *));
struct proc;
void pmap_activate __P((struct proc *));
void pmap_deactivate __P((struct proc *));
#endif /* _KERNEL */