summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/macppc/dev/adb_direct.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/sys/arch/macppc/dev/adb_direct.c b/sys/arch/macppc/dev/adb_direct.c
index 0e4e931847d..cc8823ea1a2 100644
--- a/sys/arch/macppc/dev/adb_direct.c
+++ b/sys/arch/macppc/dev/adb_direct.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adb_direct.c,v 1.10 2003/11/03 06:43:02 david Exp $ */
+/* $OpenBSD: adb_direct.c,v 1.11 2004/05/28 23:50:58 drahn Exp $ */
/* $NetBSD: adb_direct.c,v 1.14 2000/06/08 22:10:45 tsubai Exp $ */
/*
@@ -806,6 +806,18 @@ adb_soft_intr(void)
print_single(adbInbound[adbInHead].data);
}
#endif
+ /*
+ * 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 debuger by keystroke.
+ */
+ s = splhigh();
+ adbInCount--;
+ if (++adbInHead >= ADB_QUEUE)
+ adbInHead = 0;
+ splx(s);
/* call default completion routine if it's valid */
if (comprout) {
@@ -813,12 +825,6 @@ adb_soft_intr(void)
(buffer, compdata, cmd);
}
- s = splhigh();
- adbInCount--;
- if (++adbInHead >= ADB_QUEUE)
- adbInHead = 0;
- splx(s);
-
}
}