diff options
author | obrien <obrien@FreeBSD.org> | 2005-05-23 17:36:54 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2005-05-23 17:36:54 +0000 |
commit | 06c1e16bf20f9478ef6b33028aa6dc5a8667f9ce (patch) | |
tree | 83853bafbad171bac5bd7977bd3bc449a69f3a19 /sys | |
parent | 54751b46c5804e934a208492d234844e88967c08 (diff) | |
download | FreeBSD-src-06c1e16bf20f9478ef6b33028aa6dc5a8667f9ce.zip FreeBSD-src-06c1e16bf20f9478ef6b33028aa6dc5a8667f9ce.tar.gz |
Sync the style of these two files.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/amd64/mp_machdep.c | 26 | ||||
-rw-r--r-- | sys/i386/i386/mp_machdep.c | 15 |
2 files changed, 26 insertions, 15 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index bf3486b..3bf6f31 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -476,7 +476,7 @@ init_secondary(void) wrmsr(MSR_STAR, msr); wrmsr(MSR_SF_MASK, PSL_NT|PSL_T|PSL_I|PSL_C|PSL_D); - /* Disable local apic just to be sure. */ + /* Disable local APIC just to be sure. */ lapic_disable(); /* signal our startup to the BSP. */ @@ -612,11 +612,11 @@ set_logical_apic_ids(void) static int start_all_aps(void) { - u_char mpbiosreason; + vm_offset_t va = boot_address + KERNBASE; + u_int64_t *pt4, *pt3, *pt2; u_int32_t mpbioswarmvec; int apic_id, cpu, i; - u_int64_t *pt4, *pt3, *pt2; - vm_offset_t va = boot_address + KERNBASE; + u_char mpbiosreason; mtx_init(&ap_boot_mtx, "ap boot", NULL, MTX_SPIN); @@ -657,8 +657,7 @@ start_all_aps(void) outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */ /* start each AP */ - cpu = 0; - for (apic_id = 0; apic_id < MAXCPU; apic_id++) { + for (cpu = 0, apic_id = 0; apic_id < MAXCPU; apic_id++) { /* Ignore non-existent CPUs and the BSP. */ if (!cpu_info[apic_id].cpu_present || @@ -899,8 +898,9 @@ void smp_invltlb(void) { - if (smp_started) + if (smp_started) { smp_tlb_shootdown(IPI_INVLTLB, 0, 0); + } } void @@ -915,32 +915,36 @@ void smp_invlpg_range(vm_offset_t addr1, vm_offset_t addr2) { - if (smp_started) + if (smp_started) { smp_tlb_shootdown(IPI_INVLRNG, addr1, addr2); + } } void smp_masked_invltlb(u_int mask) { - if (smp_started) + if (smp_started) { smp_targeted_tlb_shootdown(mask, IPI_INVLTLB, 0, 0); + } } void smp_masked_invlpg(u_int mask, vm_offset_t addr) { - if (smp_started) + if (smp_started) { smp_targeted_tlb_shootdown(mask, IPI_INVLPG, addr, 0); + } } void smp_masked_invlpg_range(u_int mask, vm_offset_t addr1, vm_offset_t addr2) { - if (smp_started) + if (smp_started) { smp_targeted_tlb_shootdown(mask, IPI_INVLRNG, addr1, addr2); + } } diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index 01e384b..e2812d6 100644 --- a/sys/i386/i386/mp_machdep.c +++ b/sys/i386/i386/mp_machdep.c @@ -679,11 +679,11 @@ start_all_aps(void) #ifndef PC98 u_char mpbiosreason; #endif - u_long mpbioswarmvec; struct pcpu *pc; char *stack; uintptr_t kptbase; - int i, pg, apic_id, cpu; + u_int32_t mpbioswarmvec; + int apic_id, cpu, i, pg; POSTCODE(START_ALL_APS_POST); @@ -693,7 +693,7 @@ start_all_aps(void) install_ap_tramp(); /* save the current value of the warm-start vector */ - mpbioswarmvec = *((u_long *) WARMBOOT_OFF); + mpbioswarmvec = *((u_int32_t *) WARMBOOT_OFF); #ifndef PC98 outb(CMOS_REG, BIOS_RESET); mpbiosreason = inb(CMOS_DATA); @@ -777,7 +777,8 @@ start_all_aps(void) PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask)); /* restore the warmstart vector */ - *(u_long *) WARMBOOT_OFF = mpbioswarmvec; + *(u_int32_t *) WARMBOOT_OFF = mpbioswarmvec; + #ifndef PC98 outb(CMOS_REG, BIOS_RESET); outb(CMOS_DATA, mpbiosreason); @@ -1097,6 +1098,7 @@ smp_targeted_tlb_shootdown(u_int mask, u_int vector, vm_offset_t addr1, vm_offse void smp_invltlb(void) { + if (smp_started) { smp_tlb_shootdown(IPI_INVLTLB, 0, 0); #ifdef COUNT_XINVLTLB_HITS @@ -1108,6 +1110,7 @@ smp_invltlb(void) void smp_invlpg(vm_offset_t addr) { + if (smp_started) { smp_tlb_shootdown(IPI_INVLPG, addr, 0); #ifdef COUNT_XINVLTLB_HITS @@ -1119,6 +1122,7 @@ smp_invlpg(vm_offset_t addr) void smp_invlpg_range(vm_offset_t addr1, vm_offset_t addr2) { + if (smp_started) { smp_tlb_shootdown(IPI_INVLRNG, addr1, addr2); #ifdef COUNT_XINVLTLB_HITS @@ -1131,6 +1135,7 @@ smp_invlpg_range(vm_offset_t addr1, vm_offset_t addr2) void smp_masked_invltlb(u_int mask) { + if (smp_started) { smp_targeted_tlb_shootdown(mask, IPI_INVLTLB, 0, 0); #ifdef COUNT_XINVLTLB_HITS @@ -1142,6 +1147,7 @@ smp_masked_invltlb(u_int mask) void smp_masked_invlpg(u_int mask, vm_offset_t addr) { + if (smp_started) { smp_targeted_tlb_shootdown(mask, IPI_INVLPG, addr, 0); #ifdef COUNT_XINVLTLB_HITS @@ -1153,6 +1159,7 @@ smp_masked_invlpg(u_int mask, vm_offset_t addr) void smp_masked_invlpg_range(u_int mask, vm_offset_t addr1, vm_offset_t addr2) { + if (smp_started) { smp_targeted_tlb_shootdown(mask, IPI_INVLRNG, addr1, addr2); #ifdef COUNT_XINVLTLB_HITS |