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_page(unsigned long context, unsigned long page, unsigned long r); |
| 26 | |
| 27 | extern void __flush_tlb_kernel_range(unsigned long start, unsigned long end); |
| 28 | |
| 29 | #ifndef CONFIG_SMP |
| 30 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | #define flush_tlb_kernel_range(start,end) \ |
David S. Miller | 74bf431 | 2006-01-31 18:29:18 -0800 | [diff] [blame^] | 32 | do { flush_tsb_kernel_range(start,end); \ |
| 33 | __flush_tlb_kernel_range(start,end); \ |
| 34 | } while (0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | |
| 36 | #else /* CONFIG_SMP */ |
| 37 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | extern void smp_flush_tlb_kernel_range(unsigned long start, unsigned long end); |
| 39 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | #define flush_tlb_kernel_range(start, end) \ |
David S. Miller | 74bf431 | 2006-01-31 18:29:18 -0800 | [diff] [blame^] | 41 | do { flush_tsb_kernel_range(start,end); \ |
| 42 | smp_flush_tlb_kernel_range(start, end); \ |
| 43 | } while (0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | |
| 45 | #endif /* ! CONFIG_SMP */ |
| 46 | |
David S. Miller | 74bf431 | 2006-01-31 18:29:18 -0800 | [diff] [blame^] | 47 | static inline void flush_tlb_pgtables(struct mm_struct *mm, unsigned long start, unsigned long end) |
| 48 | { |
| 49 | /* We don't use virtual page tables for TLB miss processing |
| 50 | * any more. Nowadays we use the TSB. |
| 51 | */ |
| 52 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | |
| 54 | #endif /* _SPARC64_TLBFLUSH_H */ |