diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-12-19 08:58:08 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-12-19 08:58:08 +0000 |
commit | d8afae924f4db99650aa0df115c6ae66ed02b950 (patch) | |
tree | a2cbc045f0eb624a394f8e45fea1a58ecf1faaf0 /sys/uvm/uvm_amap.c | |
parent | 4a6c79ff4f05aaae32458104529a9a9e0d3d208b (diff) |
UBC was a disaster. It worked very good when it worked, but on some
machines or some configurations or in some phase of the moon (we actually
don't know when or why) files disappeared. Since we've not been able to
track down the problem in two weeks intense debugging and we need -current
to be stable, back out everything to a state it had before UBC.
We apologise for the inconvenience.
Diffstat (limited to 'sys/uvm/uvm_amap.c')
-rw-r--r-- | sys/uvm/uvm_amap.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/sys/uvm/uvm_amap.c b/sys/uvm/uvm_amap.c index a8a1a527367..29263bf7d60 100644 --- a/sys/uvm/uvm_amap.c +++ b/sys/uvm/uvm_amap.c @@ -1,5 +1,5 @@ -/* $OpenBSD: uvm_amap.c,v 1.17 2001/12/04 23:22:42 art Exp $ */ -/* $NetBSD: uvm_amap.c,v 1.33 2001/07/22 13:34:12 wiz Exp $ */ +/* $OpenBSD: uvm_amap.c,v 1.18 2001/12/19 08:58:07 art Exp $ */ +/* $NetBSD: uvm_amap.c,v 1.30 2001/02/18 21:19:09 chs Exp $ */ /* * @@ -101,7 +101,7 @@ static struct vm_amap *amap_alloc1 __P((int, int, int)); * chunk. note that the "plus one" part is needed because a reference * count of zero is neither positive or negative (need a way to tell * if we've got one zero or a bunch of them). - * + * * here are some in-line functions to help us. */ @@ -157,7 +157,7 @@ amap_init() * Initialize the vm_amap pool. */ pool_init(&uvm_amap_pool, sizeof(struct vm_amap), 0, 0, 0, - "amappl", 0, pool_page_alloc_nointr, pool_page_free_nointr, + "amappl", 0, pool_page_alloc_nointr, pool_page_free_nointr, M_UVMAMAP); } @@ -283,7 +283,7 @@ amap_free(amap) */ void amap_extend(entry, addsize) - struct vm_map_entry *entry; + vm_map_entry_t entry; vsize_t addsize; { struct vm_amap *amap = entry->aref.ar_amap; @@ -324,7 +324,7 @@ amap_extend(entry, addsize) } #endif amap_unlock(amap); - UVMHIST_LOG(maphist,"<- done (case 1), amap = 0x%x, sltneed=%d", + UVMHIST_LOG(maphist,"<- done (case 1), amap = 0x%x, sltneed=%d", amap, slotneed, 0, 0); return; /* done! */ } @@ -337,10 +337,10 @@ amap_extend(entry, addsize) #ifdef UVM_AMAP_PPREF if (amap->am_ppref && amap->am_ppref != PPREF_NONE) { if ((slotoff + slotmapped) < amap->am_nslot) - amap_pp_adjref(amap, slotoff + slotmapped, + amap_pp_adjref(amap, slotoff + slotmapped, (amap->am_nslot - (slotoff + slotmapped)), 1); - pp_setreflen(amap->am_ppref, amap->am_nslot, 1, + pp_setreflen(amap->am_ppref, amap->am_nslot, 1, slotneed - amap->am_nslot); } #endif @@ -350,7 +350,7 @@ amap_extend(entry, addsize) * no need to zero am_anon since that was done at * alloc time and we never shrink an allocation. */ - UVMHIST_LOG(maphist,"<- done (case 2), amap = 0x%x, slotneed=%d", + UVMHIST_LOG(maphist,"<- done (case 2), amap = 0x%x, slotneed=%d", amap, slotneed, 0, 0); return; } @@ -359,7 +359,7 @@ amap_extend(entry, addsize) * case 3: we need to malloc a new amap and copy all the amap * data over from old amap to the new one. * - * XXXCDC: could we take advantage of a kernel realloc()? + * XXXCDC: could we take advantage of a kernel realloc()? */ amap_unlock(amap); /* unlock in case we sleep in malloc */ @@ -412,7 +412,7 @@ amap_extend(entry, addsize) memset(newppref + amap->am_nslot, 0, sizeof(int) * slotadded); amap->am_ppref = newppref; if ((slotoff + slotmapped) < amap->am_nslot) - amap_pp_adjref(amap, slotoff + slotmapped, + amap_pp_adjref(amap, slotoff + slotmapped, (amap->am_nslot - (slotoff + slotmapped)), 1); pp_setreflen(newppref, amap->am_nslot, 1, slotadded); } @@ -433,7 +433,7 @@ amap_extend(entry, addsize) if (oldppref && oldppref != PPREF_NONE) free(oldppref, M_UVMAMAP); #endif - UVMHIST_LOG(maphist,"<- done (case 3), amap = 0x%x, slotneed=%d", + UVMHIST_LOG(maphist,"<- done (case 3), amap = 0x%x, slotneed=%d", amap, slotneed, 0, 0); } @@ -452,7 +452,7 @@ amap_extend(entry, addsize) */ void amap_share_protect(entry, prot) - struct vm_map_entry *entry; + vm_map_entry_t entry; vm_prot_t prot; { struct vm_amap *amap = entry->aref.ar_amap; @@ -489,7 +489,7 @@ amap_share_protect(entry, prot) /* * 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 + * => called from amap_unref when the final reference to an amap is * discarded (i.e. when reference count == 1) * => the amap should be locked (by the caller) */ @@ -511,12 +511,12 @@ amap_wipeout(amap) slot = amap->am_slots[lcv]; anon = amap->am_anon[slot]; - if (anon == NULL || anon->an_ref == 0) + if (anon == NULL || anon->an_ref == 0) panic("amap_wipeout: corrupt amap"); simple_lock(&anon->an_lock); /* lock anon */ - UVMHIST_LOG(maphist," processing anon 0x%x, ref=%d", anon, + UVMHIST_LOG(maphist," processing anon 0x%x, ref=%d", anon, anon->an_ref, 0, 0); refs = --anon->an_ref; @@ -542,7 +542,7 @@ amap_wipeout(amap) /* * amap_copy: ensure that a map entry's "needs_copy" flag is false * by copying the amap if necessary. - * + * * => an entry with a null amap pointer will get a new (blank) one. * => the map that the map entry belongs to must be locked by caller. * => the amap currently attached to "entry" (if any) must be unlocked. @@ -555,8 +555,8 @@ amap_wipeout(amap) void amap_copy(map, entry, waitf, canchunk, startva, endva) - struct vm_map *map; - struct vm_map_entry *entry; + vm_map_t map; + vm_map_entry_t entry; int waitf; boolean_t canchunk; vaddr_t startva, endva; @@ -595,7 +595,7 @@ amap_copy(map, entry, waitf, canchunk, startva, endva) UVM_MAP_CLIP_END(map, entry, endva); } - UVMHIST_LOG(maphist, "<- done [creating new amap 0x%x->0x%x]", + UVMHIST_LOG(maphist, "<- done [creating new amap 0x%x->0x%x]", entry->start, entry->end, 0, 0); entry->aref.ar_pageoff = 0; entry->aref.ar_amap = amap_alloc(entry->end - entry->start, 0, @@ -626,7 +626,7 @@ amap_copy(map, entry, waitf, canchunk, startva, endva) * looks like we need to copy the map. */ - UVMHIST_LOG(maphist," amap=%p, ref=%d, must copy it", + UVMHIST_LOG(maphist," amap=%p, ref=%d, must copy it", entry->aref.ar_amap, entry->aref.ar_amap->am_ref, 0, 0); AMAP_B2SLOT(slots, entry->end - entry->start); amap = amap_alloc1(slots, 0, waitf); @@ -683,7 +683,7 @@ amap_copy(map, entry, waitf, canchunk, startva, endva) srcamap->am_flags &= ~AMAP_SHARED; /* clear shared flag */ #ifdef UVM_AMAP_PPREF if (srcamap->am_ppref && srcamap->am_ppref != PPREF_NONE) { - amap_pp_adjref(srcamap, entry->aref.ar_pageoff, + amap_pp_adjref(srcamap, entry->aref.ar_pageoff, (entry->end - entry->start) >> PAGE_SHIFT, -1); } #endif @@ -813,7 +813,7 @@ ReStart: uvm_wait("cownowpage"); goto ReStart; } - + /* * got it... now we can copy the data and replace anon * with our new one... |