Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cache-smp-flush.c
Go to the documentation of this file.
1 /* Functions for global dcache flush when writeback caching in SMP
2  *
3  * Copyright (C) 2010 Red Hat, Inc. All Rights Reserved.
4  * Written by David Howells ([email protected])
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public Licence
8  * as published by the Free Software Foundation; either version
9  * 2 of the Licence, or (at your option) any later version.
10  */
11 #include <linux/mm.h>
12 #include <asm/cacheflush.h>
13 #include "cache-smp.h"
14 
21 {
22  unsigned long flags;
23 
24  flags = smp_lock_cache();
27  smp_unlock_cache(flags);
28 }
29 
37 void mn10300_dcache_flush_page(unsigned long start)
38 {
39  unsigned long flags;
40 
41  start &= ~(PAGE_SIZE-1);
42 
43  flags = smp_lock_cache();
46  smp_unlock_cache(flags);
47 }
48 
57 void mn10300_dcache_flush_range(unsigned long start, unsigned long end)
58 {
59  unsigned long flags;
60 
61  flags = smp_lock_cache();
64  smp_unlock_cache(flags);
65 }
66 
75 void mn10300_dcache_flush_range2(unsigned long start, unsigned long size)
76 {
77  unsigned long flags;
78 
79  flags = smp_lock_cache();
81  smp_cache_call(SMP_DCACHE_FLUSH_RANGE, start, start + size);
82  smp_unlock_cache(flags);
83 }
84 
91 {
92  unsigned long flags;
93 
94  flags = smp_lock_cache();
97  smp_unlock_cache(flags);
98 }
99 
109 {
110  unsigned long flags;
111 
112  start &= ~(PAGE_SIZE-1);
113 
114  flags = smp_lock_cache();
117  smp_unlock_cache(flags);
118 }
119 
129 void mn10300_dcache_flush_inv_range(unsigned long start, unsigned long end)
130 {
131  unsigned long flags;
132 
133  flags = smp_lock_cache();
136  smp_unlock_cache(flags);
137 }
138 
148 void mn10300_dcache_flush_inv_range2(unsigned long start, unsigned long size)
149 {
150  unsigned long flags;
151 
152  flags = smp_lock_cache();
154  smp_cache_call(SMP_DCACHE_FLUSH_INV_RANGE, start, start + size);
155  smp_unlock_cache(flags);
156 }