pgalloc.h 620 B

1234567891011121314151617181920212223242526272829
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ASM_POWERPC_PGALLOC_H
  3. #define _ASM_POWERPC_PGALLOC_H
  4. #include <linux/mm.h>
  5. #ifndef MODULE
  6. static inline gfp_t pgtable_gfp_flags(struct mm_struct *mm, gfp_t gfp)
  7. {
  8. if (unlikely(mm == &init_mm))
  9. return gfp;
  10. return gfp | __GFP_ACCOUNT;
  11. }
  12. #else /* !MODULE */
  13. static inline gfp_t pgtable_gfp_flags(struct mm_struct *mm, gfp_t gfp)
  14. {
  15. return gfp | __GFP_ACCOUNT;
  16. }
  17. #endif /* MODULE */
  18. #define PGALLOC_GFP (GFP_KERNEL | __GFP_ZERO)
  19. #ifdef CONFIG_PPC_BOOK3S
  20. #include <asm/book3s/pgalloc.h>
  21. #else
  22. #include <asm/nohash/pgalloc.h>
  23. #endif
  24. #endif /* _ASM_POWERPC_PGALLOC_H */