In adb_soft_intr, remove the packet from the queue before calling the

completion routine so that the completion routine can reentrantly
process the queue.  This happens, for example. when polling is turned
on by entering the debugger by keystroke.
This commit is contained in:
dbj 2002-02-23 10:47:16 +00:00
parent a290138790
commit b97918f553
1 changed files with 12 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: adb_direct.c,v 1.20 2002/01/02 20:30:45 dbj Exp $ */
/* $NetBSD: adb_direct.c,v 1.21 2002/02/23 10:47:16 dbj Exp $ */
/* From: adb_direct.c 2.02 4/18/97 jpw */
@ -1006,6 +1006,17 @@ 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) {
@ -1014,13 +1025,6 @@ adb_soft_intr(void)
(*f)(buffer, compdata, cmd);
}
s = splhigh();
adbInCount--;
if (++adbInHead >= ADB_QUEUE)
adbInHead = 0;
splx(s);
}
return;
}