aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-sparc64')
-rw-r--r--include/asm-sparc64/page.h2
-rw-r--r--include/asm-sparc64/pgalloc.h19
2 files changed, 16 insertions, 5 deletions
diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h
index cdf950e017ee..e93a482aa24a 100644
--- a/include/asm-sparc64/page.h
+++ b/include/asm-sparc64/page.h
@@ -104,6 +104,8 @@ typedef unsigned long pgprot_t;
104 104
105#endif /* (STRICT_MM_TYPECHECKS) */ 105#endif /* (STRICT_MM_TYPECHECKS) */
106 106
107typedef struct page *pgtable_t;
108
107#define TASK_UNMAPPED_BASE (test_thread_flag(TIF_32BIT) ? \ 109#define TASK_UNMAPPED_BASE (test_thread_flag(TIF_32BIT) ? \
108 (_AC(0x0000000070000000,UL)) : \ 110 (_AC(0x0000000070000000,UL)) : \
109 (_AC(0xfffff80000000000,UL) + (1UL << 32UL))) 111 (_AC(0xfffff80000000000,UL) + (1UL << 32UL)))
diff --git a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h
index b48f73c2274e..3ee2d406373b 100644
--- a/include/asm-sparc64/pgalloc.h
+++ b/include/asm-sparc64/pgalloc.h
@@ -43,11 +43,18 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
43 return quicklist_alloc(0, GFP_KERNEL, NULL); 43 return quicklist_alloc(0, GFP_KERNEL, NULL);
44} 44}
45 45
46static inline struct page *pte_alloc_one(struct mm_struct *mm, 46static inline pgtable_t pte_alloc_one(struct mm_struct *mm,
47 unsigned long address) 47 unsigned long address)
48{ 48{
49 void *pg = quicklist_alloc(0, GFP_KERNEL, NULL); 49 struct page *page;
50 return pg ? virt_to_page(pg) : NULL; 50 void *pg;
51
52 pg = quicklist_alloc(0, GFP_KERNEL, NULL);
53 if (!pg)
54 return NULL;
55 page = virt_to_page(pg);
56 pgtable_page_ctor(page);
57 return page;
51} 58}
52 59
53static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) 60static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
@@ -55,8 +62,9 @@ static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
55 quicklist_free(0, NULL, pte); 62 quicklist_free(0, NULL, pte);
56} 63}
57 64
58static inline void pte_free(struct mm_struct *mm, struct page *ptepage) 65static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage)
59{ 66{
67 pgtable_page_dtor(ptepage);
60 quicklist_free_page(0, NULL, ptepage); 68 quicklist_free_page(0, NULL, ptepage);
61} 69}
62 70
@@ -64,6 +72,7 @@ static inline void pte_free(struct mm_struct *mm, struct page *ptepage)
64#define pmd_populate_kernel(MM, PMD, PTE) pmd_set(PMD, PTE) 72#define pmd_populate_kernel(MM, PMD, PTE) pmd_set(PMD, PTE)
65#define pmd_populate(MM,PMD,PTE_PAGE) \ 73#define pmd_populate(MM,PMD,PTE_PAGE) \
66 pmd_populate_kernel(MM,PMD,page_address(PTE_PAGE)) 74 pmd_populate_kernel(MM,PMD,page_address(PTE_PAGE))
75#define pmd_pgtable(pmd) pmd_page(pmd)
67 76
68static inline void check_pgt_cache(void) 77static inline void check_pgt_cache(void)
69{ 78{