Semi-decennial update. 50% code inflation.
[cbaos.git] / kernel / timekeeping.c
blobcb58d32c074b2e595ca8b7d892c597c9a8fbba57
1 #include <timekeeping.h>
2 #include <arch/sched.h>
3 #include <types.h>
6 static u32 jiffies_up;
7 static u32 jiffies_lo;
9 void timekeeping(u32 now)
11 if (now < jiffies_lo)
12 jiffies_up++;
13 jiffies_lo = now;
16 u32 time_ms(void)
18 return jiffies_up * MSEC_IN_TICKSOVF + ticks2ms(jiffies_lo);