Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) #ifndef _ASM_SPARC64_HUGETLB_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3) #define _ASM_SPARC64_HUGETLB_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5) #include <asm/page.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) #ifdef CONFIG_HUGETLB_PAGE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) struct pud_huge_patch_entry {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) 	unsigned int addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) 	unsigned int insn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) extern struct pud_huge_patch_entry __pud_huge_patch, __pud_huge_patch_end;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #define __HAVE_ARCH_HUGE_SET_HUGE_PTE_AT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) 		     pte_t *ptep, pte_t pte);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) 			      pte_t *ptep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 					 unsigned long addr, pte_t *ptep)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #define __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 					   unsigned long addr, pte_t *ptep)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 	pte_t old_pte = *ptep;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 	set_huge_pte_at(mm, addr, ptep, pte_wrprotect(old_pte));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #define __HAVE_ARCH_HUGE_PTEP_SET_ACCESS_FLAGS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) 					     unsigned long addr, pte_t *ptep,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) 					     pte_t pte, int dirty)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) 	int changed = !pte_same(*ptep, pte);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) 	if (changed) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) 		set_huge_pte_at(vma->vm_mm, addr, ptep, pte);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) 		flush_tlb_page(vma, addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) 	return changed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) #define __HAVE_ARCH_HUGETLB_FREE_PGD_RANGE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 			    unsigned long end, unsigned long floor,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 			    unsigned long ceiling);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) #include <asm-generic/hugetlb.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #endif /* _ASM_SPARC64_HUGETLB_H */