diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-10-16 04:26:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:43:05 -0400 |
commit | 77bf4400319db9d2a8af6b00c2be6faa0f3d07cb (patch) | |
tree | ddc8fd48349b8d4dd2c0b26bce7f52f79b4e4077 /arch/um/os-Linux/skas/process.c | |
parent | ae2587e41254e48e670346aefa332d7469d86352 (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/process.c')
-rw-r--r-- | arch/um/os-Linux/skas/process.c | 24 |
1 files changed, 12 insertions, 12 deletions
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 | ||
134 | static void handle_segv(int pid, union uml_pt_regs * regs) | 134 | static void handle_segv(int pid, struct uml_pt_regs * regs) |
135 | { | 135 | { |
136 | get_skas_faultinfo(pid, ®s->skas.faultinfo); | 136 | get_skas_faultinfo(pid, ®s->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)*/ |
141 | static void handle_trap(int pid, union uml_pt_regs *regs, int local_using_sysemu) | 141 | static 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 | ||
289 | void userspace(union uml_pt_regs *regs) | 289 | void 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, ®s->skas.faultinfo); | 324 | get_skas_faultinfo(pid, ®s->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 | ||
581 | void switch_mm_skas(struct mm_id *mm_idp) | 581 | void __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; |