blob: 0bdd9c62eca0d07a40123b6fd072fb6154e794be [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001/* 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>
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00007#endif
8
David Brazdil0f672f62019-12-10 10:32:29 +00009#ifndef __ASSEMBLY__
10
11struct mm_struct;
12
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000013#ifdef CONFIG_PPC_MM_SLICES
14
15#ifdef CONFIG_HUGETLB_PAGE
16#define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
17#endif
18#define HAVE_ARCH_UNMAPPED_AREA
19#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
20
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000021unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len,
22 unsigned long flags, unsigned int psize,
23 int topdown);
24
25unsigned int get_slice_psize(struct mm_struct *mm, unsigned long addr);
26
27void slice_set_range_psize(struct mm_struct *mm, unsigned long start,
28 unsigned long len, unsigned int psize);
29
30void slice_init_new_context_exec(struct mm_struct *mm);
David Brazdil0f672f62019-12-10 10:32:29 +000031void slice_setup_new_exec(void);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000032
David Brazdil0f672f62019-12-10 10:32:29 +000033#else /* CONFIG_PPC_MM_SLICES */
34
35static inline void slice_init_new_context_exec(struct mm_struct *mm) {}
36
37static inline unsigned int get_slice_psize(struct mm_struct *mm, unsigned long addr)
38{
39 return 0;
40}
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000041
42#endif /* CONFIG_PPC_MM_SLICES */
43
David Brazdil0f672f62019-12-10 10:32:29 +000044#endif /* __ASSEMBLY__ */
45
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000046#endif /* _ASM_POWERPC_SLICE_H */