The unit here is seconds. Just convert and use the appropriate
interface.
The >> operator is of a lower precedence than the * operator in C, so
this doesn't change the duration.... though I had to double-check
that.
ok?
Index: pv/xenstore.c
===================================================================
RCS file: /cvs/src/sys/dev/pv/xenstore.c,v
retrieving revision 1.44
diff -u -p -r1.44 xenstore.c
--- pv/xenstore.c 10 Aug 2017 18:14:56 -0000 1.44
+++ pv/xenstore.c 11 Jan 2020 00:01:24 -0000
@@ -298,8 +298,8 @@ xs_get_msg(struct xs_softc *xs, int wait
delay(XST_DELAY * 1000 >> 2);
mtx_enter(&xs->xs_frqlck);
} else
- msleep(chan, &xs->xs_frqlck, PRIBIO, chan,
- XST_DELAY * hz >> 2);
+ msleep_nsec(chan, &xs->xs_frqlck, PRIBIO, chan,
+ SEC_TO_NSEC(XST_DELAY) >> 2);
}
mtx_leave(&xs->xs_frqlck);
return (xsm);
@@ -345,8 +345,10 @@ xs_poll(struct xs_softc *xs, int nosleep
s = splnet();
xs_intr(xs);
splx(s);
- } else
- tsleep(xs->xs_wchan, PRIBIO, xs->xs_wchan, XST_DELAY * hz >> 2);
+ } else {
+ tsleep_nsec(xs->xs_wchan, PRIBIO, xs->xs_wchan,
+ SEC_TO_NSEC(XST_DELAY) >> 2);
+ }
}
int
@@ -444,8 +446,8 @@ xs_reply(struct xs_transaction *xst, uin
splx(s);
mtx_enter(&xs->xs_rsplck);
} else
- msleep(xs->xs_rchan, &xs->xs_rsplck, PRIBIO,
- xs->xs_rchan, XST_DELAY * hz >> 2);
+ msleep_nsec(xs->xs_rchan, &xs->xs_rsplck, PRIBIO,
+ xs->xs_rchan, SEC_TO_NSEC(XST_DELAY) >> 2);
}
mtx_leave(&xs->xs_rsplck);
return (xsm);