summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-10-20 16:54:53 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-10-20 16:54:53 +0000
commitdb5ced60a56bb8d09d7b16c18b6d92f591d323c6 (patch)
tree59208925d4b1f316fbc3fdf3bf729a7912bd9b50 /sys
parent3e9b193c879d559ed7edac7a3ad268cda0156d1a (diff)
Make sure to send an ipi to the processor a given proc runs on in signotify(),
in the MULTIPROCESOR case. ok kettenis@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc64/include/cpu.h4
-rw-r--r--sys/arch/sparc64/sparc64/ipifuncs.c14
-rw-r--r--sys/arch/sparc64/sparc64/locore.s6
-rw-r--r--sys/arch/sparc64/sparc64/machdep.c6
4 files changed, 24 insertions, 6 deletions
diff --git a/sys/arch/sparc64/include/cpu.h b/sys/arch/sparc64/include/cpu.h
index dc2f6f8c736..c66081c983b 100644
--- a/sys/arch/sparc64/include/cpu.h
+++ b/sys/arch/sparc64/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.49 2007/10/18 20:44:47 kettenis Exp $ */
+/* $OpenBSD: cpu.h,v 1.50 2007/10/20 16:54:49 miod Exp $ */
/* $NetBSD: cpu.h,v 1.28 2001/06/14 22:56:58 thorpej Exp $ */
/*
@@ -155,6 +155,8 @@ void cpu_boot_secondary_processors(void);
void sparc64_send_ipi(int, void (*)(void), u_int64_t, u_int64_t);
void sparc64_broadcast_ipi(void (*)(void), u_int64_t, u_int64_t);
+void smp_signotify(struct proc *);
+
#else
#define cpu_number() 0
diff --git a/sys/arch/sparc64/sparc64/ipifuncs.c b/sys/arch/sparc64/sparc64/ipifuncs.c
index 501569b2e33..2dec458c16d 100644
--- a/sys/arch/sparc64/sparc64/ipifuncs.c
+++ b/sys/arch/sparc64/sparc64/ipifuncs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipifuncs.c,v 1.3 2007/10/18 20:44:47 kettenis Exp $ */
+/* $OpenBSD: ipifuncs.c,v 1.4 2007/10/20 16:54:52 miod Exp $ */
/* $NetBSD: ipifuncs.c,v 1.8 2006/10/07 18:11:36 rjs Exp $ */
/*-
@@ -36,7 +36,7 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/malloc.h>
+#include <sys/proc.h>
#include <machine/cpu.h>
#include <machine/ctlreg.h>
@@ -54,6 +54,7 @@ extern int db_active;
*/
void ipi_tlb_page_demap(void);
void ipi_tlb_context_demap(void);
+void ipi_softint(void);
/*
* Send an interprocessor interrupt.
@@ -142,3 +143,12 @@ smp_tlb_flush_ctx(int ctx)
sparc64_broadcast_ipi(ipi_tlb_context_demap, ctx, 0);
}
+
+void
+smp_signotify(struct proc *p)
+{
+ if (db_active)
+ return;
+
+ sparc64_send_ipi(p->p_cpu->ci_upaid, ipi_softint, 1 << IPL_NONE, 0UL);
+}
diff --git a/sys/arch/sparc64/sparc64/locore.s b/sys/arch/sparc64/sparc64/locore.s
index 5d335ec8a12..ac677c22686 100644
--- a/sys/arch/sparc64/sparc64/locore.s
+++ b/sys/arch/sparc64/sparc64/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.92 2007/10/20 16:41:46 miod Exp $ */
+/* $OpenBSD: locore.s,v 1.93 2007/10/20 16:54:52 miod Exp $ */
/* $NetBSD: locore.s,v 1.137 2001/08/13 06:10:10 jdolecek Exp $ */
/*
@@ -3381,6 +3381,10 @@ ENTRY(ipi_drop_fpstate)
sethi %hi(FPPROC), %g1
ba ret_from_intr_vector
stx %g0, [%g1 + %lo(FPPROC)] ! fpproc = NULL
+
+ENTRY(ipi_softint)
+ ba ret_from_intr_vector
+ wr %g3, 0, SET_SOFTINT
#endif
/*
diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c
index 4e4474e0e81..0e168761167 100644
--- a/sys/arch/sparc64/sparc64/machdep.c
+++ b/sys/arch/sparc64/sparc64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.99 2007/10/16 20:33:27 kettenis Exp $ */
+/* $OpenBSD: machdep.c,v 1.100 2007/10/20 16:54:52 miod Exp $ */
/* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */
/*-
@@ -677,7 +677,9 @@ signotify(struct proc *p)
{
aston(p);
#ifdef MULTIPROCESSOR
- /* XXX Send IPI if necessary. */
+ /* Send IPI if necessary. */
+ if (p->p_cpu != curcpu() && p->p_cpu != NULL)
+ smp_signotify(p);
#endif
}