1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_POWERPC_BOOK3S_64_SLICE_H
3 #define _ASM_POWERPC_BOOK3S_64_SLICE_H
5 #ifdef CONFIG_PPC_MM_SLICES
7 #define SLICE_LOW_SHIFT 28
8 #define SLICE_LOW_TOP (0x100000000ul)
9 #define SLICE_NUM_LOW (SLICE_LOW_TOP >> SLICE_LOW_SHIFT)
10 #define GET_LOW_SLICE_INDEX(addr) ((addr) >> SLICE_LOW_SHIFT)
12 #define SLICE_HIGH_SHIFT 40
13 #define SLICE_NUM_HIGH (H_PGTABLE_RANGE >> SLICE_HIGH_SHIFT)
14 #define GET_HIGH_SLICE_INDEX(addr) ((addr) >> SLICE_HIGH_SHIFT)
16 #else /* CONFIG_PPC_MM_SLICES */
18 #define get_slice_psize(mm, addr) ((mm)->context.user_psize)
19 #define slice_set_user_psize(mm, psize) \
21 (mm)->context.user_psize = (psize); \
22 (mm)->context.sllp = SLB_VSID_USER | mmu_psize_defs[(psize)].sllp; \
25 #endif /* CONFIG_PPC_MM_SLICES */
27 #endif /* _ASM_POWERPC_BOOK3S_64_SLICE_H */