]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
Blackfin arch: Allow ptrace to peek and poke application data in L1 data SRAM.
authorJie Zhang <jie.zhang@analog.com>
Tue, 15 Jul 2008 08:15:40 +0000 (16:15 +0800)
committerBryan Wu <cooloney@kernel.org>
Tue, 15 Jul 2008 08:15:40 +0000 (16:15 +0800)
Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
arch/blackfin/kernel/ptrace.c

index f51ab088098ec1e16162c2c4a62c4c20a42b4b17..bf1a51d8e608a39305ef8d03295060bec5416138 100644 (file)
@@ -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) {
@@ -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) {