Merge tag 'uml-for-linus-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / include / vdso / page.h
blobbc47186c07fc9c97c6a8286256dd7e4b3b923c8f
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __VDSO_PAGE_H
3 #define __VDSO_PAGE_H
5 #include <uapi/linux/const.h>
7 /*
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))
27 #else
28 #define PAGE_MASK (~(PAGE_SIZE - 1))
29 #endif
31 #endif /* __VDSO_PAGE_H */