Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #ifndef _ASM_SH_HUGETLB_H |
| 3 | #define _ASM_SH_HUGETLB_H |
| 4 | |
| 5 | #include <asm/cacheflush.h> |
| 6 | #include <asm/page.h> |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 7 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 8 | /* |
| 9 | * If the arch doesn't supply something else, assume that hugepage |
| 10 | * size aligned regions are ok without further preparation. |
| 11 | */ |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 12 | #define __HAVE_ARCH_PREPARE_HUGEPAGE_RANGE |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 13 | static inline int prepare_hugepage_range(struct file *file, |
| 14 | unsigned long addr, unsigned long len) |
| 15 | { |
| 16 | if (len & ~HPAGE_MASK) |
| 17 | return -EINVAL; |
| 18 | if (addr & ~HPAGE_MASK) |
| 19 | return -EINVAL; |
| 20 | return 0; |
| 21 | } |
| 22 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 23 | #define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 24 | static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, |
| 25 | unsigned long addr, pte_t *ptep) |
| 26 | { |
| 27 | } |
| 28 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 29 | static inline void arch_clear_hugepage_flags(struct page *page) |
| 30 | { |
| 31 | clear_bit(PG_dcache_clean, &page->flags); |
| 32 | } |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 33 | #define arch_clear_hugepage_flags arch_clear_hugepage_flags |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 34 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 35 | #include <asm-generic/hugetlb.h> |
| 36 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 37 | #endif /* _ASM_SH_HUGETLB_H */ |