2 * include/asm-ppc/tlbflush.h
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
10 #ifndef _PPC_TLBFLUSH_H
11 #define _PPC_TLBFLUSH_H
13 #include <linux/config.h>
16 extern void _tlbie(unsigned long address);
17 extern void _tlbia(void);
19 #if defined(CONFIG_4xx)
22 #define __tlbia() asm volatile ("sync; tlbia; isync" : : : "memory")
24 #define __tlbia _tlbia
27 static inline void flush_tlb_mm(struct mm_struct *mm)
29 static inline void flush_tlb_page(struct vm_area_struct *vma,
32 static inline void flush_tlb_page_nohash(struct vm_area_struct *vma,
35 static inline void flush_tlb_range(struct vm_area_struct *vma,
36 unsigned long start, unsigned long end)
38 static inline void flush_tlb_kernel_range(unsigned long start,
42 #elif defined(CONFIG_FSL_BOOKE)
44 /* TODO: determine if flush_tlb_range & flush_tlb_kernel_range
45 * are best implemented as tlbia vs specific tlbie's */
47 #define __tlbia() _tlbia()
49 static inline void flush_tlb_mm(struct mm_struct *mm)
51 static inline void flush_tlb_page(struct vm_area_struct *vma,
54 static inline void flush_tlb_page_nohash(struct vm_area_struct *vma,
57 static inline void flush_tlb_range(struct vm_area_struct *vma,
58 unsigned long start, unsigned long end)
60 static inline void flush_tlb_kernel_range(unsigned long start,
64 #elif defined(CONFIG_8xx)
65 #define __tlbia() asm volatile ("tlbia; sync" : : : "memory")
67 static inline void flush_tlb_mm(struct mm_struct *mm)
69 static inline void flush_tlb_page(struct vm_area_struct *vma,
72 static inline void flush_tlb_page_nohash(struct vm_area_struct *vma,
75 static inline void flush_tlb_range(struct mm_struct *mm,
76 unsigned long start, unsigned long end)
78 static inline void flush_tlb_kernel_range(unsigned long start,
82 #else /* 6xx, 7xx, 7xxx cpus */
84 struct vm_area_struct;
85 extern void flush_tlb_mm(struct mm_struct *mm);
86 extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
87 extern void flush_tlb_page_nohash(struct vm_area_struct *vma, unsigned long addr);
88 extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
90 extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
94 * This is called in munmap when we have freed up some page-table
95 * pages. We don't need to do anything here, there's nothing special
96 * about our page-table pages. -- paulus
98 static inline void flush_tlb_pgtables(struct mm_struct *mm,
99 unsigned long start, unsigned long end)
104 * This gets called at the end of handling a page fault, when
105 * the kernel has put a new PTE into the page table for the process.
106 * We use it to ensure coherency between the i-cache and d-cache
107 * for the page which has just been mapped in.
108 * On machines which use an MMU hash table, we use this to put a
109 * corresponding HPTE into the hash table ahead of time, instead of
110 * waiting for the inevitable extra hash-table miss exception.
112 extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t);
114 #endif /* _PPC_TLBFLUSH_H */
115 #endif /*__KERNEL__ */