powerpc: mmu_gather rework
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / powerpc / include / asm / pgalloc.h
blobdf1b4cbb2e70c0a263cd3e676374c0568f703c89
1 #ifndef _ASM_POWERPC_PGALLOC_H
2 #define _ASM_POWERPC_PGALLOC_H
3 #ifdef __KERNEL__
5 #include <linux/mm.h>
7 #ifdef CONFIG_PPC_BOOK3E
8 extern void tlb_flush_pgtable(struct mmu_gather *tlb, unsigned long address);
9 #else /* CONFIG_PPC_BOOK3E */
10 static inline void tlb_flush_pgtable(struct mmu_gather *tlb,
11 unsigned long address)
14 #endif /* !CONFIG_PPC_BOOK3E */
16 static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
18 free_page((unsigned long)pte);
21 static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage)
23 pgtable_page_dtor(ptepage);
24 __free_page(ptepage);
27 #ifdef CONFIG_PPC64
28 #include <asm/pgalloc-64.h>
29 #else
30 #include <asm/pgalloc-32.h>
31 #endif
33 #ifdef CONFIG_SMP
34 extern void pgtable_free_tlb(struct mmu_gather *tlb, void *table, unsigned shift);
35 extern void pte_free_finish(struct mmu_gather *tlb);
36 #else /* CONFIG_SMP */
37 static inline void pgtable_free_tlb(struct mmu_gather *tlb, void *table, unsigned shift)
39 pgtable_free(table, shift);
41 static inline void pte_free_finish(struct mmu_gather *tlb) { }
42 #endif /* !CONFIG_SMP */
44 static inline void __pte_free_tlb(struct mmu_gather *tlb, struct page *ptepage,
45 unsigned long address)
47 tlb_flush_pgtable(tlb, address);
48 pgtable_page_dtor(ptepage);
49 pgtable_free_tlb(tlb, page_address(ptepage), 0);
52 #endif /* __KERNEL__ */
53 #endif /* _ASM_POWERPC_PGALLOC_H */