summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorfsmp <fsmp@FreeBSD.org>1997-06-27 23:24:38 +0000
committerfsmp <fsmp@FreeBSD.org>1997-06-27 23:24:38 +0000
commit4038c31428a5ab8661cab2264fb1249ca6e3ae5c (patch)
tree1d4a9814ceba82d77c07ea72b7183afc733b4c76 /sys
parenta30e0bc8c5ab0ce07f2fa78bcd0f968921fcf232 (diff)
downloadFreeBSD-src-4038c31428a5ab8661cab2264fb1249ca6e3ae5c.zip
FreeBSD-src-4038c31428a5ab8661cab2264fb1249ca6e3ae5c.tar.gz
Experimental calls to stop_cpus()/restart_cpus() within breakpoint calls.
Turned off by default in smptests.h.
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/db_interface.c21
-rw-r--r--sys/i386/i386/db_interface.c21
2 files changed, 40 insertions, 2 deletions
diff --git a/sys/amd64/amd64/db_interface.c b/sys/amd64/amd64/db_interface.c
index 5f028b0..2b31d8e 100644
--- a/sys/amd64/amd64/db_interface.c
+++ b/sys/amd64/amd64/db_interface.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: db_interface.c,v 1.28 1997/04/26 11:45:03 peter Exp $
+ * $Id: db_interface.c,v 1.1 1997/06/26 18:40:55 smp Exp smp $
*/
/*
@@ -38,6 +38,10 @@
#include <machine/cons.h>
#include <machine/md_var.h>
#include <machine/segments.h>
+#ifdef SMP
+#include <machine/smp.h>
+#include <machine/smptests.h> /** TEST_CPUSTOP */
+#endif
#include <vm/vm.h>
#include <vm/vm_param.h>
@@ -134,6 +138,11 @@ kdb_trap(type, code, regs)
cnpollc(TRUE);
+#if defined(SMP) && defined(TEST_CPUSTOP)
+ /* we stopp all CPUs except ourselves (obviously) */
+ stop_cpus(other_cpus);
+#endif /* SMP && TEST_CPUSTOP */
+
(void) setjmp(db_global_jmpbuf);
db_global_jmpbuf_valid = TRUE;
if (ddb_mode)
@@ -142,6 +151,16 @@ kdb_trap(type, code, regs)
gdb_handle_exception(&ddb_regs, type, code);
db_global_jmpbuf_valid = FALSE;
+#if defined(SMP) && defined(TEST_CPUSTOP)
+ /* restart all the CPUs we previously stopped */
+ if (stopped_cpus != other_cpus) {
+ db_printf("whoa, other_cpus: 0x%08x, stopped_cpus: 0x%08x\n",
+ other_cpus, stopped_cpus);
+ cngetc();
+ }
+ restart_cpus(stopped_cpus);
+#endif /* SMP && TEST_CPUSTOP */
+
cnpollc(FALSE);
regs->tf_eip = ddb_regs.tf_eip;
diff --git a/sys/i386/i386/db_interface.c b/sys/i386/i386/db_interface.c
index 5f028b0..2b31d8e 100644
--- a/sys/i386/i386/db_interface.c
+++ b/sys/i386/i386/db_interface.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: db_interface.c,v 1.28 1997/04/26 11:45:03 peter Exp $
+ * $Id: db_interface.c,v 1.1 1997/06/26 18:40:55 smp Exp smp $
*/
/*
@@ -38,6 +38,10 @@
#include <machine/cons.h>
#include <machine/md_var.h>
#include <machine/segments.h>
+#ifdef SMP
+#include <machine/smp.h>
+#include <machine/smptests.h> /** TEST_CPUSTOP */
+#endif
#include <vm/vm.h>
#include <vm/vm_param.h>
@@ -134,6 +138,11 @@ kdb_trap(type, code, regs)
cnpollc(TRUE);
+#if defined(SMP) && defined(TEST_CPUSTOP)
+ /* we stopp all CPUs except ourselves (obviously) */
+ stop_cpus(other_cpus);
+#endif /* SMP && TEST_CPUSTOP */
+
(void) setjmp(db_global_jmpbuf);
db_global_jmpbuf_valid = TRUE;
if (ddb_mode)
@@ -142,6 +151,16 @@ kdb_trap(type, code, regs)
gdb_handle_exception(&ddb_regs, type, code);
db_global_jmpbuf_valid = FALSE;
+#if defined(SMP) && defined(TEST_CPUSTOP)
+ /* restart all the CPUs we previously stopped */
+ if (stopped_cpus != other_cpus) {
+ db_printf("whoa, other_cpus: 0x%08x, stopped_cpus: 0x%08x\n",
+ other_cpus, stopped_cpus);
+ cngetc();
+ }
+ restart_cpus(stopped_cpus);
+#endif /* SMP && TEST_CPUSTOP */
+
cnpollc(FALSE);
regs->tf_eip = ddb_regs.tf_eip;
OpenPOWER on IntegriCloud