blob: e11f03007b5753dfd75753651c22f27d56559957 [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _ASM_POWERPC_PGALLOC_H
3#define _ASM_POWERPC_PGALLOC_H
4
5#include <linux/mm.h>
6
7#ifndef MODULE
8static inline gfp_t pgtable_gfp_flags(struct mm_struct *mm, gfp_t gfp)
9{
10 if (unlikely(mm == &init_mm))
11 return gfp;
12 return gfp | __GFP_ACCOUNT;
13}
14#else /* !MODULE */
15static inline gfp_t pgtable_gfp_flags(struct mm_struct *mm, gfp_t gfp)
16{
17 return gfp | __GFP_ACCOUNT;
18}
19#endif /* MODULE */
20
21#define PGALLOC_GFP (GFP_KERNEL | __GFP_ZERO)
22
23#ifdef CONFIG_PPC_BOOK3S
24#include <asm/book3s/pgalloc.h>
25#else
26#include <asm/nohash/pgalloc.h>
27#endif
28
29#endif /* _ASM_POWERPC_PGALLOC_H */