diff options
-rw-r--r-- | arch/m68k/include/asm/sun3_pgalloc.h | 41 |
1 files changed, 2 insertions, 39 deletions
diff --git a/arch/m68k/include/asm/sun3_pgalloc.h b/arch/m68k/include/asm/sun3_pgalloc.h index 1456c5eecbd9..1a8ddbd0d23c 100644 --- a/arch/m68k/include/asm/sun3_pgalloc.h +++ b/arch/m68k/include/asm/sun3_pgalloc.h | |||
@@ -13,55 +13,18 @@ | |||
13 | 13 | ||
14 | #include <asm/tlb.h> | 14 | #include <asm/tlb.h> |
15 | 15 | ||
16 | #include <asm-generic/pgalloc.h> /* for pte_{alloc,free}_one */ | ||
17 | |||
16 | extern const char bad_pmd_string[]; | 18 | extern const char bad_pmd_string[]; |
17 | 19 | ||
18 | #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) | 20 | #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) |
19 | 21 | ||
20 | |||
21 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) | ||
22 | { | ||
23 | free_page((unsigned long) pte); | ||
24 | } | ||
25 | |||
26 | static inline void pte_free(struct mm_struct *mm, pgtable_t page) | ||
27 | { | ||
28 | pgtable_page_dtor(page); | ||
29 | __free_page(page); | ||
30 | } | ||
31 | |||
32 | #define __pte_free_tlb(tlb,pte,addr) \ | 22 | #define __pte_free_tlb(tlb,pte,addr) \ |
33 | do { \ | 23 | do { \ |
34 | pgtable_page_dtor(pte); \ | 24 | pgtable_page_dtor(pte); \ |
35 | tlb_remove_page((tlb), pte); \ | 25 | tlb_remove_page((tlb), pte); \ |
36 | } while (0) | 26 | } while (0) |
37 | 27 | ||
38 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm) | ||
39 | { | ||
40 | unsigned long page = __get_free_page(GFP_KERNEL); | ||
41 | |||
42 | if (!page) | ||
43 | return NULL; | ||
44 | |||
45 | memset((void *)page, 0, PAGE_SIZE); | ||
46 | return (pte_t *) (page); | ||
47 | } | ||
48 | |||
49 | static inline pgtable_t pte_alloc_one(struct mm_struct *mm) | ||
50 | { | ||
51 | struct page *page = alloc_pages(GFP_KERNEL, 0); | ||
52 | |||
53 | if (page == NULL) | ||
54 | return NULL; | ||
55 | |||
56 | clear_highpage(page); | ||
57 | if (!pgtable_page_ctor(page)) { | ||
58 | __free_page(page); | ||
59 | return NULL; | ||
60 | } | ||
61 | return page; | ||
62 | |||
63 | } | ||
64 | |||
65 | static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) | 28 | static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) |
66 | { | 29 | { |
67 | pmd_val(*pmd) = __pa((unsigned long)pte); | 30 | pmd_val(*pmd) = __pa((unsigned long)pte); |