[PATCH] uml: move libc-dependent code from trap_user.c

The serial UML OS-abstraction layer patch (um/kernel dir).

This moves all systemcalls from trap_user.c file under os-Linux dir

Signed-off-by: Gennady Sharapov <Gennady.V.Sharapov@intel.com>
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>
diff --git a/arch/um/kernel/trap_user.c b/arch/um/kernel/trap_user.c
index e551107..5590b57 100644
--- a/arch/um/kernel/trap_user.c
+++ b/arch/um/kernel/trap_user.c
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
  * Licensed under the GPL
  */
@@ -25,20 +25,6 @@
 #include "user_util.h"
 #include "os.h"
 
-void kill_child_dead(int pid)
-{
-	kill(pid, SIGKILL);
-	kill(pid, SIGCONT);
-	do {
-		int n;
-		CATCH_EINTR(n = waitpid(pid, NULL, 0));
-		if (n > 0)
-			kill(pid, SIGCONT);
-		else
-			break;
-	} while(1);
-}
-
 void segv_handler(int sig, union uml_pt_regs *regs)
 {
         struct faultinfo * fi = UPT_FAULTINFO(regs);
@@ -55,43 +41,18 @@
 	CHOOSE_MODE(syscall_handler_tt(sig, regs), (void) 0);
 }
 
-struct signal_info sig_info[] = {
-	[ SIGTRAP ] { .handler 		= relay_signal,
-		      .is_irq 		= 0 },
-	[ SIGFPE ] { .handler 		= relay_signal,
-		     .is_irq 		= 0 },
-	[ SIGILL ] { .handler 		= relay_signal,
-		     .is_irq 		= 0 },
-	[ SIGWINCH ] { .handler		= winch,
-		       .is_irq		= 1 },
-	[ SIGBUS ] { .handler 		= bus_handler,
-		     .is_irq 		= 0 },
-	[ SIGSEGV] { .handler 		= segv_handler,
-		     .is_irq 		= 0 },
-	[ SIGIO ] { .handler 		= sigio_handler,
-		    .is_irq 		= 1 },
-	[ SIGVTALRM ] { .handler 	= timer_handler,
-			.is_irq 	= 1 },
-        [ SIGALRM ] { .handler          = timer_handler,
-                      .is_irq           = 1 },
-	[ SIGUSR2 ] { .handler 		= usr2_handler,
-		      .is_irq 		= 0 },
-};
+void (*sig_info[NSIG])(int, union uml_pt_regs *);
 
-void do_longjmp(void *b, int val)
+void os_fill_handlinfo(struct kern_handlers h)
 {
-	sigjmp_buf *buf = b;
-
-	siglongjmp(*buf, val);
+	sig_info[SIGTRAP] = h.relay_signal;
+	sig_info[SIGFPE] = h.relay_signal;
+	sig_info[SIGILL] = h.relay_signal;
+	sig_info[SIGWINCH] = h.winch;
+	sig_info[SIGBUS] = h.bus_handler;
+	sig_info[SIGSEGV] = h.page_fault;
+	sig_info[SIGIO] = h.sigio_handler;
+	sig_info[SIGVTALRM] = h.timer_handler;
+	sig_info[SIGALRM] = h.timer_handler;
+	sig_info[SIGUSR2] = usr2_handler;
 }
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only.  This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-file-style: "linux"
- * End:
- */