Date: Wed, 14 Mar 2012 20:19:50 +0000 (UTC) From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r232980 - head/sys/powerpc/aim Message-ID: <201203142019.q2EKJoCX029711@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: nwhitehorn Date: Wed Mar 14 20:19:49 2012 New Revision: 232980 URL: http://svn.freebsd.org/changeset/base/232980 Log: Use LIST_FOREACH_SAFE() instead of LIST_FOREACH() in pmap_remove(), since the point of this loop is to remove elements. This worked by accident before. MFC after: 2 days Modified: head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Wed Mar 14 18:47:41 2012 (r232979) +++ head/sys/powerpc/aim/mmu_oea.c Wed Mar 14 20:19:49 2012 (r232980) @@ -1794,7 +1794,7 @@ moea_release(mmu_t mmu, pmap_t pmap) void moea_remove(mmu_t mmu, pmap_t pm, vm_offset_t sva, vm_offset_t eva) { - struct pvo_entry *pvo; + struct pvo_entry *pvo, *tpvo; int pteidx; vm_page_lock_queues(); @@ -1806,7 +1806,7 @@ moea_remove(mmu_t mmu, pmap_t pm, vm_off moea_pvo_remove(pvo, pteidx); } } else { - LIST_FOREACH(pvo, &pm->pmap_pvo, pvo_plink) { + LIST_FOREACH_SAFE(pvo, &pm->pmap_pvo, pvo_plink, tpvo) { if (PVO_VADDR(pvo) < sva || PVO_VADDR(pvo) >= eva) continue; moea_pvo_remove(pvo, -1); Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Wed Mar 14 18:47:41 2012 (r232979) +++ head/sys/powerpc/aim/mmu_oea64.c Wed Mar 14 20:19:49 2012 (r232980) @@ -2039,7 +2039,7 @@ moea64_release(mmu_t mmu, pmap_t pmap) void moea64_remove(mmu_t mmu, pmap_t pm, vm_offset_t sva, vm_offset_t eva) { - struct pvo_entry *pvo; + struct pvo_entry *pvo, *tpvo; vm_page_lock_queues(); PMAP_LOCK(pm); @@ -2050,7 +2050,7 @@ moea64_remove(mmu_t mmu, pmap_t pm, vm_o moea64_pvo_remove(mmu, pvo); } } else { - LIST_FOREACH(pvo, &pm->pmap_pvo, pvo_plink) { + LIST_FOREACH_SAFE(pvo, &pm->pmap_pvo, pvo_plink, tpvo) { if (PVO_VADDR(pvo) < sva || PVO_VADDR(pvo) >= eva) continue; moea64_pvo_remove(mmu, pvo);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203142019.q2EKJoCX029711>