Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Aug 2014 17:09:50 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r269388 - head/sys/powerpc/aim
Message-ID:  <201408011709.s71H9orb096242@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Fri Aug  1 17:09:50 2014
New Revision: 269388
URL: http://svnweb.freebsd.org/changeset/base/269388

Log:
  Simplify the selection of the pvo_head and pvo allocation zone in
  moea_enter_locked() and moea64_enter().
  
  Eliminate an unused variable from moea64_enter().

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	Fri Aug  1 16:53:04 2014	(r269387)
+++ head/sys/powerpc/aim/mmu_oea.c	Fri Aug  1 17:09:50 2014	(r269388)
@@ -1152,26 +1152,20 @@ moea_enter_locked(pmap_t pmap, vm_offset
 	u_int		pte_lo, pvo_flags;
 	int		error;
 
-	if (!moea_initialized) {
-		pvo_head = &moea_pvo_kunmanaged;
-		zone = moea_upvo_zone;
-		pvo_flags = 0;
-	} else {
-		pvo_head = vm_page_to_pvoh(m);
-		zone = moea_mpvo_zone;
-		pvo_flags = PVO_MANAGED;
-	}
 	if (pmap_bootstrapped)
 		rw_assert(&pvh_global_lock, RA_WLOCKED);
 	PMAP_LOCK_ASSERT(pmap, MA_OWNED);
 	if ((m->oflags & VPO_UNMANAGED) == 0 && !vm_page_xbusied(m))
 		VM_OBJECT_ASSERT_LOCKED(m->object);
 
-	/* XXX change the pvo head for unmanaged pages */
-	if ((m->oflags & VPO_UNMANAGED) != 0) {
-		pvo_flags &= ~PVO_MANAGED;
+	if ((m->oflags & VPO_UNMANAGED) != 0 || !moea_initialized) {
 		pvo_head = &moea_pvo_kunmanaged;
 		zone = moea_upvo_zone;
+		pvo_flags = 0;
+	} else {
+		pvo_head = vm_page_to_pvoh(m);
+		zone = moea_mpvo_zone;
+		pvo_flags = PVO_MANAGED;
 	}
 
 	pte_lo = moea_calc_wimg(VM_PAGE_TO_PHYS(m), pmap_page_get_memattr(m));

Modified: head/sys/powerpc/aim/mmu_oea64.c
==============================================================================
--- head/sys/powerpc/aim/mmu_oea64.c	Fri Aug  1 16:53:04 2014	(r269387)
+++ head/sys/powerpc/aim/mmu_oea64.c	Fri Aug  1 17:09:50 2014	(r269388)
@@ -1289,33 +1289,23 @@ moea64_enter(mmu_t mmu, pmap_t pmap, vm_
 {
 	struct		pvo_head *pvo_head;
 	uma_zone_t	zone;
-	vm_page_t	pg;
 	uint64_t	pte_lo;
 	u_int		pvo_flags;
 	int		error;
 
-	if (!moea64_initialized) {
+	if ((m->oflags & VPO_UNMANAGED) == 0 && !vm_page_xbusied(m))
+		VM_OBJECT_ASSERT_LOCKED(m->object);
+
+	if ((m->oflags & VPO_UNMANAGED) != 0 || !moea64_initialized) {
 		pvo_head = NULL;
-		pg = NULL;
 		zone = moea64_upvo_zone;
 		pvo_flags = 0;
 	} else {
 		pvo_head = vm_page_to_pvoh(m);
-		pg = m;
 		zone = moea64_mpvo_zone;
 		pvo_flags = PVO_MANAGED;
 	}
 
-	if ((m->oflags & VPO_UNMANAGED) == 0 && !vm_page_xbusied(m))
-		VM_OBJECT_ASSERT_LOCKED(m->object);
-
-	/* XXX change the pvo head for fake pages */
-	if ((m->oflags & VPO_UNMANAGED) != 0) {
-		pvo_flags &= ~PVO_MANAGED;
-		pvo_head = NULL;
-		zone = moea64_upvo_zone;
-	}
-
 	pte_lo = moea64_calc_wimg(VM_PAGE_TO_PHYS(m), pmap_page_get_memattr(m));
 
 	if (prot & VM_PROT_WRITE) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408011709.s71H9orb096242>