Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Jun 2011 14:15:44 +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: r222614 - head/sys/powerpc/aim
Message-ID:  <201106021415.p52EFiM0021013@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Thu Jun  2 14:15:44 2011
New Revision: 222614
URL: http://svn.freebsd.org/changeset/base/222614

Log:
  Remove some dead code: unnecessary isyncs and memory sorting, which are
  handled in mtmsr() and mem_regions(), respectively.

Modified:
  head/sys/powerpc/aim/interrupt.c
  head/sys/powerpc/aim/mmu_oea.c
  head/sys/powerpc/aim/mmu_oea64.c
  head/sys/powerpc/aim/moea64_native.c

Modified: head/sys/powerpc/aim/interrupt.c
==============================================================================
--- head/sys/powerpc/aim/interrupt.c	Thu Jun  2 14:12:37 2011	(r222613)
+++ head/sys/powerpc/aim/interrupt.c	Thu Jun  2 14:15:44 2011	(r222614)
@@ -100,10 +100,8 @@ powerpc_interrupt(struct trapframe *fram
 	default:
 		/* Re-enable interrupts if applicable. */
 		ee = framep->srr1 & PSL_EE;
-		if (ee != 0) {
+		if (ee != 0)
 			mtmsr(mfmsr() | ee);
-			isync();
-		}
 		trap(framep);
 	}	        
 }

Modified: head/sys/powerpc/aim/mmu_oea.c
==============================================================================
--- head/sys/powerpc/aim/mmu_oea.c	Thu Jun  2 14:12:37 2011	(r222613)
+++ head/sys/powerpc/aim/mmu_oea.c	Thu Jun  2 14:15:44 2011	(r222614)
@@ -584,26 +584,9 @@ moea_pte_change(struct pte *pt, struct p
 /*
  * Quick sort callout for comparing memory regions.
  */
-static int	mr_cmp(const void *a, const void *b);
 static int	om_cmp(const void *a, const void *b);
 
 static int
-mr_cmp(const void *a, const void *b)
-{
-	const struct	mem_region *regiona;
-	const struct	mem_region *regionb;
-
-	regiona = a;
-	regionb = b;
-	if (regiona->mr_start < regionb->mr_start)
-		return (-1);
-	else if (regiona->mr_start > regionb->mr_start)
-		return (1);
-	else
-		return (0);
-}
-
-static int
 om_cmp(const void *a, const void *b)
 {
 	const struct	ofw_map *mapa;
@@ -720,7 +703,6 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k
 	mem_regions(&pregions, &pregions_sz, &regions, &regions_sz);
 	CTR0(KTR_PMAP, "moea_bootstrap: physical memory");
 
-	qsort(pregions, pregions_sz, sizeof(*pregions), mr_cmp);
 	for (i = 0; i < pregions_sz; i++) {
 		vm_offset_t pa;
 		vm_offset_t end;
@@ -749,7 +731,7 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k
 
 	if (sizeof(phys_avail)/sizeof(phys_avail[0]) < regions_sz)
 		panic("moea_bootstrap: phys_avail too small");
-	qsort(regions, regions_sz, sizeof(*regions), mr_cmp);
+
 	phys_avail_count = 0;
 	physsz = 0;
 	hwphyssz = 0;

Modified: head/sys/powerpc/aim/mmu_oea64.c
==============================================================================
--- head/sys/powerpc/aim/mmu_oea64.c	Thu Jun  2 14:12:37 2011	(r222613)
+++ head/sys/powerpc/aim/mmu_oea64.c	Thu Jun  2 14:15:44 2011	(r222614)
@@ -162,8 +162,8 @@ __FBSDID("$FreeBSD$");
 void moea64_release_vsid(uint64_t vsid);
 uintptr_t moea64_get_unique_vsid(void); 
 
-#define DISABLE_TRANS(msr)	msr = mfmsr(); mtmsr(msr & ~PSL_DR); isync()
-#define ENABLE_TRANS(msr)	mtmsr(msr); isync()
+#define DISABLE_TRANS(msr)	msr = mfmsr(); mtmsr(msr & ~PSL_DR)
+#define ENABLE_TRANS(msr)	mtmsr(msr)
 
 #define	VSID_MAKE(sr, hash)	((sr) | (((hash) & 0xfffff) << 4))
 #define	VSID_TO_HASH(vsid)	(((vsid) >> 4) & 0xfffff)
@@ -473,26 +473,9 @@ moea64_calc_wimg(vm_offset_t pa, vm_mema
 /*
  * Quick sort callout for comparing memory regions.
  */
-static int	mr_cmp(const void *a, const void *b);
 static int	om_cmp(const void *a, const void *b);
 
 static int
-mr_cmp(const void *a, const void *b)
-{
-	const struct	mem_region *regiona;
-	const struct	mem_region *regionb;
-
-	regiona = a;
-	regionb = b;
-	if (regiona->mr_start < regionb->mr_start)
-		return (-1);
-	else if (regiona->mr_start > regionb->mr_start)
-		return (1);
-	else
-		return (0);
-}
-
-static int
 om_cmp(const void *a, const void *b)
 {
 	const struct	ofw_map *mapa;
@@ -707,10 +690,9 @@ moea64_early_bootstrap(mmu_t mmup, vm_of
 	mem_regions(&pregions, &pregions_sz, &regions, &regions_sz);
 	CTR0(KTR_PMAP, "moea64_bootstrap: physical memory");
 
-	qsort(pregions, pregions_sz, sizeof(*pregions), mr_cmp);
 	if (sizeof(phys_avail)/sizeof(phys_avail[0]) < regions_sz)
 		panic("moea64_bootstrap: phys_avail too small");
-	qsort(regions, regions_sz, sizeof(*regions), mr_cmp);
+
 	phys_avail_count = 0;
 	physsz = 0;
 	hwphyssz = 0;
@@ -895,7 +877,7 @@ moea64_late_bootstrap(mmu_t mmup, vm_off
 	 * Initialize MMU and remap early physical mappings
 	 */
 	MMU_CPU_BOOTSTRAP(mmup,0);
-	mtmsr(mfmsr() | PSL_DR | PSL_IR); isync();
+	mtmsr(mfmsr() | PSL_DR | PSL_IR);
 	pmap_bootstrapped++;
 	bs_remap_earlyboot();
 

Modified: head/sys/powerpc/aim/moea64_native.c
==============================================================================
--- head/sys/powerpc/aim/moea64_native.c	Thu Jun  2 14:12:37 2011	(r222613)
+++ head/sys/powerpc/aim/moea64_native.c	Thu Jun  2 14:15:44 2011	(r222614)
@@ -185,8 +185,8 @@ TLBIE(uint64_t vpn) {
 	mtx_unlock_spin(&tlbie_mutex);
 }
 
-#define DISABLE_TRANS(msr)	msr = mfmsr(); mtmsr(msr & ~PSL_DR); isync()
-#define ENABLE_TRANS(msr)	mtmsr(msr); isync()
+#define DISABLE_TRANS(msr)	msr = mfmsr(); mtmsr(msr & ~PSL_DR)
+#define ENABLE_TRANS(msr)	mtmsr(msr)
 
 /*
  * PTEG data.
@@ -344,7 +344,7 @@ moea64_cpu_bootstrap_native(mmu_t mmup, 
 	 * Initialize segment registers and MMU
 	 */
 
-	mtmsr(mfmsr() & ~PSL_DR & ~PSL_IR); isync();
+	mtmsr(mfmsr() & ~PSL_DR & ~PSL_IR);
 
 	/*
 	 * Install kernel SLB entries



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