Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
4eb5845d
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看板
提交
4eb5845d
编写于
9月 08, 2008
作者:
P
Paul Mundt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sh: kprobes: __kprobes annotations and formatting cleanups.
Signed-off-by:
N
Paul Mundt
<
lethal@linux-sh.org
>
上级
734db377
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
17 deletion
+20
-17
arch/sh/kernel/kprobes.c
arch/sh/kernel/kprobes.c
+20
-17
未找到文件。
arch/sh/kernel/kprobes.c
浏览文件 @
4eb5845d
...
...
@@ -115,20 +115,20 @@ void __kprobes arch_remove_kprobe(struct kprobe *p)
}
}
static
inline
void
save_previous_kprobe
(
struct
kprobe_ctlblk
*
kcb
)
static
void
__kprobes
save_previous_kprobe
(
struct
kprobe_ctlblk
*
kcb
)
{
kcb
->
prev_kprobe
.
kp
=
kprobe_running
();
kcb
->
prev_kprobe
.
status
=
kcb
->
kprobe_status
;
}
static
inline
void
restore_previous_kprobe
(
struct
kprobe_ctlblk
*
kcb
)
static
void
__kprobes
restore_previous_kprobe
(
struct
kprobe_ctlblk
*
kcb
)
{
__get_cpu_var
(
current_kprobe
)
=
kcb
->
prev_kprobe
.
kp
;
kcb
->
kprobe_status
=
kcb
->
prev_kprobe
.
status
;
}
static
inline
void
set_current_kprobe
(
struct
kprobe
*
p
,
struct
pt_regs
*
regs
,
struct
kprobe_ctlblk
*
kcb
)
static
void
__kprobes
set_current_kprobe
(
struct
kprobe
*
p
,
struct
pt_regs
*
regs
,
struct
kprobe_ctlblk
*
kcb
)
{
__get_cpu_var
(
current_kprobe
)
=
p
;
}
...
...
@@ -138,7 +138,7 @@ static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
* on the next instruction, following branches. Two probes are set if the
* branch is conditional.
*/
static
inline
void
prepare_singlestep
(
struct
kprobe
*
p
,
struct
pt_regs
*
regs
)
static
void
__kprobes
prepare_singlestep
(
struct
kprobe
*
p
,
struct
pt_regs
*
regs
)
{
kprobe_opcode_t
*
addr
=
NULL
;
saved_current_opcode
.
addr
=
(
kprobe_opcode_t
*
)
(
regs
->
pc
);
...
...
@@ -273,12 +273,12 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
/* handler has already set things up, so skip ss setup */
return
1
;
ss_probe:
ss_probe:
prepare_singlestep
(
p
,
regs
);
kcb
->
kprobe_status
=
KPROBE_HIT_SS
;
return
1
;
no_kprobe:
no_kprobe:
preempt_enable_no_resched
();
return
ret
;
}
...
...
@@ -358,7 +358,7 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
return
orig_ret_address
;
}
static
in
line
int
post_kprobe_handler
(
struct
pt_regs
*
regs
)
static
in
t
__kprobes
post_kprobe_handler
(
struct
pt_regs
*
regs
)
{
struct
kprobe
*
cur
=
kprobe_running
();
struct
kprobe_ctlblk
*
kcb
=
get_kprobe_ctlblk
();
...
...
@@ -391,14 +391,15 @@ static inline int post_kprobe_handler(struct pt_regs *regs)
}
}
/*Restore back the original saved kprobes variables and continue. */
/*
Restore back the original saved kprobes variables and continue. */
if
(
kcb
->
kprobe_status
==
KPROBE_REENTER
)
{
restore_previous_kprobe
(
kcb
);
goto
out
;
}
reset_current_kprobe
();
out:
out:
preempt_enable_no_resched
();
return
1
;
...
...
@@ -463,6 +464,7 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
default:
break
;
}
return
0
;
}
...
...
@@ -498,8 +500,8 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
ret
=
NOTIFY_STOP
;
}
else
{
p
=
__get_cpu_var
(
current_kprobe
);
if
(
p
->
break_handler
&&
p
->
break_handler
(
p
,
args
->
regs
))
if
(
p
->
break_handler
&&
p
->
break_handler
(
p
,
args
->
regs
))
ret
=
NOTIFY_STOP
;
}
}
...
...
@@ -542,25 +544,26 @@ void __kprobes jprobe_return(void)
int
__kprobes
longjmp_break_handler
(
struct
kprobe
*
p
,
struct
pt_regs
*
regs
)
{
struct
kprobe_ctlblk
*
kcb
=
get_kprobe_ctlblk
();
u8
*
addr
=
(
u8
*
)
regs
->
pc
;
unsigned
long
stack_addr
=
kcb
->
jprobe_saved_r15
;
u8
*
addr
=
(
u8
*
)
regs
->
pc
;
if
((
addr
>=
(
u8
*
)
jprobe_return
)
&&
(
addr
<=
(
u8
*
)
jprobe_return_end
))
{
if
((
addr
>=
(
u8
*
)
jprobe_return
)
&&
(
addr
<=
(
u8
*
)
jprobe_return_end
))
{
*
regs
=
kcb
->
jprobe_saved_regs
;
memcpy
((
kprobe_opcode_t
*
)
stack_addr
,
kcb
->
jprobes_stack
,
memcpy
((
kprobe_opcode_t
*
)
stack_addr
,
kcb
->
jprobes_stack
,
MIN_STACK_SIZE
(
stack_addr
));
kcb
->
kprobe_status
=
KPROBE_HIT_SS
;
preempt_enable_no_resched
();
return
1
;
}
return
0
;
}
static
struct
kprobe
trampoline_p
=
{
.
addr
=
(
kprobe_opcode_t
*
)
&
kretprobe_trampoline
,
.
addr
=
(
kprobe_opcode_t
*
)
&
kretprobe_trampoline
,
.
pre_handler
=
trampoline_probe_handler
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录