Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
eda96977
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
165
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
eda96977
编写于
12年前
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
score: switch to generic fork/vfork/clone
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
951b3961
无相关合并请求
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
8 addition
and
58 deletion
+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
未找到文件。
arch/score/Kconfig
浏览文件 @
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"
...
...
This diff is collapsed.
Click to expand it.
arch/score/include/asm/syscalls.h
浏览文件 @
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
);
...
...
This diff is collapsed.
Click to expand it.
arch/score/include/asm/unistd.h
浏览文件 @
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>
This diff is collapsed.
Click to expand it.
arch/score/kernel/entry.S
浏览文件 @
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 */
This diff is collapsed.
Click to expand it.
arch/score/kernel/process.c
浏览文件 @
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
;
}
...
...
This diff is collapsed.
Click to expand it.
arch/score/kernel/sys_score.c
浏览文件 @
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
);
}
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
反馈
建议
客服
返回
顶部