diff options
Diffstat (limited to 'arch/um/os-Linux/time.c')
-rw-r--r-- | arch/um/os-Linux/time.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/um/os-Linux/time.c b/arch/um/os-Linux/time.c index 574b134f0502..e34e1effe0f5 100644 --- a/arch/um/os-Linux/time.c +++ b/arch/um/os-Linux/time.c | |||
@@ -14,7 +14,7 @@ | |||
14 | 14 | ||
15 | int set_interval(void) | 15 | int set_interval(void) |
16 | { | 16 | { |
17 | int usec = 1000000/UM_HZ; | 17 | int usec = UM_USEC_PER_SEC / UM_HZ; |
18 | struct itimerval interval = ((struct itimerval) { { 0, usec }, | 18 | struct itimerval interval = ((struct itimerval) { { 0, usec }, |
19 | { 0, usec } }); | 19 | { 0, usec } }); |
20 | 20 | ||
@@ -26,11 +26,11 @@ int set_interval(void) | |||
26 | 26 | ||
27 | int timer_one_shot(int ticks) | 27 | int timer_one_shot(int ticks) |
28 | { | 28 | { |
29 | unsigned long usec = ticks * 1000000 / UM_HZ; | 29 | unsigned long usec = ticks * UM_USEC_PER_SEC / UM_HZ; |
30 | unsigned long sec = usec / 1000000; | 30 | unsigned long sec = usec / UM_USEC_PER_SEC; |
31 | struct itimerval interval; | 31 | struct itimerval interval; |
32 | 32 | ||
33 | usec %= 1000000; | 33 | usec %= UM_USEC_PER_SEC; |
34 | interval = ((struct itimerval) { { 0, 0 }, { sec, usec } }); | 34 | interval = ((struct itimerval) { { 0, 0 }, { sec, usec } }); |
35 | 35 | ||
36 | if (setitimer(ITIMER_VIRTUAL, &interval, NULL) == -1) | 36 | if (setitimer(ITIMER_VIRTUAL, &interval, NULL) == -1) |
@@ -78,8 +78,8 @@ extern void alarm_handler(int sig, struct sigcontext *sc); | |||
78 | 78 | ||
79 | void idle_sleep(unsigned long long nsecs) | 79 | void idle_sleep(unsigned long long nsecs) |
80 | { | 80 | { |
81 | struct timespec ts = { .tv_sec = nsecs / BILLION, | 81 | struct timespec ts = { .tv_sec = nsecs / UM_NSEC_PER_SEC, |
82 | .tv_nsec = nsecs % BILLION }; | 82 | .tv_nsec = nsecs % UM_NSEC_PER_SEC }; |
83 | 83 | ||
84 | if (nanosleep(&ts, &ts) == 0) | 84 | if (nanosleep(&ts, &ts) == 0) |
85 | alarm_handler(SIGVTALRM, NULL); | 85 | alarm_handler(SIGVTALRM, NULL); |