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
b9763ce3
Commit
b9763ce3
authored
Oct 21, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
frv: switch to generic fork/vfork/clone
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
0bcfe540
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
40 deletions
+8
-40
arch/frv/include/asm/unistd.h
arch/frv/include/asm/unistd.h
+3
-0
arch/frv/kernel/process.c
arch/frv/kernel/process.c
+5
-40
No files found.
arch/frv/include/asm/unistd.h
View file @
b9763ce3
...
...
@@ -30,6 +30,9 @@
#define __ARCH_WANT_SYS_RT_SIGACTION
#define __ARCH_WANT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK
#define __ARCH_WANT_SYS_CLONE
/*
* "Conditional" syscalls
...
...
arch/frv/kernel/process.c
View file @
b9763ce3
...
...
@@ -139,42 +139,12 @@ inline unsigned long user_stack(const struct pt_regs *regs)
return
user_mode
(
regs
)
?
regs
->
sp
:
0
;
}
asmlinkage
int
sys_fork
(
void
)
{
#ifndef CONFIG_MMU
/* fork almost works, enough to trick you into looking elsewhere:-( */
return
-
EINVAL
;
#else
return
do_fork
(
SIGCHLD
,
user_stack
(
__frame
),
__frame
,
0
,
NULL
,
NULL
);
#endif
}
asmlinkage
int
sys_vfork
(
void
)
{
return
do_fork
(
CLONE_VFORK
|
CLONE_VM
|
SIGCHLD
,
user_stack
(
__frame
),
__frame
,
0
,
NULL
,
NULL
);
}
/*****************************************************************************/
/*
* clone a process
* - tlsptr is retrieved by copy_thread()
*/
asmlinkage
int
sys_clone
(
unsigned
long
clone_flags
,
unsigned
long
newsp
,
int
__user
*
parent_tidptr
,
int
__user
*
child_tidptr
,
int
__user
*
tlsptr
)
{
if
(
!
newsp
)
newsp
=
user_stack
(
__frame
);
return
do_fork
(
clone_flags
,
newsp
,
__frame
,
0
,
parent_tidptr
,
child_tidptr
);
}
/* end sys_clone() */
/*
* set up the kernel stack and exception frames for a new process
*/
int
copy_thread
(
unsigned
long
clone_flags
,
unsigned
long
usp
,
unsigned
long
arg
,
struct
task_struct
*
p
,
struct
pt_regs
*
regs
)
struct
task_struct
*
p
,
struct
pt_regs
*
unused
)
{
struct
pt_regs
*
childregs
;
...
...
@@ -182,9 +152,7 @@ int copy_thread(unsigned long clone_flags,
(
task_stack_page
(
p
)
+
THREAD_SIZE
-
FRV_FRAME0_SIZE
);
/* set up the userspace frame (the only place that the USP is stored) */
*
childregs
=
*
__kernel_frame0_ptr
;
p
->
set_child_tid
=
p
->
clear_child_tid
=
NULL
;
*
childregs
=
*
current_pt_regs
();
p
->
thread
.
frame
=
childregs
;
p
->
thread
.
curr
=
p
;
...
...
@@ -193,17 +161,14 @@ int copy_thread(unsigned long clone_flags,
p
->
thread
.
lr
=
0
;
p
->
thread
.
frame0
=
childregs
;
if
(
unlikely
(
!
regs
))
{
if
(
unlikely
(
p
->
flags
&
PF_KTHREAD
))
{
childregs
->
gr9
=
usp
;
/* function */
childregs
->
gr8
=
arg
;
p
->
thread
.
pc
=
(
unsigned
long
)
ret_from_kernel_thread
;
save_user_regs
(
p
->
thread
.
user
);
return
0
;
}
/* set up the userspace frame (the only place that the USP is stored) */
*
childregs
=
*
regs
;
if
(
usp
)
childregs
->
sp
=
usp
;
childregs
->
next_frame
=
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