Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
ee1e17c6
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看板
提交
ee1e17c6
编写于
10月 13, 2012
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
blackfin: convert kernel_thread() and kernel_execve() to generic ones
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
ddffeb8c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
27 addition
and
109 deletion
+27
-109
arch/blackfin/Kconfig
arch/blackfin/Kconfig
+2
-0
arch/blackfin/include/asm/processor.h
arch/blackfin/include/asm/processor.h
+0
-2
arch/blackfin/kernel/entry.S
arch/blackfin/kernel/entry.S
+8
-14
arch/blackfin/kernel/process.c
arch/blackfin/kernel/process.c
+17
-38
arch/blackfin/mach-common/entry.S
arch/blackfin/mach-common/entry.S
+0
-55
未找到文件。
arch/blackfin/Kconfig
浏览文件 @
ee1e17c6
...
@@ -45,6 +45,8 @@ config BLACKFIN
...
@@ -45,6 +45,8 @@ config BLACKFIN
select ARCH_USES_GETTIMEOFFSET if !GENERIC_CLOCKEVENTS
select ARCH_USES_GETTIMEOFFSET if !GENERIC_CLOCKEVENTS
select HAVE_MOD_ARCH_SPECIFIC
select HAVE_MOD_ARCH_SPECIFIC
select MODULES_USE_ELF_RELA
select MODULES_USE_ELF_RELA
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
config GENERIC_CSUM
config GENERIC_CSUM
def_bool y
def_bool y
...
...
arch/blackfin/include/asm/processor.h
浏览文件 @
ee1e17c6
...
@@ -75,8 +75,6 @@ static inline void release_thread(struct task_struct *dead_task)
...
@@ -75,8 +75,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..
* Free current thread data structures etc..
*/
*/
...
...
arch/blackfin/kernel/entry.S
浏览文件 @
ee1e17c6
...
@@ -46,22 +46,16 @@ ENTRY(_ret_from_fork)
...
@@ -46,22 +46,16 @@ ENTRY(_ret_from_fork)
SP
+=
-
12
;
SP
+=
-
12
;
pseudo_long_call
_schedule_tail
,
p5
;
pseudo_long_call
_schedule_tail
,
p5
;
SP
+=
12
;
SP
+=
12
;
r0
=
[
sp
+
PT_IPEND
]
;
p1
=
[
sp
++]
;
cc
=
bittst
(
r0
,
1
)
;
r0
=
[
sp
++]
;
if
cc
jump
.
Lin_kernel
;
cc
=
p1
==
0
;
if
cc
jump
.
Lfork
;
sp
+=
-
12
;
call
(
p1
)
;
sp
+=
12
;
.
Lfork
:
RESTORE_CONTEXT
RESTORE_CONTEXT
rti
;
rti
;
.
Lin_kernel
:
bitclr
(
r0
,1)
;
[
sp
+
PT_IPEND
]
=
r0
;
/
*
do
a
'fake'
RTI
by
jumping
to
[
RETI
]
*
to
avoid
clearing
supervisor
mode
in
child
*/
r0
=
[
sp
+
PT_PC
]
;
[
sp
+
PT_P0
]
=
r0
;
RESTORE_ALL_SYS
jump
(
p0
)
;
ENDPROC
(
_ret_from_fork
)
ENDPROC
(
_ret_from_fork
)
ENTRY
(
_sys_vfork
)
ENTRY
(
_sys_vfork
)
...
...
arch/blackfin/kernel/process.c
浏览文件 @
ee1e17c6
...
@@ -101,40 +101,6 @@ void cpu_idle(void)
...
@@ -101,40 +101,6 @@ void cpu_idle(void)
}
}
}
}
/*
* This gets run with P1 containing the
* function to call, and R1 containing
* the "args". Note P0 is clobbered on the way here.
*/
void
kernel_thread_helper
(
void
);
__asm__
(
".section .text
\n
"
".align 4
\n
"
"_kernel_thread_helper:
\n\t
"
"
\t
sp += -12;
\n\t
"
"
\t
r0 = r1;
\n\t
"
"
\t
call (p1);
\n\t
"
"
\t
call _do_exit;
\n
"
".previous"
);
/*
* Create a kernel thread.
*/
pid_t
kernel_thread
(
int
(
*
fn
)
(
void
*
),
void
*
arg
,
unsigned
long
flags
)
{
struct
pt_regs
regs
;
memset
(
&
regs
,
0
,
sizeof
(
regs
));
regs
.
r1
=
(
unsigned
long
)
arg
;
regs
.
p1
=
(
unsigned
long
)
fn
;
regs
.
pc
=
(
unsigned
long
)
kernel_thread_helper
;
regs
.
orig_p0
=
-
1
;
/* Set bit 2 to tell ret_from_fork we should be returning to kernel
mode. */
regs
.
ipend
=
0x8002
;
__asm__
__volatile__
(
"%0 = syscfg;"
:
"=da"
(
regs
.
syscfg
)
:
);
return
do_fork
(
flags
|
CLONE_VM
|
CLONE_UNTRACED
,
0
,
&
regs
,
0
,
NULL
,
NULL
);
}
EXPORT_SYMBOL
(
kernel_thread
);
/*
/*
* Do necessary setup to start up a newly executed thread.
* Do necessary setup to start up a newly executed thread.
*
*
...
@@ -193,13 +159,26 @@ copy_thread(unsigned long clone_flags,
...
@@ -193,13 +159,26 @@ copy_thread(unsigned long clone_flags,
struct
task_struct
*
p
,
struct
pt_regs
*
regs
)
struct
task_struct
*
p
,
struct
pt_regs
*
regs
)
{
{
struct
pt_regs
*
childregs
;
struct
pt_regs
*
childregs
;
unsigned
long
*
v
;
childregs
=
(
struct
pt_regs
*
)
(
task_stack_page
(
p
)
+
THREAD_SIZE
)
-
1
;
childregs
=
(
struct
pt_regs
*
)
(
task_stack_page
(
p
)
+
THREAD_SIZE
)
-
1
;
*
childregs
=
*
regs
;
v
=
((
unsigned
long
*
)
childregs
)
-
2
;
childregs
->
r0
=
0
;
if
(
unlikely
(
!
regs
))
{
memset
(
childregs
,
0
,
sizeof
(
struct
pt_regs
));
v
[
0
]
=
usp
;
v
[
1
]
=
topstk
;
childregs
->
orig_p0
=
-
1
;
childregs
->
ipend
=
0x8000
;
__asm__
__volatile__
(
"%0 = syscfg;"
:
"=da"
(
childregs
->
syscfg
)
:
);
p
->
thread
.
usp
=
0
;
}
else
{
*
childregs
=
*
regs
;
childregs
->
r0
=
0
;
p
->
thread
.
usp
=
usp
;
v
[
0
]
=
v
[
1
]
=
0
;
}
p
->
thread
.
usp
=
usp
;
p
->
thread
.
ksp
=
(
unsigned
long
)
v
;
p
->
thread
.
ksp
=
(
unsigned
long
)
childregs
;
p
->
thread
.
pc
=
(
unsigned
long
)
ret_from_fork
;
p
->
thread
.
pc
=
(
unsigned
long
)
ret_from_fork
;
return
0
;
return
0
;
...
...
arch/blackfin/mach-common/entry.S
浏览文件 @
ee1e17c6
...
@@ -530,61 +530,6 @@ ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/
...
@@ -530,61 +530,6 @@ ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/
jump
.
Lsyscall_really_exit
;
jump
.
Lsyscall_really_exit
;
ENDPROC
(
_trap
)
ENDPROC
(
_trap
)
ENTRY
(
_kernel_execve
)
link
SIZEOF_PTREGS
;
p0
=
sp
;
r3
=
SIZEOF_PTREGS
/
4
;
r4
=
0
(
x
)
;
.
Lclear_regs
:
[
p0
++
]
=
r4
;
r3
+=
-
1
;
cc
=
r3
==
0
;
if
!
cc
jump
.
Lclear_regs
(
bp
)
;
p0
=
sp
;
sp
+=
-
16
;
[
sp
+
12
]
=
p0
;
pseudo_long_call
_do_execve
,
p5
;
SP
+=
16
;
cc
=
r0
==
0
;
if
!
cc
jump
.
Lexecve_failed
;
/
*
Success
.
Copy
our
temporary
pt_regs
to
the
top
of
the
kernel
*
stack
and
do
a
normal
exception
return
.
*/
r1
=
sp
;
r0
=
(-
KERNEL_STACK_SIZE
)
(
x
)
;
r1
=
r1
&
r0
;
p2
=
r1
;
p3
=
[
p2
]
;
r0
=
KERNEL_STACK_SIZE
-
4
(
z
)
;
p1
=
r0
;
p1
=
p1
+
p2
;
p0
=
fp
;
r4
=
[
p0
--]
;
r3
=
SIZEOF_PTREGS
/
4
;
.
Lcopy_regs
:
r4
=
[
p0
--]
;
[
p1
--
]
=
r4
;
r3
+=
-
1
;
cc
=
r3
==
0
;
if
!
cc
jump
.
Lcopy_regs
(
bp
)
;
r0
=
(
KERNEL_STACK_SIZE
-
SIZEOF_PTREGS
)
(
z
)
;
p1
=
r0
;
p1
=
p1
+
p2
;
sp
=
p1
;
r0
=
syscfg
;
[
SP
+
PT_SYSCFG
]
=
r0
;
[
p3
+
(
TASK_THREAD
+
THREAD_KSP
)]
=
sp
;
RESTORE_CONTEXT
;
rti
;
.
Lexecve_failed
:
unlink
;
rts
;
ENDPROC
(
_kernel_execve
)
ENTRY
(
_system_call
)
ENTRY
(
_system_call
)
/
*
Store
IPEND
*/
/
*
Store
IPEND
*/
p2.l
=
lo
(
IPEND
)
;
p2.l
=
lo
(
IPEND
)
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录