Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
eda96977
Commit
eda96977
authored
Oct 21, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
score: switch to generic fork/vfork/clone
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
951b3961
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
58 deletions
+8
-58
arch/score/Kconfig
arch/score/Kconfig
+1
-0
arch/score/include/asm/syscalls.h
arch/score/include/asm/syscalls.h
+0
-1
arch/score/include/asm/unistd.h
arch/score/include/asm/unistd.h
+3
-0
arch/score/kernel/entry.S
arch/score/kernel/entry.S
+0
-18
arch/score/kernel/process.c
arch/score/kernel/process.c
+4
-4
arch/score/kernel/sys_score.c
arch/score/kernel/sys_score.c
+0
-35
No files found.
arch/score/Kconfig
View file @
eda96977
...
...
@@ -15,6 +15,7 @@ config SCORE
select MODULES_USE_ELF_REL
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
select CLONE_BACKWARDS
choice
prompt "System type"
...
...
arch/score/include/asm/syscalls.h
View file @
eda96977
#ifndef _ASM_SCORE_SYSCALLS_H
#define _ASM_SCORE_SYSCALLS_H
asmlinkage
long
score_clone
(
struct
pt_regs
*
regs
);
asmlinkage
long
score_sigaltstack
(
struct
pt_regs
*
regs
);
asmlinkage
long
score_rt_sigreturn
(
struct
pt_regs
*
regs
);
...
...
arch/score/include/asm/unistd.h
View file @
eda96977
...
...
@@ -5,5 +5,8 @@
#define __ARCH_WANT_SYSCALL_OFF_T
#define __ARCH_WANT_SYSCALL_DEPRECATED
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_CLONE
#define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK
#include <asm-generic/unistd.h>
arch/score/kernel/entry.S
View file @
eda96977
...
...
@@ -487,11 +487,6 @@ illegal_syscall:
sw
r9
,
[
r0
,
PT_R7
]
j
syscall_return
ENTRY
(
sys_clone
)
mv
r4
,
r0
la
r8
,
score_clone
br
r8
ENTRY
(
sys_rt_sigreturn
)
mv
r4
,
r0
la
r8
,
score_rt_sigreturn
...
...
@@ -501,16 +496,3 @@ ENTRY(sys_sigaltstack)
mv
r4
,
r0
la
r8
,
score_sigaltstack
br
r8
#ifdef __ARCH_WANT_SYSCALL_DEPRECATED
ENTRY
(
sys_fork
)
mv
r4
,
r0
la
r8
,
score_fork
br
r8
ENTRY
(
sys_vfork
)
mv
r4
,
r0
la
r8
,
score_vfork
br
r8
#endif /* __ARCH_WANT_SYSCALL_DEPRECATED */
arch/score/kernel/process.c
View file @
eda96977
...
...
@@ -94,17 +94,17 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
struct
pt_regs
*
childregs
=
task_pt_regs
(
p
);
p
->
thread
.
reg0
=
(
unsigned
long
)
childregs
;
if
(
unlikely
(
!
regs
))
{
if
(
unlikely
(
p
->
flags
&
PF_KTHREAD
))
{
memset
(
childregs
,
0
,
sizeof
(
struct
pt_regs
));
p
->
thread
->
reg12
=
usp
;
p
->
thread
->
reg13
=
arg
;
p
->
thread
.
reg3
=
(
unsigned
long
)
ret_from_kernel_thread
;
}
else
{
*
childregs
=
*
regs
;
*
childregs
=
*
current_pt_regs
()
;
childregs
->
regs
[
7
]
=
0
;
/* Clear error flag */
childregs
->
regs
[
4
]
=
0
;
/* Child gets zero as return value */
childregs
->
regs
[
0
]
=
usp
;
/* user fork */
regs
->
regs
[
4
]
=
p
->
pid
;
/* WTF?
*/
if
(
usp
)
childregs
->
regs
[
0
]
=
usp
;
/* user fork
*/
p
->
thread
.
reg3
=
(
unsigned
long
)
ret_from_fork
;
}
...
...
arch/score/kernel/sys_score.c
View file @
eda96977
...
...
@@ -48,38 +48,3 @@ sys_mmap(unsigned long addr, unsigned long len, unsigned long prot,
return
-
EINVAL
;
return
sys_mmap_pgoff
(
addr
,
len
,
prot
,
flags
,
fd
,
offset
>>
PAGE_SHIFT
);
}
asmlinkage
long
score_fork
(
struct
pt_regs
*
regs
)
{
return
do_fork
(
SIGCHLD
,
regs
->
regs
[
0
],
regs
,
0
,
NULL
,
NULL
);
}
/*
* Clone a task - this clones the calling program thread.
* This is called indirectly via a small wrapper
*/
asmlinkage
long
score_clone
(
struct
pt_regs
*
regs
)
{
unsigned
long
clone_flags
;
unsigned
long
newsp
;
int
__user
*
parent_tidptr
,
*
child_tidptr
;
clone_flags
=
regs
->
regs
[
4
];
newsp
=
regs
->
regs
[
5
];
if
(
!
newsp
)
newsp
=
regs
->
regs
[
0
];
parent_tidptr
=
(
int
__user
*
)
regs
->
regs
[
6
];
child_tidptr
=
(
int
__user
*
)
regs
->
regs
[
8
];
return
do_fork
(
clone_flags
,
newsp
,
regs
,
0
,
parent_tidptr
,
child_tidptr
);
}
asmlinkage
long
score_vfork
(
struct
pt_regs
*
regs
)
{
return
do_fork
(
CLONE_VFORK
|
CLONE_VM
|
SIGCHLD
,
regs
->
regs
[
0
],
regs
,
0
,
NULL
,
NULL
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment