Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
92bbe6cd
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 3 年多
通知
13
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
92bbe6cd
编写于
10月 21, 2012
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
m32r: switch to generic fork/vfork/clone
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
27d892fb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
42 deletion
+7
-42
arch/m32r/include/asm/unistd.h
arch/m32r/include/asm/unistd.h
+3
-0
arch/m32r/kernel/process.c
arch/m32r/kernel/process.c
+4
-42
未找到文件。
arch/m32r/include/asm/unistd.h
浏览文件 @
92bbe6cd
...
...
@@ -353,6 +353,9 @@
#define __ARCH_WANT_SYS_RT_SIGACTION
#define __ARCH_WANT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_CLONE
#define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK
#define __IGNORE_lchown
#define __IGNORE_setuid
...
...
arch/m32r/kernel/process.c
浏览文件 @
92bbe6cd
...
...
@@ -192,7 +192,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
}
int
copy_thread
(
unsigned
long
clone_flags
,
unsigned
long
spu
,
unsigned
long
arg
,
struct
task_struct
*
tsk
,
struct
pt_regs
*
regs
)
unsigned
long
arg
,
struct
task_struct
*
tsk
,
struct
pt_regs
*
unused
)
{
struct
pt_regs
*
childregs
=
task_pt_regs
(
tsk
);
extern
void
ret_from_fork
(
void
);
...
...
@@ -206,8 +206,9 @@ int copy_thread(unsigned long clone_flags, unsigned long spu,
tsk
->
thread
.
lr
=
(
unsigned
long
)
ret_from_kernel_thread
;
}
else
{
/* Copy registers */
*
childregs
=
*
regs
;
childregs
->
spu
=
spu
;
*
childregs
=
*
current_pt_regs
();
if
(
spu
)
childregs
->
spu
=
spu
;
childregs
->
r0
=
0
;
/* Child gets zero as return value */
tsk
->
thread
.
lr
=
(
unsigned
long
)
ret_from_fork
;
}
...
...
@@ -216,45 +217,6 @@ int copy_thread(unsigned long clone_flags, unsigned long spu,
return
0
;
}
asmlinkage
int
sys_fork
(
void
)
{
#ifdef CONFIG_MMU
struct
pt_regs
*
regs
=
current_pt_regs
();
return
do_fork
(
SIGCHLD
,
regs
->
spu
,
regs
,
0
,
NULL
,
NULL
);
#else
return
-
EINVAL
;
#endif
/* CONFIG_MMU */
}
asmlinkage
int
sys_clone
(
unsigned
long
clone_flags
,
unsigned
long
newsp
,
unsigned
long
parent_tidptr
,
unsigned
long
child_tidptr
)
{
struct
pt_regs
*
regs
=
current_pt_regs
();
if
(
!
newsp
)
newsp
=
regs
->
spu
;
return
do_fork
(
clone_flags
,
newsp
,
regs
,
0
,
(
int
__user
*
)
parent_tidptr
,
(
int
__user
*
)
child_tidptr
);
}
/*
* This is trivial, and on the face of it looks like it
* could equally well be done in user mode.
*
* Not so, for quite unobvious reasons - register pressure.
* In user mode vfork() cannot have a stack frame, and if
* done by calling the "clone()" system call directly, you
* do not have enough call-clobbered registers to hold all
* the information you need.
*/
asmlinkage
int
sys_vfork
(
void
)
{
struct
pt_regs
*
regs
=
current_pt_regs
();
return
do_fork
(
CLONE_VFORK
|
CLONE_VM
|
SIGCHLD
,
regs
->
spu
,
regs
,
0
,
NULL
,
NULL
);
}
/*
* These bracket the sleeping functions..
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录