aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-10-16 01:26:58 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 09:43:05 -0700
commit77bf4400319db9d2a8af6b00c2be6faa0f3d07cb (patch)
treeddc8fd48349b8d4dd2c0b26bce7f52f79b4e4077 /arch/um/os-Linux
parentae2587e41254e48e670346aefa332d7469d86352 (diff)
downloadkernel_samsung_tuna-77bf4400319db9d2a8af6b00c2be6faa0f3d07cb.zip
kernel_samsung_tuna-77bf4400319db9d2a8af6b00c2be6faa0f3d07cb.tar.gz
kernel_samsung_tuna-77bf4400319db9d2a8af6b00c2be6faa0f3d07cb.tar.bz2
uml: remove code made redundant by CHOOSE_MODE removal
This patch makes a number of simplifications enabled by the removal of CHOOSE_MODE. There were lots of functions that looked like int foo(args){ foo_skas(args); } The bodies of foo_skas are now folded into foo, and their declarations (and sometimes entire header files) are deleted. In addition, the union uml_pt_regs, which was a union between the tt and skas register formats, is now a struct, with the tt-mode arm of the union being removed. It turns out that usr2_handler was unused, so it is gone. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/os-Linux')
-rw-r--r--arch/um/os-Linux/aio.c1
-rw-r--r--arch/um/os-Linux/main.c1
-rw-r--r--arch/um/os-Linux/process.c3
-rw-r--r--arch/um/os-Linux/registers.c12
-rw-r--r--arch/um/os-Linux/signal.c5
-rw-r--r--arch/um/os-Linux/skas/mem.c4
-rw-r--r--arch/um/os-Linux/skas/process.c24
-rw-r--r--arch/um/os-Linux/skas/trap.c14
-rw-r--r--arch/um/os-Linux/start_up.c1
-rw-r--r--arch/um/os-Linux/trap.c8
-rw-r--r--arch/um/os-Linux/umid.c1
11 files changed, 28 insertions, 46 deletions
diff --git a/arch/um/os-Linux/aio.c b/arch/um/os-Linux/aio.c
index c8f5b7a..11c2b01 100644
--- a/arch/um/os-Linux/aio.c
+++ b/arch/um/os-Linux/aio.c
@@ -13,7 +13,6 @@
#include "aio.h"
#include "init.h"
#include "user.h"
-#include "mode.h"
#include "kern_constants.h"
struct aio_thread_req {
diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c
index bfabb88..aeeecc6 100644
--- a/arch/um/os-Linux/main.c
+++ b/arch/um/os-Linux/main.c
@@ -18,7 +18,6 @@
#include "irq_user.h"
#include "user.h"
#include "init.h"
-#include "mode.h"
#include "uml-config.h"
#include "os.h"
#include "um_malloc.h"
diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c
index d5fef4ce..a955e9b 100644
--- a/arch/um/os-Linux/process.c
+++ b/arch/um/os-Linux/process.c
@@ -244,9 +244,6 @@ void init_new_thread_signals(void)
SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
set_handler(SIGBUS, (__sighandler_t) sig_handler, SA_ONSTACK,
SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
- set_handler(SIGUSR2, (__sighandler_t) sig_handler,
- SA_ONSTACK, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM,
- -1);
signal(SIGHUP, SIG_IGN);
init_irq_signals(1);
diff --git a/arch/um/os-Linux/registers.c b/arch/um/os-Linux/registers.c
index 9dc3fad..ce0b791 100644
--- a/arch/um/os-Linux/registers.c
+++ b/arch/um/os-Linux/registers.c
@@ -13,26 +13,26 @@
static unsigned long exec_regs[MAX_REG_NR];
-void init_thread_registers(union uml_pt_regs *to)
+void init_thread_registers(struct uml_pt_regs *to)
{
- memcpy(to->skas.regs, exec_regs, sizeof(to->skas.regs));
+ memcpy(to->regs, exec_regs, sizeof(to->regs));
}
-void save_registers(int pid, union uml_pt_regs *regs)
+void save_registers(int pid, struct uml_pt_regs *regs)
{
int err;
- err = ptrace(PTRACE_GETREGS, pid, 0, regs->skas.regs);
+ err = ptrace(PTRACE_GETREGS, pid, 0, regs->regs);
if(err < 0)
panic("save_registers - saving registers failed, errno = %d\n",
errno);
}
-void restore_registers(int pid, union uml_pt_regs *regs)
+void restore_registers(int pid, struct uml_pt_regs *regs)
{
int err;
- err = ptrace(PTRACE_SETREGS, pid, 0, regs->skas.regs);
+ err = ptrace(PTRACE_SETREGS, pid, 0, regs->regs);
if(err < 0)
panic("restore_registers - saving registers failed, "
"errno = %d\n", errno);
diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c
index 0d6122a..583424b 100644
--- a/arch/um/os-Linux/signal.c
+++ b/arch/um/os-Linux/signal.c
@@ -16,7 +16,6 @@
#include "sysdep/sigcontext.h"
#include "sysdep/barrier.h"
#include "sigcontext.h"
-#include "mode.h"
#include "os.h"
/* These are the asynchronous signals. SIGVTALRM and SIGARLM are handled
@@ -60,14 +59,14 @@ void sig_handler(int sig, struct sigcontext *sc)
static void real_alarm_handler(int sig, struct sigcontext *sc)
{
- union uml_pt_regs regs;
+ struct uml_pt_regs regs;
if(sig == SIGALRM)
switch_timers(0);
if(sc != NULL)
copy_sc(&regs, sc);
- regs.skas.is_user = 0;
+ regs.is_user = 0;
unblock_signals();
timer_handler(sig, &regs);
diff --git a/arch/um/os-Linux/skas/mem.c b/arch/um/os-Linux/skas/mem.c
index 383052b..ae76857 100644
--- a/arch/um/os-Linux/skas/mem.c
+++ b/arch/um/os-Linux/skas/mem.c
@@ -294,7 +294,3 @@ int protect(struct mm_id * mm_idp, unsigned long addr, unsigned long len,
return ret;
}
-
-void before_mem_skas(unsigned long unused)
-{
-}
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
index db020d2..eb02767 100644
--- a/arch/um/os-Linux/skas/process.c
+++ b/arch/um/os-Linux/skas/process.c
@@ -131,19 +131,19 @@ void get_skas_faultinfo(int pid, struct faultinfo * fi)
}
}
-static void handle_segv(int pid, union uml_pt_regs * regs)
+static void handle_segv(int pid, struct uml_pt_regs * regs)
{
- get_skas_faultinfo(pid, &regs->skas.faultinfo);
- segv(regs->skas.faultinfo, 0, 1, NULL);
+ get_skas_faultinfo(pid, &regs->faultinfo);
+ segv(regs->faultinfo, 0, 1, NULL);
}
/*To use the same value of using_sysemu as the caller, ask it that value (in local_using_sysemu)*/
-static void handle_trap(int pid, union uml_pt_regs *regs, int local_using_sysemu)
+static void handle_trap(int pid, struct uml_pt_regs *regs, int local_using_sysemu)
{
int err, status;
/* Mark this as a syscall */
- UPT_SYSCALL_NR(regs) = PT_SYSCALL_NR(regs->skas.regs);
+ UPT_SYSCALL_NR(regs) = PT_SYSCALL_NR(regs->regs);
if (!local_using_sysemu)
{
@@ -286,7 +286,7 @@ int start_userspace(unsigned long stub_stack)
return(pid);
}
-void userspace(union uml_pt_regs *regs)
+void userspace(struct uml_pt_regs *regs)
{
int err, status, op, pid = userspace_pid[0];
/* To prevent races if using_sysemu changes under us.*/
@@ -312,7 +312,7 @@ void userspace(union uml_pt_regs *regs)
panic("userspace - waitpid failed, errno = %d\n",
errno);
- regs->skas.is_user = 1;
+ regs->is_user = 1;
save_registers(pid, regs);
UPT_SYSCALL_NR(regs) = -1; /* Assume: It's not a syscall */
@@ -321,7 +321,7 @@ void userspace(union uml_pt_regs *regs)
switch(sig){
case SIGSEGV:
if(PTRACE_FULL_FAULTINFO || !ptrace_faultinfo){
- get_skas_faultinfo(pid, &regs->skas.faultinfo);
+ get_skas_faultinfo(pid, &regs->faultinfo);
(*sig_info[SIGSEGV])(SIGSEGV, regs);
}
else handle_segv(pid, regs);
@@ -351,7 +351,7 @@ void userspace(union uml_pt_regs *regs)
/* Avoid -ERESTARTSYS handling in host */
if(PT_SYSCALL_NR_OFFSET != PT_SYSCALL_RET_OFFSET)
- PT_SYSCALL_NR(regs->skas.regs) = -1;
+ PT_SYSCALL_NR(regs->regs) = -1;
}
}
}
@@ -578,16 +578,16 @@ void reboot_skas(void)
UML_LONGJMP(&initial_jmpbuf, INIT_JMP_REBOOT);
}
-void switch_mm_skas(struct mm_id *mm_idp)
+void __switch_mm(struct mm_id *mm_idp)
{
int err;
- /* FIXME: need cpu pid in switch_mm_skas */
+ /* FIXME: need cpu pid in __switch_mm */
if(proc_mm){
err = ptrace(PTRACE_SWITCH_MM, userspace_pid[0], 0,
mm_idp->u.mm_fd);
if(err)
- panic("switch_mm_skas - PTRACE_SWITCH_MM failed, "
+ panic("__switch_mm - PTRACE_SWITCH_MM failed, "
"errno = %d\n", errno);
}
else userspace_pid[0] = mm_idp->u.pid;
diff --git a/arch/um/os-Linux/skas/trap.c b/arch/um/os-Linux/skas/trap.c
index 3b600c2..d43e470 100644
--- a/arch/um/os-Linux/skas/trap.c
+++ b/arch/um/os-Linux/skas/trap.c
@@ -15,13 +15,13 @@
#include "sysdep/ptrace_user.h"
#include "os.h"
-static union uml_pt_regs ksig_regs[UM_NR_CPUS];
+static struct uml_pt_regs ksig_regs[UM_NR_CPUS];
void sig_handler_common_skas(int sig, void *sc_ptr)
{
struct sigcontext *sc = sc_ptr;
- union uml_pt_regs *r;
- void (*handler)(int, union uml_pt_regs *);
+ struct uml_pt_regs *r;
+ void (*handler)(int, struct uml_pt_regs *);
int save_user, save_errno = errno;
/* This is done because to allow SIGSEGV to be delivered inside a SEGV
@@ -42,12 +42,12 @@ void sig_handler_common_skas(int sig, void *sc_ptr)
}
else r = TASK_REGS(get_current());
- save_user = r->skas.is_user;
- r->skas.is_user = 0;
+ save_user = r->is_user;
+ r->is_user = 0;
if ( sig == SIGFPE || sig == SIGSEGV ||
sig == SIGBUS || sig == SIGILL ||
sig == SIGTRAP ) {
- GET_FAULTINFO_FROM_SC(r->skas.faultinfo, sc);
+ GET_FAULTINFO_FROM_SC(r->faultinfo, sc);
}
change_sig(SIGUSR1, 1);
@@ -62,5 +62,5 @@ void sig_handler_common_skas(int sig, void *sc_ptr)
handler(sig, r);
errno = save_errno;
- r->skas.is_user = save_user;
+ r->is_user = save_user;
}
diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c
index da5c90d..abfc094 100644
--- a/arch/um/os-Linux/start_up.c
+++ b/arch/um/os-Linux/start_up.c
@@ -31,7 +31,6 @@
#include "init.h"
#include "os.h"
#include "uml-config.h"
-#include "mode.h"
#include "tempfile.h"
#include "kern_constants.h"
#include "skas.h"
diff --git a/arch/um/os-Linux/trap.c b/arch/um/os-Linux/trap.c
index b17f546..e87fb536 100644
--- a/arch/um/os-Linux/trap.c
+++ b/arch/um/os-Linux/trap.c
@@ -7,15 +7,10 @@
#include <signal.h>
#include "kern_util.h"
#include "os.h"
-#include "mode.h"
#include "longjmp.h"
-void usr2_handler(int sig, union uml_pt_regs *regs)
-{
-}
-
/* Initialized from linux_main() */
-void (*sig_info[NSIG])(int, union uml_pt_regs *);
+void (*sig_info[NSIG])(int, struct uml_pt_regs *);
void os_fill_handlinfo(struct kern_handlers h)
{
@@ -28,7 +23,6 @@ void os_fill_handlinfo(struct kern_handlers h)
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)
diff --git a/arch/um/os-Linux/umid.c b/arch/um/os-Linux/umid.c
index b462863..e36541e 100644
--- a/arch/um/os-Linux/umid.c
+++ b/arch/um/os-Linux/umid.c
@@ -11,7 +11,6 @@
#include "init.h"
#include "os.h"
#include "user.h"
-#include "mode.h"
#define UML_DIR "~/.uml/"