diff options
author | Jeff Dike <jdike@addtoit.com> | 2006-04-19 01:21:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-04-19 12:13:51 -0400 |
commit | ad28e029789ef46aebdfb9ece01d431ce1c637c8 (patch) | |
tree | e2e5dffefbb2484324ac4d0e74b77d312058b4a5 /arch/um/os-Linux/skas/process.c | |
parent | 4127272c38619c56f0c1aa01d01c7bd757db70a1 (diff) |
[PATCH] uml: change sigjmp_buf to jmp_buf
Clean up the jmpbuf code. Since softints, we no longer use sig_setjmp, so
the UML_SIGSETJMP wrapper now has a misleading name. Also, I forgot to
change the buffers from sigjmp_buf to jmp_buf.
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/process.c')
-rw-r--r-- | arch/um/os-Linux/skas/process.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c index 045ae0037456..0776bc18ca85 100644 --- a/arch/um/os-Linux/skas/process.c +++ b/arch/um/os-Linux/skas/process.c | |||
@@ -434,7 +434,7 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr, | |||
434 | void (*handler)(int)) | 434 | void (*handler)(int)) |
435 | { | 435 | { |
436 | unsigned long flags; | 436 | unsigned long flags; |
437 | sigjmp_buf switch_buf, fork_buf; | 437 | jmp_buf switch_buf, fork_buf; |
438 | int enable; | 438 | int enable; |
439 | 439 | ||
440 | *switch_buf_ptr = &switch_buf; | 440 | *switch_buf_ptr = &switch_buf; |
@@ -450,7 +450,7 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr, | |||
450 | */ | 450 | */ |
451 | flags = get_signals(); | 451 | flags = get_signals(); |
452 | block_signals(); | 452 | block_signals(); |
453 | if(UML_SIGSETJMP(&fork_buf, enable) == 0) | 453 | if(UML_SETJMP(&fork_buf, enable) == 0) |
454 | new_thread_proc(stack, handler); | 454 | new_thread_proc(stack, handler); |
455 | 455 | ||
456 | remove_sigstack(); | 456 | remove_sigstack(); |
@@ -466,35 +466,35 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr, | |||
466 | 466 | ||
467 | void thread_wait(void *sw, void *fb) | 467 | void thread_wait(void *sw, void *fb) |
468 | { | 468 | { |
469 | sigjmp_buf buf, **switch_buf = sw, *fork_buf; | 469 | jmp_buf buf, **switch_buf = sw, *fork_buf; |
470 | int enable; | 470 | int enable; |
471 | 471 | ||
472 | *switch_buf = &buf; | 472 | *switch_buf = &buf; |
473 | fork_buf = fb; | 473 | fork_buf = fb; |
474 | if(UML_SIGSETJMP(&buf, enable) == 0) | 474 | if(UML_SETJMP(&buf, enable) == 0) |
475 | siglongjmp(*fork_buf, INIT_JMP_REMOVE_SIGSTACK); | 475 | siglongjmp(*fork_buf, INIT_JMP_REMOVE_SIGSTACK); |
476 | } | 476 | } |
477 | 477 | ||
478 | void switch_threads(void *me, void *next) | 478 | void switch_threads(void *me, void *next) |
479 | { | 479 | { |
480 | sigjmp_buf my_buf, **me_ptr = me, *next_buf = next; | 480 | jmp_buf my_buf, **me_ptr = me, *next_buf = next; |
481 | int enable; | 481 | int enable; |
482 | 482 | ||
483 | *me_ptr = &my_buf; | 483 | *me_ptr = &my_buf; |
484 | if(UML_SIGSETJMP(&my_buf, enable) == 0) | 484 | if(UML_SETJMP(&my_buf, enable) == 0) |
485 | UML_SIGLONGJMP(next_buf, 1); | 485 | UML_LONGJMP(next_buf, 1); |
486 | } | 486 | } |
487 | 487 | ||
488 | static sigjmp_buf initial_jmpbuf; | 488 | static jmp_buf initial_jmpbuf; |
489 | 489 | ||
490 | /* XXX Make these percpu */ | 490 | /* XXX Make these percpu */ |
491 | static void (*cb_proc)(void *arg); | 491 | static void (*cb_proc)(void *arg); |
492 | static void *cb_arg; | 492 | static void *cb_arg; |
493 | static sigjmp_buf *cb_back; | 493 | static jmp_buf *cb_back; |
494 | 494 | ||
495 | int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr) | 495 | int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr) |
496 | { | 496 | { |
497 | sigjmp_buf **switch_buf = switch_buf_ptr; | 497 | jmp_buf **switch_buf = switch_buf_ptr; |
498 | int n, enable; | 498 | int n, enable; |
499 | 499 | ||
500 | set_handler(SIGWINCH, (__sighandler_t) sig_handler, | 500 | set_handler(SIGWINCH, (__sighandler_t) sig_handler, |
@@ -502,7 +502,7 @@ int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr) | |||
502 | SIGVTALRM, -1); | 502 | SIGVTALRM, -1); |
503 | 503 | ||
504 | *fork_buf_ptr = &initial_jmpbuf; | 504 | *fork_buf_ptr = &initial_jmpbuf; |
505 | n = UML_SIGSETJMP(&initial_jmpbuf, enable); | 505 | n = UML_SETJMP(&initial_jmpbuf, enable); |
506 | switch(n){ | 506 | switch(n){ |
507 | case INIT_JMP_NEW_THREAD: | 507 | case INIT_JMP_NEW_THREAD: |
508 | new_thread_proc((void *) stack, new_thread_handler); | 508 | new_thread_proc((void *) stack, new_thread_handler); |
@@ -512,7 +512,7 @@ int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr) | |||
512 | break; | 512 | break; |
513 | case INIT_JMP_CALLBACK: | 513 | case INIT_JMP_CALLBACK: |
514 | (*cb_proc)(cb_arg); | 514 | (*cb_proc)(cb_arg); |
515 | UML_SIGLONGJMP(cb_back, 1); | 515 | UML_LONGJMP(cb_back, 1); |
516 | break; | 516 | break; |
517 | case INIT_JMP_HALT: | 517 | case INIT_JMP_HALT: |
518 | kmalloc_ok = 0; | 518 | kmalloc_ok = 0; |
@@ -523,12 +523,12 @@ int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr) | |||
523 | default: | 523 | default: |
524 | panic("Bad sigsetjmp return in start_idle_thread - %d\n", n); | 524 | panic("Bad sigsetjmp return in start_idle_thread - %d\n", n); |
525 | } | 525 | } |
526 | UML_SIGLONGJMP(*switch_buf, 1); | 526 | UML_LONGJMP(*switch_buf, 1); |
527 | } | 527 | } |
528 | 528 | ||
529 | void initial_thread_cb_skas(void (*proc)(void *), void *arg) | 529 | void initial_thread_cb_skas(void (*proc)(void *), void *arg) |
530 | { | 530 | { |
531 | sigjmp_buf here; | 531 | jmp_buf here; |
532 | int enable; | 532 | int enable; |
533 | 533 | ||
534 | cb_proc = proc; | 534 | cb_proc = proc; |
@@ -536,8 +536,8 @@ void initial_thread_cb_skas(void (*proc)(void *), void *arg) | |||
536 | cb_back = &here; | 536 | cb_back = &here; |
537 | 537 | ||
538 | block_signals(); | 538 | block_signals(); |
539 | if(UML_SIGSETJMP(&here, enable) == 0) | 539 | if(UML_SETJMP(&here, enable) == 0) |
540 | UML_SIGLONGJMP(&initial_jmpbuf, INIT_JMP_CALLBACK); | 540 | UML_LONGJMP(&initial_jmpbuf, INIT_JMP_CALLBACK); |
541 | unblock_signals(); | 541 | unblock_signals(); |
542 | 542 | ||
543 | cb_proc = NULL; | 543 | cb_proc = NULL; |
@@ -548,13 +548,13 @@ void initial_thread_cb_skas(void (*proc)(void *), void *arg) | |||
548 | void halt_skas(void) | 548 | void halt_skas(void) |
549 | { | 549 | { |
550 | block_signals(); | 550 | block_signals(); |
551 | UML_SIGLONGJMP(&initial_jmpbuf, INIT_JMP_HALT); | 551 | UML_LONGJMP(&initial_jmpbuf, INIT_JMP_HALT); |
552 | } | 552 | } |
553 | 553 | ||
554 | void reboot_skas(void) | 554 | void reboot_skas(void) |
555 | { | 555 | { |
556 | block_signals(); | 556 | block_signals(); |
557 | UML_SIGLONGJMP(&initial_jmpbuf, INIT_JMP_REBOOT); | 557 | UML_LONGJMP(&initial_jmpbuf, INIT_JMP_REBOOT); |
558 | } | 558 | } |
559 | 559 | ||
560 | void switch_mm_skas(struct mm_id *mm_idp) | 560 | void switch_mm_skas(struct mm_id *mm_idp) |