diff options
author | David Daney <ddaney@avtrex.com> | 2008-09-23 03:11:26 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-10-11 11:18:57 -0400 |
commit | 0926bf953ee79b8f139741b442e5a18520f81705 (patch) | |
tree | 5e2cbdb2060ec9324866e6a072d1d7666849445c /arch/mips/include | |
parent | 2c708cbaa6031b73be6b992adb3ec1811f91cdb1 (diff) |
MIPS: Ptrace support for HARDWARE_WATCHPOINTS
This is the final part of the watch register patch. Here we hook up
ptrace so that the user space debugger (gdb), can set and read the
registers.
Signed-off-by: David Daney <ddaney@avtrex.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include')
-rw-r--r-- | arch/mips/include/asm/ptrace.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/arch/mips/include/asm/ptrace.h b/arch/mips/include/asm/ptrace.h index c00cca24dae0..cd5e8a47812b 100644 --- a/arch/mips/include/asm/ptrace.h +++ b/arch/mips/include/asm/ptrace.h | |||
@@ -74,11 +74,57 @@ struct pt_regs { | |||
74 | #define PTRACE_POKEDATA_3264 0xc3 | 74 | #define PTRACE_POKEDATA_3264 0xc3 |
75 | #define PTRACE_GET_THREAD_AREA_3264 0xc4 | 75 | #define PTRACE_GET_THREAD_AREA_3264 0xc4 |
76 | 76 | ||
77 | /* Read and write watchpoint registers. */ | ||
78 | enum pt_watch_style { | ||
79 | pt_watch_style_mips32, | ||
80 | pt_watch_style_mips64 | ||
81 | }; | ||
82 | struct mips32_watch_regs { | ||
83 | uint32_t watchlo[8]; | ||
84 | /* Lower 16 bits of watchhi. */ | ||
85 | uint16_t watchhi[8]; | ||
86 | /* Valid mask and I R W bits. | ||
87 | * bit 0 -- 1 if W bit is usable. | ||
88 | * bit 1 -- 1 if R bit is usable. | ||
89 | * bit 2 -- 1 if I bit is usable. | ||
90 | * bits 3 - 11 -- Valid watchhi mask bits. | ||
91 | */ | ||
92 | uint16_t watch_masks[8]; | ||
93 | /* The number of valid watch register pairs. */ | ||
94 | uint32_t num_valid; | ||
95 | } __attribute__((aligned(8))); | ||
96 | |||
97 | struct mips64_watch_regs { | ||
98 | uint64_t watchlo[8]; | ||
99 | uint16_t watchhi[8]; | ||
100 | uint16_t watch_masks[8]; | ||
101 | uint32_t num_valid; | ||
102 | } __attribute__((aligned(8))); | ||
103 | |||
104 | struct pt_watch_regs { | ||
105 | enum pt_watch_style style; | ||
106 | union { | ||
107 | struct mips32_watch_regs mips32; | ||
108 | struct mips32_watch_regs mips64; | ||
109 | }; | ||
110 | }; | ||
111 | |||
112 | #define PTRACE_GET_WATCH_REGS 0xd0 | ||
113 | #define PTRACE_SET_WATCH_REGS 0xd1 | ||
114 | |||
77 | #ifdef __KERNEL__ | 115 | #ifdef __KERNEL__ |
78 | 116 | ||
117 | #include <linux/compiler.h> | ||
79 | #include <linux/linkage.h> | 118 | #include <linux/linkage.h> |
80 | #include <asm/isadep.h> | 119 | #include <asm/isadep.h> |
81 | 120 | ||
121 | struct task_struct; | ||
122 | |||
123 | extern int ptrace_get_watch_regs(struct task_struct *child, | ||
124 | struct pt_watch_regs __user *addr); | ||
125 | extern int ptrace_set_watch_regs(struct task_struct *child, | ||
126 | struct pt_watch_regs __user *addr); | ||
127 | |||
82 | /* | 128 | /* |
83 | * Does the process account for user or for system time? | 129 | * Does the process account for user or for system time? |
84 | */ | 130 | */ |