summaryrefslogtreecommitdiff
path: root/kern/timer.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-09-01 23:58:40 +0200
committerRichard Braun <rbraun@sceen.net>2017-09-01 23:58:40 +0200
commit850c52ee1b4e91c6781d337bc129302697188f62 (patch)
tree3cf906e75053a0693966efded88a4be769378809 /kern/timer.h
parentfe715443e82b068a0b061f1b8ed3c01a96b1e4ba (diff)
kern/timer: make timer time reads non atomic
This makes such accesses on 32-bits processor without 64-bits atomic instruction too cumbersome for what it's worth.
Diffstat (limited to 'kern/timer.h')
-rw-r--r--kern/timer.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/kern/timer.h b/kern/timer.h
index a082c538..ddace45e 100644
--- a/kern/timer.h
+++ b/kern/timer.h
@@ -23,7 +23,6 @@
#include <stdint.h>
-#include <kern/atomic.h>
#include <kern/init.h>
/*
@@ -44,11 +43,14 @@ typedef void (*timer_fn_t)(struct timer *);
/*
* Return the absolute expiration time of the timer, in ticks.
+ *
+ * This function may not be called while another thread is scheduling the
+ * timer.
*/
static inline uint64_t
timer_get_time(const struct timer *timer)
{
- return atomic_load(&timer->ticks, ATOMIC_RELAXED);
+ return timer->ticks;
}
/*