Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204634
b: refs/heads/master
c: 6847ba9
h: refs/heads/master
v: v3
  • Loading branch information
Michal Simek committed Aug 4, 2010
1 parent 840b8cb commit 79f0415
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e05816679b61e47e90d7455a8f6dc6126dc479e3
refs/heads/master: 6847ba91a190fe41d21779d6b382b47b2f4c50f4
4 changes: 3 additions & 1 deletion trunk/arch/microblaze/include/asm/cacheflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,10 @@ do { \

#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
do { \
u32 addr = virt_to_phys(dst); \
invalidate_icache_range((unsigned) (addr), (unsigned) (addr) + (len));\
memcpy((dst), (src), (len)); \
flush_icache_range((unsigned) (dst), (unsigned) (dst) + (len)); \
flush_dcache_range((unsigned) (addr), (unsigned) (addr) + (len));\
} while (0)

#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
Expand Down
17 changes: 16 additions & 1 deletion trunk/arch/microblaze/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#include <asm/processor.h>
#include <linux/uaccess.h>
#include <asm/asm-offsets.h>
#include <asm/cacheflush.h>
#include <asm/io.h>

/* Returns the address where the register at REG_OFFS in P is stashed away. */
static microblaze_reg_t *reg_save_addr(unsigned reg_offs,
Expand Down Expand Up @@ -101,8 +103,21 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
microblaze_reg_t *reg_addr = reg_save_addr(addr, child);
if (request == PTRACE_PEEKUSR)
val = *reg_addr;
else
else {
#if 1
*reg_addr = data;
#else
/* MS potential problem on WB system
* Be aware that reg_addr is virtual address
* virt_to_phys conversion is necessary.
* This could be sensible solution.
*/
u32 paddr = virt_to_phys((u32)reg_addr);
invalidate_icache_range(paddr, paddr + 4);
*reg_addr = data;
flush_dcache_range(paddr, paddr + 4);
#endif
}
} else
rval = -EIO;

Expand Down

0 comments on commit 79f0415

Please sign in to comment.