From ef7ea2cdf4c9a16817b29059735c2b46b1f8e337 Mon Sep 17 00:00:00 2001 From: skrll Date: Fri, 23 Dec 2011 16:35:00 +0000 Subject: [PATCH] Define PMAP_NEED_PROCWR and provide pmap_procwr so that the i-cache is synchronised with the d-cache appropriately. --- sys/arch/hppa/hppa/pmap.c | 16 ++++++++++++++-- sys/arch/hppa/include/pmap.h | 6 +++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/sys/arch/hppa/hppa/pmap.c b/sys/arch/hppa/hppa/pmap.c index 06bb6b813467..d1df3a6bb99f 100644 --- a/sys/arch/hppa/hppa/pmap.c +++ b/sys/arch/hppa/hppa/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.83 2011/12/16 12:45:04 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.84 2011/12/23 16:35:00 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.83 2011/12/16 12:45:04 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.84 2011/12/23 16:35:00 skrll Exp $"); #include "opt_cputype.h" @@ -1587,6 +1587,18 @@ pmap_activate(struct lwp *l) mtctl(pmap->pm_pid, CR_PIDR2); } +void +pmap_procwr(struct proc *p, vaddr_t va, size_t len) +{ + pmap_t pmap = p->p_vmspace->vm_map.pmap; + + fdcache(pmap->pm_space, va, len); + sync_caches(); + ficache(pmap->pm_space, va, len); + sync_caches(); + +} + static inline void pmap_flush_page(struct vm_page *pg, bool purge) { diff --git a/sys/arch/hppa/include/pmap.h b/sys/arch/hppa/include/pmap.h index 00518b65b4d8..2345fda49e92 100644 --- a/sys/arch/hppa/include/pmap.h +++ b/sys/arch/hppa/include/pmap.h @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.32 2011/12/16 13:38:44 skrll Exp $ */ +/* $NetBSD: pmap.h,v 1.33 2011/12/23 16:35:00 skrll Exp $ */ /* $OpenBSD: pmap.h,v 1.35 2007/12/14 18:32:23 deraadt Exp $ */ @@ -48,6 +48,8 @@ #ifdef _KERNEL +#define PMAP_NEED_PROCWR + struct pmap { struct uvm_object pm_obj; /* object (lck by object lock) */ #define pm_lock pm_obj.vmobjlock @@ -148,6 +150,8 @@ void pmap_write_protect(struct pmap *, vaddr_t, vaddr_t, vm_prot_t); void pmap_remove(struct pmap *pmap, vaddr_t sva, vaddr_t eva); void pmap_page_remove(struct vm_page *pg); +void pmap_procwr(struct proc *, vaddr_t, size_t); + static inline void pmap_deactivate(struct lwp *l) {