summaryrefslogtreecommitdiff
path: root/sys/arch/mips64
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-11-24 20:59:20 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-11-24 20:59:20 +0000
commitcad87e49786f97d5c91e9a0969873f85eddadbc2 (patch)
tree47e708c160bacfee5cc23be529f1ffcc06d05827 /sys/arch/mips64
parent8c3ee02366a43845c0621c049a68968560f539b8 (diff)
Implement a real pmap_proc_iflush() instead of relying on trap.c to perform
copious cache flushes behind our back.
Diffstat (limited to 'sys/arch/mips64')
-rw-r--r--sys/arch/mips64/include/pmap.h13
-rw-r--r--sys/arch/mips64/mips64/pmap.c21
2 files changed, 22 insertions, 12 deletions
diff --git a/sys/arch/mips64/include/pmap.h b/sys/arch/mips64/include/pmap.h
index f036829d3b3..ba19c5e643d 100644
--- a/sys/arch/mips64/include/pmap.h
+++ b/sys/arch/mips64/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.20 2010/02/02 02:49:57 syuu Exp $ */
+/* $OpenBSD: pmap.h,v 1.21 2010/11/24 20:59:17 miod Exp $ */
/*
* Copyright (c) 1987 Carnegie-Mellon University
@@ -43,12 +43,7 @@
#include <machine/pte.h>
/*
- * The user address space is 2Gb (0x0 - 0x80000000).
- * User programs are laid out in memory as follows:
- * address
- * USRTEXT 0x00400000
- * USRDATA 0x10000000
- * USRSTACK 0x7FFFFFFF
+ * The user address space is currently limited to 2Gb (0x0 - 0x80000000).
*
* The user address space is mapped using a two level structure where
* virtual address bits 30..22 are used to index into a segment table which
@@ -56,9 +51,6 @@
* Bits 21..12 are then used to index a PTE which describes a page within
* a segment.
*
- * The wired entries in the TLB will contain the following:
- * 0-1 (UPAGES) for curproc user struct and kernel stack.
- *
* Note: The kernel doesn't use the same data structures as user programs.
* All the PTE entries are stored in a single array in Sysmap which is
* dynamically allocated at boot time.
@@ -144,7 +136,6 @@ void pmap_set_modify(vm_page_t);
void pmap_page_cache(vm_page_t, int);
#define pmap_collect(x) do { /* nothing */ } while (0)
-#define pmap_proc_iflush(p,va,len) do { /* nothing yet (handled in trap now) */ } while (0)
#define pmap_unuse_final(p) do { /* nothing yet */ } while (0)
#define pmap_remove_holes(map) do { /* nothing */ } while (0)
diff --git a/sys/arch/mips64/mips64/pmap.c b/sys/arch/mips64/mips64/pmap.c
index 84fbcbfb325..fa10067705c 100644
--- a/sys/arch/mips64/mips64/pmap.c
+++ b/sys/arch/mips64/mips64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.49 2010/02/02 02:49:57 syuu Exp $ */
+/* $OpenBSD: pmap.c,v 1.50 2010/11/24 20:59:19 miod Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -1629,3 +1629,22 @@ pmap_pg_free(struct pool *pp, void *item)
Mips_HitInvalidateDCache(curcpu(), va, pa, PAGE_SIZE);
uvm_pagefree(pg);
}
+
+void
+pmap_proc_iflush(struct proc *p, vaddr_t va, vsize_t len)
+{
+#ifdef MULTIPROCESSOR
+ struct pmap *pmap = vm_map_pmap(&p->p_vmspace->vm_map);
+ CPU_INFO_ITERATOR cii;
+ struct cpu_info *ci;
+
+ CPU_INFO_FOREACH(cii, ci) {
+ if (ci->ci_curpmap == pmap) {
+ Mips_InvalidateICache(ci, va, len);
+ break;
+ }
+ }
+#else
+ Mips_InvalidateICache(curcpu(), va, len);
+#endif
+}