Make it possible to enter ddb from the serial console.
authorkettenis <kettenis@openbsd.org>
Tue, 19 Aug 2008 08:26:20 +0000 (08:26 +0000)
committerkettenis <kettenis@openbsd.org>
Tue, 19 Aug 2008 08:26:20 +0000 (08:26 +0000)
ok miod@, deraadt@

sys/arch/macppc/macppc/db_interface.c

index 6d68639..db288ef 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: db_interface.c,v 1.7 2003/10/15 17:50:16 drahn Exp $  */
+/*     $OpenBSD: db_interface.c,v 1.8 2008/08/19 08:26:20 kettenis Exp $       */
 /*      $NetBSD: db_interface.c,v 1.12 2001/07/22 11:29:46 wiz Exp $ */
 
 #include <sys/param.h>
@@ -10,6 +10,8 @@
 #include <machine/db_machdep.h>
 #include <ddb/db_extern.h>
 
+int db_active = 0;
+
 int ddb_trap_glue(struct trapframe *frame); /* called from locore */
 
 void
@@ -31,9 +33,11 @@ ddb_trap_glue(struct trapframe *frame)
                DDB_REGS->tf.srr0 = frame->srr0;
                DDB_REGS->tf.srr1 = frame->srr1;
 
+               db_active++;
                cnpollc(TRUE);
                db_trap(T_BREAKPOINT, 0);
                cnpollc(FALSE);
+               db_active--;
 
                bcopy(DDB_REGS->tf.fixreg, frame->fixreg,
                        32 * sizeof(u_int32_t));