diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-05-06 17:51:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-07 15:13:03 -0400 |
commit | 77f6af778dc23514d897f4fdc7935329285ecb1b (patch) | |
tree | b800f241f3d49dce3ef79c7ec2e6cf8ff04e07a7 /arch/um/os-Linux/skas/process.c | |
parent | 63843c265fd0e0c7894f713e0db5777560e756ae (diff) |
uml: don't try to handle signals on initial process stack
Code running on the initial UML stack can't receive or process signals since
current must be valid when IRQs are handled, and there is no current for this
stack.
So, instead of using UML_LONGJMP and UML_SETJMP, which are careful to save and
restore signal state, and, as a side-effect, handle any deferred signals,
start_idle_thread must use the bare equivalents, which don't do anything with
signals.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
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 | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c index 5b1943dc15e9..1f39f2bf7ce9 100644 --- a/arch/um/os-Linux/skas/process.c +++ b/arch/um/os-Linux/skas/process.c | |||
@@ -494,7 +494,15 @@ int start_idle_thread(void *stack, jmp_buf *switch_buf) | |||
494 | SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGALRM, | 494 | SA_ONSTACK | SA_RESTART, SIGUSR1, SIGIO, SIGALRM, |
495 | SIGVTALRM, -1); | 495 | SIGVTALRM, -1); |
496 | 496 | ||
497 | n = UML_SETJMP(&initial_jmpbuf); | 497 | /* |
498 | * Can't use UML_SETJMP or UML_LONGJMP here because they save | ||
499 | * and restore signals, with the possible side-effect of | ||
500 | * trying to handle any signals which came when they were | ||
501 | * blocked, which can't be done on this stack. | ||
502 | * Signals must be blocked when jumping back here and restored | ||
503 | * after returning to the jumper. | ||
504 | */ | ||
505 | n = setjmp(initial_jmpbuf); | ||
498 | switch(n){ | 506 | switch(n){ |
499 | case INIT_JMP_NEW_THREAD: | 507 | case INIT_JMP_NEW_THREAD: |
500 | (*switch_buf)[0].JB_IP = (unsigned long) new_thread_handler; | 508 | (*switch_buf)[0].JB_IP = (unsigned long) new_thread_handler; |
@@ -504,7 +512,7 @@ int start_idle_thread(void *stack, jmp_buf *switch_buf) | |||
504 | break; | 512 | break; |
505 | case INIT_JMP_CALLBACK: | 513 | case INIT_JMP_CALLBACK: |
506 | (*cb_proc)(cb_arg); | 514 | (*cb_proc)(cb_arg); |
507 | UML_LONGJMP(cb_back, 1); | 515 | longjmp(*cb_back, 1); |
508 | break; | 516 | break; |
509 | case INIT_JMP_HALT: | 517 | case INIT_JMP_HALT: |
510 | kmalloc_ok = 0; | 518 | kmalloc_ok = 0; |
@@ -515,7 +523,7 @@ int start_idle_thread(void *stack, jmp_buf *switch_buf) | |||
515 | default: | 523 | default: |
516 | panic("Bad sigsetjmp return in start_idle_thread - %d\n", n); | 524 | panic("Bad sigsetjmp return in start_idle_thread - %d\n", n); |
517 | } | 525 | } |
518 | UML_LONGJMP(switch_buf, 1); | 526 | longjmp(*switch_buf, 1); |
519 | } | 527 | } |
520 | 528 | ||
521 | void initial_thread_cb_skas(void (*proc)(void *), void *arg) | 529 | void initial_thread_cb_skas(void (*proc)(void *), void *arg) |