1
2
3
4
5
6
7
8#ifndef _ASM_C6X_CACHEFLUSH_H
9#define _ASM_C6X_CACHEFLUSH_H
10
11#include <linux/spinlock.h>
12
13#include <asm/setup.h>
14#include <asm/cache.h>
15#include <asm/mman.h>
16#include <asm/page.h>
17#include <asm/string.h>
18
19
20
21
22#define flush_icache_range(s, e) \
23do { \
24 L1D_cache_block_writeback((s), (e)); \
25 L1P_cache_block_invalidate((s), (e)); \
26} while (0)
27
28#define flush_icache_page(vma, page) \
29do { \
30 if ((vma)->vm_flags & PROT_EXEC) \
31 L1D_cache_block_writeback_invalidate(page_address(page), \
32 (unsigned long) page_address(page) + PAGE_SIZE)); \
33 L1P_cache_block_invalidate(page_address(page), \
34 (unsigned long) page_address(page) + PAGE_SIZE)); \
35} while (0)
36
37#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
38do { \
39 memcpy(dst, src, len); \
40 flush_icache_range((unsigned) (dst), (unsigned) (dst) + (len)); \
41} while (0)
42
43#include <asm-generic/cacheflush.h>
44
45#endif
46