1 #ifndef _ASM_POWERPC_PGALLOC_H
2 #define _ASM_POWERPC_PGALLOC_H
7 static inline void pte_free_kernel(struct mm_struct
*mm
, pte_t
*pte
)
9 free_page((unsigned long)pte
);
12 static inline void pte_free(struct mm_struct
*mm
, pgtable_t ptepage
)
14 pgtable_page_dtor(ptepage
);
18 typedef struct pgtable_free
{
22 #define PGF_CACHENUM_MASK 0x7
24 static inline pgtable_free_t
pgtable_free_cache(void *p
, int cachenum
,
27 BUG_ON(cachenum
> PGF_CACHENUM_MASK
);
29 return (pgtable_free_t
){.val
= ((unsigned long) p
& ~mask
) | cachenum
};
33 #include <asm/pgalloc-64.h>
35 #include <asm/pgalloc-32.h>
38 extern void pgtable_free_tlb(struct mmu_gather
*tlb
, pgtable_free_t pgf
);
41 #define __pte_free_tlb(tlb,ptepage) \
43 pgtable_page_dtor(ptepage); \
44 pgtable_free_tlb(tlb, pgtable_free_cache(page_address(ptepage), \
45 PTE_NONCACHE_NUM, PTE_TABLE_SIZE-1)); \
48 #define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, (pte))
52 #endif /* __KERNEL__ */
53 #endif /* _ASM_POWERPC_PGALLOC_H */