special usb hub handling, IDE disks, and retries all over the place
[linux-2.4.git] / include / asm-mips / cacheflush.h
1 /*
2  * This file is subject to the terms and conditions of the GNU General Public
3  * License.  See the file "COPYING" in the main directory of this archive
4  * for more details.
5  *
6  * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 by Ralf Baechle at alii
7  * Copyright (C) 1999 Silicon Graphics, Inc.
8  */
9 #ifndef __ASM_CACHEFLUSH_H
10 #define __ASM_CACHEFLUSH_H
11
12 #include <linux/config.h>
13
14 struct mm_struct;
15 struct vm_area_struct;
16 struct page;
17
18 /* Cache flushing:
19  *
20  *  - flush_cache_all() flushes entire cache
21  *  - flush_cache_mm(mm) flushes the specified mm context's cache lines
22  *  - flush_cache_page(mm, vmaddr) flushes a single page
23  *  - flush_cache_range(mm, start, end) flushes a range of pages
24  *  - flush_page_to_ram(page) write back kernel page to ram
25  *  - flush_icache_range(start, end) flush a range of instructions
26  *
27  * MIPS specific flush operations:
28  *
29  *  - flush_cache_sigtramp() flush signal trampoline
30  *  - flush_icache_all() flush the entire instruction cache
31  *  - flush_data_cache_page() flushes a page from the data cache
32  */
33 extern void (*_flush_cache_all)(void);
34 extern void (*___flush_cache_all)(void);
35 extern void (*_flush_cache_mm)(struct mm_struct *mm);
36 extern void (*_flush_cache_range)(struct mm_struct *mm, unsigned long start,
37         unsigned long end);
38 extern void (*_flush_cache_page)(struct vm_area_struct *vma,
39         unsigned long page);
40 extern void flush_dcache_page(struct page * page);
41 extern void (*_flush_icache_range)(unsigned long start, unsigned long end);
42 extern void (*_flush_icache_page)(struct vm_area_struct *vma,
43         struct page *page);
44
45 extern void (*_flush_cache_sigtramp)(unsigned long addr);
46 extern void (*_flush_icache_all)(void);
47 extern void (*_flush_data_cache_page)(unsigned long addr);
48
49 #define flush_cache_all()               _flush_cache_all()
50 #define __flush_cache_all()             ___flush_cache_all()
51 #define flush_cache_mm(mm)              _flush_cache_mm(mm)
52 #define flush_cache_range(mm,start,end) _flush_cache_range(mm,start,end)
53 #define flush_cache_page(vma,page)      _flush_cache_page(vma, page)
54 #define flush_page_to_ram(page)         do { } while (0)
55
56 #define flush_icache_range(start, end)  _flush_icache_range(start,end)
57 #define flush_icache_user_range(vma, page, addr, len) \
58                                         _flush_icache_page((vma), (page))
59 #define flush_icache_page(vma, page)    _flush_icache_page(vma, page)
60
61 #define flush_cache_sigtramp(addr)      _flush_cache_sigtramp(addr)
62 #define flush_data_cache_page(addr)     _flush_data_cache_page(addr)
63 #ifdef CONFIG_VTAG_ICACHE
64 #define flush_icache_all()              _flush_icache_all()
65 #else
66 #define flush_icache_all()              do { } while(0)
67 #endif
68
69 #endif /* __ASM_CACHEFLUSH_H */