mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-23 15:32:25 +00:00
dde_linux: fix calculation of ktime from jiffies
This commit is contained in:
parent
47c6377ac0
commit
bcef3aeb1e
@ -56,7 +56,7 @@ void hrtimer_init(struct hrtimer *timer, clockid_t clock_id, enum hrtimer_mode m
|
||||
int hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
|
||||
unsigned long delta_ns, const enum hrtimer_mode mode)
|
||||
{
|
||||
unsigned long expires = tim / (NSEC_PER_MSEC * HZ);
|
||||
unsigned long expires = tim / ((1000/HZ) * NSEC_PER_MSEC);
|
||||
|
||||
/*
|
||||
* Prevent truncation through rounding the values by adding 1 jiffy
|
||||
|
@ -80,7 +80,7 @@ static inline ktime_t ktime_add_ms(const ktime_t kt, const u64 msec)
|
||||
|
||||
static inline ktime_t ktime_get(void)
|
||||
{
|
||||
return (ktime_t){ (s64)jiffies * HZ * NSEC_PER_MSEC /* ns */ };
|
||||
return (ktime_t){ (s64)jiffies * (1000/HZ) * NSEC_PER_MSEC /* ns */ };
|
||||
}
|
||||
|
||||
static inline ktime_t ktime_set(const long sec, const unsigned long nsec)
|
||||
|
Loading…
Reference in New Issue
Block a user