aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux/skas
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-07-14 03:24:02 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-15 00:53:52 -0400
commita5df0d1a2c0f7dbd135d978d02daf2d99e62ff7a (patch)
tree89824d59364a431d332ce68d548068db4616e68c /arch/um/os-Linux/skas
parent8477b55ba11a49515b26573a90414b718179c908 (diff)
[PATCH] uml: tidy longjmp macro
The UML_SETJMP macro was requiring its users to pass in a argument which it could supply itself, since it wasn't used outside that invocation of the macro. Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/os-Linux/skas')
-rw-r--r--arch/um/os-Linux/skas/process.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
index bf35572d9cfa..7baf90fda58b 100644
--- a/arch/um/os-Linux/skas/process.c
+++ b/arch/um/os-Linux/skas/process.c
@@ -435,7 +435,6 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
435{ 435{
436 unsigned long flags; 436 unsigned long flags;
437 jmp_buf switch_buf, fork_buf; 437 jmp_buf switch_buf, fork_buf;
438 int enable;
439 438
440 *switch_buf_ptr = &switch_buf; 439 *switch_buf_ptr = &switch_buf;
441 *fork_buf_ptr = &fork_buf; 440 *fork_buf_ptr = &fork_buf;
@@ -450,7 +449,7 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
450 */ 449 */
451 flags = get_signals(); 450 flags = get_signals();
452 block_signals(); 451 block_signals();
453 if(UML_SETJMP(&fork_buf, enable) == 0) 452 if(UML_SETJMP(&fork_buf) == 0)
454 new_thread_proc(stack, handler); 453 new_thread_proc(stack, handler);
455 454
456 remove_sigstack(); 455 remove_sigstack();
@@ -467,21 +466,19 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr,
467void thread_wait(void *sw, void *fb) 466void thread_wait(void *sw, void *fb)
468{ 467{
469 jmp_buf buf, **switch_buf = sw, *fork_buf; 468 jmp_buf buf, **switch_buf = sw, *fork_buf;
470 int enable;
471 469
472 *switch_buf = &buf; 470 *switch_buf = &buf;
473 fork_buf = fb; 471 fork_buf = fb;
474 if(UML_SETJMP(&buf, enable) == 0) 472 if(UML_SETJMP(&buf) == 0)
475 siglongjmp(*fork_buf, INIT_JMP_REMOVE_SIGSTACK); 473 siglongjmp(*fork_buf, INIT_JMP_REMOVE_SIGSTACK);
476} 474}
477 475
478void switch_threads(void *me, void *next) 476void switch_threads(void *me, void *next)
479{ 477{
480 jmp_buf my_buf, **me_ptr = me, *next_buf = next; 478 jmp_buf my_buf, **me_ptr = me, *next_buf = next;
481 int enable;
482 479
483 *me_ptr = &my_buf; 480 *me_ptr = &my_buf;
484 if(UML_SETJMP(&my_buf, enable) == 0) 481 if(UML_SETJMP(&my_buf) == 0)
485 UML_LONGJMP(next_buf, 1); 482 UML_LONGJMP(next_buf, 1);
486} 483}
487 484
@@ -495,14 +492,14 @@ static jmp_buf *cb_back;
495int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr) 492int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr)
496{ 493{
497 jmp_buf **switch_buf = switch_buf_ptr; 494 jmp_buf **switch_buf = switch_buf_ptr;
498 int n, enable; 495 int n;
499 496
500 set_handler(SIGWINCH, (__sighandler_t) sig_handler, 497 set_handler(SIGWINCH, (__sighandler_t) sig_handler,
501 SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGALRM, 498 SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGALRM,
502 SIGVTALRM, -1); 499 SIGVTALRM, -1);
503 500
504 *fork_buf_ptr = &initial_jmpbuf; 501 *fork_buf_ptr = &initial_jmpbuf;
505 n = UML_SETJMP(&initial_jmpbuf, enable); 502 n = UML_SETJMP(&initial_jmpbuf);
506 switch(n){ 503 switch(n){
507 case INIT_JMP_NEW_THREAD: 504 case INIT_JMP_NEW_THREAD:
508 new_thread_proc((void *) stack, new_thread_handler); 505 new_thread_proc((void *) stack, new_thread_handler);
@@ -529,14 +526,13 @@ int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr)
529void initial_thread_cb_skas(void (*proc)(void *), void *arg) 526void initial_thread_cb_skas(void (*proc)(void *), void *arg)
530{ 527{
531 jmp_buf here; 528 jmp_buf here;
532 int enable;
533 529
534 cb_proc = proc; 530 cb_proc = proc;
535 cb_arg = arg; 531 cb_arg = arg;
536 cb_back = &here; 532 cb_back = &here;
537 533
538 block_signals(); 534 block_signals();
539 if(UML_SETJMP(&here, enable) == 0) 535 if(UML_SETJMP(&here) == 0)
540 UML_LONGJMP(&initial_jmpbuf, INIT_JMP_CALLBACK); 536 UML_LONGJMP(&initial_jmpbuf, INIT_JMP_CALLBACK);
541 unblock_signals(); 537 unblock_signals();
542 538