Paul Mackerras | 047ea78 | 2005-11-19 20:17:32 +1100 | [diff] [blame] | 1 | #ifndef _ASM_POWERPC_PGALLOC_H |
| 2 | #define _ASM_POWERPC_PGALLOC_H |
| 3 | |
Kumar Gala | 0186f47 | 2008-11-19 12:50:04 +0000 | [diff] [blame] | 4 | #include <linux/mm.h> |
| 5 | |
Balbir Singh | de3b876 | 2017-05-02 15:17:04 +1000 | [diff] [blame] | 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 | |
Michael Ellerman | 5b6c133 | 2017-08-15 20:02:56 +1000 | [diff] [blame] | 20 | #define PGALLOC_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO) |
| 21 | |
Aneesh Kumar K.V | 75a9b8a | 2016-04-29 23:26:14 +1000 | [diff] [blame] | 22 | #ifdef CONFIG_PPC_BOOK3S |
| 23 | #include <asm/book3s/pgalloc.h> |
Paul Mackerras | 047ea78 | 2005-11-19 20:17:32 +1100 | [diff] [blame] | 24 | #else |
Aneesh Kumar K.V | 75a9b8a | 2016-04-29 23:26:14 +1000 | [diff] [blame] | 25 | #include <asm/nohash/pgalloc.h> |
Benjamin Herrenschmidt | 3c726f8 | 2005-11-07 11:06:55 +1100 | [diff] [blame] | 26 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | |
Paul Mackerras | 047ea78 | 2005-11-19 20:17:32 +1100 | [diff] [blame] | 28 | #endif /* _ASM_POWERPC_PGALLOC_H */ |