| .. | .. |
|---|
| 12 | 12 | |
|---|
| 13 | 13 | #include <linux/mm.h> |
|---|
| 14 | 14 | |
|---|
| 15 | +#include <asm-generic/pgalloc.h> |
|---|
| 16 | + |
|---|
| 15 | 17 | static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, |
|---|
| 16 | 18 | pte_t *pte) |
|---|
| 17 | 19 | { |
|---|
| .. | .. |
|---|
| 32 | 34 | |
|---|
| 33 | 35 | extern pgd_t *pgd_alloc(struct mm_struct *mm); |
|---|
| 34 | 36 | |
|---|
| 35 | | -static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
|---|
| 36 | | -{ |
|---|
| 37 | | - free_pages((unsigned long)pgd, PGD_ORDER); |
|---|
| 38 | | -} |
|---|
| 39 | | - |
|---|
| 40 | | -static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, |
|---|
| 41 | | - unsigned long address) |
|---|
| 42 | | -{ |
|---|
| 43 | | - pte_t *pte; |
|---|
| 44 | | - |
|---|
| 45 | | - pte = (pte_t *) __get_free_pages(GFP_KERNEL|__GFP_ZERO, PTE_ORDER); |
|---|
| 46 | | - |
|---|
| 47 | | - return pte; |
|---|
| 48 | | -} |
|---|
| 49 | | - |
|---|
| 50 | | -static inline pgtable_t pte_alloc_one(struct mm_struct *mm, |
|---|
| 51 | | - unsigned long address) |
|---|
| 52 | | -{ |
|---|
| 53 | | - struct page *pte; |
|---|
| 54 | | - |
|---|
| 55 | | - pte = alloc_pages(GFP_KERNEL, PTE_ORDER); |
|---|
| 56 | | - if (pte) { |
|---|
| 57 | | - if (!pgtable_page_ctor(pte)) { |
|---|
| 58 | | - __free_page(pte); |
|---|
| 59 | | - return NULL; |
|---|
| 60 | | - } |
|---|
| 61 | | - clear_highpage(pte); |
|---|
| 62 | | - } |
|---|
| 63 | | - return pte; |
|---|
| 64 | | -} |
|---|
| 65 | | - |
|---|
| 66 | | -static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
|---|
| 67 | | -{ |
|---|
| 68 | | - free_pages((unsigned long)pte, PTE_ORDER); |
|---|
| 69 | | -} |
|---|
| 70 | | - |
|---|
| 71 | | -static inline void pte_free(struct mm_struct *mm, struct page *pte) |
|---|
| 72 | | -{ |
|---|
| 73 | | - pgtable_page_dtor(pte); |
|---|
| 74 | | - __free_pages(pte, PTE_ORDER); |
|---|
| 75 | | -} |
|---|
| 76 | | - |
|---|
| 77 | 37 | #define __pte_free_tlb(tlb, pte, addr) \ |
|---|
| 78 | 38 | do { \ |
|---|
| 79 | | - pgtable_page_dtor(pte); \ |
|---|
| 39 | + pgtable_pte_page_dtor(pte); \ |
|---|
| 80 | 40 | tlb_remove_page((tlb), (pte)); \ |
|---|
| 81 | 41 | } while (0) |
|---|
| 82 | | - |
|---|
| 83 | | -#define check_pgt_cache() do { } while (0) |
|---|
| 84 | 42 | |
|---|
| 85 | 43 | #endif /* _ASM_NIOS2_PGALLOC_H */ |
|---|