blob: 45ae1212ab8a965cf057062677f6ea429188bd55 [file] [log] [blame]
Paul Mackerras047ea782005-11-19 20:17:32 +11001#ifndef _ASM_POWERPC_PGALLOC_H
2#define _ASM_POWERPC_PGALLOC_H
3
Kumar Gala0186f472008-11-19 12:50:04 +00004#include <linux/mm.h>
5
Balbir Singhde3b8762017-05-02 15:17:04 +10006#ifndef MODULE
7static 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 */
14static inline gfp_t pgtable_gfp_flags(struct mm_struct *mm, gfp_t gfp)
15{
16 return gfp | __GFP_ACCOUNT;
17}
18#endif /* MODULE */
19
Michael Ellerman5b6c1332017-08-15 20:02:56 +100020#define PGALLOC_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO)
21
Aneesh Kumar K.V75a9b8a2016-04-29 23:26:14 +100022#ifdef CONFIG_PPC_BOOK3S
23#include <asm/book3s/pgalloc.h>
Paul Mackerras047ea782005-11-19 20:17:32 +110024#else
Aneesh Kumar K.V75a9b8a2016-04-29 23:26:14 +100025#include <asm/nohash/pgalloc.h>
Benjamin Herrenschmidt3c726f82005-11-07 11:06:55 +110026#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070027
Paul Mackerras047ea782005-11-19 20:17:32 +110028#endif /* _ASM_POWERPC_PGALLOC_H */