aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mn10300/include/asm/tlbflush.h
diff options
context:
space:
mode:
authorAkira Takeuchi <takeuchi.akr@jp.panasonic.com>2010-10-27 12:28:51 -0400
committerDavid Howells <dhowells@redhat.com>2010-10-27 12:28:51 -0400
commit965ea4bbb9ae926358273368144ba838c561bc38 (patch)
treec6ee08f2f2970bb500ccc7cf58de6beea870e4f8 /arch/mn10300/include/asm/tlbflush.h
parentdccbf4853a31a3f774f38c402209d23388d99f52 (diff)
MN10300: SMP TLB flushing
Implement global TLB flushing for MN10300. This will be used by the AM34 which is SMP capable. Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com> Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com> Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'arch/mn10300/include/asm/tlbflush.h')
-rw-r--r--arch/mn10300/include/asm/tlbflush.h81
1 files changed, 52 insertions, 29 deletions
diff --git a/arch/mn10300/include/asm/tlbflush.h b/arch/mn10300/include/asm/tlbflush.h
index c3c194d4031e..efddd6e1adea 100644
--- a/arch/mn10300/include/asm/tlbflush.h
+++ b/arch/mn10300/include/asm/tlbflush.h
@@ -11,6 +11,7 @@
11#ifndef _ASM_TLBFLUSH_H 11#ifndef _ASM_TLBFLUSH_H
12#define _ASM_TLBFLUSH_H 12#define _ASM_TLBFLUSH_H
13 13
14#include <linux/mm.h>
14#include <asm/processor.h> 15#include <asm/processor.h>
15 16
16struct tlb_state { 17struct tlb_state {
@@ -93,39 +94,61 @@ void local_flush_tlb_page(struct mm_struct *mm, unsigned long addr)
93 * - flush_tlb_range(mm, start, end) flushes a range of pages 94 * - flush_tlb_range(mm, start, end) flushes a range of pages
94 * - flush_tlb_pgtables(mm, start, end) flushes a range of page tables 95 * - flush_tlb_pgtables(mm, start, end) flushes a range of page tables
95 */ 96 */
96#define flush_tlb_all() \ 97#ifdef CONFIG_SMP
97do { \ 98
98 preempt_disable(); \ 99#include <asm/smp.h>
99 local_flush_tlb_all(); \ 100
100 preempt_enable(); \ 101extern void flush_tlb_all(void);
101} while (0) 102extern void flush_tlb_current_task(void);
102 103extern void flush_tlb_mm(struct mm_struct *);
103#define flush_tlb_mm(mm) \ 104extern void flush_tlb_page(struct vm_area_struct *, unsigned long);
104do { \ 105
105 preempt_disable(); \ 106#define flush_tlb() flush_tlb_current_task()
106 local_flush_tlb_all(); \ 107
107 preempt_enable(); \ 108static inline void flush_tlb_range(struct vm_area_struct *vma,
108} while (0) 109 unsigned long start, unsigned long end)
109 110{
110#define flush_tlb_range(vma, start, end) \ 111 flush_tlb_mm(vma->vm_mm);
111do { \ 112}
112 unsigned long __s __attribute__((unused)) = (start); \ 113
113 unsigned long __e __attribute__((unused)) = (end); \ 114#else /* CONFIG_SMP */
114 preempt_disable(); \ 115
115 local_flush_tlb_all(); \ 116static inline void flush_tlb_all(void)
116 preempt_enable(); \ 117{
117} while (0) 118 preempt_disable();
119 local_flush_tlb_all();
120 preempt_enable();
121}
122
123static inline void flush_tlb_mm(struct mm_struct *mm)
124{
125 preempt_disable();
126 local_flush_tlb_all();
127 preempt_enable();
128}
129
130static inline void flush_tlb_range(struct vm_area_struct *vma,
131 unsigned long start, unsigned long end)
132{
133 preempt_disable();
134 local_flush_tlb_all();
135 preempt_enable();
136}
118 137
119#define flush_tlb_page(vma, addr) local_flush_tlb_page((vma)->vm_mm, addr) 138#define flush_tlb_page(vma, addr) local_flush_tlb_page((vma)->vm_mm, addr)
120#define flush_tlb() flush_tlb_all() 139#define flush_tlb() flush_tlb_all()
121 140
122#define flush_tlb_kernel_range(start, end) \ 141#endif /* CONFIG_SMP */
123do { \
124 unsigned long __s __attribute__((unused)) = (start); \
125 unsigned long __e __attribute__((unused)) = (end); \
126 flush_tlb_all(); \
127} while (0)
128 142
129#define flush_tlb_pgtables(mm, start, end) do {} while (0) 143static inline void flush_tlb_kernel_range(unsigned long start,
144 unsigned long end)
145{
146 flush_tlb_all();
147}
148
149static inline void flush_tlb_pgtables(struct mm_struct *mm,
150 unsigned long start, unsigned long end)
151{
152}
130 153
131#endif /* _ASM_TLBFLUSH_H */ 154#endif /* _ASM_TLBFLUSH_H */