Christophe Leroy | a3286f0 | 2018-02-22 15:27:22 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #ifndef _ASM_POWERPC_SLICE_H |
| 3 | #define _ASM_POWERPC_SLICE_H |
| 4 | |
| 5 | #ifdef CONFIG_PPC_BOOK3S_64 |
| 6 | #include <asm/book3s/64/slice.h> |
Christophe Leroy | 02f89ae | 2019-04-25 14:29:28 +0000 | [diff] [blame] | 7 | #elif defined(CONFIG_PPC_MMU_NOHASH_32) |
Christophe Leroy | db3a528 | 2018-02-22 15:27:24 +0100 | [diff] [blame] | 8 | #include <asm/nohash/32/slice.h> |
Christophe Leroy | a3286f0 | 2018-02-22 15:27:22 +0100 | [diff] [blame] | 9 | #endif |
| 10 | |
Christophe Leroy | badb968 | 2018-12-10 12:23:05 +0000 | [diff] [blame] | 11 | #ifndef __ASSEMBLY__ |
| 12 | |
| 13 | struct mm_struct; |
| 14 | |
Christophe Leroy | a3286f0 | 2018-02-22 15:27:22 +0100 | [diff] [blame] | 15 | #ifdef CONFIG_PPC_MM_SLICES |
| 16 | |
| 17 | #ifdef CONFIG_HUGETLB_PAGE |
| 18 | #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA |
| 19 | #endif |
| 20 | #define HAVE_ARCH_UNMAPPED_AREA |
| 21 | #define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN |
| 22 | |
Christophe Leroy | a3286f0 | 2018-02-22 15:27:22 +0100 | [diff] [blame] | 23 | unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len, |
| 24 | unsigned long flags, unsigned int psize, |
| 25 | int topdown); |
| 26 | |
| 27 | unsigned int get_slice_psize(struct mm_struct *mm, unsigned long addr); |
| 28 | |
Christophe Leroy | a3286f0 | 2018-02-22 15:27:22 +0100 | [diff] [blame] | 29 | void slice_set_range_psize(struct mm_struct *mm, unsigned long start, |
| 30 | unsigned long len, unsigned int psize); |
Nicholas Piggin | 1753dd1 | 2018-03-07 11:37:09 +1000 | [diff] [blame] | 31 | |
| 32 | void slice_init_new_context_exec(struct mm_struct *mm); |
Nicholas Piggin | 425d331 | 2018-09-15 01:30:55 +1000 | [diff] [blame] | 33 | void slice_setup_new_exec(void); |
Nicholas Piggin | 1753dd1 | 2018-03-07 11:37:09 +1000 | [diff] [blame] | 34 | |
Christophe Leroy | badb968 | 2018-12-10 12:23:05 +0000 | [diff] [blame] | 35 | #else /* CONFIG_PPC_MM_SLICES */ |
| 36 | |
| 37 | static inline void slice_init_new_context_exec(struct mm_struct *mm) {} |
Christophe Leroy | a3286f0 | 2018-02-22 15:27:22 +0100 | [diff] [blame] | 38 | |
Christophe Leroy | 43ed790 | 2019-04-25 14:29:35 +0000 | [diff] [blame] | 39 | static inline unsigned int get_slice_psize(struct mm_struct *mm, unsigned long addr) |
| 40 | { |
| 41 | return 0; |
| 42 | } |
| 43 | |
Christophe Leroy | a3286f0 | 2018-02-22 15:27:22 +0100 | [diff] [blame] | 44 | #endif /* CONFIG_PPC_MM_SLICES */ |
| 45 | |
Christophe Leroy | badb968 | 2018-12-10 12:23:05 +0000 | [diff] [blame] | 46 | #endif /* __ASSEMBLY__ */ |
| 47 | |
Christophe Leroy | a3286f0 | 2018-02-22 15:27:22 +0100 | [diff] [blame] | 48 | #endif /* _ASM_POWERPC_SLICE_H */ |