From c64a15a5956a6dbcd4f10dc78ff97f7aa3edc736 Mon Sep 17 00:00:00 2001 From: Kalesh Singh Date: Wed, 31 Jul 2024 20:45:07 -0700 Subject: [PATCH] ANDROID: 16K: Introduce __MAX_PAGE_SIZE macros For some cases, such as the vDSO layout, the page alignment needs to be know at build time. Introduce __MAX_PAGE_SIZE and friends for use in such scenarios. Bug: 383389337 Bug: 356729201 Change-Id: I216568384efb147c868278318718703099e12e1c Signed-off-by: Kalesh Singh --- include/linux/page_size_compat.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linux/page_size_compat.h b/include/linux/page_size_compat.h index 944a708fc0ec..7c6f5bd05b7f 100644 --- a/include/linux/page_size_compat.h +++ b/include/linux/page_size_compat.h @@ -22,6 +22,12 @@ #include +#define __MAX_PAGE_SHIFT 14 +#define __MAX_PAGE_SIZE (_AC(1,UL) << __MAX_PAGE_SHIFT) +#define __MAX_PAGE_MASK (~(__MAX_PAGE_SIZE-1)) + +#ifndef __ASSEMBLY__ + #include #include #include @@ -143,4 +149,6 @@ static __always_inline void __filemap_fixup(unsigned long addr, unsigned long pr ___filemap_fixup(addr, prot, old_len, new_len); } +#endif /* !__ASSEMBLY__ */ + #endif /* __LINUX_PAGE_SIZE_COMPAT_H */