Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
49ed3398
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看板
提交
49ed3398
编写于
9月 22, 2012
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
frv: switch to generic kernel_thread()
上级
019f96a3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
23 deletion
+20
-23
arch/frv/Kconfig
arch/frv/Kconfig
+1
-0
arch/frv/include/asm/processor.h
arch/frv/include/asm/processor.h
+0
-1
arch/frv/kernel/process.c
arch/frv/kernel/process.c
+19
-22
未找到文件。
arch/frv/Kconfig
浏览文件 @
49ed3398
...
...
@@ -10,6 +10,7 @@ config FRV
select ARCH_HAVE_NMI_SAFE_CMPXCHG
select GENERIC_CPU_DEVICES
select ARCH_WANT_IPC_PARSE_VERSION
select GENERIC_KERNEL_THREAD
config ZONE_DMA
bool
...
...
arch/frv/include/asm/processor.h
浏览文件 @
49ed3398
...
...
@@ -105,7 +105,6 @@ static inline void release_thread(struct task_struct *dead_task)
{
}
extern
asmlinkage
int
kernel_thread
(
int
(
*
fn
)(
void
*
),
void
*
arg
,
unsigned
long
flags
);
extern
asmlinkage
void
save_user_regs
(
struct
user_context
*
target
);
extern
asmlinkage
void
*
restore_user_regs
(
const
struct
user_context
*
target
,
...);
...
...
arch/frv/kernel/process.c
浏览文件 @
49ed3398
...
...
@@ -170,7 +170,7 @@ asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
* set up the kernel stack and exception frames for a new process
*/
int
copy_thread
(
unsigned
long
clone_flags
,
unsigned
long
usp
,
unsigned
long
topstk
,
unsigned
long
usp
,
unsigned
long
arg
,
struct
task_struct
*
p
,
struct
pt_regs
*
regs
)
{
struct
pt_regs
*
childregs
;
...
...
@@ -178,17 +178,6 @@ int copy_thread(unsigned long clone_flags,
childregs
=
(
struct
pt_regs
*
)
(
task_stack_page
(
p
)
+
THREAD_SIZE
-
FRV_FRAME0_SIZE
);
/* set up the userspace frame (the only place that the USP is stored) */
*
childregs
=
*
regs
;
childregs
->
sp
=
usp
;
childregs
->
next_frame
=
NULL
;
if
(
unlikely
(
!
user_mode
(
regs
)))
p
->
thread
.
pc
=
(
unsigned
long
)
ret_from_kernel_thread
;
else
p
->
thread
.
pc
=
(
unsigned
long
)
ret_from_fork
;
p
->
set_child_tid
=
p
->
clear_child_tid
=
NULL
;
p
->
thread
.
frame
=
childregs
;
...
...
@@ -198,6 +187,24 @@ int copy_thread(unsigned long clone_flags,
p
->
thread
.
lr
=
0
;
p
->
thread
.
frame0
=
childregs
;
if
(
unlikely
(
!
regs
))
{
memset
(
childregs
,
0
,
sizeof
(
struct
pt_regs
));
childregs
->
gr9
=
usp
;
/* function */
childregs
->
gr8
=
arg
;
chilregs
->
psr
=
PSR_S
;
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
;
childregs
->
sp
=
usp
;
childregs
->
next_frame
=
NULL
;
p
->
thread
.
pc
=
(
unsigned
long
)
ret_from_fork
;
/* the new TLS pointer is passed in as arg #5 to sys_clone() */
if
(
clone_flags
&
CLONE_SETTLS
)
childregs
->
gr29
=
childregs
->
gr12
;
...
...
@@ -320,13 +327,3 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpregs)
sizeof
(
current
->
thread
.
user
->
f
));
return
1
;
}
int
kernel_thread
(
int
(
*
fn
)(
void
*
),
void
*
arg
,
unsigned
long
flags
)
{
struct
pt_regs
regs
=
{
.
gr8
=
(
unsigned
long
)
arg
;
.
gr9
=
(
unsigned
long
)
fn
;
.
psr
=
PSR_S
;
};
return
do_fork
(
flags
|
CLONE_VM
|
CLONE_UNTRACED
,
0
,
&
regs
,
0
,
NULL
,
NULL
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录