Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
557e1995
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
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看板
提交
557e1995
编写于
10月 10, 2012
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
h8300: generic kernel_thread()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
ddffeb8c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
21 addition
and
36 deletion
+21
-36
arch/h8300/Kconfig
arch/h8300/Kconfig
+1
-0
arch/h8300/include/asm/processor.h
arch/h8300/include/asm/processor.h
+0
-2
arch/h8300/include/asm/ptrace.h
arch/h8300/include/asm/ptrace.h
+2
-0
arch/h8300/kernel/entry.S
arch/h8300/kernel/entry.S
+10
-0
arch/h8300/kernel/h8300_ksyms.c
arch/h8300/kernel/h8300_ksyms.c
+0
-1
arch/h8300/kernel/process.c
arch/h8300/kernel/process.c
+8
-33
未找到文件。
arch/h8300/Kconfig
浏览文件 @
557e1995
...
...
@@ -8,6 +8,7 @@ config H8300
select GENERIC_IRQ_SHOW
select GENERIC_CPU_DEVICES
select MODULES_USE_ELF_RELA
select GENERIC_KERNEL_THREAD
config SYMBOL_PREFIX
string
...
...
arch/h8300/include/asm/processor.h
浏览文件 @
557e1995
...
...
@@ -107,8 +107,6 @@ static inline void release_thread(struct task_struct *dead_task)
{
}
extern
int
kernel_thread
(
int
(
*
fn
)(
void
*
),
void
*
arg
,
unsigned
long
flags
);
/*
* Free current thread data structures etc..
*/
...
...
arch/h8300/include/asm/ptrace.h
浏览文件 @
557e1995
...
...
@@ -60,6 +60,8 @@ struct pt_regs {
#define user_mode(regs) (!((regs)->ccr & PS_S))
#define instruction_pointer(regs) ((regs)->pc)
#define profile_pc(regs) instruction_pointer(regs)
#define current_pt_regs() ((struct pt_regs *) \
(THREAD_SIZE + (unsigned long)current_thread_info()) - 1)
#endif
/* __KERNEL__ */
#endif
/* __ASSEMBLY__ */
#endif
/* _H8300_PTRACE_H */
arch/h8300/kernel/entry.S
浏览文件 @
557e1995
...
...
@@ -158,6 +158,7 @@ INTERRUPTS = 128
.
globl
SYMBOL_NAME
(
system_call
)
.
globl
SYMBOL_NAME
(
ret_from_exception
)
.
globl
SYMBOL_NAME
(
ret_from_fork
)
.
globl
SYMBOL_NAME
(
ret_from_kernel_thread
)
.
globl
SYMBOL_NAME
(
ret_from_interrupt
)
.
globl
SYMBOL_NAME
(
interrupt_redirect_table
)
.
globl
SYMBOL_NAME
(
sw_ksp
),
SYMBOL_NAME
(
sw_usp
)
...
...
@@ -330,6 +331,15 @@ SYMBOL_NAME_LABEL(ret_from_fork)
jsr
@
SYMBOL_NAME
(
schedule_tail
)
jmp
@
SYMBOL_NAME
(
ret_from_exception
)
SYMBOL_NAME_LABEL
(
ret_from_kernel_thread
)
mov.l
er2
,
er0
jsr
@
SYMBOL_NAME
(
schedule_tail
)
mov.l
@
(
LER4
:
16
,
sp
),
er0
mov.l
@
(
LER5
:
16
,
sp
),
er1
jsr
@
er1
sub.l
@
er0
,
@
er0
jsr
@
SYMBOL_NAME
(
sys_exit
)
SYMBOL_NAME_LABEL
(
resume
)
/
*
*
Beware
-
when
entering
resume
,
offset
of
tss
is
in
d1
,
...
...
arch/h8300/kernel/h8300_ksyms.c
浏览文件 @
557e1995
...
...
@@ -33,7 +33,6 @@ EXPORT_SYMBOL(strncmp);
EXPORT_SYMBOL
(
ip_fast_csum
);
EXPORT_SYMBOL
(
kernel_thread
);
EXPORT_SYMBOL
(
enable_irq
);
EXPORT_SYMBOL
(
disable_irq
);
...
...
arch/h8300/kernel/process.c
浏览文件 @
557e1995
...
...
@@ -47,6 +47,7 @@ void (*pm_power_off)(void) = NULL;
EXPORT_SYMBOL
(
pm_power_off
);
asmlinkage
void
ret_from_fork
(
void
);
asmlinkage
void
ret_from_kernel_thread
(
void
);
/*
* The idle loop on an H8/300..
...
...
@@ -122,39 +123,6 @@ void show_regs(struct pt_regs * regs)
printk
(
"
\n
"
);
}
/*
* Create a kernel thread
*/
int
kernel_thread
(
int
(
*
fn
)(
void
*
),
void
*
arg
,
unsigned
long
flags
)
{
long
retval
;
long
clone_arg
;
mm_segment_t
fs
;
fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
clone_arg
=
flags
|
CLONE_VM
;
__asm__
(
"mov.l sp,er3
\n\t
"
"sub.l er2,er2
\n\t
"
"mov.l %2,er1
\n\t
"
"mov.l %1,er0
\n\t
"
"trapa #0
\n\t
"
"cmp.l sp,er3
\n\t
"
"beq 1f
\n\t
"
"mov.l %4,er0
\n\t
"
"mov.l %3,er1
\n\t
"
"jsr @er1
\n\t
"
"mov.l %5,er0
\n\t
"
"trapa #0
\n
"
"1:
\n\t
"
"mov.l er0,%0"
:
"=r"
(
retval
)
:
"i"
(
__NR_clone
),
"g"
(
clone_arg
),
"g"
(
fn
),
"g"
(
arg
),
"i"
(
__NR_exit
)
:
"er0"
,
"er1"
,
"er2"
,
"er3"
);
set_fs
(
fs
);
return
retval
;
}
void
flush_thread
(
void
)
{
}
...
...
@@ -198,6 +166,13 @@ int copy_thread(unsigned long clone_flags,
childregs
=
(
struct
pt_regs
*
)
(
THREAD_SIZE
+
task_stack_page
(
p
))
-
1
;
if
(
unlikely
(
p
->
flags
&
PF_KTHREAD
))
{
memset
(
childregs
,
0
,
sizeof
(
struct
pt_regs
));
childregs
->
retpc
=
(
unsigned
long
)
ret_from_kernel_thread
;
childregs
->
er4
=
topstk
;
/* arg */
childregs
->
er5
=
usp
;
/* fn */
p
->
thread
.
ksp
=
(
unsigned
long
)
childregs
;
}
*
childregs
=
*
regs
;
childregs
->
retpc
=
(
unsigned
long
)
ret_from_fork
;
childregs
->
er0
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录