pmap_do_remove(pmap, sva, eva, PMAP_REMOVE_ALL);
pt_entry_t *ptes; boolean_t result; paddr_t ptppa; vaddr_t blkendva; struct vm_page *ptp; struct pmap_remove_record pmap_rr, *prr;    PMAP_MAP_TO_HEAD_LOCK(); ptes = pmap_map_ptes(pmap);	    if (sva + PAGE_SIZE == eva) {  if (pmap_valid_entry(pmap->pm_pdir[pdei(sva)])) {   ptppa = pmap->pm_pdir[pdei(sva)] & PG_FRAME;    if (pmap == pmap_kernel()) {  ptp = NULL; } else { if (pmap->pm_ptphint && VM_PAGE_TO_PHYS(pmap->pm_ptphint) == ptppa) { ptp = pmap->pm_ptphint; } else { ptp = PHYS_TO_VM_PAGE(ptppa); #ifdef DIAGNOSTIC if (ptp == NULL) panic("pmap_remove: unmanaged " "PTP detected"); #endif } }   result = pmap_remove_pte(pmap, ptp, &ptes[i386_btop(sva)], sva);    if (result && ptp && ptp->wire_count <= 1) { pmap->pm_pdir[pdei(sva)] = 0;	 #if defined(I386_CPU)  if (cpu_class != CPUCLASS_386) #endif { pmap_update_pg(((vaddr_t) ptes) + ptp->offset); } pmap->pm_stats.resident_count--; if (pmap->pm_ptphint == ptp) pmap->pm_ptphint = TAILQ_FIRST(&pmap->pm_obj.memq); ptp->wire_count = 0; uvm_pagefree(ptp); } }  pmap_unmap_ptes(pmap);		 PMAP_MAP_TO_HEAD_UNLOCK(); return; }    if (pmap_is_curpmap(pmap)) { prr = &pmap_rr; prr->prr_npages = 0; } else { prr = NULL; }  for ( ; sva < eva ; sva = blkendva) {   blkendva = i386_round_pdr(sva+1); if (blkendva > eva) blkendva = eva;    if (pdei(sva) == PDSLOT_PTE)  continue;  if (!pmap_valid_entry(pmap->pm_pdir[pdei(sva)]))  continue;   ptppa = (pmap->pm_pdir[pdei(sva)] & PG_FRAME);   if (pmap == pmap_kernel()) {  ptp = NULL; } else { if (pmap->pm_ptphint && VM_PAGE_TO_PHYS(pmap->pm_ptphint) == ptppa) { ptp = pmap->pm_ptphint; } else { ptp = PHYS_TO_VM_PAGE(ptppa); #ifdef DIAGNOSTIC if (ptp == NULL) panic("pmap_remove: unmanaged PTP " "detected"); #endif } } pmap_remove_ptes(pmap, prr, ptp, (vaddr_t)&ptes[i386_btop(sva)], sva, blkendva);   if (ptp && ptp->wire_count <= 1) { pmap->pm_pdir[pdei(sva)] = 0;	 pmap_update_pg( ((vaddr_t) ptes) + ptp->offset); #if defined(I386_CPU)  if (cpu_class == CPUCLASS_386 && prr) prr->prr_npages = 0; #endif pmap->pm_stats.resident_count--; if (pmap->pm_ptphint == ptp)	 pmap->pm_ptphint = TAILQ_FIRST(&pmap->pm_obj.memq); ptp->wire_count = 0; uvm_pagefree(ptp); } }    if (prr && prr->prr_npages) { #if defined(I386_CPU) if (cpu_class == CPUCLASS_386) { tlbflush(); } else #endif {  if (prr->prr_npages > PMAP_RR_MAX) { tlbflush(); } else { while (prr->prr_npages) { pmap_update_pg( prr->prr_vas[--prr->prr_npages]); } } }  } pmap_unmap_ptes(pmap); PMAP_MAP_TO_HEAD_UNLOCK();
pmap_remove(pmap, sva, eva)	struct pmap *pmap;	vaddr_t sva, eva;{	pmap_do_remove(pmap, sva, eva, PMAP_REMOVE_ALL);}