diff options
| -rw-r--r-- | arch/sh/kernel/hw_breakpoint.c | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/arch/sh/kernel/hw_breakpoint.c b/arch/sh/kernel/hw_breakpoint.c index e2f1753d275c..675eea7785d9 100644 --- a/arch/sh/kernel/hw_breakpoint.c +++ b/arch/sh/kernel/hw_breakpoint.c | |||
| @@ -143,26 +143,6 @@ static int arch_check_va_in_kernelspace(unsigned long va, u8 hbp_len) | |||
| 143 | return (va >= TASK_SIZE) && ((va + len - 1) >= TASK_SIZE); | 143 | return (va >= TASK_SIZE) && ((va + len - 1) >= TASK_SIZE); |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | /* | ||
| 147 | * Store a breakpoint's encoded address, length, and type. | ||
| 148 | */ | ||
| 149 | static int arch_store_info(struct perf_event *bp) | ||
| 150 | { | ||
| 151 | struct arch_hw_breakpoint *info = counter_arch_bp(bp); | ||
| 152 | |||
| 153 | /* | ||
| 154 | * User-space requests will always have the address field populated | ||
| 155 | * For kernel-addresses, either the address or symbol name can be | ||
| 156 | * specified. | ||
| 157 | */ | ||
| 158 | if (info->name) | ||
| 159 | info->address = (unsigned long)kallsyms_lookup_name(info->name); | ||
| 160 | if (info->address) | ||
| 161 | return 0; | ||
| 162 | |||
| 163 | return -EINVAL; | ||
| 164 | } | ||
| 165 | |||
| 166 | int arch_bp_generic_fields(int sh_len, int sh_type, | 146 | int arch_bp_generic_fields(int sh_len, int sh_type, |
| 167 | int *gen_len, int *gen_type) | 147 | int *gen_len, int *gen_type) |
| 168 | { | 148 | { |
| @@ -276,10 +256,12 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp, | |||
| 276 | return ret; | 256 | return ret; |
| 277 | } | 257 | } |
| 278 | 258 | ||
| 279 | ret = arch_store_info(bp); | 259 | /* |
| 280 | 260 | * For kernel-addresses, either the address or symbol name can be | |
| 281 | if (ret < 0) | 261 | * specified. |
| 282 | return ret; | 262 | */ |
| 263 | if (info->name) | ||
| 264 | info->address = (unsigned long)kallsyms_lookup_name(info->name); | ||
| 283 | 265 | ||
| 284 | /* | 266 | /* |
| 285 | * Check that the low-order bits of the address are appropriate | 267 | * Check that the low-order bits of the address are appropriate |
