pgalloc_nopmd.h 696 B

123456789101112131415161718192021222324252627282930
  1. #ifndef __ASM_SH_PGALLOC_NOPMD_H
  2. #define __ASM_SH_PGALLOC_NOPMD_H
  3. #define QUICK_PGD 0 /* We preserve special mappings over free */
  4. static inline void pgd_ctor(void *x)
  5. {
  6. pgd_t *pgd = x;
  7. memcpy(pgd + USER_PTRS_PER_PGD,
  8. swapper_pg_dir + USER_PTRS_PER_PGD,
  9. (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
  10. }
  11. static inline pgd_t *pgd_alloc(struct mm_struct *mm)
  12. {
  13. return quicklist_alloc(QUICK_PGD, GFP_KERNEL | __GFP_REPEAT, pgd_ctor);
  14. }
  15. static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
  16. {
  17. quicklist_free(QUICK_PGD, NULL, pgd);
  18. }
  19. static inline void __check_pgt_cache(void)
  20. {
  21. quicklist_trim(QUICK_PGD, NULL, 25, 16);
  22. }
  23. #endif /* __ASM_SH_PGALLOC_NOPMD_H */