Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cache-smp-inv.c
Go to the documentation of this file.
1 /* Functions for global i/dcache invalidation when 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_icache_inv_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_icache_inv_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_icache_inv_range2(unsigned long start, unsigned long size)
76 {
77  unsigned long flags;
78 
79  flags = smp_lock_cache();
81  smp_cache_call(SMP_ICACHE_INV_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 
107 void mn10300_dcache_inv_page(unsigned long start)
108 {
109  unsigned long flags;
110 
111  start &= ~(PAGE_SIZE-1);
112 
113  flags = smp_lock_cache();
116  smp_unlock_cache(flags);
117 }
118 
127 void mn10300_dcache_inv_range(unsigned long start, unsigned long end)
128 {
129  unsigned long flags;
130 
131  flags = smp_lock_cache();
132  mn10300_local_dcache_inv_range(start, end);
134  smp_unlock_cache(flags);
135 }
136 
145 void mn10300_dcache_inv_range2(unsigned long start, unsigned long size)
146 {
147  unsigned long flags;
148 
149  flags = smp_lock_cache();
150  mn10300_local_dcache_inv_range2(start, size);
151  smp_cache_call(SMP_DCACHE_INV_RANGE, start, start + size);
152  smp_unlock_cache(flags);
153 }