Commit 152856ea authored by Jeff Dike's avatar Jeff Dike Committed by Linus Torvalds

[PATCH] uml: finish conversion to sigjmp_buf/siglongjmp

UML needs to use siglongjmp instead of longjmp everywhere.  This patch fixes
the remaining longjmp/jmp_buf occurrences.
Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0d967d28
...@@ -297,7 +297,7 @@ void __init check_ptrace(void) ...@@ -297,7 +297,7 @@ void __init check_ptrace(void)
int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr) int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr)
{ {
jmp_buf buf; sigjmp_buf buf;
int n; int n;
*jmp_ptr = &buf; *jmp_ptr = &buf;
......
...@@ -209,7 +209,7 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr, ...@@ -209,7 +209,7 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
void (*handler)(int)) void (*handler)(int))
{ {
unsigned long flags; unsigned long flags;
jmp_buf switch_buf, fork_buf; sigjmp_buf switch_buf, fork_buf;
*switch_buf_ptr = &switch_buf; *switch_buf_ptr = &switch_buf;
*fork_buf_ptr = &fork_buf; *fork_buf_ptr = &fork_buf;
...@@ -233,7 +233,7 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr, ...@@ -233,7 +233,7 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
void thread_wait(void *sw, void *fb) void thread_wait(void *sw, void *fb)
{ {
jmp_buf buf, **switch_buf = sw, *fork_buf; sigjmp_buf buf, **switch_buf = sw, *fork_buf;
*switch_buf = &buf; *switch_buf = &buf;
fork_buf = fb; fork_buf = fb;
...@@ -295,23 +295,23 @@ void restore_registers(union uml_pt_regs *regs) ...@@ -295,23 +295,23 @@ void restore_registers(union uml_pt_regs *regs)
void switch_threads(void *me, void *next) void switch_threads(void *me, void *next)
{ {
jmp_buf my_buf, **me_ptr = me, *next_buf = next; sigjmp_buf my_buf, **me_ptr = me, *next_buf = next;
*me_ptr = &my_buf; *me_ptr = &my_buf;
if(sigsetjmp(my_buf, 1) == 0) if(sigsetjmp(my_buf, 1) == 0)
siglongjmp(*next_buf, 1); siglongjmp(*next_buf, 1);
} }
static jmp_buf initial_jmpbuf; static sigjmp_buf initial_jmpbuf;
/* XXX Make these percpu */ /* XXX Make these percpu */
static void (*cb_proc)(void *arg); static void (*cb_proc)(void *arg);
static void *cb_arg; static void *cb_arg;
static jmp_buf *cb_back; static sigjmp_buf *cb_back;
int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr) int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr)
{ {
jmp_buf **switch_buf = switch_buf_ptr; sigjmp_buf **switch_buf = switch_buf_ptr;
int n; int n;
*fork_buf_ptr = &initial_jmpbuf; *fork_buf_ptr = &initial_jmpbuf;
...@@ -347,7 +347,7 @@ void remove_sigstack(void) ...@@ -347,7 +347,7 @@ void remove_sigstack(void)
void initial_thread_cb_skas(void (*proc)(void *), void *arg) void initial_thread_cb_skas(void (*proc)(void *), void *arg)
{ {
jmp_buf here; sigjmp_buf here;
cb_proc = proc; cb_proc = proc;
cb_arg = arg; cb_arg = arg;
......
...@@ -127,7 +127,7 @@ void alarm_handler(int sig, struct sigcontext sc) ...@@ -127,7 +127,7 @@ void alarm_handler(int sig, struct sigcontext sc)
void do_longjmp(void *b, int val) void do_longjmp(void *b, int val)
{ {
jmp_buf *buf = b; sigjmp_buf *buf = b;
siglongjmp(*buf, val); siglongjmp(*buf, val);
} }
......
...@@ -72,7 +72,7 @@ int __do_strnlen_user(const char *str, unsigned long n, ...@@ -72,7 +72,7 @@ int __do_strnlen_user(const char *str, unsigned long n,
struct tt_regs save = TASK_REGS(get_current())->tt; struct tt_regs save = TASK_REGS(get_current())->tt;
int ret; int ret;
unsigned long *faddrp = (unsigned long *)fault_addr; unsigned long *faddrp = (unsigned long *)fault_addr;
jmp_buf jbuf; sigjmp_buf jbuf;
*fault_catcher = &jbuf; *fault_catcher = &jbuf;
if(sigsetjmp(jbuf, 1) == 0) if(sigsetjmp(jbuf, 1) == 0)
......
...@@ -17,8 +17,8 @@ unsigned long __do_user_copy(void *to, const void *from, int n, ...@@ -17,8 +17,8 @@ unsigned long __do_user_copy(void *to, const void *from, int n,
int n), int *faulted_out) int n), int *faulted_out)
{ {
unsigned long *faddrp = (unsigned long *) fault_addr, ret; unsigned long *faddrp = (unsigned long *) fault_addr, ret;
sigjmp_buf jbuf;
jmp_buf jbuf;
*fault_catcher = &jbuf; *fault_catcher = &jbuf;
if(sigsetjmp(jbuf, 1) == 0){ if(sigsetjmp(jbuf, 1) == 0){
(*op)(to, from, n); (*op)(to, from, n);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment