aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/kernel/ptrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/microblaze/kernel/ptrace.c')
-rw-r--r--arch/microblaze/kernel/ptrace.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/microblaze/kernel/ptrace.c b/arch/microblaze/kernel/ptrace.c
index a4a7770c614..dc03ffc8174 100644
--- a/arch/microblaze/kernel/ptrace.c
+++ b/arch/microblaze/kernel/ptrace.c
@@ -38,6 +38,8 @@
38#include <asm/processor.h> 38#include <asm/processor.h>
39#include <linux/uaccess.h> 39#include <linux/uaccess.h>
40#include <asm/asm-offsets.h> 40#include <asm/asm-offsets.h>
41#include <asm/cacheflush.h>
42#include <asm/io.h>
41 43
42/* Returns the address where the register at REG_OFFS in P is stashed away. */ 44/* Returns the address where the register at REG_OFFS in P is stashed away. */
43static microblaze_reg_t *reg_save_addr(unsigned reg_offs, 45static microblaze_reg_t *reg_save_addr(unsigned reg_offs,
@@ -101,8 +103,21 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
101 microblaze_reg_t *reg_addr = reg_save_addr(addr, child); 103 microblaze_reg_t *reg_addr = reg_save_addr(addr, child);
102 if (request == PTRACE_PEEKUSR) 104 if (request == PTRACE_PEEKUSR)
103 val = *reg_addr; 105 val = *reg_addr;
104 else 106 else {
107#if 1
105 *reg_addr = data; 108 *reg_addr = data;
109#else
110 /* MS potential problem on WB system
111 * Be aware that reg_addr is virtual address
112 * virt_to_phys conversion is necessary.
113 * This could be sensible solution.
114 */
115 u32 paddr = virt_to_phys((u32)reg_addr);
116 invalidate_icache_range(paddr, paddr + 4);
117 *reg_addr = data;
118 flush_dcache_range(paddr, paddr + 4);
119#endif
120 }
106 } else 121 } else
107 rval = -EIO; 122 rval = -EIO;
108 123