Remove some dead code: unnecessary isyncs and memory sorting, which are
handled in mtmsr() and mem_regions(), respectively.
This commit is contained in:
parent
1787909001
commit
97f7cde42c
@ -100,10 +100,8 @@ powerpc_interrupt(struct trapframe *framep)
|
||||
default:
|
||||
/* Re-enable interrupts if applicable. */
|
||||
ee = framep->srr1 & PSL_EE;
|
||||
if (ee != 0) {
|
||||
if (ee != 0)
|
||||
mtmsr(mfmsr() | ee);
|
||||
isync();
|
||||
}
|
||||
trap(framep);
|
||||
}
|
||||
}
|
||||
|
@ -584,25 +584,8 @@ moea_pte_change(struct pte *pt, struct pte *pvo_pt, vm_offset_t va)
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
@ -720,7 +703,6 @@ moea_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend)
|
||||
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 kernelstart, vm_offset_t kernelend)
|
||||
|
||||
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;
|
||||
|
@ -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,25 +473,8 @@ moea64_calc_wimg(vm_offset_t pa, vm_memattr_t ma)
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
@ -707,10 +690,9 @@ moea64_early_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelen
|
||||
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_offset_t kernelstart, vm_offset_t kernelend
|
||||
* 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();
|
||||
|
||||
|
@ -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, int ap)
|
||||
* Initialize segment registers and MMU
|
||||
*/
|
||||
|
||||
mtmsr(mfmsr() & ~PSL_DR & ~PSL_IR); isync();
|
||||
mtmsr(mfmsr() & ~PSL_DR & ~PSL_IR);
|
||||
|
||||
/*
|
||||
* Install kernel SLB entries
|
||||
|
Loading…
Reference in New Issue
Block a user