pgtable: add pmd_index() fallback sandbox/dwlee08/v5.4-tizen-mg-lru
authorMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 18 Jan 2024 14:41:31 +0000 (15:41 +0100)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 18 Jan 2024 14:41:57 +0000 (15:41 +0100)
It is needed for ARM 32bit non-LPAE builds.

Change-Id: Ic38faf98600a7f9cb46142c1bd39649df3b14692
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
include/asm-generic/pgtable.h

index e5d4e2b..1925c06 100644 (file)
@@ -1220,6 +1220,14 @@ static inline bool arch_has_pfn_modify_check(void)
 #define pmd_leaf(x)    0
 #endif
 
+#ifndef pmd_index
+static inline unsigned long pmd_index(unsigned long address)
+{
+       return (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1);
+}
+#define pmd_index pmd_index
+#endif
+
 #ifndef pud_index
 static inline unsigned long pud_index(unsigned long address)
 {