diff options
author | 2010-01-03 19:23:49 +0000 | |
---|---|---|
committer | 2010-01-03 19:23:49 +0000 | |
commit | a47641e348df5808c329c84c5f6ccf232db55fc8 (patch) | |
tree | ad15940e1d3d60c875c4b8f9d3911a42776e54fb | |
parent | Use atomic operations to access the per-cpu scheduler flags. (diff) | |
download | wireguard-openbsd-a47641e348df5808c329c84c5f6ccf232db55fc8.tar.xz wireguard-openbsd-a47641e348df5808c329c84c5f6ccf232db55fc8.zip |
Implement pmap_proc_iflush() such that the instruction cache is synchronized
with the data cache when ptrace(2) is used to write into a process' address
space.
ok miod@
-rw-r--r-- | sys/arch/hppa/hppa/pmap.c | 13 | ||||
-rw-r--r-- | sys/arch/hppa/include/pmap.h | 4 |
2 files changed, 14 insertions, 3 deletions
diff --git a/sys/arch/hppa/hppa/pmap.c b/sys/arch/hppa/hppa/pmap.c index 9b282abdd3d..515604f4baa 100644 --- a/sys/arch/hppa/hppa/pmap.c +++ b/sys/arch/hppa/hppa/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.146 2009/11/11 18:09:55 deraadt Exp $ */ +/* $OpenBSD: pmap.c,v 1.147 2010/01/03 19:23:49 kettenis Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -1314,6 +1314,17 @@ pmap_kremove(va, size) DPRINTF(PDB_FOLLOW|PDB_REMOVE, ("pmap_kremove: leaving\n")); } +void +pmap_proc_iflush(struct proc *p, vaddr_t va, vsize_t len) +{ + pmap_t pmap = vm_map_pmap(&p->p_vmspace->vm_map); + + fdcache(pmap->pm_space, va, len); + sync_caches(); + ficache(pmap->pm_space, va, len); + sync_caches(); +} + struct vm_page * pmap_unmap_direct(vaddr_t va) { diff --git a/sys/arch/hppa/include/pmap.h b/sys/arch/hppa/include/pmap.h index bc952b887fb..3b4cf6b521e 100644 --- a/sys/arch/hppa/include/pmap.h +++ b/sys/arch/hppa/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.36 2009/06/11 20:10:51 kettenis Exp $ */ +/* $OpenBSD: pmap.h,v 1.37 2010/01/03 19:23:49 kettenis Exp $ */ /* * Copyright (c) 2002-2004 Michael Shalayeff @@ -111,7 +111,6 @@ struct vm_page *pmap_unmap_direct(vaddr_t); #define pmap_is_referenced(pg) pmap_testbit(pg, PTE_PROT(TLB_REFTRAP)) #define pmap_phys_address(ppn) ((ppn) << PAGE_SHIFT) -#define pmap_proc_iflush(p,va,len) /* nothing */ #define pmap_unuse_final(p) /* nothing */ #define pmap_remove_holes(map) do { /* nothing */ } while (0) @@ -121,6 +120,7 @@ boolean_t pmap_testbit(struct vm_page *, u_int); 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_proc_iflush(struct proc *, vaddr_t, vsize_t); static __inline int pmap_prot(struct pmap *pmap, int prot) |