]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-sh/pgalloc.h
CONFIG_HIGHPTE vs. sub-page page tables.
[linux-2.6-omap-h63xx.git] / include / asm-sh / pgalloc.h
index 59ca16d77a1d79b20775362e8d76d7d9cc2d3594..84dd2db7104c74f4f57eb4f1c7d0bfc1f4159869 100644 (file)
@@ -14,10 +14,11 @@ static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
 }
 
 static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
-                               struct page *pte)
+                               pgtable_t pte)
 {
        set_pmd(pmd, __pmd((unsigned long)page_address(pte)));
 }
+#define pmd_pgtable(pmd) pmd_page(pmd)
 
 static inline void pgd_ctor(void *x)
 {
@@ -47,11 +48,18 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
        return quicklist_alloc(QUICK_PT, GFP_KERNEL | __GFP_REPEAT, NULL);
 }
 
-static inline struct page *pte_alloc_one(struct mm_struct *mm,
-                                        unsigned long address)
+static inline pgtable_t pte_alloc_one(struct mm_struct *mm,
+                                       unsigned long address)
 {
-       void *pg = quicklist_alloc(QUICK_PT, GFP_KERNEL | __GFP_REPEAT, NULL);
-       return pg ? virt_to_page(pg) : NULL;
+       struct page *page;
+       void *pg;
+
+       pg = quicklist_alloc(QUICK_PT, GFP_KERNEL | __GFP_REPEAT, NULL);
+       if (!pg)
+               return NULL;
+       page = virt_to_page(pg);
+       pgtable_page_ctor(page);
+       return page;
 }
 
 static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
@@ -59,12 +67,17 @@ static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
        quicklist_free(QUICK_PT, NULL, pte);
 }
 
-static inline void pte_free(struct mm_struct *mm, struct page *pte)
+static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
 {
+       pgtable_page_dtor(pte);
        quicklist_free_page(QUICK_PT, NULL, pte);
 }
 
-#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
+#define __pte_free_tlb(tlb,pte)                                \
+do {                                                   \
+       pgtable_page_dtor(pte);                         \
+       tlb_remove_page((tlb), (pte));                  \
+} while (0)
 
 /*
  * allocating and freeing a pmd is trivial: the 1-entry pmd is