summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb.c
diff options
context:
space:
mode:
authortholo <tholo@openbsd.org>2004-06-24 19:35:22 +0000
committertholo <tholo@openbsd.org>2004-06-24 19:35:22 +0000
commitc247527514ab9a1b328cae8b6e13b0ff68eb2a76 (patch)
tree276db6e65e12534fa619a2bf272017ece0e3f6b6 /sys/dev/usb/usb.c
parentregress test for re-exec corner cases (diff)
downloadwireguard-openbsd-c247527514ab9a1b328cae8b6e13b0ff68eb2a76.tar.xz
wireguard-openbsd-c247527514ab9a1b328cae8b6e13b0ff68eb2a76.zip
This moves access to wall and uptime variables in MI code,
encapsulating all such access into wall-defined functions that makes sure locking is done as needed. It also cleans up some uses of wall time vs. uptime some places, but there is sure to be more of these needed as well, particularily in MD code. Also, many current calls to microtime() should probably be changed to getmicrotime(), or to the {,get}microuptime() versions. ok art@ deraadt@ aaron@ matthieu@ beck@ sturm@ millert@ others "Oh, that is not your problem!" from miod@
Diffstat (limited to 'sys/dev/usb/usb.c')
-rw-r--r--sys/dev/usb/usb.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c
index 64be39aaacc..60e918b2865 100644
--- a/sys/dev/usb/usb.c
+++ b/sys/dev/usb/usb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb.c,v 1.27 2004/05/04 16:59:32 grange Exp $ */
+/* $OpenBSD: usb.c,v 1.28 2004/06/24 19:35:24 tholo Exp $ */
/* $NetBSD: usb.c,v 1.77 2003/01/01 00:10:26 thorpej Exp $ */
/*
@@ -720,15 +720,15 @@ usb_add_event(int type, struct usb_event *uep)
{
struct usb_event_q *ueq;
struct usb_event ue;
- struct timeval thetime;
+ struct timespec thetime;
int s;
- microtime(&thetime);
+ nanotime(&thetime);
/* Don't want to wait here inside splusb() */
ueq = malloc(sizeof *ueq, M_USBDEV, M_WAITOK);
ueq->ue = *uep;
ueq->ue.ue_type = type;
- TIMEVAL_TO_TIMESPEC(&thetime, &ueq->ue.ue_time);
+ ueq->ue.ue_time = thetime;
s = splusb();
if (++usb_nevents >= USB_MAX_EVENTS) {