diff options
-rw-r--r-- | sys/arch/m88k/include/pmap.h | 9 | ||||
-rw-r--r-- | sys/arch/m88k/m88k/pmap.c | 25 |
2 files changed, 28 insertions, 6 deletions
diff --git a/sys/arch/m88k/include/pmap.h b/sys/arch/m88k/include/pmap.h index a4c5e8bb3b7..695dbd14fdb 100644 --- a/sys/arch/m88k/include/pmap.h +++ b/sys/arch/m88k/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.1 2004/07/25 11:06:42 miod Exp $ */ +/* $OpenBSD: pmap.h,v 1.2 2004/07/26 11:08:19 miod Exp $ */ /* * Mach Operating System * Copyright (c) 1991 Carnegie Mellon University @@ -68,10 +68,9 @@ extern caddr_t vmmap; #define pmap_clear_modify(pg) pmap_unsetbit(pg, PG_M) #define pmap_clear_reference(pg) pmap_unsetbit(pg, PG_U) -#define pmap_proc_iflush(p,va,len) do { /* nothing */ } while (0) - -void pmap_bootstrap(vaddr_t); -void pmap_cache_ctrl(pmap_t, vaddr_t, vaddr_t, u_int); +void pmap_bootstrap(vaddr_t); +void pmap_cache_ctrl(pmap_t, vaddr_t, vaddr_t, u_int); +void pmap_proc_iflush(struct proc *, vaddr_t, vsize_t); boolean_t pmap_unsetbit(struct vm_page *, int); #endif /* _KERNEL */ diff --git a/sys/arch/m88k/m88k/pmap.c b/sys/arch/m88k/m88k/pmap.c index 6ebc8a2ae86..f3095b8aa5b 100644 --- a/sys/arch/m88k/m88k/pmap.c +++ b/sys/arch/m88k/m88k/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.1 2004/07/25 11:06:42 miod Exp $ */ +/* $OpenBSD: pmap.c,v 1.2 2004/07/26 11:08:20 miod Exp $ */ /* * Copyright (c) 2001-2004, Miodrag Vallat * Copyright (c) 1998-2001 Steve Murphree, Jr. @@ -2678,3 +2678,26 @@ pmap_kremove(vaddr_t va, vsize_t len) } PMAP_UNLOCK(map, spl); } + +void +pmap_proc_iflush(struct proc *p, vaddr_t va, vsize_t len) +{ + pmap_t pmap = vm_map_pmap(&p->p_vmspace->vm_map); + vaddr_t eva; + paddr_t pa; + u_int cpu, users; + + eva = round_page(va + len); + va = trunc_page(va); + + while (va < eva) { + if (pmap_extract(pmap, va, &pa)) { + users = pmap->pm_cpus; + while ((cpu = ff1(users)) != 32) { + cmmu_flush_inst_cache(cpu, pa, PAGE_SIZE); + users &= ~(1 << cpu); + } + } + va += PAGE_SIZE; + } +} |