blob: d795c5d5789cfddc584bd1a75c8e71e6e29155cf [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
Aneesh Kumar K.V75a9b8a2016-04-29 23:26:14 +100020#ifdef CONFIG_PPC_BOOK3S
21#include <asm/book3s/pgalloc.h>
Paul Mackerras047ea782005-11-19 20:17:32 +110022#else
Aneesh Kumar K.V75a9b8a2016-04-29 23:26:14 +100023#include <asm/nohash/pgalloc.h>
Benjamin Herrenschmidt3c726f82005-11-07 11:06:55 +110024#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
Paul Mackerras047ea782005-11-19 20:17:32 +110026#endif /* _ASM_POWERPC_PGALLOC_H */