aboutsummaryrefslogtreecommitdiff
path: root/arch/um/os-Linux
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-07-10 04:45:05 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-10 13:24:23 -0700
commitaceb343464a136e1c0de5294b097a1f9ab018870 (patch)
treedb42e6d7b059948b3ef0d957fb9dcc87462c7fd3 /arch/um/os-Linux
parent598d188af1a0645dc75c9541eff0017a4f6d9987 (diff)
[PATCH] uml: timer initialization cleanup
This cleans up the mess that is the timer initialization. There used to be two timer handlers - one that basically ran during delay loop calibration and one that handled the timer afterwards. There were also two sets of timer initialization code - one that starts in user code and calls into the kernel side of the house, and one that starts in kernel code and calls user code. This eliminates one timer handler and consolidates the two sets of initialization code. [akpm@osdl.org: use new INTF_ flags] Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/os-Linux')
-rw-r--r--arch/um/os-Linux/irq.c11
-rw-r--r--arch/um/os-Linux/signal.c23
-rw-r--r--arch/um/os-Linux/time.c16
3 files changed, 4 insertions, 46 deletions
diff --git a/arch/um/os-Linux/irq.c b/arch/um/os-Linux/irq.c
index 3788d4568d3..64c114b0270 100644
--- a/arch/um/os-Linux/irq.c
+++ b/arch/um/os-Linux/irq.c
@@ -142,17 +142,14 @@ void os_set_ioignore(void)
void init_irq_signals(int on_sigstack)
{
- __sighandler_t h;
int flags;
flags = on_sigstack ? SA_ONSTACK : 0;
- if (timer_irq_inited)
- h = (__sighandler_t)alarm_handler;
- else
- h = boot_timer_handler;
- set_handler(SIGVTALRM, h, flags | SA_RESTART,
- SIGUSR1, SIGIO, SIGWINCH, SIGALRM, -1);
+ set_handler(SIGVTALRM, (__sighandler_t) alarm_handler,
+ flags | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, -1);
+ set_handler(SIGALRM, (__sighandler_t) alarm_handler,
+ flags | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, -1);
set_handler(SIGIO, (__sighandler_t) sig_handler, flags | SA_RESTART,
SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
signal(SIGWINCH, SIG_IGN);
diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c
index f11b3124a0c..60e4faedf25 100644
--- a/arch/um/os-Linux/signal.c
+++ b/arch/um/os-Linux/signal.c
@@ -106,29 +106,6 @@ void alarm_handler(ARCH_SIGHDLR_PARAM)
set_signals(enabled);
}
-extern void do_boot_timer_handler(struct sigcontext * sc);
-
-void boot_timer_handler(ARCH_SIGHDLR_PARAM)
-{
- struct sigcontext *sc;
- int enabled;
-
- ARCH_GET_SIGCONTEXT(sc, sig);
-
- enabled = signals_enabled;
- if(!enabled){
- if(sig == SIGVTALRM)
- pending |= SIGVTALRM_MASK;
- else pending |= SIGALRM_MASK;
- return;
- }
-
- block_signals();
-
- do_boot_timer_handler(sc);
- set_signals(enabled);
-}
-
void set_sigstack(void *sig_stack, int size)
{
stack_t stack = ((stack_t) { .ss_flags = 0,
diff --git a/arch/um/os-Linux/time.c b/arch/um/os-Linux/time.c
index 280c4fb9b58..beb7f9666de 100644
--- a/arch/um/os-Linux/time.c
+++ b/arch/um/os-Linux/time.c
@@ -81,14 +81,6 @@ void uml_idle_timer(void)
set_interval(ITIMER_REAL);
}
-void time_init(void)
-{
- if(signal(SIGVTALRM, boot_timer_handler) == SIG_ERR)
- panic("Couldn't set SIGVTALRM handler");
- set_interval(ITIMER_VIRTUAL);
- time_init_kern();
-}
-
unsigned long long os_nsecs(void)
{
struct timeval tv;
@@ -106,15 +98,7 @@ void idle_sleep(int secs)
nanosleep(&ts, NULL);
}
-/* XXX This partly duplicates init_irq_signals */
-
void user_time_init(void)
{
- set_handler(SIGVTALRM, (__sighandler_t) alarm_handler,
- SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH,
- SIGALRM, SIGUSR2, -1);
- set_handler(SIGALRM, (__sighandler_t) alarm_handler,
- SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH,
- SIGVTALRM, SIGUSR2, -1);
set_interval(ITIMER_VIRTUAL);
}