repo.or.cz
/
cbaos.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Semi-decennial update. 50% code inflation.
[cbaos.git]
/
kernel
/
timekeeping.c
blob
cb58d32c074b2e595ca8b7d892c597c9a8fbba57
1
#include <timekeeping.h>
2
#include <arch/sched.h>
3
#include <types.h>
4
5
6
static
u32 jiffies_up
;
7
static
u32 jiffies_lo
;
8
9
void
timekeeping
(
u32 now
)
10
{
11
if
(
now
<
jiffies_lo
)
12
jiffies_up
++;
13
jiffies_lo
=
now
;
14
}
15
16
u32
time_ms
(
void
)
17
{
18
return
jiffies_up
*
MSEC_IN_TICKSOVF
+
ticks2ms
(
jiffies_lo
);
19
}