summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1995-11-30 22:59:06 +0000
committerderaadt <deraadt@openbsd.org>1995-11-30 22:59:06 +0000
commitf740b26dca924248b739901c9b9efafbc228c56f (patch)
tree18db8ebed9a2c0c94d890c48e415bacc681d1962
parentdo not truncate swdevt[] ever (diff)
downloadwireguard-openbsd-f740b26dca924248b739901c9b9efafbc228c56f.tar.xz
wireguard-openbsd-f740b26dca924248b739901c9b9efafbc228c56f.zip
correct way to call tsleep is almost always "while (condition) tsleep(...)"
-rw-r--r--sys/dev/isa/aha.c14
-rw-r--r--sys/dev/isa/aha1542.c14
2 files changed, 16 insertions, 12 deletions
diff --git a/sys/dev/isa/aha.c b/sys/dev/isa/aha.c
index d516a8d6421..1049d677dfe 100644
--- a/sys/dev/isa/aha.c
+++ b/sys/dev/isa/aha.c
@@ -71,9 +71,10 @@
#define Debugger() panic("should call debugger here (aha1542.c)")
#endif /* ! DDB */
-/* XXX fixme: */
-/* on i386 at least xfers from/to user memory */
-/* cannot be serviced at interrupt time. */
+/* XXX fixme:
+ * on i386 at least, xfers to/from user memory
+ * cannot be serviced at interrupt time.
+ */
#ifdef i386
#include <machine/vmparam.h>
#define VOLATILE_XS(xs) \
@@ -1329,9 +1330,10 @@ aha_scsi_cmd(xs)
SC_DEBUG(sc_link, SDEV_DB3, ("cmd_sent\n"));
if (VOLATILE_XS(xs)) {
- if (tsleep(ccb, PRIBIO, "ahawait", (xs->timeout * hz) / 1000)) {
- aha_timeout(ccb);
- tsleep(ccb, PRIBIO, "ahawait1", 2000);
+ timeout(aha_timeout, ccb, (xs->timeout * hz) / 1000);
+ while ((ccb->xs->flags & ITSDONE) == 0) {
+ tsleep(ccb, PRIBIO, "ahawait",
+ (xs->timeout * hz) / 1000);
}
splx(s);
if (ccb->data_nseg) {
diff --git a/sys/dev/isa/aha1542.c b/sys/dev/isa/aha1542.c
index d516a8d6421..1049d677dfe 100644
--- a/sys/dev/isa/aha1542.c
+++ b/sys/dev/isa/aha1542.c
@@ -71,9 +71,10 @@
#define Debugger() panic("should call debugger here (aha1542.c)")
#endif /* ! DDB */
-/* XXX fixme: */
-/* on i386 at least xfers from/to user memory */
-/* cannot be serviced at interrupt time. */
+/* XXX fixme:
+ * on i386 at least, xfers to/from user memory
+ * cannot be serviced at interrupt time.
+ */
#ifdef i386
#include <machine/vmparam.h>
#define VOLATILE_XS(xs) \
@@ -1329,9 +1330,10 @@ aha_scsi_cmd(xs)
SC_DEBUG(sc_link, SDEV_DB3, ("cmd_sent\n"));
if (VOLATILE_XS(xs)) {
- if (tsleep(ccb, PRIBIO, "ahawait", (xs->timeout * hz) / 1000)) {
- aha_timeout(ccb);
- tsleep(ccb, PRIBIO, "ahawait1", 2000);
+ timeout(aha_timeout, ccb, (xs->timeout * hz) / 1000);
+ while ((ccb->xs->flags & ITSDONE) == 0) {
+ tsleep(ccb, PRIBIO, "ahawait",
+ (xs->timeout * hz) / 1000);
}
splx(s);
if (ccb->data_nseg) {