diff options
Diffstat (limited to 'arch/um/kernel/time.c')
-rw-r--r-- | arch/um/kernel/time.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c index c40c86a3f918..f829b309b63c 100644 --- a/arch/um/kernel/time.c +++ b/arch/um/kernel/time.c | |||
@@ -33,7 +33,7 @@ void timer(void) | |||
33 | timeradd(&xtime, &local_offset, &xtime); | 33 | timeradd(&xtime, &local_offset, &xtime); |
34 | } | 34 | } |
35 | 35 | ||
36 | void set_interval(int timer_type) | 36 | static void set_interval(int timer_type) |
37 | { | 37 | { |
38 | int usec = 1000000/hz(); | 38 | int usec = 1000000/hz(); |
39 | struct itimerval interval = ((struct itimerval) { { 0, usec }, | 39 | struct itimerval interval = ((struct itimerval) { { 0, usec }, |
@@ -45,12 +45,7 @@ void set_interval(int timer_type) | |||
45 | 45 | ||
46 | void enable_timer(void) | 46 | void enable_timer(void) |
47 | { | 47 | { |
48 | int usec = 1000000/hz(); | 48 | set_interval(ITIMER_VIRTUAL); |
49 | struct itimerval enable = ((struct itimerval) { { 0, usec }, | ||
50 | { 0, usec }}); | ||
51 | if(setitimer(ITIMER_VIRTUAL, &enable, NULL)) | ||
52 | printk("enable_timer - setitimer failed, errno = %d\n", | ||
53 | errno); | ||
54 | } | 49 | } |
55 | 50 | ||
56 | void disable_timer(void) | 51 | void disable_timer(void) |
@@ -155,13 +150,15 @@ void idle_sleep(int secs) | |||
155 | nanosleep(&ts, NULL); | 150 | nanosleep(&ts, NULL); |
156 | } | 151 | } |
157 | 152 | ||
158 | /* | 153 | /* XXX This partly duplicates init_irq_signals */ |
159 | * Overrides for Emacs so that we follow Linus's tabbing style. | 154 | |
160 | * Emacs will notice this stuff at the end of the file and automatically | 155 | void user_time_init(void) |
161 | * adjust the settings for this buffer only. This must remain at the end | 156 | { |
162 | * of the file. | 157 | set_handler(SIGVTALRM, (__sighandler_t) alarm_handler, |
163 | * --------------------------------------------------------------------------- | 158 | SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, |
164 | * Local variables: | 159 | SIGALRM, SIGUSR2, -1); |
165 | * c-file-style: "linux" | 160 | set_handler(SIGALRM, (__sighandler_t) alarm_handler, |
166 | * End: | 161 | SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, |
167 | */ | 162 | SIGVTALRM, SIGUSR2, -1); |
163 | set_interval(ITIMER_VIRTUAL); | ||
164 | } | ||