From 850c52ee1b4e91c6781d337bc129302697188f62 Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Fri, 1 Sep 2017 23:58:40 +0200 Subject: 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. --- kern/timer.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'kern/timer.h') 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 -#include #include /* @@ -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; } /* -- cgit v1.2.3