diff options
-rw-r--r-- | sys/arch/amd64/amd64/cpu.c | 17 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/ipi.c | 14 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/lapic.c | 16 | ||||
-rw-r--r-- | sys/arch/amd64/include/cpuvar.h | 4 | ||||
-rw-r--r-- | sys/arch/i386/i386/cpu.c | 15 | ||||
-rw-r--r-- | sys/arch/i386/i386/ipifuncs.c | 16 | ||||
-rw-r--r-- | sys/arch/i386/i386/lapic.c | 6 | ||||
-rw-r--r-- | sys/arch/i386/include/cpuvar.h | 4 |
8 files changed, 33 insertions, 59 deletions
diff --git a/sys/arch/amd64/amd64/cpu.c b/sys/arch/amd64/amd64/cpu.c index 0a6703f1251..588090c0157 100644 --- a/sys/arch/amd64/amd64/cpu.c +++ b/sys/arch/amd64/amd64/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.87 2015/07/18 19:19:14 sf Exp $ */ +/* $OpenBSD: cpu.c,v 1.88 2015/07/18 19:21:02 sf Exp $ */ /* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */ /*- @@ -730,9 +730,6 @@ cpu_debug_dump(void) int mp_cpu_start(struct cpu_info *ci) { -#if NLAPIC > 0 - int error; -#endif unsigned short dwordptr[2]; /* @@ -765,16 +762,12 @@ mp_cpu_start(struct cpu_info *ci) delay(10000); if (cpu_feature & CPUID_APIC) { - if ((error = x86_ipi(MP_TRAMPOLINE/PAGE_SIZE, - ci->ci_apicid, - LAPIC_DLMODE_STARTUP)) != 0) - return error; + x86_ipi(MP_TRAMPOLINE/PAGE_SIZE, ci->ci_apicid, + LAPIC_DLMODE_STARTUP); delay(200); - if ((error = x86_ipi(MP_TRAMPOLINE/PAGE_SIZE, - ci->ci_apicid, - LAPIC_DLMODE_STARTUP)) != 0) - return error; + x86_ipi(MP_TRAMPOLINE/PAGE_SIZE, ci->ci_apicid, + LAPIC_DLMODE_STARTUP); delay(200); } } diff --git a/sys/arch/amd64/amd64/ipi.c b/sys/arch/amd64/amd64/ipi.c index 8cb50892d66..17e283a3581 100644 --- a/sys/arch/amd64/amd64/ipi.c +++ b/sys/arch/amd64/amd64/ipi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipi.c,v 1.14 2015/03/14 03:38:46 jsg Exp $ */ +/* $OpenBSD: ipi.c,v 1.15 2015/07/18 19:21:02 sf Exp $ */ /* $NetBSD: ipi.c,v 1.2 2003/03/01 13:05:37 fvdl Exp $ */ /*- @@ -53,13 +53,7 @@ x86_send_ipi(struct cpu_info *ci, int ipimask) if (!(ci->ci_flags & CPUF_RUNNING)) return ENOENT; - ret = x86_ipi(LAPIC_IPI_VECTOR, ci->ci_apicid, LAPIC_DLMODE_FIXED); - if (ret != 0) { - printf("ipi of %x from %s to %s failed\n", - ipimask, - curcpu()->ci_dev->dv_xname, - ci->ci_dev->dv_xname); - } + x86_ipi(LAPIC_IPI_VECTOR, ci->ci_apicid, LAPIC_DLMODE_FIXED); return ret; } @@ -70,7 +64,9 @@ x86_fast_ipi(struct cpu_info *ci, int ipi) if (!(ci->ci_flags & CPUF_RUNNING)) return (ENOENT); - return (x86_ipi(ipi, ci->ci_apicid, LAPIC_DLMODE_FIXED)); + x86_ipi(ipi, ci->ci_apicid, LAPIC_DLMODE_FIXED); + + return 0; } void diff --git a/sys/arch/amd64/amd64/lapic.c b/sys/arch/amd64/amd64/lapic.c index 423524ac628..29a8a6c71df 100644 --- a/sys/arch/amd64/amd64/lapic.c +++ b/sys/arch/amd64/amd64/lapic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lapic.c,v 1.40 2015/07/18 19:19:14 sf Exp $ */ +/* $OpenBSD: lapic.c,v 1.41 2015/07/18 19:21:02 sf Exp $ */ /* $NetBSD: lapic.c,v 1.2 2003/05/08 01:04:35 fvdl Exp $ */ /*- @@ -95,17 +95,17 @@ int x2apic_enabled = 0; u_int32_t x2apic_readreg(int reg); u_int32_t x2apic_cpu_number(); void x2apic_writereg(int reg, u_int32_t val); -int x2apic_ipi(int vec, int target, int dl); +void x2apic_ipi(int vec, int target, int dl); u_int32_t i82489_readreg(int reg); u_int32_t i82489_cpu_number(); void i82489_writereg(int reg, u_int32_t val); -int i82489_ipi(int vec, int target, int dl); +void i82489_ipi(int vec, int target, int dl); u_int32_t (*lapic_readreg)(int) = i82489_readreg; void (*lapic_writereg)(int, u_int32_t) = i82489_writereg; #ifdef MULTIPROCESSOR -int (*x86_ipi)(int vec, int target, int dl) = i82489_ipi; +void (*x86_ipi)(int vec, int target, int dl) = i82489_ipi; #endif u_int32_t @@ -608,7 +608,7 @@ i82489_ipi_init(int target) i82489_icr_wait(); } -int +void i82489_ipi(int vec, int target, int dl) { int s; @@ -626,8 +626,6 @@ i82489_ipi(int vec, int target, int dl) i82489_icr_wait(); splx(s); - - return 0; } void @@ -647,7 +645,7 @@ x2apic_ipi_init(int target) LAPIC_LVL_TRIG | LAPIC_LVL_DEASSERT); } -int +void x2apic_ipi(int vec, int target, int dl) { u_int64_t hi = 0, lo; @@ -658,8 +656,6 @@ x2apic_ipi(int vec, int target, int dl) lo = (target & LAPIC_DEST_MASK) | vec | dl | LAPIC_LVL_ASSERT; x2apic_writeicr(hi, lo); - - return 0; } void diff --git a/sys/arch/amd64/include/cpuvar.h b/sys/arch/amd64/include/cpuvar.h index e5f4043d2c8..3870ab6e5b0 100644 --- a/sys/arch/amd64/include/cpuvar.h +++ b/sys/arch/amd64/include/cpuvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpuvar.h,v 1.6 2015/07/18 19:19:14 sf Exp $ */ +/* $OpenBSD: cpuvar.h,v 1.7 2015/07/18 19:21:03 sf Exp $ */ /* $NetBSD: cpuvar.h,v 1.1 2003/03/01 18:29:28 fvdl Exp $ */ /*- @@ -88,7 +88,7 @@ struct cpu_attach_args { #ifdef _KERNEL #ifdef MULTIPROCESSOR -extern int (*x86_ipi)(int,int,int); +extern void (*x86_ipi)(int,int,int); void x86_ipi_init(int); #endif diff --git a/sys/arch/i386/i386/cpu.c b/sys/arch/i386/i386/cpu.c index 01e78074fc8..7a978aae1a8 100644 --- a/sys/arch/i386/i386/cpu.c +++ b/sys/arch/i386/i386/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.66 2015/07/18 19:19:14 sf Exp $ */ +/* $OpenBSD: cpu.c,v 1.67 2015/07/18 19:21:03 sf Exp $ */ /* $NetBSD: cpu.c,v 1.1.2.7 2000/06/26 02:04:05 sommerfeld Exp $ */ /*- @@ -678,9 +678,6 @@ cpu_set_tss_gates(struct cpu_info *ci) int mp_cpu_start(struct cpu_info *ci) { -#if NLAPIC > 0 - int error; -#endif unsigned short dwordptr[2]; /* @@ -715,14 +712,12 @@ mp_cpu_start(struct cpu_info *ci) delay(10000); if (cpu_feature & CPUID_APIC) { - if ((error = i386_ipi(MP_TRAMPOLINE / PAGE_SIZE, - ci->ci_apicid, LAPIC_DLMODE_STARTUP)) != 0) - return (error); + i386_ipi(MP_TRAMPOLINE / PAGE_SIZE, ci->ci_apicid, + LAPIC_DLMODE_STARTUP); delay(200); - if ((error = i386_ipi(MP_TRAMPOLINE / PAGE_SIZE, - ci->ci_apicid, LAPIC_DLMODE_STARTUP)) != 0) - return (error); + i386_ipi(MP_TRAMPOLINE / PAGE_SIZE, ci->ci_apicid, + LAPIC_DLMODE_STARTUP); delay(200); } } diff --git a/sys/arch/i386/i386/ipifuncs.c b/sys/arch/i386/i386/ipifuncs.c index 64011b0e1fb..c282e3eb29f 100644 --- a/sys/arch/i386/i386/ipifuncs.c +++ b/sys/arch/i386/i386/ipifuncs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipifuncs.c,v 1.25 2015/01/27 20:50:46 sf Exp $ */ +/* $OpenBSD: ipifuncs.c,v 1.26 2015/07/18 19:21:03 sf Exp $ */ /* $NetBSD: ipifuncs.c,v 1.1.2.3 2000/06/26 02:04:06 sommerfeld Exp $ */ /*- @@ -147,21 +147,15 @@ i386_spurious(void) int i386_send_ipi(struct cpu_info *ci, int ipimask) { - int ret; - i386_atomic_setbits_l(&ci->ci_ipis, ipimask); /* Don't send IPI to cpu which isn't (yet) running. */ if (!(ci->ci_flags & CPUF_RUNNING)) return ENOENT; - ret = i386_ipi(LAPIC_IPI_VECTOR, ci->ci_apicid, LAPIC_DLMODE_FIXED); - if (ret != 0) { - printf("ipi of %x from %s to %s failed\n", - ipimask, curcpu()->ci_dev.dv_xname, ci->ci_dev.dv_xname); - } + i386_ipi(LAPIC_IPI_VECTOR, ci->ci_apicid, LAPIC_DLMODE_FIXED); - return ret; + return 0; } int @@ -170,7 +164,9 @@ i386_fast_ipi(struct cpu_info *ci, int ipi) if (!(ci->ci_flags & CPUF_RUNNING)) return (ENOENT); - return (i386_ipi(ipi, ci->ci_apicid, LAPIC_DLMODE_FIXED)); + i386_ipi(ipi, ci->ci_apicid, LAPIC_DLMODE_FIXED); + + return 0; } void diff --git a/sys/arch/i386/i386/lapic.c b/sys/arch/i386/i386/lapic.c index 1ac870a5c28..999b0255ff0 100644 --- a/sys/arch/i386/i386/lapic.c +++ b/sys/arch/i386/i386/lapic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lapic.c,v 1.39 2015/07/18 19:19:14 sf Exp $ */ +/* $OpenBSD: lapic.c,v 1.40 2015/07/18 19:21:03 sf Exp $ */ /* $NetBSD: lapic.c,v 1.1.2.8 2000/02/23 06:10:50 sommerfeld Exp $ */ /*- @@ -459,7 +459,7 @@ i386_ipi_init(int target) i82489_icr_wait(); } -int +void i386_ipi(int vec, int target, int dl) { int s; @@ -477,7 +477,5 @@ i386_ipi(int vec, int target, int dl) i82489_icr_wait(); splx(s); - - return 0; } #endif /* MULTIPROCESSOR */ diff --git a/sys/arch/i386/include/cpuvar.h b/sys/arch/i386/include/cpuvar.h index 8369d462a46..1fcb4634f16 100644 --- a/sys/arch/i386/include/cpuvar.h +++ b/sys/arch/i386/include/cpuvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpuvar.h,v 1.5 2015/07/18 19:19:14 sf Exp $ */ +/* $OpenBSD: cpuvar.h,v 1.6 2015/07/18 19:21:03 sf Exp $ */ /* $NetBSD: cpuvar.h,v 1.1.2.3 2000/02/21 18:54:07 sommerfeld Exp $ */ /*- @@ -89,7 +89,7 @@ struct cpu_attach_args { #ifdef _KERNEL -int i386_ipi(int,int,int); +void i386_ipi(int,int,int); void i386_ipi_init(int); void identifycpu(struct cpu_info *); |