* first advance to the correct place in the ppref array, fragment * if needed.
* first advance to the correct place in the ppref array, * fragment if needed.
amap_pp_adjref(amap, curslot, slotlen, adjval)	struct vm_amap *amap;	int curslot;	vsize_t slotlen;	int adjval;{	int stopslot, *ppref, lcv;	int ref, len;	/*	 * get init values	 */	stopslot = curslot + slotlen;	ppref = amap->am_ppref;	/*	 * first advance to the correct place in the ppref array, fragment	 * if needed.	 */	for (lcv = 0 ; lcv < curslot ; lcv += len) {		pp_getreflen(ppref, lcv, &ref, &len);		if (lcv + len > curslot) {     /* goes past start? */			pp_setreflen(ppref, lcv, ref, curslot - lcv);			pp_setreflen(ppref, curslot, ref, len - (curslot -lcv));			len = curslot - lcv;   /* new length of entry @ lcv */		}	}	/*	 * now adjust reference counts in range (make sure we dont overshoot)	 */	if (lcv != curslot)		panic("amap_pp_adjref: overshot target");	for (/* lcv already set */; lcv < stopslot ; lcv += len) {		pp_getreflen(ppref, lcv, &ref, &len);		if (lcv + len > stopslot) {     /* goes past end? */			pp_setreflen(ppref, lcv, ref, stopslot - lcv);			pp_setreflen(ppref, stopslot, ref,			    len - (stopslot - lcv));			len = stopslot - lcv;		}		ref = ref + adjval;    /* ADJUST! */		if (ref < 0)			panic("amap_pp_adjref: negative reference count");		pp_setreflen(ppref, lcv, ref, len);		if (ref == 0)			amap_wiperange(amap, lcv, len);	}}