summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorart <art@openbsd.org>1999-04-22 17:07:29 +0000
committerart <art@openbsd.org>1999-04-22 17:07:29 +0000
commit739ec3749532a50ac8e1139bbf6f6e30c6a91095 (patch)
treef6fd6bd7919d5d10b3be99fc9d470ac29f40580f
parentprotect from multiple include (diff)
downloadwireguard-openbsd-739ec3749532a50ac8e1139bbf6f6e30c6a91095.tar.xz
wireguard-openbsd-739ec3749532a50ac8e1139bbf6f6e30c6a91095.zip
implement pmap_{,de}activate
-rw-r--r--sys/arch/sparc/include/pmap.h5
-rw-r--r--sys/arch/sparc/sparc/pmap.c41
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!).