xref: /linux/arch/powerpc/include/asm/pgalloc.h (revision e558bdc21ae1f0db520eccd84015e17d8a589973)
1 #ifndef _ASM_POWERPC_PGALLOC_H
2 #define _ASM_POWERPC_PGALLOC_H
3 
4 #include <linux/mm.h>
5 
6 #ifndef MODULE
7 static inline gfp_t pgtable_gfp_flags(struct mm_struct *mm, gfp_t gfp)
8 {
9 	if (unlikely(mm == &init_mm))
10 		return gfp;
11 	return gfp | __GFP_ACCOUNT;
12 }
13 #else /* !MODULE */
14 static inline gfp_t pgtable_gfp_flags(struct mm_struct *mm, gfp_t gfp)
15 {
16 	return gfp | __GFP_ACCOUNT;
17 }
18 #endif /* MODULE */
19 
20 #ifdef CONFIG_PPC_BOOK3S
21 #include <asm/book3s/pgalloc.h>
22 #else
23 #include <asm/nohash/pgalloc.h>
24 #endif
25 
26 #endif /* _ASM_POWERPC_PGALLOC_H */
27