ARC: add hugetlb definitions
authorPavel Kozlov <pavel.kozlov@synopsys.com>
Wed, 13 Dec 2023 15:07:10 +0000 (19:07 +0400)
committerVineet Gupta <vgupta@kernel.org>
Thu, 14 Dec 2023 03:33:10 +0000 (19:33 -0800)
Add hugetlb definitions if THP enabled. ARC doesn't support
HugeTLB FS but it supports THP. Some kernel code such as pagemap
uses hugetlb definitions with THP.

This patch fixes ARC build issue (HPAGE_SIZE undeclared error) with
TRANSPARENT_HUGEPAGE enabled.

Signed-off-by: Pavel Kozlov <pavel.kozlov@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@kernel.org>
arch/arc/include/asm/hugepage.h

index ef8d416..8a24416 100644 (file)
 #include <linux/types.h>
 #include <asm-generic/pgtable-nopmd.h>
 
+/*
+ * Hugetlb definitions.
+ */
+#define HPAGE_SHIFT            PMD_SHIFT
+#define HPAGE_SIZE             (_AC(1, UL) << HPAGE_SHIFT)
+#define HPAGE_MASK             (~(HPAGE_SIZE - 1))
+
 static inline pte_t pmd_pte(pmd_t pmd)
 {
        return __pte(pmd_val(pmd));