diff options
Diffstat (limited to 'arch/tile/include/asm/page.h')
-rw-r--r-- | arch/tile/include/asm/page.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/tile/include/asm/page.h b/arch/tile/include/asm/page.h index f894a9016da6..7d90641cf18d 100644 --- a/arch/tile/include/asm/page.h +++ b/arch/tile/include/asm/page.h | |||
@@ -129,6 +129,11 @@ static inline u64 pmd_val(pmd_t pmd) | |||
129 | 129 | ||
130 | #endif | 130 | #endif |
131 | 131 | ||
132 | static inline __attribute_const__ int get_order(unsigned long size) | ||
133 | { | ||
134 | return BITS_PER_LONG - __builtin_clzl((size - 1) >> PAGE_SHIFT); | ||
135 | } | ||
136 | |||
132 | #endif /* !__ASSEMBLY__ */ | 137 | #endif /* !__ASSEMBLY__ */ |
133 | 138 | ||
134 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) | 139 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) |
@@ -332,7 +337,6 @@ extern pte_t *virt_to_pte(struct mm_struct *mm, unsigned long addr); | |||
332 | (VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) | 337 | (VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) |
333 | 338 | ||
334 | #include <asm-generic/memory_model.h> | 339 | #include <asm-generic/memory_model.h> |
335 | #include <asm-generic/getorder.h> | ||
336 | 340 | ||
337 | #endif /* __KERNEL__ */ | 341 | #endif /* __KERNEL__ */ |
338 | 342 | ||