sh: Abstract the number of page table levels
[linux-2.6.git] / arch / sh / include / asm / pgalloc_nopmd.h
blobe4b344c37e74a00cd00f752782c716c1e494e798
1 #ifndef __ASM_SH_PGALLOC_NOPMD_H
2 #define __ASM_SH_PGALLOC_NOPMD_H
4 #define QUICK_PGD 0 /* We preserve special mappings over free */
6 static inline void pgd_ctor(void *x)
8 pgd_t *pgd = x;
10 memcpy(pgd + USER_PTRS_PER_PGD,
11 swapper_pg_dir + USER_PTRS_PER_PGD,
12 (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
15 static inline pgd_t *pgd_alloc(struct mm_struct *mm)
17 return quicklist_alloc(QUICK_PGD, GFP_KERNEL | __GFP_REPEAT, pgd_ctor);
20 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
22 quicklist_free(QUICK_PGD, NULL, pgd);
25 static inline void __check_pgt_cache(void)
27 quicklist_trim(QUICK_PGD, NULL, 25, 16);
30 #endif /* __ASM_SH_PGALLOC_NOPMD_H */