aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/kernel/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/kernel/time.c')
-rw-r--r--arch/um/kernel/time.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c
index c40c86a3f918..c40b611e3d93 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
36void set_interval(int timer_type) 36static 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,14 @@ void set_interval(int timer_type)
45 45
46void enable_timer(void) 46void enable_timer(void)
47{ 47{
48 set_interval(ITIMER_VIRTUAL);
49}
50
51void prepare_timer(void * ptr)
52{
48 int usec = 1000000/hz(); 53 int usec = 1000000/hz();
49 struct itimerval enable = ((struct itimerval) { { 0, usec }, 54 *(struct itimerval *)ptr = ((struct itimerval) { { 0, usec },
50 { 0, usec }}); 55 { 0, usec }});
51 if(setitimer(ITIMER_VIRTUAL, &enable, NULL))
52 printk("enable_timer - setitimer failed, errno = %d\n",
53 errno);
54} 56}
55 57
56void disable_timer(void) 58void disable_timer(void)
@@ -155,13 +157,15 @@ void idle_sleep(int secs)
155 nanosleep(&ts, NULL); 157 nanosleep(&ts, NULL);
156} 158}
157 159
158/* 160/* XXX This partly duplicates init_irq_signals */
159 * Overrides for Emacs so that we follow Linus's tabbing style. 161
160 * Emacs will notice this stuff at the end of the file and automatically 162void user_time_init(void)
161 * adjust the settings for this buffer only. This must remain at the end 163{
162 * of the file. 164 set_handler(SIGVTALRM, (__sighandler_t) alarm_handler,
163 * --------------------------------------------------------------------------- 165 SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH,
164 * Local variables: 166 SIGALRM, SIGUSR2, -1);
165 * c-file-style: "linux" 167 set_handler(SIGALRM, (__sighandler_t) alarm_handler,
166 * End: 168 SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH,
167 */ 169 SIGVTALRM, SIGUSR2, -1);
170 set_interval(ITIMER_VIRTUAL);
171}