Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
415bfae9
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
415bfae9
编写于
10月 26, 2012
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
parisc: switch to generic fork/vfork/clone
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
92bbe6cd
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
22 addition
and
69 deletion
+22
-69
arch/parisc/Kconfig
arch/parisc/Kconfig
+1
-0
arch/parisc/include/asm/unistd.h
arch/parisc/include/asm/unistd.h
+3
-0
arch/parisc/kernel/entry.S
arch/parisc/kernel/entry.S
+8
-30
arch/parisc/kernel/process.c
arch/parisc/kernel/process.c
+10
-39
未找到文件。
arch/parisc/Kconfig
浏览文件 @
415bfae9
...
...
@@ -24,6 +24,7 @@ config PARISC
select MODULES_USE_ELF_RELA
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
select CLONE_BACKWARDS
help
The PA-RISC microprocessor is designed by Hewlett-Packard and used
...
...
arch/parisc/include/asm/unistd.h
浏览文件 @
415bfae9
...
...
@@ -164,6 +164,9 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
#define __ARCH_WANT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK
#define __ARCH_WANT_SYS_CLONE
#endif
/* __ASSEMBLY__ */
...
...
arch/parisc/kernel/entry.S
浏览文件 @
415bfae9
...
...
@@ -1688,18 +1688,20 @@ dtlb_fault:
LDREG
PT_GR18
(
\
regs
),%
r18
.
endm
ENTRY
(
sys_fork_wrapper
)
.
macro
fork_like
name
ENTRY
(
sys_
\
name
\()
_wrapper
)
LDREG
TI_TASK
-
THREAD_SZ_ALGN
-
FRAME_SIZE
(%
r30
),
%
r1
ldo
TASK_REGS
(%
r1
),%
r1
reg_save
%
r1
mfctl
%
cr27
,
%
r28
b
sys_
\
name
STREG
%
r28
,
PT_CR27
(%
r1
)
ENDPROC
(
sys_
\
name
\()
_wrapper
)
.
endm
LDREG
PT_GR30
(%
r1
),%
r25
copy
%
r1
,%
r24
b
sys_clone
ldi
SIGCHLD
,%
r26
ENDPROC
(
sys_fork_wrapper
)
fork_like
clone
fork_like
fork
fork_like
vfork
/
*
Set
the
return
value
for
the
child
*/
ENTRY
(
child_return
)
...
...
@@ -1716,30 +1718,6 @@ finish_child_return:
copy
%
r0
,%
r28
ENDPROC
(
child_return
)
ENTRY
(
sys_clone_wrapper
)
LDREG
TI_TASK
-
THREAD_SZ_ALGN
-
FRAME_SIZE
(%
r30
),%
r1
ldo
TASK_REGS
(%
r1
),%
r1
/*
get
pt
regs
*/
reg_save
%
r1
mfctl
%
cr27
,
%
r28
STREG
%
r28
,
PT_CR27
(%
r1
)
b
sys_clone
copy
%
r1
,%
r24
ENDPROC
(
sys_clone_wrapper
)
ENTRY
(
sys_vfork_wrapper
)
LDREG
TI_TASK
-
THREAD_SZ_ALGN
-
FRAME_SIZE
(%
r30
),%
r1
ldo
TASK_REGS
(%
r1
),%
r1
/*
get
pt
regs
*/
reg_save
%
r1
mfctl
%
cr27
,
%
r28
STREG
%
r28
,
PT_CR27
(%
r1
)
b
sys_vfork
copy
%
r1
,%
r26
ENDPROC
(
sys_vfork_wrapper
)
ENTRY
(
sys_rt_sigreturn_wrapper
)
LDREG
TI_TASK
-
THREAD_SZ_ALGN
-
FRAME_SIZE
(%
r30
),%
r26
ldo
TASK_REGS
(%
r26
),%
r26
/*
get
pt
regs
*/
...
...
arch/parisc/kernel/process.c
浏览文件 @
415bfae9
...
...
@@ -202,46 +202,10 @@ int dump_task_fpu (struct task_struct *tsk, elf_fpregset_t *r)
return
1
;
}
/* Note that "fork()" is implemented in terms of clone, with
parameters (SIGCHLD, regs->gr[30], regs). */
int
sys_clone
(
unsigned
long
clone_flags
,
unsigned
long
usp
,
struct
pt_regs
*
regs
)
{
/* Arugments from userspace are:
r26 = Clone flags.
r25 = Child stack.
r24 = parent_tidptr.
r23 = Is the TLS storage descriptor
r22 = child_tidptr
However, these last 3 args are only examined
if the proper flags are set. */
int
__user
*
parent_tidptr
=
(
int
__user
*
)
regs
->
gr
[
24
];
int
__user
*
child_tidptr
=
(
int
__user
*
)
regs
->
gr
[
22
];
/* usp must be word aligned. This also prevents users from
* passing in the value 1 (which is the signal for a special
* return for a kernel thread) */
usp
=
ALIGN
(
usp
,
4
);
/* A zero value for usp means use the current stack */
if
(
usp
==
0
)
usp
=
regs
->
gr
[
30
];
return
do_fork
(
clone_flags
,
usp
,
regs
,
0
,
parent_tidptr
,
child_tidptr
);
}
int
sys_vfork
(
struct
pt_regs
*
regs
)
{
return
do_fork
(
CLONE_VFORK
|
CLONE_VM
|
SIGCHLD
,
regs
->
gr
[
30
],
regs
,
0
,
NULL
,
NULL
);
}
int
copy_thread
(
unsigned
long
clone_flags
,
unsigned
long
usp
,
unsigned
long
arg
,
struct
task_struct
*
p
,
struct
pt_regs
*
pregs
)
struct
task_struct
*
p
,
struct
pt_regs
*
unused
)
{
struct
pt_regs
*
cregs
=
&
(
p
->
thread
.
regs
);
void
*
stack
=
task_stack_page
(
p
);
...
...
@@ -278,7 +242,14 @@ copy_thread(unsigned long clone_flags, unsigned long usp,
cregs
->
gr
[
25
]
=
arg
;
}
else
{
/* user thread */
/* usp must be word aligned. This also prevents users from
* passing in the value 1 (which is the signal for a special
* return for a kernel thread) */
if
(
usp
)
{
usp
=
ALIGN
(
usp
,
4
);
if
(
likely
(
usp
))
cregs
->
gr
[
30
]
=
usp
;
}
cregs
->
ksp
=
(
unsigned
long
)
stack
+
THREAD_SZ_ALGN
+
FRAME_SIZE
;
if
(
personality
(
p
->
personality
)
==
PER_HPUX
)
{
#ifdef CONFIG_HPUX
...
...
@@ -291,7 +262,7 @@ copy_thread(unsigned long clone_flags, unsigned long usp,
}
/* Setup thread TLS area from the 4th parameter in clone */
if
(
clone_flags
&
CLONE_SETTLS
)
cregs
->
cr27
=
p
regs
->
gr
[
23
];
cregs
->
cr27
=
c
regs
->
gr
[
23
];
}
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录