1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <uapi/linux/const.h>
8 * PAGE_SHIFT determines the page size.
10 * Note: This definition is required because PAGE_SHIFT is used
11 * in several places throughout the codebase.
13 #define PAGE_SHIFT CONFIG_PAGE_SHIFT
15 #define PAGE_SIZE (_AC(1,UL) << CONFIG_PAGE_SHIFT)
17 #if !defined(CONFIG_64BIT)
19 * Applies only to 32-bit architectures.
21 * Subtle: (1 << CONFIG_PAGE_SHIFT) is an int, not an unsigned long.
22 * So if we assign PAGE_MASK to a larger type it gets extended the
23 * way we want (i.e. with 1s in the high bits) while masking a
24 * 64-bit value such as phys_addr_t.
26 #define PAGE_MASK (~((1 << CONFIG_PAGE_SHIFT) - 1))
28 #define PAGE_MASK (~(PAGE_SIZE - 1))
31 #endif /* __VDSO_PAGE_H */