Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _SPARC64_TLBFLUSH_H |
| 2 | #define _SPARC64_TLBFLUSH_H |
| 3 | |
| 4 | #include <linux/config.h> |
| 5 | #include <linux/mm.h> |
| 6 | #include <asm/mmu_context.h> |
| 7 | |
David S. Miller | 74bf431 | 2006-01-31 18:29:18 -0800 | [diff] [blame] | 8 | /* TSB flush operations. */ |
| 9 | struct mmu_gather; |
| 10 | extern void flush_tsb_kernel_range(unsigned long start, unsigned long end); |
| 11 | extern void flush_tsb_user(struct mmu_gather *mp); |
| 12 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | /* TLB flush operations. */ |
| 14 | |
| 15 | extern void flush_tlb_pending(void); |
| 16 | |
| 17 | #define flush_tlb_range(vma,start,end) \ |
| 18 | do { (void)(start); flush_tlb_pending(); } while (0) |
| 19 | #define flush_tlb_page(vma,addr) flush_tlb_pending() |
| 20 | #define flush_tlb_mm(mm) flush_tlb_pending() |
| 21 | |
David S. Miller | 74bf431 | 2006-01-31 18:29:18 -0800 | [diff] [blame] | 22 | /* Local cpu only. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | extern void __flush_tlb_all(void); |
David S. Miller | 74bf431 | 2006-01-31 18:29:18 -0800 | [diff] [blame] | 24 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | extern void __flush_tlb_kernel_range(unsigned long start, unsigned long end); |
| 26 | |
| 27 | #ifndef CONFIG_SMP |
| 28 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | #define flush_tlb_kernel_range(start,end) \ |
David S. Miller | 74bf431 | 2006-01-31 18:29:18 -0800 | [diff] [blame] | 30 | do { flush_tsb_kernel_range(start,end); \ |
| 31 | __flush_tlb_kernel_range(start,end); \ |
| 32 | } while (0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | |
| 34 | #else /* CONFIG_SMP */ |
| 35 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | extern void smp_flush_tlb_kernel_range(unsigned long start, unsigned long end); |
| 37 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | #define flush_tlb_kernel_range(start, end) \ |
David S. Miller | 74bf431 | 2006-01-31 18:29:18 -0800 | [diff] [blame] | 39 | do { flush_tsb_kernel_range(start,end); \ |
| 40 | smp_flush_tlb_kernel_range(start, end); \ |
| 41 | } while (0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | |
| 43 | #endif /* ! CONFIG_SMP */ |
| 44 | |
David S. Miller | 74bf431 | 2006-01-31 18:29:18 -0800 | [diff] [blame] | 45 | static inline void flush_tlb_pgtables(struct mm_struct *mm, unsigned long start, unsigned long end) |
| 46 | { |
| 47 | /* We don't use virtual page tables for TLB miss processing |
| 48 | * any more. Nowadays we use the TSB. |
| 49 | */ |
| 50 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | |
| 52 | #endif /* _SPARC64_TLBFLUSH_H */ |