Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef __ASM_SH_CACHEFLUSH_H |
| 2 | #define __ASM_SH_CACHEFLUSH_H |
| 3 | #ifdef __KERNEL__ |
| 4 | |
Paul Mundt | 26ff6c1 | 2006-09-27 15:13:36 +0900 | [diff] [blame] | 5 | #include <linux/mm.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | #include <asm/cpu/cacheflush.h> |
| 7 | |
| 8 | /* Flush (write-back only) a region (smaller than a page) */ |
| 9 | extern void __flush_wback_region(void *start, int size); |
| 10 | /* Flush (write-back & invalidate) a region (smaller than a page) */ |
| 11 | extern void __flush_purge_region(void *start, int size); |
| 12 | /* Flush (invalidate only) a region (smaller than a page) */ |
| 13 | extern void __flush_invalidate_region(void *start, int size); |
| 14 | |
| 15 | #define flush_cache_vmap(start, end) flush_cache_all() |
| 16 | #define flush_cache_vunmap(start, end) flush_cache_all() |
| 17 | |
| 18 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ |
| 19 | do { \ |
| 20 | flush_cache_page(vma, vaddr, page_to_pfn(page));\ |
| 21 | memcpy(dst, src, len); \ |
| 22 | flush_icache_user_range(vma, page, vaddr, len); \ |
| 23 | } while (0) |
| 24 | |
| 25 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ |
| 26 | do { \ |
| 27 | flush_cache_page(vma, vaddr, page_to_pfn(page));\ |
| 28 | memcpy(dst, src, len); \ |
| 29 | } while (0) |
| 30 | |
Paul Mundt | f3c2575 | 2006-09-27 18:36:17 +0900 | [diff] [blame^] | 31 | #define HAVE_ARCH_UNMAPPED_AREA |
| 32 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | #endif /* __KERNEL__ */ |
| 34 | #endif /* __ASM_SH_CACHEFLUSH_H */ |