diff options
-rw-r--r-- | sys/uvm/uvm_amap.c | 45 | ||||
-rw-r--r-- | sys/uvm/uvm_amap.h | 4 |
2 files changed, 2 insertions, 47 deletions
diff --git a/sys/uvm/uvm_amap.c b/sys/uvm/uvm_amap.c index ef8e5058bf1..4983afa169e 100644 --- a/sys/uvm/uvm_amap.c +++ b/sys/uvm/uvm_amap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_amap.c,v 1.59 2015/08/21 16:04:35 visa Exp $ */ +/* $OpenBSD: uvm_amap.c,v 1.60 2016/03/06 14:47:07 stefan Exp $ */ /* $NetBSD: uvm_amap.c,v 1.27 2000/11/25 06:27:59 chs Exp $ */ /* @@ -403,49 +403,6 @@ amap_extend(struct vm_map_entry *entry, vsize_t addsize) } /* - * amap_share_protect: change protection of anons in a shared amap - * - * for shared amaps, given the current data structure layout, it is - * not possible for us to directly locate all maps referencing the - * shared anon (to change the protection). in order to protect data - * in shared maps we use pmap_page_protect(). [this is useful for IPC - * mechanisms like map entry passing that may want to write-protect - * all mappings of a shared amap.] we traverse am_anon or am_slots - * depending on the current state of the amap. - */ -void -amap_share_protect(struct vm_map_entry *entry, vm_prot_t prot) -{ - struct vm_amap *amap = entry->aref.ar_amap; - int slots, lcv, slot, stop; - - AMAP_B2SLOT(slots, (entry->end - entry->start)); - stop = entry->aref.ar_pageoff + slots; - - if (slots < amap->am_nused) { - /* cheaper to traverse am_anon */ - for (lcv = entry->aref.ar_pageoff ; lcv < stop ; lcv++) { - if (amap->am_anon[lcv] == NULL) - continue; - if (amap->am_anon[lcv]->an_page != NULL) - pmap_page_protect(amap->am_anon[lcv]->an_page, - prot); - } - return; - } - - /* cheaper to traverse am_slots */ - for (lcv = 0 ; lcv < amap->am_nused ; lcv++) { - slot = amap->am_slots[lcv]; - if (slot < entry->aref.ar_pageoff || slot >= stop) - continue; - if (amap->am_anon[slot]->an_page != NULL) - pmap_page_protect(amap->am_anon[slot]->an_page, prot); - } - return; -} - -/* * amap_wipeout: wipeout all anon's in an amap; then free the amap! * * => called from amap_unref when the final reference to an amap is diff --git a/sys/uvm/uvm_amap.h b/sys/uvm/uvm_amap.h index e10e73538dd..333aa49eb35 100644 --- a/sys/uvm/uvm_amap.h +++ b/sys/uvm/uvm_amap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_amap.h,v 1.20 2014/07/11 16:35:40 jsg Exp $ */ +/* $OpenBSD: uvm_amap.h,v 1.21 2016/03/06 14:47:07 stefan Exp $ */ /* $NetBSD: uvm_amap.h,v 1.14 2001/02/18 21:19:08 chs Exp $ */ /* @@ -88,8 +88,6 @@ void amap_lookups(struct vm_aref *, vaddr_t, struct vm_anon **, int); void amap_ref(struct vm_amap *, vaddr_t, vsize_t, int); /* get number of references of amap */ int amap_refs(struct vm_amap *); - /* protect pages in a shared amap */ -void amap_share_protect(vm_map_entry_t, vm_prot_t); /* split reference to amap into two */ void amap_splitref(struct vm_aref *, struct vm_aref *, vaddr_t); /* remove an anon from an amap */ |