Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32623
b: refs/heads/master
c: a5df0d1
h: refs/heads/master
i:
  32621: 6bfa204
  32619: 67c484e
  32615: 63a71a1
  32607: 67dfe82
v: v3
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed Jul 15, 2006
1 parent 7373613 commit 6598fce
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8477b55ba11a49515b26573a90414b718179c908
refs/heads/master: a5df0d1a2c0f7dbd135d978d02daf2d99e62ff7a
4 changes: 2 additions & 2 deletions trunk/arch/um/include/longjmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
longjmp(*buf, val); \
} while(0)

#define UML_SETJMP(buf, enable) ({ \
int n; \
#define UML_SETJMP(buf) ({ \
int n, enable; \
enable = get_signals(); \
n = setjmp(*buf); \
if(n != 0) \
Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/um/os-Linux/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,12 @@ void init_new_thread_signals(void)
int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr)
{
jmp_buf buf;
int n, enable;
int n;

*jmp_ptr = &buf;
n = UML_SETJMP(&buf, enable);
n = UML_SETJMP(&buf);
if(n != 0)
return(n);
return n;
(*fn)(arg);
return(0);
return 0;
}
16 changes: 6 additions & 10 deletions trunk/arch/um/os-Linux/skas/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,6 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
{
unsigned long flags;
jmp_buf switch_buf, fork_buf;
int enable;

*switch_buf_ptr = &switch_buf;
*fork_buf_ptr = &fork_buf;
Expand All @@ -450,7 +449,7 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
*/
flags = get_signals();
block_signals();
if(UML_SETJMP(&fork_buf, enable) == 0)
if(UML_SETJMP(&fork_buf) == 0)
new_thread_proc(stack, handler);

remove_sigstack();
Expand All @@ -467,21 +466,19 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
void thread_wait(void *sw, void *fb)
{
jmp_buf buf, **switch_buf = sw, *fork_buf;
int enable;

*switch_buf = &buf;
fork_buf = fb;
if(UML_SETJMP(&buf, enable) == 0)
if(UML_SETJMP(&buf) == 0)
siglongjmp(*fork_buf, INIT_JMP_REMOVE_SIGSTACK);
}

void switch_threads(void *me, void *next)
{
jmp_buf my_buf, **me_ptr = me, *next_buf = next;
int enable;

*me_ptr = &my_buf;
if(UML_SETJMP(&my_buf, enable) == 0)
if(UML_SETJMP(&my_buf) == 0)
UML_LONGJMP(next_buf, 1);
}

Expand All @@ -495,14 +492,14 @@ static jmp_buf *cb_back;
int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr)
{
jmp_buf **switch_buf = switch_buf_ptr;
int n, enable;
int n;

set_handler(SIGWINCH, (__sighandler_t) sig_handler,
SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGALRM,
SIGVTALRM, -1);

*fork_buf_ptr = &initial_jmpbuf;
n = UML_SETJMP(&initial_jmpbuf, enable);
n = UML_SETJMP(&initial_jmpbuf);
switch(n){
case INIT_JMP_NEW_THREAD:
new_thread_proc((void *) stack, new_thread_handler);
Expand All @@ -529,14 +526,13 @@ int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr)
void initial_thread_cb_skas(void (*proc)(void *), void *arg)
{
jmp_buf here;
int enable;

cb_proc = proc;
cb_arg = arg;
cb_back = &here;

block_signals();
if(UML_SETJMP(&here, enable) == 0)
if(UML_SETJMP(&here) == 0)
UML_LONGJMP(&initial_jmpbuf, INIT_JMP_CALLBACK);
unblock_signals();

Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/um/os-Linux/uaccess.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ unsigned long __do_user_copy(void *to, const void *from, int n,
int n), int *faulted_out)
{
unsigned long *faddrp = (unsigned long *) fault_addr, ret;
int enable;

jmp_buf jbuf;
*fault_catcher = &jbuf;
if(UML_SETJMP(&jbuf, enable) == 0){
if(UML_SETJMP(&jbuf) == 0){
(*op)(to, from, n);
ret = 0;
*faulted_out = 0;
Expand Down

0 comments on commit 6598fce

Please sign in to comment.