aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux/skas
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-10-16 04:26:58 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:43:05 -0400
commit77bf4400319db9d2a8af6b00c2be6faa0f3d07cb (patch)
treeddc8fd48349b8d4dd2c0b26bce7f52f79b4e4077 /arch/um/os-Linux/skas
parentae2587e41254e48e670346aefa332d7469d86352 (diff)
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/skas')
-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
3 files changed, 19 insertions, 23 deletions
diff --git a/arch/um/os-Linux/skas/mem.c b/arch/um/os-Linux/skas/mem.c
index 383052baa166..ae7685710c46 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,
294 294
295 return ret; 295 return ret;
296} 296}
297
298void before_mem_skas(unsigned long unused)
299{
300}
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
index db020d21f132..eb027673f357 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)
131 } 131 }
132} 132}
133 133
134static void handle_segv(int pid, union uml_pt_regs * regs) 134static void handle_segv(int pid, struct uml_pt_regs * regs)
135{ 135{
136 get_skas_faultinfo(pid, &regs->skas.faultinfo); 136 get_skas_faultinfo(pid, &regs->faultinfo);
137 segv(regs->skas.faultinfo, 0, 1, NULL); 137 segv(regs->faultinfo, 0, 1, NULL);
138} 138}
139 139
140/*To use the same value of using_sysemu as the caller, ask it that value (in local_using_sysemu)*/ 140/*To use the same value of using_sysemu as the caller, ask it that value (in local_using_sysemu)*/
141static void handle_trap(int pid, union uml_pt_regs *regs, int local_using_sysemu) 141static void handle_trap(int pid, struct uml_pt_regs *regs, int local_using_sysemu)
142{ 142{
143 int err, status; 143 int err, status;
144 144
145 /* Mark this as a syscall */ 145 /* Mark this as a syscall */
146 UPT_SYSCALL_NR(regs) = PT_SYSCALL_NR(regs->skas.regs); 146 UPT_SYSCALL_NR(regs) = PT_SYSCALL_NR(regs->regs);
147 147
148 if (!local_using_sysemu) 148 if (!local_using_sysemu)
149 { 149 {
@@ -286,7 +286,7 @@ int start_userspace(unsigned long stub_stack)
286 return(pid); 286 return(pid);
287} 287}
288 288
289void userspace(union uml_pt_regs *regs) 289void userspace(struct uml_pt_regs *regs)
290{ 290{
291 int err, status, op, pid = userspace_pid[0]; 291 int err, status, op, pid = userspace_pid[0];
292 /* To prevent races if using_sysemu changes under us.*/ 292 /* To prevent races if using_sysemu changes under us.*/
@@ -312,7 +312,7 @@ void userspace(union uml_pt_regs *regs)
312 panic("userspace - waitpid failed, errno = %d\n", 312 panic("userspace - waitpid failed, errno = %d\n",
313 errno); 313 errno);
314 314
315 regs->skas.is_user = 1; 315 regs->is_user = 1;
316 save_registers(pid, regs); 316 save_registers(pid, regs);
317 UPT_SYSCALL_NR(regs) = -1; /* Assume: It's not a syscall */ 317 UPT_SYSCALL_NR(regs) = -1; /* Assume: It's not a syscall */
318 318
@@ -321,7 +321,7 @@ void userspace(union uml_pt_regs *regs)
321 switch(sig){ 321 switch(sig){
322 case SIGSEGV: 322 case SIGSEGV:
323 if(PTRACE_FULL_FAULTINFO || !ptrace_faultinfo){ 323 if(PTRACE_FULL_FAULTINFO || !ptrace_faultinfo){
324 get_skas_faultinfo(pid, &regs->skas.faultinfo); 324 get_skas_faultinfo(pid, &regs->faultinfo);
325 (*sig_info[SIGSEGV])(SIGSEGV, regs); 325 (*sig_info[SIGSEGV])(SIGSEGV, regs);
326 } 326 }
327 else handle_segv(pid, regs); 327 else handle_segv(pid, regs);
@@ -351,7 +351,7 @@ void userspace(union uml_pt_regs *regs)
351 351
352 /* Avoid -ERESTARTSYS handling in host */ 352 /* Avoid -ERESTARTSYS handling in host */
353 if(PT_SYSCALL_NR_OFFSET != PT_SYSCALL_RET_OFFSET) 353 if(PT_SYSCALL_NR_OFFSET != PT_SYSCALL_RET_OFFSET)
354 PT_SYSCALL_NR(regs->skas.regs) = -1; 354 PT_SYSCALL_NR(regs->regs) = -1;
355 } 355 }
356 } 356 }
357} 357}
@@ -578,16 +578,16 @@ void reboot_skas(void)
578 UML_LONGJMP(&initial_jmpbuf, INIT_JMP_REBOOT); 578 UML_LONGJMP(&initial_jmpbuf, INIT_JMP_REBOOT);
579} 579}
580 580
581void switch_mm_skas(struct mm_id *mm_idp) 581void __switch_mm(struct mm_id *mm_idp)
582{ 582{
583 int err; 583 int err;
584 584
585 /* FIXME: need cpu pid in switch_mm_skas */ 585 /* FIXME: need cpu pid in __switch_mm */
586 if(proc_mm){ 586 if(proc_mm){
587 err = ptrace(PTRACE_SWITCH_MM, userspace_pid[0], 0, 587 err = ptrace(PTRACE_SWITCH_MM, userspace_pid[0], 0,
588 mm_idp->u.mm_fd); 588 mm_idp->u.mm_fd);
589 if(err) 589 if(err)
590 panic("switch_mm_skas - PTRACE_SWITCH_MM failed, " 590 panic("__switch_mm - PTRACE_SWITCH_MM failed, "
591 "errno = %d\n", errno); 591 "errno = %d\n", errno);
592 } 592 }
593 else userspace_pid[0] = mm_idp->u.pid; 593 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 3b600c2e63b8..d43e470227de 100644
--- a/arch/um/os-Linux/skas/trap.c
+++ b/arch/um/os-Linux/skas/trap.c
@@ -15,13 +15,13 @@
15#include "sysdep/ptrace_user.h" 15#include "sysdep/ptrace_user.h"
16#include "os.h" 16#include "os.h"
17 17
18static union uml_pt_regs ksig_regs[UM_NR_CPUS]; 18static struct uml_pt_regs ksig_regs[UM_NR_CPUS];
19 19
20void sig_handler_common_skas(int sig, void *sc_ptr) 20void sig_handler_common_skas(int sig, void *sc_ptr)
21{ 21{
22 struct sigcontext *sc = sc_ptr; 22 struct sigcontext *sc = sc_ptr;
23 union uml_pt_regs *r; 23 struct uml_pt_regs *r;
24 void (*handler)(int, union uml_pt_regs *); 24 void (*handler)(int, struct uml_pt_regs *);
25 int save_user, save_errno = errno; 25 int save_user, save_errno = errno;
26 26
27 /* This is done because to allow SIGSEGV to be delivered inside a SEGV 27 /* 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)
42 } 42 }
43 else r = TASK_REGS(get_current()); 43 else r = TASK_REGS(get_current());
44 44
45 save_user = r->skas.is_user; 45 save_user = r->is_user;
46 r->skas.is_user = 0; 46 r->is_user = 0;
47 if ( sig == SIGFPE || sig == SIGSEGV || 47 if ( sig == SIGFPE || sig == SIGSEGV ||
48 sig == SIGBUS || sig == SIGILL || 48 sig == SIGBUS || sig == SIGILL ||
49 sig == SIGTRAP ) { 49 sig == SIGTRAP ) {
50 GET_FAULTINFO_FROM_SC(r->skas.faultinfo, sc); 50 GET_FAULTINFO_FROM_SC(r->faultinfo, sc);
51 } 51 }
52 52
53 change_sig(SIGUSR1, 1); 53 change_sig(SIGUSR1, 1);
@@ -62,5 +62,5 @@ void sig_handler_common_skas(int sig, void *sc_ptr)
62 handler(sig, r); 62 handler(sig, r);
63 63
64 errno = save_errno; 64 errno = save_errno;
65 r->skas.is_user = save_user; 65 r->is_user = save_user;
66} 66}