Make pmap_activate() take a struct proc *.
This commit is contained in:
parent
c162e92a71
commit
a6f228e498
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pmap.c,v 1.15 1997/10/14 11:31:30 mark Exp $ */
|
||||
/* $NetBSD: pmap.c,v 1.16 1998/01/02 22:36:33 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994-1997 Mark Brinicombe.
|
||||
@ -1173,27 +1173,46 @@ pmap_pageable(pmap, sva, eva, pageable)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Activate the address space for the specified process. If the process
|
||||
* is the current process, load the new MMU context.
|
||||
*/
|
||||
void
|
||||
pmap_activate(pmap, pcbp)
|
||||
pmap_t pmap;
|
||||
struct pcb *pcbp;
|
||||
pmap_activate(p)
|
||||
struct proc *p;
|
||||
{
|
||||
if (pmap != NULL) {
|
||||
pcbp->pcb_pagedir = (pd_entry_t *)pmap_extract(kernel_pmap,
|
||||
(vm_offset_t)pmap->pm_pdir);
|
||||
#ifdef PMAP_DEBUG
|
||||
if (pmap_debug_level >= 0)
|
||||
printf("pmap_activate: pmap=%p pcb=%p pdir=%p l1=%p\n",
|
||||
pmap, pcbp, pmap->pm_pdir,
|
||||
pcbp->pcb_pagedir);
|
||||
#endif /* PMAP_DEBUG */
|
||||
pmap_t pmap = p->p_vmspace->vm_map.pmap;
|
||||
struct pcb *pcb = &p->p_addr->u_pcb;
|
||||
|
||||
if (pmap == curproc->p_vmspace->vm_map.pmap) {
|
||||
printf("pmap: Setting TTB\n");
|
||||
setttb((u_int)pcbp->pcb_pagedir);
|
||||
}
|
||||
/* pmap->pm_pdchanged = FALSE;*/
|
||||
pcb->pcb_pagedir = (pd_entry_t *)pmap_extract(kernel_pmap,
|
||||
(vm_offset_t)pmap->pm_pdir);
|
||||
|
||||
#ifdef PMAP_DEBUG
|
||||
if (pmap_debug_level >= 0)
|
||||
printf("pmap_activate: p=%p pmap=%p pcb=%p pdir=%p l1=%p\n",
|
||||
p, pmap, pcb, pmap->pm_pdir, pcb->pcb_pagedir);
|
||||
#endif
|
||||
|
||||
if (p == curproc) {
|
||||
#if PMAP_DEBUG
|
||||
if (pmap_debug_level >= 0)
|
||||
printf("pmap_activate: setting TTB\n");
|
||||
#endif
|
||||
setttb((u_int)pcb->pcb_pagedir);
|
||||
}
|
||||
#if 0
|
||||
pmap->pm_pdchanged = FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Deactivate the address space of the specified process.
|
||||
*/
|
||||
void
|
||||
pmap_deactivate(p)
|
||||
struct proc *p;
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vm_machdep.c,v 1.16 1997/10/14 11:23:54 mark Exp $ */
|
||||
/* $NetBSD: vm_machdep.c,v 1.17 1998/01/02 22:36:34 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994-1997 Mark Brinicombe.
|
||||
@ -87,7 +87,6 @@ int process_read_fpregs __P((struct proc *p, struct fpreg *regs));
|
||||
|
||||
void switch_exit __P((struct proc *p, struct proc *proc0));
|
||||
int savectx __P((struct pcb *pcb));
|
||||
void pmap_activate __P((pmap_t pmap, struct pcb *pcbp));
|
||||
extern void proc_trampoline __P(());
|
||||
extern void child_return __P(());
|
||||
|
||||
@ -245,7 +244,7 @@ cpu_fork(p1, p2)
|
||||
pmap_enter(p2->p_vmspace->vm_map.pmap, 0,
|
||||
systempage.physical, VM_PROT_READ, TRUE);
|
||||
|
||||
pmap_activate(p2->p_vmspace->vm_map.pmap, &up->u_pcb);
|
||||
pmap_activate(p2);
|
||||
|
||||
#ifdef ARMFPE
|
||||
/* Initialise a new FP context for p2 and copy the context from p1 */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pmap.h,v 1.8 1997/10/14 09:20:26 mark Exp $ */
|
||||
/* $NetBSD: pmap.h,v 1.9 1998/01/02 22:36:35 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994,1995 Mark Brinicombe.
|
||||
@ -133,6 +133,9 @@ extern struct pmap kernel_pmap_store;
|
||||
boolean_t pmap_testbit __P((vm_offset_t, int));
|
||||
void pmap_changebit __P((vm_offset_t, int, int));
|
||||
|
||||
void pmap_activate __P((struct proc *));
|
||||
void pmap_deactivate __P((struct proc *));
|
||||
|
||||
static __inline vm_offset_t
|
||||
pmap_phys_address(int ppn)
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pmap.h,v 1.16 1997/07/09 19:27:54 matthias Exp $ */
|
||||
/* $NetBSD: pmap.h,v 1.17 1998/01/02 22:43:31 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
|
||||
@ -155,8 +155,9 @@ struct pv_entry *pv_table; /* array of entries, one per page */
|
||||
#define pmap_resident_count(pmap) ((pmap)->pm_stats.resident_count)
|
||||
#define pmap_update() tlbflush()
|
||||
|
||||
struct pcb;
|
||||
void pmap_activate __P((pmap_t, struct pcb *));
|
||||
struct proc;
|
||||
void pmap_activate __P((struct proc *));
|
||||
void pmap_deactivate __P((struct proc *));
|
||||
void pmap_bootstrap __P((vm_offset_t start));
|
||||
pt_entry_t *pmap_pte __P((pmap_t, vm_offset_t));
|
||||
boolean_t pmap_testbit __P((vm_offset_t, int));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pmap.c,v 1.21 1997/09/19 13:55:06 leo Exp $ */
|
||||
/* $NetBSD: pmap.c,v 1.22 1998/01/02 22:43:29 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved.
|
||||
@ -188,7 +188,6 @@ void ns532_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
|
||||
@ -733,21 +732,26 @@ pmap_reference(pmap)
|
||||
simple_unlock(&pmap->pm_lock);
|
||||
}
|
||||
|
||||
/*
|
||||
* Activate the specified address space of the specified process.
|
||||
* If the process is the current process, load the MMU context.
|
||||
*/
|
||||
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_ptb =
|
||||
pmap_extract(pmap_kernel(), (vm_offset_t)pmap->pm_pdir);
|
||||
if (pmap == curproc->p_vmspace->vm_map.pmap)
|
||||
load_ptb(pcb->pcb_ptb);
|
||||
pmap->pm_pdchanged = FALSE;
|
||||
}
|
||||
pcb->pcb_ptb = pmap_extract(pmap_kernel(), (vm_offset_t)pmap->pm_pdir);
|
||||
if (p == curproc)
|
||||
load_ptb(pcb->pcb_ptb);
|
||||
pmap->pm_pdchanged = FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Deactivate the address space of the specified process.
|
||||
*/
|
||||
void
|
||||
pmap_deactivate(pmap, pcb)
|
||||
pmap_t pmap;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vm_machdep.c,v 1.20 1997/07/09 19:26:37 matthias Exp $ */
|
||||
/* $NetBSD: vm_machdep.c,v 1.21 1998/01/02 22:43:30 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 Matthias Pfaller.
|
||||
@ -85,7 +85,7 @@ cpu_fork(p1, p2)
|
||||
/* If p1 is holding the FPU, update the FPU context of p2. */
|
||||
if (fpu_proc == p1)
|
||||
save_fpu_context(pcb);
|
||||
pmap_activate(p2->p_vmspace->vm_map.pmap, pcb);
|
||||
pmap_activate(p2);
|
||||
|
||||
/*
|
||||
* Copy the syscframe, and arrange for the child to return directly
|
||||
|
Loading…
Reference in New Issue
Block a user