diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 1999-04-22 17:07:31 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 1999-04-22 17:07:31 +0000 |
commit | 9a4edc2bcac9a1022d5e1bd911af78018a791da4 (patch) | |
tree | 0c932414ad18bc8e4d59fa580674ae1ce6ac7dde /sys | |
parent | 6aa06f941e20c3272dccbae1fa937ea4ca759be7 (diff) |
implement pmap_{,de}activate
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/sparc/include/pmap.h | 5 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/pmap.c | 41 |
2 files changed, 44 insertions, 2 deletions
diff --git a/sys/arch/sparc/include/pmap.h b/sys/arch/sparc/include/pmap.h index a96e5fc48f6..550d6e9aa1a 100644 --- a/sys/arch/sparc/include/pmap.h +++ b/sys/arch/sparc/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.7 1997/11/07 08:11:41 deraadt Exp $ */ +/* $OpenBSD: pmap.h,v 1.8 1999/04/22 17:07:29 art Exp $ */ /* $NetBSD: pmap.h,v 1.30 1997/08/04 20:00:47 pk Exp $ */ /* @@ -246,6 +246,9 @@ int pmap_dumpmmu __P((int (*)__P((dev_t, daddr_t, caddr_t, size_t)), /* FUNCTION DECLARATIONS FOR COMMON PMAP MODULE */ +struct proc; +void pmap_activate __P((struct proc *)); +void pmap_deactivate __P((struct proc *)); void pmap_bootstrap __P((int nmmu, int nctx, int nregion)); int pmap_count_ptes __P((struct pmap *)); void pmap_prefer __P((vm_offset_t, vm_offset_t *)); diff --git a/sys/arch/sparc/sparc/pmap.c b/sys/arch/sparc/sparc/pmap.c index 8ccd5f9dea9..950e498ea3a 100644 --- a/sys/arch/sparc/sparc/pmap.c +++ b/sys/arch/sparc/sparc/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.23 1999/01/11 05:11:59 millert Exp $ */ +/* $OpenBSD: pmap.c,v 1.24 1999/04/22 17:07:30 art Exp $ */ /* $NetBSD: pmap.c,v 1.118 1998/05/19 19:00:18 thorpej Exp $ */ /* @@ -6399,6 +6399,45 @@ pmap_redzone() #endif } +/* + * Activate the address space for the specified process. If the + * process is the current process, load the new MMU context. + */ +void +pmap_activate(p) + struct proc *p; +{ + pmap_t pmap = p->p_vmspace->vm_map.pmap; + int s; + + /* + * This is essentially the same thing that happens in cpu_switch() + * when the newly selected process is about to run, except that we + * have to make sure to clean the register windows before we set + * the new context. + */ + + s = splpmap(); + if (p == curproc) { + write_user_windows(); + if (pmap->pm_ctx == NULL) { + ctx_alloc(pmap); /* performs setcontext() */ + } else { + setcontext(pmap->pm_ctxnum); + } + } + splx(s); +} + +/* + * Deactivate the address space of the specified process. + */ +void +pmap_deactivate(p) + struct proc *p; +{ +} + #ifdef DEBUG /* * Check consistency of a pmap (time consuming!). |