From owner-svn-src-head@FreeBSD.ORG Thu Jun 2 14:15:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3A8B1065670; Thu, 2 Jun 2011 14:15:44 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B3E248FC1F; Thu, 2 Jun 2011 14:15:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p52EFiOQ021018; Thu, 2 Jun 2011 14:15:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p52EFiM0021013; Thu, 2 Jun 2011 14:15:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106021415.p52EFiM0021013@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 2 Jun 2011 14:15:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222614 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jun 2011 14:15:44 -0000 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, ®ions, ®ions_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, ®ions, ®ions_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