diff options
author | Michal Simek <monstr@monstr.eu> | 2010-05-28 14:45:38 +0200 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2011-03-09 08:09:55 +0100 |
commit | a706729c3df22d5cf4a50a02c25f5ebfcb370c82 (patch) | |
tree | 0ddc0f876ec8e17720eb2eab40c13d4e7a510af3 /arch/microblaze | |
parent | cd3415779bdb13e3daaf13965c89d286a0cf0480 (diff) | |
download | linux-a706729c3df22d5cf4a50a02c25f5ebfcb370c82.tar.gz linux-a706729c3df22d5cf4a50a02c25f5ebfcb370c82.tar.bz2 linux-a706729c3df22d5cf4a50a02c25f5ebfcb370c82.zip |
microblaze: Fix GDB issue caused by cache issue
Used the same solution as SH. Changed len to PAGE_SIZE
in copy_to_user_page macro.
Implement flush_cache_page macro.
Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze')
-rw-r--r-- | arch/microblaze/include/asm/cacheflush.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/microblaze/include/asm/cacheflush.h b/arch/microblaze/include/asm/cacheflush.h index 7ebd955460d9..5a5d835ae16d 100644 --- a/arch/microblaze/include/asm/cacheflush.h +++ b/arch/microblaze/include/asm/cacheflush.h @@ -89,7 +89,9 @@ do { \ #define flush_cache_vmap(start, end) do { } while (0) #define flush_cache_vunmap(start, end) do { } while (0) #define flush_cache_mm(mm) do { } while (0) -#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) + +#define flush_cache_page(vma, vmaddr, pfn) \ + flush_dcache_range(pfn << PAGE_SHIFT, (pfn << PAGE_SHIFT) + PAGE_SIZE); /* MS: kgdb code use this macro, wrong len with FLASH */ #if 0 @@ -104,9 +106,13 @@ 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_dcache_range((unsigned) (addr), (unsigned) (addr) + (len));\ + if (vma->vm_flags & VM_EXEC) { \ + invalidate_icache_range((unsigned) (addr), \ + (unsigned) (addr) + PAGE_SIZE); \ + flush_dcache_range((unsigned) (addr), \ + (unsigned) (addr) + PAGE_SIZE); \ + } \ } while (0) #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ |