xref: /openbmc/linux/arch/powerpc/include/asm/pgalloc.h (revision 8cb5d748)
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 #define PGALLOC_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO)
21 
22 #ifdef CONFIG_PPC_BOOK3S
23 #include <asm/book3s/pgalloc.h>
24 #else
25 #include <asm/nohash/pgalloc.h>
26 #endif
27 
28 #endif /* _ASM_POWERPC_PGALLOC_H */
29