ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-ppc64 / tlbflush.h
1 #ifndef _PPC64_TLBFLUSH_H
2 #define _PPC64_TLBFLUSH_H
3
4 /*
5  * TLB flushing:
6  *
7  *  - flush_tlb_mm(mm) flushes the specified mm context TLB's
8  *  - flush_tlb_page(vma, vmaddr) flushes one page
9  *  - flush_tlb_range(vma, start, end) flushes a range of pages
10  *  - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
11  *  - flush_tlb_pgtables(mm, start, end) flushes a range of page tables
12  */
13
14 #include <linux/percpu.h>
15 #include <asm/page.h>
16
17 #define PPC64_TLB_BATCH_NR 192
18
19 struct mm_struct;
20 struct ppc64_tlb_batch {
21         unsigned long index;
22         unsigned long context;
23         struct mm_struct *mm;
24         pte_t pte[PPC64_TLB_BATCH_NR];
25         unsigned long addr[PPC64_TLB_BATCH_NR];
26         unsigned long vaddr[PPC64_TLB_BATCH_NR];
27 };
28 DECLARE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch);
29
30 extern void __flush_tlb_pending(struct ppc64_tlb_batch *batch);
31
32 static inline void flush_tlb_pending(void)
33 {
34         struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch);
35
36         if (batch->index)
37                 __flush_tlb_pending(batch);
38 }
39
40 #define flush_tlb_mm(mm)                        flush_tlb_pending()
41 #define flush_tlb_page(vma, addr)               flush_tlb_pending()
42 #define flush_tlb_range(vma, start, end) \
43                 do { (void)(start); flush_tlb_pending(); } while (0)
44 #define flush_tlb_kernel_range(start, end)      flush_tlb_pending()
45 #define flush_tlb_pgtables(mm, start, end)      do { } while (0)
46
47 extern void flush_hash_page(unsigned long context, unsigned long ea, pte_t pte,
48                             int local);
49 void flush_hash_range(unsigned long context, unsigned long number, int local);
50
51 #endif /* _PPC64_TLBFLUSH_H */