diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 2004-06-24 19:35:28 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 2004-06-24 19:35:28 +0000 |
commit | c6cc17e855e1d9fe177fba41d00de6e89fdc852e (patch) | |
tree | bdc6bde04c820ca59fe49d60185cf6ac40b44e30 /sys/dev/usb/usb.c | |
parent | 128dd71ffeec48b94e085c757b3626553d619e7c (diff) |
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.c | 8 |
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) { |