mirror of
https://github.com/torvalds/linux.git
synced 2026-05-05 23:05:25 -04:00
In preparation for the following patch which will fix an issue on the 8xx by re-using the 'slices', this patch enhances the 'slices' implementation to support 32 bits CPUs. On PPC32, the address space is limited to 4Gbytes, hence only the low slices will be used. The high slices use bitmaps. As bitmap functions are not prepared to handle bitmaps of size 0, this patch ensures that bitmap functions are called only when SLICE_NUM_HIGH is not nul. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
19 lines
517 B
C
19 lines
517 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _ASM_POWERPC_NOHASH_32_SLICE_H
|
|
#define _ASM_POWERPC_NOHASH_32_SLICE_H
|
|
|
|
#ifdef CONFIG_PPC_MM_SLICES
|
|
|
|
#define SLICE_LOW_SHIFT 28
|
|
#define SLICE_LOW_TOP (0x100000000ull)
|
|
#define SLICE_NUM_LOW (SLICE_LOW_TOP >> SLICE_LOW_SHIFT)
|
|
#define GET_LOW_SLICE_INDEX(addr) ((addr) >> SLICE_LOW_SHIFT)
|
|
|
|
#define SLICE_HIGH_SHIFT 0
|
|
#define SLICE_NUM_HIGH 0ul
|
|
#define GET_HIGH_SLICE_INDEX(addr) (addr & 0)
|
|
|
|
#endif /* CONFIG_PPC_MM_SLICES */
|
|
|
|
#endif /* _ASM_POWERPC_NOHASH_32_SLICE_H */
|