diff options
author | cheloha <cheloha@cvs.openbsd.org> | 2019-05-07 14:22:07 +0000 |
---|---|---|
committer | cheloha <cheloha@cvs.openbsd.org> | 2019-05-07 14:22:07 +0000 |
commit | 52156f96f22bd308ecb1ff974e3b34b02f682223 (patch) | |
tree | d1cdd7d432fd57e931e45a3c14d4eb7928304d30 /sys/dev | |
parent | 85f43390d8a6f802ee08af904247b45816296606 (diff) |
Fix delay logic: measure w/ uptime, pack timeval correctly. ok krw@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/ncr53c9x.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/ic/ncr53c9x.c b/sys/dev/ic/ncr53c9x.c index e4a25139049..509171ebaf3 100644 --- a/sys/dev/ic/ncr53c9x.c +++ b/sys/dev/ic/ncr53c9x.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ncr53c9x.c,v 1.64 2017/09/08 05:36:52 deraadt Exp $ */ +/* $OpenBSD: ncr53c9x.c,v 1.65 2019/05/07 14:22:06 cheloha Exp $ */ /* $NetBSD: ncr53c9x.c,v 1.56 2000/11/30 14:41:46 thorpej Exp $ */ /* @@ -2713,16 +2713,16 @@ shortcut: { struct timeval wait, cur; - microtime(&wait); + microuptime(&wait); wait.tv_usec += 50/sc->sc_freq; - if (wait.tv_usec > 1000000) { + if (wait.tv_usec >= 1000000) { wait.tv_sec++; wait.tv_usec -= 1000000; } do { if (NCRDMA_ISINTR(sc)) goto again; - microtime(&cur); + microuptime(&cur); } while (timercmp(&cur, &wait, <=)); } goto out; |