Skip to content

Commit dfe09ae

Browse files
author
Al Viro
committed
alpha: switch to generic fork/vfork/clone
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 87f1ca8 commit dfe09ae

4 files changed

Lines changed: 17 additions & 59 deletions

File tree

‎arch/alpha/include/asm/unistd.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,9 @@
482482
#define __ARCH_WANT_SYS_SIGPENDING
483483
#define __ARCH_WANT_SYS_RT_SIGSUSPEND
484484
#define __ARCH_WANT_SYS_EXECVE
485+
#define __ARCH_WANT_SYS_FORK
486+
#define __ARCH_WANT_SYS_VFORK
487+
#define __ARCH_WANT_SYS_CLONE
485488

486489
/* "Conditional" syscalls. What we want is
487490

‎arch/alpha/kernel/entry.S‎

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -612,44 +612,24 @@ ret_from_kernel_thread:
612612
* Special system calls. Most of these are special in that they either
613613
* have to play switch_stack games or in some way use the pt_regs struct.
614614
*/
615+
616+
.macro fork_like name
615617
.align 4
616-
.globl sys_fork
617-
.ent sys_fork
618-
sys_fork:
618+
.globl alpha_\name
619+
.ent alpha_\name
620+
alpha_\name:
619621
.prologue 0
620622
bsr $1, do_switch_stack
621-
bis $31, SIGCHLD, $16
622-
mov $31, $17
623-
mov $31, $18
624-
mov $31, $19
625-
mov $31, $20
626-
jsr $26, alpha_clone
627-
fork_out:
623+
jsr $26, sys_\name
628624
ldq $26, 56($sp)
629625
lda $sp, SWITCH_STACK_SIZE($sp)
630626
ret
631-
.end sys_fork
632-
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
627+
.end alpha_\name
628+
.endm
643629

644-
.align 4
645-
.globl sys_vfork
646-
.ent sys_vfork
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
630+
fork_like fork
631+
fork_like vfork
632+
fork_like clone
653633

654634
.align 4
655635
.globl sys_sigreturn

‎arch/alpha/kernel/process.c‎

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -234,31 +234,6 @@ release_thread(struct task_struct *dead_task)
234234
{
235235
}
236236

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-
262237
/*
263238
* Copy an alpha thread..
264239
*/

‎arch/alpha/kernel/systbls.S‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
sys_call_table:
1313
.quad alpha_ni_syscall /* 0 */
1414
.quad sys_exit
15-
.quad sys_fork
15+
.quad alpha_fork
1616
.quad sys_read
1717
.quad sys_write
1818
.quad alpha_ni_syscall /* 5 */
@@ -76,7 +76,7 @@ sys_call_table:
7676
.quad sys_getpgrp
7777
.quad sys_getpagesize
7878
.quad alpha_ni_syscall /* 65 */
79-
.quad sys_vfork
79+
.quad alpha_vfork
8080
.quad sys_newstat
8181
.quad sys_newlstat
8282
.quad alpha_ni_syscall
@@ -330,7 +330,7 @@ sys_call_table:
330330
.quad sys_ni_syscall /* 309: old get_kernel_syms */
331331
.quad sys_syslog /* 310 */
332332
.quad sys_reboot
333-
.quad sys_clone
333+
.quad alpha_clone
334334
.quad sys_uselib
335335
.quad sys_mlock
336336
.quad sys_munlock /* 315 */

0 commit comments

Comments
 (0)