-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sh: hw-breakpoints: Add preliminary support for SH-4A UBC.
This adds preliminary support for the SH-4A UBC to the hw-breakpoints API. Presently only a single channel is implemented, and the ptrace interface still needs to be converted. This is the first step to cleaning up the long-standing UBC mess, making the UBC more generally accessible, and finally making it SMP safe. An additional abstraction will be layered on top of this as with the perf events code to permit the various CPU families to wire up support for their own specific UBCs, as many variations exist. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
- Loading branch information
Paul Mundt
committed
Dec 8, 2009
1 parent
6ec22f9
commit 09a0729
Showing
13 changed files
with
495 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#ifndef __ASM_SH_HW_BREAKPOINT_H | ||
#define __ASM_SH_HW_BREAKPOINT_H | ||
|
||
#include <linux/kdebug.h> | ||
#include <linux/types.h> | ||
#include <asm/ubc.h> | ||
|
||
#ifdef __KERNEL__ | ||
#define __ARCH_HW_BREAKPOINT_H | ||
|
||
struct arch_hw_breakpoint { | ||
char *name; /* Contains name of the symbol to set bkpt */ | ||
unsigned long address; | ||
unsigned long asid; | ||
u16 len; | ||
u16 type; | ||
}; | ||
|
||
enum { | ||
SH_BREAKPOINT_READ = (1 << 1), | ||
SH_BREAKPOINT_WRITE = (1 << 2), | ||
SH_BREAKPOINT_RW = SH_BREAKPOINT_READ | SH_BREAKPOINT_WRITE, | ||
|
||
SH_BREAKPOINT_LEN_1 = (1 << 12), | ||
SH_BREAKPOINT_LEN_2 = (1 << 13), | ||
SH_BREAKPOINT_LEN_4 = SH_BREAKPOINT_LEN_1 | SH_BREAKPOINT_LEN_2, | ||
SH_BREAKPOINT_LEN_8 = (1 << 14), | ||
}; | ||
|
||
/* Total number of available UBC channels */ | ||
#define HBP_NUM 1 /* XXX */ | ||
|
||
struct perf_event; | ||
struct task_struct; | ||
struct pmu; | ||
|
||
extern int arch_check_va_in_userspace(unsigned long va, u16 hbp_len); | ||
extern int arch_validate_hwbkpt_settings(struct perf_event *bp, | ||
struct task_struct *tsk); | ||
extern int hw_breakpoint_exceptions_notify(struct notifier_block *unused, | ||
unsigned long val, void *data); | ||
|
||
int arch_install_hw_breakpoint(struct perf_event *bp); | ||
void arch_uninstall_hw_breakpoint(struct perf_event *bp); | ||
void hw_breakpoint_pmu_read(struct perf_event *bp); | ||
void hw_breakpoint_pmu_unthrottle(struct perf_event *bp); | ||
|
||
extern void arch_fill_perf_breakpoint(struct perf_event *bp); | ||
|
||
extern struct pmu perf_ops_bp; | ||
|
||
#endif /* __KERNEL__ */ | ||
#endif /* __ASM_SH_HW_BREAKPOINT_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ enum die_val { | |
DIE_TRAP, | ||
DIE_NMI, | ||
DIE_OOPS, | ||
DIE_BREAKPOINT, | ||
DIE_SSTEP, | ||
}; | ||
|
||
#endif /* __ASM_SH_KDEBUG_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.