sh: Optimise flush_dcache_page() on SH4
[pandora-kernel.git] / arch / sh / include / asm / pgalloc_pmd.h
1 #ifndef __ASM_SH_PGALLOC_PMD_H
2 #define __ASM_SH_PGALLOC_PMD_H
3
4 static inline pgd_t *pgd_alloc(struct mm_struct *mm)
5 {
6         pgd_t *pgd;
7         int i;
8
9         pgd = kzalloc(sizeof(*pgd) * PTRS_PER_PGD, GFP_KERNEL | __GFP_REPEAT);
10
11         for (i = USER_PTRS_PER_PGD; i < PTRS_PER_PGD; i++)
12                 pgd[i] = swapper_pg_dir[i];
13
14         return pgd;
15 }
16
17 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
18 {
19         kfree(pgd);
20 }
21
22 static inline void __check_pgt_cache(void)
23 {
24 }
25
26 static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
27 {
28         set_pud(pud, __pud((unsigned long)pmd));
29 }
30
31 static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
32 {
33         return quicklist_alloc(QUICK_PT, GFP_KERNEL | __GFP_REPEAT, NULL);
34 }
35
36 static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
37 {
38         quicklist_free(QUICK_PT, NULL, pmd);
39 }
40
41 #endif /* __ASM_SH_PGALLOC_PMD_H */