-/*
- * pmap_modify_pages(pmap, s, e)
- * sets the modified bit on all virtual addresses v in the
- * virtual address range determined by [s, e] and pmap,
- * s and e must be on machine independent page boundaries and
- * s must be less than or equal to e.
- *
- * Note that this function will not descend nested pmaps.
- */
-void
-pmap_modify_pages(
- pmap_t pmap,
- vm_map_offset_t sva,
- vm_map_offset_t eva)
-{
- spl_t spl;
- mapping_t *mp;
- ppnum_t pa;
- addr64_t va, endva;
- unsigned int savetype;
-
- if (pmap == PMAP_NULL) return; /* If no pmap, can't do it... */
-
- va = sva & -4096; /* Round to page */
- endva = eva & -4096; /* Round to page */
-
- while (va < endva) { /* Walk through all pages */
-
- spl = splhigh(); /* We can't allow any loss of control here */
-
- mp = mapping_find(pmap, (addr64_t)va, &va, 0); /* Find the mapping for this address */
-
- if(!mp) { /* Is the page mapped? */
- splx(spl); /* Page not mapped, restore interruptions */
- if((va == 0) || (va >= endva)) break; /* We are done if there are no more or we hit the end... */
- continue; /* We are not done and there is more to check... */
- }
-
- savetype = mp->mpFlags & mpType; /* Remember the type */
- pa = mp->mpPAddr; /* Remember ppage because mapping may vanish after drop call */
-
- mapping_drop_busy(mp); /* We have everything we need from the mapping */
-
- splx(spl); /* Restore 'rupts */
-
- if(savetype != mpNormal) continue; /* Can't mess around with these guys... */
-
- mapping_set_mod(pa); /* Set the modfied bit for this page */
-
- if(va == 0) break; /* We hit the end of the pmap, might as well leave now... */
- }
- return; /* Leave... */
-}
-