Skip to content

Commit

Permalink
Blackfin arch: Allow ptrace to peek and poke application data in L1 d…
Browse files Browse the repository at this point in the history
…ata SRAM.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
  • Loading branch information
Jie Zhang authored and Bryan Wu committed Jul 15, 2008
1 parent 2cfebf2 commit 6546eae
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions arch/blackfin/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,20 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
safe_dma_memcpy (&tmp, (const void *)(addr + add), sizeof(tmp));
copied = sizeof(tmp);
} else
#endif
#if L1_DATA_A_LENGTH != 0
if (addr + add >= L1_DATA_A_START
&& addr + add + sizeof(tmp) <= L1_DATA_A_START + L1_DATA_A_LENGTH) {
memcpy(&tmp, (const void *)(addr + add), sizeof(tmp));
copied = sizeof(tmp);
} else
#endif
#if L1_DATA_B_LENGTH != 0
if (addr + add >= L1_DATA_B_START
&& addr + add + sizeof(tmp) <= L1_DATA_B_START + L1_DATA_B_LENGTH) {
memcpy(&tmp, (const void *)(addr + add), sizeof(tmp));
copied = sizeof(tmp);
} else
#endif
if (addr + add >= FIXED_CODE_START
&& addr + add + sizeof(tmp) <= FIXED_CODE_END) {
Expand Down Expand Up @@ -289,6 +303,20 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
safe_dma_memcpy ((void *)(addr + add), &data, sizeof(data));
copied = sizeof(data);
} else
#endif
#if L1_DATA_A_LENGTH != 0
if (addr + add >= L1_DATA_A_START
&& addr + add + sizeof(data) <= L1_DATA_A_START + L1_DATA_A_LENGTH) {
memcpy((void *)(addr + add), &data, sizeof(data));
copied = sizeof(data);
} else
#endif
#if L1_DATA_B_LENGTH != 0
if (addr + add >= L1_DATA_B_START
&& addr + add + sizeof(data) <= L1_DATA_B_START + L1_DATA_B_LENGTH) {
memcpy((void *)(addr + add), &data, sizeof(data));
copied = sizeof(data);
} else
#endif
if (addr + add >= FIXED_CODE_START
&& addr + add + sizeof(data) <= FIXED_CODE_END) {
Expand Down

0 comments on commit 6546eae

Please sign in to comment.