Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
037c10a6
Commit
037c10a6
authored
Sep 08, 2008
by
Paul Mundt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sh: kprobes: Hook up kprobe_fault_handler() in the page fault path.
Signed-off-by:
Paul Mundt
<
lethal@linux-sh.org
>
parent
fc63562a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
4 deletions
+30
-4
arch/sh/include/asm/kprobes.h
arch/sh/include/asm/kprobes.h
+1
-2
arch/sh/kernel/kprobes.c
arch/sh/kernel/kprobes.c
+1
-1
arch/sh/mm/fault_32.c
arch/sh/mm/fault_32.c
+28
-1
No files found.
arch/sh/include/asm/kprobes.h
View file @
037c10a6
...
...
@@ -6,8 +6,6 @@
#include <linux/types.h>
#include <linux/ptrace.h>
struct
pt_regs
;
typedef
u16
kprobe_opcode_t
;
#define BREAKPOINT_INSTRUCTION 0xc3ff
...
...
@@ -48,6 +46,7 @@ struct kprobe_ctlblk {
struct
prev_kprobe
prev_kprobe
;
};
extern
int
kprobe_fault_handler
(
struct
pt_regs
*
regs
,
int
trapnr
);
extern
int
kprobe_exceptions_notify
(
struct
notifier_block
*
self
,
unsigned
long
val
,
void
*
data
);
extern
int
kprobe_handle_illslot
(
unsigned
long
pc
);
...
...
arch/sh/kernel/kprobes.c
View file @
037c10a6
...
...
@@ -393,7 +393,7 @@ static inline int post_kprobe_handler(struct pt_regs *regs)
return
1
;
}
static
inline
int
kprobe_fault_handler
(
struct
pt_regs
*
regs
,
int
trapnr
)
int
__kprobes
kprobe_fault_handler
(
struct
pt_regs
*
regs
,
int
trapnr
)
{
struct
kprobe
*
cur
=
kprobe_running
();
struct
kprobe_ctlblk
*
kcb
=
get_kprobe_ctlblk
();
...
...
arch/sh/mm/fault_32.c
View file @
037c10a6
...
...
@@ -2,7 +2,7 @@
* Page fault handler for SH with an MMU.
*
* Copyright (C) 1999 Niibe Yutaka
* Copyright (C) 2003 - 200
7
Paul Mundt
* Copyright (C) 2003 - 200
8
Paul Mundt
*
* Based on linux/arch/i386/mm/fault.c:
* Copyright (C) 1995 Linus Torvalds
...
...
@@ -21,6 +21,27 @@
#include <asm/tlbflush.h>
#include <asm/kgdb.h>
#ifdef CONFIG_KPROBES
static
inline
int
notify_page_fault
(
struct
pt_regs
*
regs
,
int
trap
)
{
int
ret
=
0
;
if
(
!
user_mode
(
regs
))
{
preempt_disable
();
if
(
kprobe_running
()
&&
kprobe_fault_handler
(
regs
,
trap
))
ret
=
1
;
preempt_enable
();
}
return
ret
;
}
#else
static
inline
int
notify_page_fault
(
struct
pt_regs
*
regs
,
int
trap
)
{
return
0
;
}
#endif
/*
* This routine handles page faults. It determines the address,
* and the problem, and then passes it off to one of the appropriate
...
...
@@ -37,6 +58,9 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
int
fault
;
siginfo_t
info
;
if
(
notify_page_fault
(
regs
,
writeaccess
))
return
;
#ifdef CONFIG_SH_KGDB
if
(
kgdb_nofault
&&
kgdb_bus_err_hook
)
kgdb_bus_err_hook
();
...
...
@@ -269,6 +293,9 @@ asmlinkage int __kprobes __do_page_fault(struct pt_regs *regs,
pte_t
*
pte
;
pte_t
entry
;
if
(
notify_page_fault
(
regs
,
writeaccess
))
return
0
;
#ifdef CONFIG_SH_KGDB
if
(
kgdb_nofault
&&
kgdb_bus_err_hook
)
kgdb_bus_err_hook
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment