diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-26 09:54:47 -0400 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-11-28 22:44:45 -0500 |
| commit | dfe09ae0e5fe40679af05b1ba810d469844c97b3 (patch) | |
| tree | 0131917cc3c8f7e1cb5126e43064a01d2e1cab1c /arch/alpha/kernel | |
| parent | 87f1ca8fd9f00cc024a141623d042ca4319e12c1 (diff) | |
alpha: switch to generic fork/vfork/clone
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/alpha/kernel')
| -rw-r--r-- | arch/alpha/kernel/entry.S | 42 | ||||
| -rw-r--r-- | arch/alpha/kernel/process.c | 25 | ||||
| -rw-r--r-- | arch/alpha/kernel/systbls.S | 6 |
3 files changed, 14 insertions, 59 deletions
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S index c245de65c61b..f62a994ef126 100644 --- a/arch/alpha/kernel/entry.S +++ b/arch/alpha/kernel/entry.S | |||
| @@ -612,44 +612,24 @@ ret_from_kernel_thread: | |||
| 612 | * Special system calls. Most of these are special in that they either | 612 | * Special system calls. Most of these are special in that they either |
| 613 | * have to play switch_stack games or in some way use the pt_regs struct. | 613 | * have to play switch_stack games or in some way use the pt_regs struct. |
| 614 | */ | 614 | */ |
| 615 | |||
| 616 | .macro fork_like name | ||
| 615 | .align 4 | 617 | .align 4 |
| 616 | .globl sys_fork | 618 | .globl alpha_\name |
| 617 | .ent sys_fork | 619 | .ent alpha_\name |
| 618 | sys_fork: | 620 | alpha_\name: |
| 619 | .prologue 0 | 621 | .prologue 0 |
| 620 | bsr $1, do_switch_stack | 622 | bsr $1, do_switch_stack |
| 621 | bis $31, SIGCHLD, $16 | 623 | jsr $26, sys_\name |
| 622 | mov $31, $17 | ||
| 623 | mov $31, $18 | ||
| 624 | mov $31, $19 | ||
| 625 | mov $31, $20 | ||
| 626 | jsr $26, alpha_clone | ||
| 627 | fork_out: | ||
| 628 | ldq $26, 56($sp) | 624 | ldq $26, 56($sp) |
| 629 | lda $sp, SWITCH_STACK_SIZE($sp) | 625 | lda $sp, SWITCH_STACK_SIZE($sp) |
| 630 | ret | 626 | ret |
| 631 | .end sys_fork | 627 | .end alpha_\name |
| 632 | 628 | .endm | |
| 633 | .align 4 | ||
| 634 | .globl sys_clone | ||
| 635 | .ent sys_clone | ||
| 636 | sys_clone: | ||
| 637 | .prologue 0 | ||
| 638 | bsr $1, do_switch_stack | ||
| 639 | /* $16, $17, $18, $19, $20 come from the user. */ | ||
| 640 | lda $26, fork_out | ||
| 641 | jsr $31, alpha_clone | ||
| 642 | .end sys_clone | ||
| 643 | 629 | ||
| 644 | .align 4 | 630 | fork_like fork |
| 645 | .globl sys_vfork | 631 | fork_like vfork |
| 646 | .ent sys_vfork | 632 | fork_like clone |
| 647 | sys_vfork: | ||
| 648 | .prologue 0 | ||
| 649 | bsr $1, do_switch_stack | ||
| 650 | lda $26, fork_out | ||
| 651 | jsr $31, alpha_vfork | ||
| 652 | .end sys_vfork | ||
| 653 | 633 | ||
| 654 | .align 4 | 634 | .align 4 |
| 655 | .globl sys_sigreturn | 635 | .globl sys_sigreturn |
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index a4dc79ba030f..e9705bcc96f9 100644 --- a/arch/alpha/kernel/process.c +++ b/arch/alpha/kernel/process.c | |||
| @@ -235,31 +235,6 @@ release_thread(struct task_struct *dead_task) | |||
| 235 | } | 235 | } |
| 236 | 236 | ||
| 237 | /* | 237 | /* |
| 238 | * "alpha_clone()".. By the time we get here, the | ||
| 239 | * non-volatile registers have also been saved on the | ||
| 240 | * stack. We do some ugly pointer stuff here.. (see | ||
| 241 | * also copy_thread) | ||
| 242 | * | ||
| 243 | * Notice that "fork()" is implemented in terms of clone, | ||
| 244 | * with parameters (SIGCHLD, 0). | ||
| 245 | */ | ||
| 246 | int | ||
| 247 | alpha_clone(unsigned long clone_flags, unsigned long usp, | ||
| 248 | int __user *parent_tid, int __user *child_tid, | ||
| 249 | unsigned long tls_value) | ||
| 250 | { | ||
| 251 | return do_fork(clone_flags, usp, current_pt_regs(), 0, | ||
| 252 | parent_tid, child_tid); | ||
| 253 | } | ||
| 254 | |||
| 255 | int | ||
| 256 | alpha_vfork(void) | ||
| 257 | { | ||
| 258 | return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 0, | ||
| 259 | current_pt_regs(), 0, NULL, NULL); | ||
| 260 | } | ||
| 261 | |||
| 262 | /* | ||
| 263 | * Copy an alpha thread.. | 238 | * Copy an alpha thread.. |
| 264 | */ | 239 | */ |
| 265 | 240 | ||
diff --git a/arch/alpha/kernel/systbls.S b/arch/alpha/kernel/systbls.S index 2ac6b45c3e00..4284ec798ec9 100644 --- a/arch/alpha/kernel/systbls.S +++ b/arch/alpha/kernel/systbls.S | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | sys_call_table: | 12 | sys_call_table: |
| 13 | .quad alpha_ni_syscall /* 0 */ | 13 | .quad alpha_ni_syscall /* 0 */ |
| 14 | .quad sys_exit | 14 | .quad sys_exit |
| 15 | .quad sys_fork | 15 | .quad alpha_fork |
| 16 | .quad sys_read | 16 | .quad sys_read |
| 17 | .quad sys_write | 17 | .quad sys_write |
| 18 | .quad alpha_ni_syscall /* 5 */ | 18 | .quad alpha_ni_syscall /* 5 */ |
| @@ -76,7 +76,7 @@ sys_call_table: | |||
| 76 | .quad sys_getpgrp | 76 | .quad sys_getpgrp |
| 77 | .quad sys_getpagesize | 77 | .quad sys_getpagesize |
| 78 | .quad alpha_ni_syscall /* 65 */ | 78 | .quad alpha_ni_syscall /* 65 */ |
| 79 | .quad sys_vfork | 79 | .quad alpha_vfork |
| 80 | .quad sys_newstat | 80 | .quad sys_newstat |
| 81 | .quad sys_newlstat | 81 | .quad sys_newlstat |
| 82 | .quad alpha_ni_syscall | 82 | .quad alpha_ni_syscall |
| @@ -330,7 +330,7 @@ sys_call_table: | |||
| 330 | .quad sys_ni_syscall /* 309: old get_kernel_syms */ | 330 | .quad sys_ni_syscall /* 309: old get_kernel_syms */ |
| 331 | .quad sys_syslog /* 310 */ | 331 | .quad sys_syslog /* 310 */ |
| 332 | .quad sys_reboot | 332 | .quad sys_reboot |
| 333 | .quad sys_clone | 333 | .quad alpha_clone |
| 334 | .quad sys_uselib | 334 | .quad sys_uselib |
| 335 | .quad sys_mlock | 335 | .quad sys_mlock |
| 336 | .quad sys_munlock /* 315 */ | 336 | .quad sys_munlock /* 315 */ |
