diff options
author | marius <marius@FreeBSD.org> | 2008-09-28 18:34:14 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2008-09-28 18:34:14 +0000 |
commit | a1ec700ce86e235c28f1c3187005ffd0a4fc0771 (patch) | |
tree | 9ce76384feced5a803e792230ba07f3bb5776ef3 | |
parent | 67d011afcbb04955068e1ab6d7a373efa90ac749 (diff) | |
download | FreeBSD-src-a1ec700ce86e235c28f1c3187005ffd0a4fc0771.zip FreeBSD-src-a1ec700ce86e235c28f1c3187005ffd0a4fc0771.tar.gz |
Remove ipi_all() and ipi_self() as the former hasn't been used at
all to date and the latter also is only used in ia64 and powerpc
code which no longer serves a real purpose after bring-up and just
can be removed as well. Note that architectures like sun4u also
provide no means of implementing IPI'ing a CPU itself natively
in the first place.
Suggested by: jhb
Reviewed by: arch, grehan, jhb
-rw-r--r-- | sys/amd64/amd64/mp_machdep.c | 30 | ||||
-rw-r--r-- | sys/amd64/include/smp.h | 2 | ||||
-rw-r--r-- | sys/i386/i386/mp_machdep.c | 30 | ||||
-rw-r--r-- | sys/i386/include/smp.h | 2 | ||||
-rw-r--r-- | sys/i386/xen/mp_machdep.c | 35 | ||||
-rw-r--r-- | sys/ia64/ia64/interrupt.c | 7 | ||||
-rw-r--r-- | sys/ia64/ia64/mp_machdep.c | 31 | ||||
-rw-r--r-- | sys/ia64/ia64/sal.c | 1 | ||||
-rw-r--r-- | sys/ia64/include/smp.h | 13 | ||||
-rw-r--r-- | sys/mips/include/smp.h | 2 | ||||
-rw-r--r-- | sys/mips/mips/mp_machdep.c | 20 | ||||
-rw-r--r-- | sys/powerpc/include/smp.h | 4 | ||||
-rw-r--r-- | sys/powerpc/powerpc/intr_machdep.c | 5 | ||||
-rw-r--r-- | sys/powerpc/powerpc/mp_machdep.c | 29 | ||||
-rw-r--r-- | sys/sun4v/include/smp.h | 1 |
15 files changed, 5 insertions, 207 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 2de63e3..7996a90 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -1013,21 +1013,6 @@ ipi_selected(u_int32_t cpus, u_int ipi) } /* - * send an IPI INTerrupt containing 'vector' to all CPUs, including myself - */ -void -ipi_all(u_int ipi) -{ - - if (IPI_IS_BITMAPED(ipi) || (ipi == IPI_STOP && stop_cpus_with_nmi)) { - ipi_selected(all_cpus, ipi); - return; - } - CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); - lapic_ipi_vectored(ipi, APIC_IPI_DEST_ALL); -} - -/* * send an IPI to all CPUs EXCEPT myself */ void @@ -1042,21 +1027,6 @@ ipi_all_but_self(u_int ipi) lapic_ipi_vectored(ipi, APIC_IPI_DEST_OTHERS); } -/* - * send an IPI to myself - */ -void -ipi_self(u_int ipi) -{ - - if (IPI_IS_BITMAPED(ipi) || (ipi == IPI_STOP && stop_cpus_with_nmi)) { - ipi_selected(PCPU_GET(cpumask), ipi); - return; - } - CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); - lapic_ipi_vectored(ipi, APIC_IPI_DEST_SELF); -} - #ifdef STOP_NMI /* * send NMI IPI to selected CPUs diff --git a/sys/amd64/include/smp.h b/sys/amd64/include/smp.h index f961d6b..06222f8 100644 --- a/sys/amd64/include/smp.h +++ b/sys/amd64/include/smp.h @@ -55,9 +55,7 @@ void cpu_add(u_int apic_id, char boot_cpu); void cpustop_handler(void); void init_secondary(void); void ipi_selected(u_int cpus, u_int ipi); -void ipi_all(u_int ipi); void ipi_all_but_self(u_int ipi); -void ipi_self(u_int ipi); void ipi_bitmap_handler(struct trapframe frame); u_int mp_bootaddress(u_int); int mp_grab_cpu_hlt(void); diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index 5c80cfb..4488915 100644 --- a/sys/i386/i386/mp_machdep.c +++ b/sys/i386/i386/mp_machdep.c @@ -1194,21 +1194,6 @@ ipi_selected(u_int32_t cpus, u_int ipi) } /* - * send an IPI INTerrupt containing 'vector' to all CPUs, including myself - */ -void -ipi_all(u_int ipi) -{ - - if (IPI_IS_BITMAPED(ipi) || (ipi == IPI_STOP && stop_cpus_with_nmi)) { - ipi_selected(all_cpus, ipi); - return; - } - CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); - lapic_ipi_vectored(ipi, APIC_IPI_DEST_ALL); -} - -/* * send an IPI to all CPUs EXCEPT myself */ void @@ -1223,21 +1208,6 @@ ipi_all_but_self(u_int ipi) lapic_ipi_vectored(ipi, APIC_IPI_DEST_OTHERS); } -/* - * send an IPI to myself - */ -void -ipi_self(u_int ipi) -{ - - if (IPI_IS_BITMAPED(ipi) || (ipi == IPI_STOP && stop_cpus_with_nmi)) { - ipi_selected(PCPU_GET(cpumask), ipi); - return; - } - CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); - lapic_ipi_vectored(ipi, APIC_IPI_DEST_SELF); -} - #ifdef STOP_NMI /* * send NMI IPI to selected CPUs diff --git a/sys/i386/include/smp.h b/sys/i386/include/smp.h index 9905177..0b821d2 100644 --- a/sys/i386/include/smp.h +++ b/sys/i386/include/smp.h @@ -65,9 +65,7 @@ void cpu_add(u_int apic_id, char boot_cpu); void cpustop_handler(void); void init_secondary(void); void ipi_selected(u_int cpus, u_int ipi); -void ipi_all(u_int ipi); void ipi_all_but_self(u_int ipi); -void ipi_self(u_int ipi); void ipi_bitmap_handler(struct trapframe frame); u_int mp_bootaddress(u_int); int mp_grab_cpu_hlt(void); diff --git a/sys/i386/xen/mp_machdep.c b/sys/i386/xen/mp_machdep.c index c1af917..945ae69 100644 --- a/sys/i386/xen/mp_machdep.c +++ b/sys/i386/xen/mp_machdep.c @@ -965,26 +965,6 @@ ipi_selected(u_int32_t cpus, u_int ipi) } /* - * send an IPI INTerrupt containing 'vector' to all CPUs, including myself - */ -void -ipi_all(u_int ipi) -{ - - if (IPI_IS_BITMAPED(ipi) || (ipi == IPI_STOP && stop_cpus_with_nmi)) { - ipi_selected(all_cpus, ipi); - return; - } - CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); - - /* - * - */ - - ipi_selected(-1, ipi); -} - -/* * send an IPI to all CPUs EXCEPT myself */ void @@ -999,21 +979,6 @@ ipi_all_but_self(u_int ipi) ipi_selected(((int)-1 & ~(1 << curcpu)), ipi); } -/* - * send an IPI to myself - */ -void -ipi_self(u_int ipi) -{ - - if (IPI_IS_BITMAPED(ipi) || (ipi == IPI_STOP && stop_cpus_with_nmi)) { - ipi_selected(PCPU_GET(cpumask), ipi); - return; - } - CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); - ipi_pcpu(curcpu, ipi); -} - #ifdef STOP_NMI /* * send NMI IPI to selected CPUs diff --git a/sys/ia64/ia64/interrupt.c b/sys/ia64/ia64/interrupt.c index 7ba1455..0c50b48 100644 --- a/sys/ia64/ia64/interrupt.c +++ b/sys/ia64/ia64/interrupt.c @@ -74,10 +74,6 @@ struct evcnt clock_intr_evcnt; /* event counter for clock intrs. */ #include <ddb/ddb.h> #endif -#ifdef SMP -extern int mp_ipi_test; -#endif - static void ia64_dispatch_intr(void *, u_int); static void @@ -241,9 +237,6 @@ interrupt(struct trapframe *tf) cpu_spinwait(); atomic_clear_int(&started_cpus, mybit); atomic_clear_int(&stopped_cpus, mybit); - } else if (vector == ipi_vector[IPI_TEST]) { - CTR1(KTR_SMP, "IPI_TEST, cpuid=%d", PCPU_GET(cpuid)); - mp_ipi_test++; } else if (vector == ipi_vector[IPI_PREEMPT]) { CTR1(KTR_SMP, "IPI_PREEMPT, cpuid=%d", PCPU_GET(cpuid)); __asm __volatile("mov cr.eoi = r0;; srlz.d"); diff --git a/sys/ia64/ia64/mp_machdep.c b/sys/ia64/ia64/mp_machdep.c index 23b86fb..ce2b4d1 100644 --- a/sys/ia64/ia64/mp_machdep.c +++ b/sys/ia64/ia64/mp_machdep.c @@ -72,8 +72,6 @@ void ia64_ap_startup(void); #define LID_SAPIC_SET(id,eid) (((id & 0xff) << 8 | (eid & 0xff)) << 16); #define LID_SAPIC_MASK 0xffff0000UL -int mp_ipi_test = 0; - /* Variables used by os_boot_rendez and ia64_ap_startup */ struct pcpu *ap_pcpu; void *ap_stack; @@ -269,9 +267,6 @@ cpu_mp_start() if (!ap_awake) printf("SMP: WARNING: cpu%d did not wake up\n", pc->pc_cpuid); - } else { - pc->pc_awake = 1; - ipi_self(IPI_TEST); } } } @@ -285,9 +280,6 @@ cpu_mp_unleash(void *dummy) if (mp_ncpus <= 1) return; - if (mp_ipi_test != 1) - printf("SMP: WARNING: sending of a test IPI failed\n"); - cpus = 0; smp_cpus = 0; SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { @@ -326,19 +318,6 @@ ipi_selected(cpumask_t cpus, int ipi) } /* - * send an IPI to all CPUs, including myself. - */ -void -ipi_all(int ipi) -{ - struct pcpu *pc; - - SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { - ipi_send(pc, ipi); - } -} - -/* * send an IPI to all CPUs EXCEPT myself. */ void @@ -353,16 +332,6 @@ ipi_all_but_self(int ipi) } /* - * send an IPI to myself. - */ -void -ipi_self(int ipi) -{ - - ipi_send(pcpup, ipi); -} - -/* * Send an IPI to the specified processor. The lid parameter holds the * cr.lid (CR64) contents of the target processor. Only the id and eid * fields are used here. diff --git a/sys/ia64/ia64/sal.c b/sys/ia64/ia64/sal.c index 6a55f39..4f46d65 100644 --- a/sys/ia64/ia64/sal.c +++ b/sys/ia64/ia64/sal.c @@ -80,7 +80,6 @@ setup_ipi_vectors(int ceil) ipi_vector[IPI_HIGH_FP] = ceil - 0x30; ipi_vector[IPI_MCA_CMCV] = ceil - 0x30 + 1; - ipi_vector[IPI_TEST] = ceil - 0x30 + 2; } void diff --git a/sys/ia64/include/smp.h b/sys/ia64/include/smp.h index cf1fab3..c6d98f7 100644 --- a/sys/ia64/include/smp.h +++ b/sys/ia64/include/smp.h @@ -17,14 +17,13 @@ #define IPI_HIGH_FP 1 #define IPI_MCA_CMCV 2 #define IPI_MCA_RENDEZ 3 -#define IPI_TEST 4 /* Machine independent IPIs. */ -#define IPI_AST 5 -#define IPI_RENDEZVOUS 6 -#define IPI_STOP 7 -#define IPI_PREEMPT 8 +#define IPI_AST 4 +#define IPI_RENDEZVOUS 5 +#define IPI_STOP 6 +#define IPI_PREEMPT 7 -#define IPI_COUNT 9 +#define IPI_COUNT 8 #ifndef LOCORE @@ -32,10 +31,8 @@ struct pcpu; extern int ipi_vector[]; -void ipi_all(int ipi); void ipi_all_but_self(int ipi); void ipi_selected(cpumask_t cpus, int ipi); -void ipi_self(int ipi); void ipi_send(struct pcpu *, int ipi); #endif /* !LOCORE */ diff --git a/sys/mips/include/smp.h b/sys/mips/include/smp.h index d0ac25d..798beed 100644 --- a/sys/mips/include/smp.h +++ b/sys/mips/include/smp.h @@ -30,9 +30,7 @@ extern u_int32_t boot_cpu_id; void ipi_selected(u_int cpus, u_int32_t ipi); -void ipi_all(u_int32_t ipi); void ipi_all_but_self(u_int32_t ipi); -void ipi_self(u_int32_t ipi); intrmask_t smp_handle_ipi(struct trapframe *frame); void smp_init_secondary(u_int32_t cpuid); void mips_ipi_send(int thread_id); diff --git a/sys/mips/mips/mp_machdep.c b/sys/mips/mips/mp_machdep.c index 1a7e272..3f7d731 100644 --- a/sys/mips/mips/mp_machdep.c +++ b/sys/mips/mips/mp_machdep.c @@ -86,16 +86,6 @@ ipi_selected(u_int32_t cpus, u_int ipi) } /* - * send an IPI INTerrupt containing 'vector' to all CPUs, including myself - */ -void -ipi_all(u_int ipi) -{ - - ipi_selected(all_cpus, ipi); -} - -/* * send an IPI to all CPUs EXCEPT myself */ void @@ -106,16 +96,6 @@ ipi_all_but_self(u_int ipi) } /* - * send an IPI to myself - */ -void -ipi_self(u_int ipi) -{ - - ipi_selected(PCPU_GET(cpumask), ipi); -} - -/* * Handle an IPI sent to this processor. */ intrmask_t diff --git a/sys/powerpc/include/smp.h b/sys/powerpc/include/smp.h index 4d364ab..2b054c5 100644 --- a/sys/powerpc/include/smp.h +++ b/sys/powerpc/include/smp.h @@ -36,14 +36,10 @@ #define IPI_RENDEZVOUS 2 #define IPI_STOP 3 -#define IPI_PPC_TEST 4 - #ifndef LOCORE -void ipi_all(int ipi); void ipi_all_but_self(int ipi); void ipi_selected(cpumask_t cpus, int ipi); -void ipi_self(int ipi); struct cpuref { uintptr_t cr_hwref; diff --git a/sys/powerpc/powerpc/intr_machdep.c b/sys/powerpc/powerpc/intr_machdep.c index dbf3cfc..3e07348 100644 --- a/sys/powerpc/powerpc/intr_machdep.c +++ b/sys/powerpc/powerpc/intr_machdep.c @@ -235,11 +235,6 @@ powerpc_enable_intr(void) PIC_ENABLE(pic, i->irq, vector); } -#ifdef SMP - /* Send ourself a test IPI message. */ - ipi_self(IPI_PPC_TEST); -#endif - return (0); } diff --git a/sys/powerpc/powerpc/mp_machdep.c b/sys/powerpc/powerpc/mp_machdep.c index 12962fb..5d05fd1 100644 --- a/sys/powerpc/powerpc/mp_machdep.c +++ b/sys/powerpc/powerpc/mp_machdep.c @@ -50,8 +50,6 @@ volatile static u_int ap_state; volatile static uint32_t ap_decr; volatile static uint32_t ap_tbl; -int mp_ipi_test = 0; - void machdep_ap_bootstrap(void) { @@ -182,11 +180,6 @@ cpu_mp_unleash(void *dummy) if (mp_ncpus <= 1) return; - if (mp_ipi_test != 1) { - printf("SMP: ERROR: sending of a test IPI failed\n"); - return; - } - cpus = 0; smp_cpus = 0; SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { @@ -263,9 +256,6 @@ powerpc_ipi_handler(void *arg) atomic_clear_int(&started_cpus, self); atomic_clear_int(&stopped_cpus, self); break; - case IPI_PPC_TEST: - mp_ipi_test++; - break; } } @@ -292,17 +282,6 @@ ipi_selected(cpumask_t cpus, int ipi) } } -/* Send an IPI to all CPUs, including myself. */ -void -ipi_all(int ipi) -{ - struct pcpu *pc; - - SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { - ipi_send(pc, ipi); - } -} - /* Send an IPI to all CPUs EXCEPT myself. */ void ipi_all_but_self(int ipi) @@ -314,11 +293,3 @@ ipi_all_but_self(int ipi) ipi_send(pc, ipi); } } - -/* Send an IPI to myself. */ -void -ipi_self(int ipi) -{ - - ipi_send(pcpup, ipi); -} diff --git a/sys/sun4v/include/smp.h b/sys/sun4v/include/smp.h index d1d9da4..4f5adc5 100644 --- a/sys/sun4v/include/smp.h +++ b/sys/sun4v/include/smp.h @@ -82,7 +82,6 @@ void cpu_ipi_stop(struct trapframe *tf); void cpu_ipi_preempt(struct trapframe *tf); void ipi_selected(u_int cpus, u_int ipi); -void ipi_all(u_int ipi); void ipi_all_but_self(u_int ipi); vm_offset_t mp_tramp_alloc(void); |