diff options
author | Jie Zhang <jie.zhang@analog.com> | 2008-07-15 04:15:40 -0400 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2008-07-15 04:15:40 -0400 |
commit | 6546eae4fd90ab11ca7ab6d6b9e1b243d1ce5fe6 (patch) | |
tree | 7a06b366724ab98f8b2b2ee550e0e1b477e319ae /arch/blackfin/kernel/ptrace.c | |
parent | 2cfebf2bceff4645b403246b608b1bb6222e4deb (diff) |
Blackfin arch: Allow ptrace to peek and poke application data in L1 data SRAM.
Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin/kernel/ptrace.c')
-rw-r--r-- | arch/blackfin/kernel/ptrace.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/blackfin/kernel/ptrace.c b/arch/blackfin/kernel/ptrace.c index f51ab088098e..bf1a51d8e608 100644 --- a/arch/blackfin/kernel/ptrace.c +++ b/arch/blackfin/kernel/ptrace.c | |||
@@ -220,6 +220,20 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
220 | copied = sizeof(tmp); | 220 | copied = sizeof(tmp); |
221 | } else | 221 | } else |
222 | #endif | 222 | #endif |
223 | #if L1_DATA_A_LENGTH != 0 | ||
224 | if (addr + add >= L1_DATA_A_START | ||
225 | && addr + add + sizeof(tmp) <= L1_DATA_A_START + L1_DATA_A_LENGTH) { | ||
226 | memcpy(&tmp, (const void *)(addr + add), sizeof(tmp)); | ||
227 | copied = sizeof(tmp); | ||
228 | } else | ||
229 | #endif | ||
230 | #if L1_DATA_B_LENGTH != 0 | ||
231 | if (addr + add >= L1_DATA_B_START | ||
232 | && addr + add + sizeof(tmp) <= L1_DATA_B_START + L1_DATA_B_LENGTH) { | ||
233 | memcpy(&tmp, (const void *)(addr + add), sizeof(tmp)); | ||
234 | copied = sizeof(tmp); | ||
235 | } else | ||
236 | #endif | ||
223 | if (addr + add >= FIXED_CODE_START | 237 | if (addr + add >= FIXED_CODE_START |
224 | && addr + add + sizeof(tmp) <= FIXED_CODE_END) { | 238 | && addr + add + sizeof(tmp) <= FIXED_CODE_END) { |
225 | memcpy(&tmp, (const void *)(addr + add), sizeof(tmp)); | 239 | memcpy(&tmp, (const void *)(addr + add), sizeof(tmp)); |
@@ -290,6 +304,20 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
290 | copied = sizeof(data); | 304 | copied = sizeof(data); |
291 | } else | 305 | } else |
292 | #endif | 306 | #endif |
307 | #if L1_DATA_A_LENGTH != 0 | ||
308 | if (addr + add >= L1_DATA_A_START | ||
309 | && addr + add + sizeof(data) <= L1_DATA_A_START + L1_DATA_A_LENGTH) { | ||
310 | memcpy((void *)(addr + add), &data, sizeof(data)); | ||
311 | copied = sizeof(data); | ||
312 | } else | ||
313 | #endif | ||
314 | #if L1_DATA_B_LENGTH != 0 | ||
315 | if (addr + add >= L1_DATA_B_START | ||
316 | && addr + add + sizeof(data) <= L1_DATA_B_START + L1_DATA_B_LENGTH) { | ||
317 | memcpy((void *)(addr + add), &data, sizeof(data)); | ||
318 | copied = sizeof(data); | ||
319 | } else | ||
320 | #endif | ||
293 | if (addr + add >= FIXED_CODE_START | 321 | if (addr + add >= FIXED_CODE_START |
294 | && addr + add + sizeof(data) <= FIXED_CODE_END) { | 322 | && addr + add + sizeof(data) <= FIXED_CODE_END) { |
295 | memcpy((void *)(addr + add), &data, sizeof(data)); | 323 | memcpy((void *)(addr + add), &data, sizeof(data)); |