summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2020-03-05 19:39:04 +0000
committerkettenis <kettenis@openbsd.org>2020-03-05 19:39:04 +0000
commit7fd16c35604733b78d14a61f28afc5168a16b100 (patch)
tree0a6303f608b65980ca86c79ba2c81cd674057487
parentAllow amd64 boot(8) and friends to read from an ffs2 filesystem. (diff)
downloadwireguard-openbsd-7fd16c35604733b78d14a61f28afc5168a16b100.tar.xz
wireguard-openbsd-7fd16c35604733b78d14a61f28afc5168a16b100.zip
The local_clock_us() function needs microsecond resolution so implement it
using microuptime(9). Avoids a hard hang when starting X on Intel Cherry Trail Atom processors. ok jsg@
-rw-r--r--sys/dev/pci/drm/i915/i915_request.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/i915/i915_request.c b/sys/dev/pci/drm/i915/i915_request.c
index a65040e0452..714a3d842c7 100644
--- a/sys/dev/pci/drm/i915/i915_request.c
+++ b/sys/dev/pci/drm/i915/i915_request.c
@@ -1205,8 +1205,11 @@ static unsigned long local_clock_us(unsigned int *cpu)
#else
static unsigned long local_clock_us(unsigned *cpu)
{
+ struct timeval tv;
+
*cpu = cpu_number();
- return ticks * tick;
+ microuptime(&tv);
+ return tv.tv_sec * 1000000 + tv.tv_usec;
}
#endif