Skip to content

Commit

Permalink
[PATCH] uml: merge trap_user.c and trap_kern.c
Browse files Browse the repository at this point in the history
The serial UML OS-abstraction layer patch (um/kernel dir).

This joins trap_user.c and trap_kernel.c files.

Signed-off-by: Gennady Sharapov <[email protected]>
Signed-off-by: Jeff Dike <[email protected]>
Cc: Paolo 'Blaisorblade' Giarrusso <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Gennady Sharapov authored and Linus Torvalds committed Jan 9, 2006
1 parent ea2ba7d commit c66fdd5
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 60 deletions.
2 changes: 1 addition & 1 deletion arch/um/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ obj-y = config.o exec_kern.o exitcode.o \
init_task.o irq.o irq_user.o ksyms.o mem.o physmem.o \
process_kern.o ptrace.o reboot.o resource.o sigio_user.o sigio_kern.o \
signal_kern.o smp.o syscall_kern.o sysrq.o time.o \
time_kern.o tlb.o trap_kern.o trap_user.o uaccess.o um_arch.o umid.o \
time_kern.o tlb.o trap_kern.o uaccess.o um_arch.o umid.o \
user_util.o

obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o
Expand Down
14 changes: 14 additions & 0 deletions arch/um/kernel/trap_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
#include "mconsole_kern.h"
#include "mem.h"
#include "mem_kern.h"
#include "sysdep/sigcontext.h"
#include "sysdep/ptrace.h"
#include "os.h"
#ifdef CONFIG_MODE_SKAS
#include "skas.h"
#endif
Expand Down Expand Up @@ -126,6 +129,17 @@ int handle_page_fault(unsigned long address, unsigned long ip,
goto out;
}

void segv_handler(int sig, union uml_pt_regs *regs)
{
struct faultinfo * fi = UPT_FAULTINFO(regs);

if(UPT_IS_USER(regs) && !SEGV_IS_FIXABLE(fi)){
bad_segv(*fi, UPT_IP(regs));
return;
}
segv(*fi, UPT_IP(regs), UPT_IS_USER(regs), regs);
}

struct kern_handlers handlinfo_kern = {
.relay_signal = relay_signal,
.winch = winch,
Expand Down
58 changes: 0 additions & 58 deletions arch/um/kernel/trap_user.c

This file was deleted.

25 changes: 24 additions & 1 deletion arch/um/os-Linux/trap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,34 @@
* Licensed under the GPL
*/

#include <setjmp.h>
#include <stdlib.h>
#include <signal.h>
#include <setjmp.h>
#include "kern_util.h"
#include "user_util.h"
#include "os.h"
#include "mode.h"

void usr2_handler(int sig, union uml_pt_regs *regs)
{
CHOOSE_MODE(syscall_handler_tt(sig, regs), (void) 0);
}

void (*sig_info[NSIG])(int, union uml_pt_regs *);

void os_fill_handlinfo(struct kern_handlers h)
{
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;
}

void do_longjmp(void *b, int val)
{
Expand Down

0 comments on commit c66fdd5

Please sign in to comment.