Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
38a61b6b
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
38a61b6b
编写于
10月 21, 2012
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
arm: switch to generic fork/vfork/clone
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
1d4b4b29
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
13 addition
and
55 deletion
+13
-55
arch/arm/Kconfig
arch/arm/Kconfig
+1
-0
arch/arm/include/asm/unistd.h
arch/arm/include/asm/unistd.h
+3
-0
arch/arm/kernel/calls.S
arch/arm/kernel/calls.S
+3
-3
arch/arm/kernel/entry-common.S
arch/arm/kernel/entry-common.S
+0
-16
arch/arm/kernel/process.c
arch/arm/kernel/process.c
+6
-5
arch/arm/kernel/sys_arm.c
arch/arm/kernel/sys_arm.c
+0
-31
未找到文件。
arch/arm/Kconfig
浏览文件 @
38a61b6b
...
...
@@ -55,6 +55,7 @@ config ARM
select SYS_SUPPORTS_APM_EMULATION
select HAVE_MOD_ARCH_SPECIFIC if ARM_UNWIND
select MODULES_USE_ELF_REL
select CLONE_BACKWARDS
help
The ARM series is a line of low-power-consumption RISC chip designs
licensed by ARM Ltd and targeted at embedded applications and
...
...
arch/arm/include/asm/unistd.h
浏览文件 @
38a61b6b
...
...
@@ -42,6 +42,9 @@
#define __ARCH_WANT_SYS_SOCKETCALL
#endif
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK
#define __ARCH_WANT_SYS_CLONE
/*
* "Conditional" syscalls
...
...
arch/arm/kernel/calls.S
浏览文件 @
38a61b6b
...
...
@@ -11,7 +11,7 @@
*/
/*
0
*/
CALL
(
sys_restart_syscall
)
CALL
(
sys_exit
)
CALL
(
sys_fork
_wrapper
)
CALL
(
sys_fork
)
CALL
(
sys_read
)
CALL
(
sys_write
)
/*
5
*/
CALL
(
sys_open
)
...
...
@@ -129,7 +129,7 @@
CALL
(
OBSOLETE
(
ABI
(
sys_ipc
,
sys_oabi_ipc
)))
CALL
(
sys_fsync
)
CALL
(
sys_sigreturn_wrapper
)
/*
120
*/
CALL
(
sys_clone
_wrapper
)
/*
120
*/
CALL
(
sys_clone
)
CALL
(
sys_setdomainname
)
CALL
(
sys_newuname
)
CALL
(
sys_ni_syscall
)
/*
modify_ldt
*/
...
...
@@ -199,7 +199,7 @@
CALL
(
sys_sendfile
)
CALL
(
sys_ni_syscall
)
/*
getpmsg
*/
CALL
(
sys_ni_syscall
)
/*
putpmsg
*/
/*
190
*/
CALL
(
sys_vfork
_wrapper
)
/*
190
*/
CALL
(
sys_vfork
)
CALL
(
sys_getrlimit
)
CALL
(
sys_mmap2
)
CALL
(
ABI
(
sys_truncate64
,
sys_oabi_truncate64
))
...
...
arch/arm/kernel/entry-common.S
浏览文件 @
38a61b6b
...
...
@@ -510,22 +510,6 @@ sys_syscall:
b
sys_ni_syscall
ENDPROC
(
sys_syscall
)
sys_fork_wrapper
:
add
r0
,
sp
,
#
S_OFF
b
sys_fork
ENDPROC
(
sys_fork_wrapper
)
sys_vfork_wrapper
:
add
r0
,
sp
,
#
S_OFF
b
sys_vfork
ENDPROC
(
sys_vfork_wrapper
)
sys_clone_wrapper
:
add
ip
,
sp
,
#
S_OFF
str
ip
,
[
sp
,
#
4
]
b
sys_clone
ENDPROC
(
sys_clone_wrapper
)
sys_sigreturn_wrapper
:
add
r0
,
sp
,
#
S_OFF
mov
why
,
#
0
@
prevent
syscall
restart
handling
...
...
arch/arm/kernel/process.c
浏览文件 @
38a61b6b
...
...
@@ -376,16 +376,17 @@ asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
int
copy_thread
(
unsigned
long
clone_flags
,
unsigned
long
stack_start
,
unsigned
long
stk_sz
,
struct
task_struct
*
p
,
struct
pt_regs
*
regs
)
unsigned
long
stk_sz
,
struct
task_struct
*
p
,
struct
pt_regs
*
unused
)
{
struct
thread_info
*
thread
=
task_thread_info
(
p
);
struct
pt_regs
*
childregs
=
task_pt_regs
(
p
);
memset
(
&
thread
->
cpu_context
,
0
,
sizeof
(
struct
cpu_context_save
));
if
(
likely
(
regs
))
{
*
childregs
=
*
regs
;
if
(
likely
(
!
(
p
->
flags
&
PF_KTHREAD
)
))
{
*
childregs
=
*
current_pt_regs
()
;
childregs
->
ARM_r0
=
0
;
if
(
stack_start
)
childregs
->
ARM_sp
=
stack_start
;
}
else
{
memset
(
childregs
,
0
,
sizeof
(
struct
pt_regs
));
...
...
@@ -399,7 +400,7 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start,
clear_ptrace_hw_breakpoint
(
p
);
if
(
clone_flags
&
CLONE_SETTLS
)
thread
->
tp_value
=
regs
->
ARM_r3
;
thread
->
tp_value
=
child
regs
->
ARM_r3
;
thread_notify
(
THREAD_NOTIFY_COPY
,
thread
);
...
...
arch/arm/kernel/sys_arm.c
浏览文件 @
38a61b6b
...
...
@@ -28,37 +28,6 @@
#include <linux/uaccess.h>
#include <linux/slab.h>
/* Fork a new task - this creates a new program thread.
* This is called indirectly via a small wrapper
*/
asmlinkage
int
sys_fork
(
struct
pt_regs
*
regs
)
{
#ifdef CONFIG_MMU
return
do_fork
(
SIGCHLD
,
regs
->
ARM_sp
,
regs
,
0
,
NULL
,
NULL
);
#else
/* can not support in nommu mode */
return
(
-
EINVAL
);
#endif
}
/* Clone a task - this clones the calling program thread.
* This is called indirectly via a small wrapper
*/
asmlinkage
int
sys_clone
(
unsigned
long
clone_flags
,
unsigned
long
newsp
,
int
__user
*
parent_tidptr
,
int
tls_val
,
int
__user
*
child_tidptr
,
struct
pt_regs
*
regs
)
{
if
(
!
newsp
)
newsp
=
regs
->
ARM_sp
;
return
do_fork
(
clone_flags
,
newsp
,
regs
,
0
,
parent_tidptr
,
child_tidptr
);
}
asmlinkage
int
sys_vfork
(
struct
pt_regs
*
regs
)
{
return
do_fork
(
CLONE_VFORK
|
CLONE_VM
|
SIGCHLD
,
regs
->
ARM_sp
,
regs
,
0
,
NULL
,
NULL
);
}
/*
* Since loff_t is a 64 bit type we avoid a lot of ABI hassle
* with a different argument ordering.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录