summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJie Zhang <jie.zhang@analog.com>2008-07-15 16:15:40 +0800
committerBryan Wu <cooloney@kernel.org>2008-07-15 16:15:40 +0800
commit6546eae4fd90ab11ca7ab6d6b9e1b243d1ce5fe6 (patch)
tree7a06b366724ab98f8b2b2ee550e0e1b477e319ae /arch
parent2cfebf2bceff4645b403246b608b1bb6222e4deb (diff)
downloadop-kernel-dev-6546eae4fd90ab11ca7ab6d6b9e1b243d1ce5fe6.zip
op-kernel-dev-6546eae4fd90ab11ca7ab6d6b9e1b243d1ce5fe6.tar.gz
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')
-rw-r--r--arch/blackfin/kernel/ptrace.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/blackfin/kernel/ptrace.c b/arch/blackfin/kernel/ptrace.c
index f51ab08..bf1a51d 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)
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) {
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)
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) {
memcpy((void *)(addr + add), &data, sizeof(data));
OpenPOWER on IntegriCloud