diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/blackfin/kernel/ptrace.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'arch/blackfin/kernel/ptrace.c')
-rw-r--r-- | arch/blackfin/kernel/ptrace.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/arch/blackfin/kernel/ptrace.c b/arch/blackfin/kernel/ptrace.c index 6ec77685df52..75089f80855d 100644 --- a/arch/blackfin/kernel/ptrace.c +++ b/arch/blackfin/kernel/ptrace.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <asm/fixed_code.h> | 27 | #include <asm/fixed_code.h> |
28 | #include <asm/cacheflush.h> | 28 | #include <asm/cacheflush.h> |
29 | #include <asm/mem_map.h> | 29 | #include <asm/mem_map.h> |
30 | #include <asm/mmu_context.h> | ||
30 | 31 | ||
31 | /* | 32 | /* |
32 | * does not yet catch signals sent when the child dies. | 33 | * does not yet catch signals sent when the child dies. |
@@ -37,12 +38,13 @@ | |||
37 | * Get contents of register REGNO in task TASK. | 38 | * Get contents of register REGNO in task TASK. |
38 | */ | 39 | */ |
39 | static inline long | 40 | static inline long |
40 | get_reg(struct task_struct *task, long regno, unsigned long __user *datap) | 41 | get_reg(struct task_struct *task, unsigned long regno, |
42 | unsigned long __user *datap) | ||
41 | { | 43 | { |
42 | long tmp; | 44 | long tmp; |
43 | struct pt_regs *regs = task_pt_regs(task); | 45 | struct pt_regs *regs = task_pt_regs(task); |
44 | 46 | ||
45 | if (regno & 3 || regno > PT_LAST_PSEUDO || regno < 0) | 47 | if (regno & 3 || regno > PT_LAST_PSEUDO) |
46 | return -EIO; | 48 | return -EIO; |
47 | 49 | ||
48 | switch (regno) { | 50 | switch (regno) { |
@@ -73,11 +75,11 @@ get_reg(struct task_struct *task, long regno, unsigned long __user *datap) | |||
73 | * Write contents of register REGNO in task TASK. | 75 | * Write contents of register REGNO in task TASK. |
74 | */ | 76 | */ |
75 | static inline int | 77 | static inline int |
76 | put_reg(struct task_struct *task, long regno, unsigned long data) | 78 | put_reg(struct task_struct *task, unsigned long regno, unsigned long data) |
77 | { | 79 | { |
78 | struct pt_regs *regs = task_pt_regs(task); | 80 | struct pt_regs *regs = task_pt_regs(task); |
79 | 81 | ||
80 | if (regno & 3 || regno > PT_LAST_PSEUDO || regno < 0) | 82 | if (regno & 3 || regno > PT_LAST_PSEUDO) |
81 | return -EIO; | 83 | return -EIO; |
82 | 84 | ||
83 | switch (regno) { | 85 | switch (regno) { |
@@ -113,8 +115,8 @@ put_reg(struct task_struct *task, long regno, unsigned long data) | |||
113 | /* | 115 | /* |
114 | * check that an address falls within the bounds of the target process's memory mappings | 116 | * check that an address falls within the bounds of the target process's memory mappings |
115 | */ | 117 | */ |
116 | static inline int is_user_addr_valid(struct task_struct *child, | 118 | int |
117 | unsigned long start, unsigned long len) | 119 | is_user_addr_valid(struct task_struct *child, unsigned long start, unsigned long len) |
118 | { | 120 | { |
119 | struct vm_area_struct *vma; | 121 | struct vm_area_struct *vma; |
120 | struct sram_list_struct *sraml; | 122 | struct sram_list_struct *sraml; |
@@ -135,6 +137,13 @@ static inline int is_user_addr_valid(struct task_struct *child, | |||
135 | if (start >= FIXED_CODE_START && start + len < FIXED_CODE_END) | 137 | if (start >= FIXED_CODE_START && start + len < FIXED_CODE_END) |
136 | return 0; | 138 | return 0; |
137 | 139 | ||
140 | #ifdef CONFIG_APP_STACK_L1 | ||
141 | if (child->mm->context.l1_stack_save) | ||
142 | if (start >= (unsigned long)l1_stack_base && | ||
143 | start + len < (unsigned long)l1_stack_base + l1_stack_len) | ||
144 | return 0; | ||
145 | #endif | ||
146 | |||
138 | return -EIO; | 147 | return -EIO; |
139 | } | 148 | } |
140 | 149 | ||
@@ -232,7 +241,8 @@ void user_disable_single_step(struct task_struct *child) | |||
232 | clear_tsk_thread_flag(child, TIF_SINGLESTEP); | 241 | clear_tsk_thread_flag(child, TIF_SINGLESTEP); |
233 | } | 242 | } |
234 | 243 | ||
235 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) | 244 | long arch_ptrace(struct task_struct *child, long request, |
245 | unsigned long addr, unsigned long data) | ||
236 | { | 246 | { |
237 | int ret; | 247 | int ret; |
238 | unsigned long __user *datap = (unsigned long __user *)data; | 248 | unsigned long __user *datap = (unsigned long __user *)data; |
@@ -360,14 +370,14 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
360 | return copy_regset_to_user(child, &user_bfin_native_view, | 370 | return copy_regset_to_user(child, &user_bfin_native_view, |
361 | REGSET_GENERAL, | 371 | REGSET_GENERAL, |
362 | 0, sizeof(struct pt_regs), | 372 | 0, sizeof(struct pt_regs), |
363 | (void __user *)data); | 373 | datap); |
364 | 374 | ||
365 | case PTRACE_SETREGS: | 375 | case PTRACE_SETREGS: |
366 | pr_debug("ptrace: PTRACE_SETREGS\n"); | 376 | pr_debug("ptrace: PTRACE_SETREGS\n"); |
367 | return copy_regset_from_user(child, &user_bfin_native_view, | 377 | return copy_regset_from_user(child, &user_bfin_native_view, |
368 | REGSET_GENERAL, | 378 | REGSET_GENERAL, |
369 | 0, sizeof(struct pt_regs), | 379 | 0, sizeof(struct pt_regs), |
370 | (const void __user *)data); | 380 | datap); |
371 | 381 | ||
372 | case_default: | 382 | case_default: |
373 | default: | 383 | default: |