summaryrefslogtreecommitdiff
path: root/sys/arch/mac68k/dev
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-02-12 17:03:26 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-02-12 17:03:26 +0000
commit86cb2c1a1a55bb32cceafec8ae6cf30a9cd5c7d6 (patch)
tree78d0c584660432257100b3a080f2cf8b9cfe4423 /sys/arch/mac68k/dev
parentd28e9e60d3f2f53f3d5867be56c8101eb725a2be (diff)
Remove packets from the queue before calling their completion routine, as
done on macppc.
Diffstat (limited to 'sys/arch/mac68k/dev')
-rw-r--r--sys/arch/mac68k/dev/adb.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/sys/arch/mac68k/dev/adb.c b/sys/arch/mac68k/dev/adb.c
index ec2630de6c8..6b6030baa54 100644
--- a/sys/arch/mac68k/dev/adb.c
+++ b/sys/arch/mac68k/dev/adb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adb.c,v 1.21 2006/01/22 15:25:30 miod Exp $ */
+/* $OpenBSD: adb.c,v 1.22 2006/02/12 17:03:25 miod Exp $ */
/* $NetBSD: adb.c,v 1.47 2005/06/16 22:43:36 jmc Exp $ */
/* $NetBSD: adb_direct.c,v 1.51 2005/06/16 22:43:36 jmc Exp $ */
@@ -1706,20 +1706,25 @@ adb_soft_intr(void)
}
#endif
- /* call default completion routine if it's valid */
- if (comprout) {
- (void)((int (*)(u_char *, u_char *, int))comprout)
- (buffer, compdata, cmd);
- }
-
+ /*
+ * Remove the packet from the queue before calling
+ * the completion routine, so that the completion
+ * routine can reentrantly process the queue. For
+ * example, this happens when polling is turned on
+ * by entering the debugger by keystroke.
+ */
s = splhigh();
adbInCount--;
if (++adbInHead >= ADB_QUEUE)
adbInHead = 0;
splx(s);
+ /* call default completion routine if it's valid */
+ if (comprout) {
+ (void)((int (*)(u_char *, u_char *, int))comprout)
+ (buffer, compdata, cmd);
+ }
}
- return;
}