]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/commitdiff
Blackfin: ptrace: enable access to L1 stacks
authorBarry Song <barry.song@analog.com>
Mon, 21 Jun 2010 10:19:50 +0000 (10:19 +0000)
committerMike Frysinger <vapier@gentoo.org>
Fri, 22 Oct 2010 07:48:52 +0000 (03:48 -0400)
If an app is placing its stack in L1 scratchpad SRAM, make sure ptrace
is granted access to it so that gdb can do its thing.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
arch/blackfin/kernel/ptrace.c

index 6ec77685df526899c6998fe3030513714d42d5a8..d890c1e35ec6aceefd7b5752534503a0a2d7b0fb 100644 (file)
@@ -27,6 +27,7 @@
 #include <asm/fixed_code.h>
 #include <asm/cacheflush.h>
 #include <asm/mem_map.h>
+#include <asm/mmu_context.h>
 
 /*
  * does not yet catch signals sent when the child dies.
@@ -135,6 +136,13 @@ static inline int is_user_addr_valid(struct task_struct *child,
        if (start >= FIXED_CODE_START && start + len < FIXED_CODE_END)
                return 0;
 
+#ifdef CONFIG_APP_STACK_L1
+       if (child->mm->context.l1_stack_save)
+               if (start >= (unsigned long)l1_stack_base &&
+                       start + len < (unsigned long)l1_stack_base + l1_stack_len)
+                       return 0;
+#endif
+
        return -EIO;
 }