aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-frv/cacheflush.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-frv/cacheflush.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/asm-frv/cacheflush.h')
-rw-r--r--include/asm-frv/cacheflush.h91
1 files changed, 91 insertions, 0 deletions
diff --git a/include/asm-frv/cacheflush.h b/include/asm-frv/cacheflush.h
new file mode 100644
index 000000000000..3007deccb490
--- /dev/null
+++ b/include/asm-frv/cacheflush.h
@@ -0,0 +1,91 @@
1/* cacheflush.h: FRV cache flushing routines
2 *
3 * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#ifndef _ASM_CACHEFLUSH_H
13#define _ASM_CACHEFLUSH_H
14
15/* Keep includes the same across arches. */
16#include <linux/mm.h>
17
18/*
19 * virtually-indexed cache management (our cache is physically indexed)
20 */
21#define flush_cache_all() do {} while(0)
22#define flush_cache_mm(mm) do {} while(0)
23#define flush_cache_range(mm, start, end) do {} while(0)
24#define flush_cache_page(vma, vmaddr, pfn) do {} while(0)
25#define flush_cache_vmap(start, end) do {} while(0)
26#define flush_cache_vunmap(start, end) do {} while(0)
27#define flush_dcache_mmap_lock(mapping) do {} while(0)
28#define flush_dcache_mmap_unlock(mapping) do {} while(0)
29
30/*
31 * physically-indexed cache managment
32 * - see arch/frv/lib/cache.S
33 */
34extern void frv_dcache_writeback(unsigned long start, unsigned long size);
35extern void frv_cache_invalidate(unsigned long start, unsigned long size);
36extern void frv_icache_invalidate(unsigned long start, unsigned long size);
37extern void frv_cache_wback_inv(unsigned long start, unsigned long size);
38
39static inline void __flush_cache_all(void)
40{
41 asm volatile(" dcef @(gr0,gr0),#1 \n"
42 " icei @(gr0,gr0),#1 \n"
43 " membar \n"
44 : : : "memory"
45 );
46}
47
48/* dcache/icache coherency... */
49#ifdef CONFIG_MMU
50extern void flush_dcache_page(struct page *page);
51#else
52static inline void flush_dcache_page(struct page *page)
53{
54 unsigned long addr = page_to_phys(page);
55 frv_dcache_writeback(addr, addr + PAGE_SIZE);
56}
57#endif
58
59static inline void flush_page_to_ram(struct page *page)
60{
61 flush_dcache_page(page);
62}
63
64static inline void flush_icache(void)
65{
66 __flush_cache_all();
67}
68
69static inline void flush_icache_range(unsigned long start, unsigned long end)
70{
71 frv_cache_wback_inv(start, end);
72}
73
74#ifdef CONFIG_MMU
75extern void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
76 unsigned long start, unsigned long len);
77#else
78static inline void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
79 unsigned long start, unsigned long len)
80{
81 frv_cache_wback_inv(start, start + len);
82}
83#endif
84
85static inline void flush_icache_page(struct vm_area_struct *vma, struct page *page)
86{
87 flush_icache_user_range(vma, page, page_to_phys(page), PAGE_SIZE);
88}
89
90
91#endif /* _ASM_CACHEFLUSH_H */