pgalloc_pmd.h 859 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef __ASM_SH_PGALLOC_PMD_H
  2. #define __ASM_SH_PGALLOC_PMD_H
  3. static inline pgd_t *pgd_alloc(struct mm_struct *mm)
  4. {
  5. pgd_t *pgd;
  6. int i;
  7. pgd = kzalloc(sizeof(*pgd) * PTRS_PER_PGD, GFP_KERNEL | __GFP_REPEAT);
  8. for (i = USER_PTRS_PER_PGD; i < PTRS_PER_PGD; i++)
  9. pgd[i] = swapper_pg_dir[i];
  10. return pgd;
  11. }
  12. static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
  13. {
  14. kfree(pgd);
  15. }
  16. static inline void __check_pgt_cache(void)
  17. {
  18. }
  19. static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
  20. {
  21. set_pud(pud, __pud((unsigned long)pmd));
  22. }
  23. static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
  24. {
  25. return quicklist_alloc(QUICK_PT, GFP_KERNEL | __GFP_REPEAT, NULL);
  26. }
  27. static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
  28. {
  29. quicklist_free(QUICK_PT, NULL, pmd);
  30. }
  31. #endif /* __ASM_SH_PGALLOC_PMD_H */