summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-17 13:35:51 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-17 13:35:51 +0000
commitca2f8b9fa01ae65edad766e21893f663da80dfec (patch)
tree43ba00dda0e762b155942bee426d437db85d8a0e
parenta20d99b0201df231d4d3d1d36efcdbe9b7011da5 (diff)
from netbsd:
Make an NMI activate the debugger. This only works on a TT and needs a small hardware patch. This makes it easier to debug drivers that hang on an ipl > splsoft.
-rw-r--r--sys/arch/atari/atari/atari_init.c9
-rw-r--r--sys/arch/atari/atari/genassym.c3
-rw-r--r--sys/arch/atari/atari/locore.s19
3 files changed, 27 insertions, 4 deletions
diff --git a/sys/arch/atari/atari/atari_init.c b/sys/arch/atari/atari/atari_init.c
index 78ada192fd2..62b3890656e 100644
--- a/sys/arch/atari/atari/atari_init.c
+++ b/sys/arch/atari/atari/atari_init.c
@@ -1,4 +1,4 @@
-/* $NetBSD: atari_init.c,v 1.8 1995/08/17 20:31:31 leo Exp $ */
+/* $NetBSD: atari_init.c,v 1.9 1995/12/16 21:40:28 leo Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman
@@ -481,6 +481,13 @@ char *esym_addr; /* Address of kernel '_esym' symbol */
* MFP (ipl6) and softints (ipl1).
*/
SCU->sys_mask = SCU_MFP | SCU_SCC | SCU_SYS_SOFT;
+#ifdef DDB
+ /*
+ * This allows people with the correct hardware modification
+ * to drop into the debugger from an NMI.
+ */
+ SCU->sys_mask |= SCU_IRQ7;
+#endif
}
else machineid |= ATARI_FALCON;
diff --git a/sys/arch/atari/atari/genassym.c b/sys/arch/atari/atari/genassym.c
index a8295a127c2..46dbd9941c6 100644
--- a/sys/arch/atari/atari/genassym.c
+++ b/sys/arch/atari/atari/genassym.c
@@ -1,4 +1,4 @@
-/* $NetBSD: genassym.c,v 1.5 1995/05/28 19:14:30 leo Exp $ */
+/* $NetBSD: genassym.c,v 1.6 1995/12/16 21:40:29 leo Exp $ */
/*
* Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -166,6 +166,7 @@ main()
printf("#define\tMMU_68040 %d\n", MMU_68040);
printf("#define\tSOFTINT_ADDR %d\n", &SCU->sys_int);
+ printf("#define\tSYSMASK_ADDR %d\n", &SCU->sys_mask);
exit(0);
}
diff --git a/sys/arch/atari/atari/locore.s b/sys/arch/atari/atari/locore.s
index f7d598cfe74..9df163961f5 100644
--- a/sys/arch/atari/atari/locore.s
+++ b/sys/arch/atari/atari/locore.s
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.12 1995/12/11 02:38:01 thorpej Exp $ */
+/* $NetBSD: locore.s,v 1.13 1995/12/16 21:40:31 leo Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -598,7 +598,22 @@ _lev1intr:
addql #1,_cnt+V_INTR | chalk up another interrupt
jra rei
-_lev7intr: /* Should never occur */
+ /*
+ * Should never occur, except when special hardware modification
+ * is installed. In this case, one expects to be dropped into
+ * the debugger.
+ */
+_lev7intr:
+#ifdef DDB
+ /*
+ * Note that the nmi has to be turned off while handling it because
+ * the hardware modification has no de-bouncing logic....
+ */
+ movb SYSMASK_ADDR, sp@- | save current sysmask
+ movb #0, 0xff8e01 | disable all interrupts
+ trap #15 | drop into the debugger
+ movb sp@+, SYSMASK_ADDR | restore sysmask
+#endif
addql #1,_intrcnt+28 | add another nmi interrupt
rte | all done