• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6.36/arch/powerpc/include/asm/
1#ifndef _ASM_POWERPC_PGALLOC_H
2#define _ASM_POWERPC_PGALLOC_H
3#ifdef __KERNEL__
4
5#include <linux/mm.h>
6
7#ifdef CONFIG_PPC_BOOK3E
8extern void tlb_flush_pgtable(struct mmu_gather *tlb, unsigned long address);
9#else /* CONFIG_PPC_BOOK3E */
10static inline void tlb_flush_pgtable(struct mmu_gather *tlb,
11				     unsigned long address)
12{
13}
14#endif /* !CONFIG_PPC_BOOK3E */
15
16static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
17{
18	free_page((unsigned long)pte);
19}
20
21static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage)
22{
23	pgtable_page_dtor(ptepage);
24	__free_page(ptepage);
25}
26
27#ifdef CONFIG_PPC64
28#include <asm/pgalloc-64.h>
29#else
30#include <asm/pgalloc-32.h>
31#endif
32
33#ifdef CONFIG_SMP
34extern void pgtable_free_tlb(struct mmu_gather *tlb, void *table, unsigned shift);
35extern void pte_free_finish(void);
36#else /* CONFIG_SMP */
37static inline void pgtable_free_tlb(struct mmu_gather *tlb, void *table, unsigned shift)
38{
39	pgtable_free(table, shift);
40}
41static inline void pte_free_finish(void) { }
42#endif /* !CONFIG_SMP */
43
44static inline void __pte_free_tlb(struct mmu_gather *tlb, struct page *ptepage,
45				  unsigned long address)
46{
47	tlb_flush_pgtable(tlb, address);
48	pgtable_page_dtor(ptepage);
49	pgtable_free_tlb(tlb, page_address(ptepage), 0);
50}
51
52#endif /* __KERNEL__ */
53#endif /* _ASM_POWERPC_PGALLOC_H */
54