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-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  * Copyright (C) 2013-15 Synopsys, Inc. (www.synopsys.com)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) #ifndef _ASM_ARC_HUGEPAGE_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) #define _ASM_ARC_HUGEPAGE_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <asm-generic/pgtable-nopmd.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) static inline pte_t pmd_pte(pmd_t pmd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) 	return __pte(pmd_val(pmd));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) static inline pmd_t pte_pmd(pte_t pte)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) 	return __pmd(pte_val(pte));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #define pmd_wrprotect(pmd)	pte_pmd(pte_wrprotect(pmd_pte(pmd)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define pmd_mkwrite(pmd)	pte_pmd(pte_mkwrite(pmd_pte(pmd)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #define pmd_mkdirty(pmd)	pte_pmd(pte_mkdirty(pmd_pte(pmd)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #define pmd_mkold(pmd)		pte_pmd(pte_mkold(pmd_pte(pmd)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #define pmd_mkyoung(pmd)	pte_pmd(pte_mkyoung(pmd_pte(pmd)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #define pmd_mkhuge(pmd)		pte_pmd(pte_mkhuge(pmd_pte(pmd)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #define pmd_mkinvalid(pmd)	pte_pmd(pte_mknotpresent(pmd_pte(pmd)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #define pmd_mkclean(pmd)	pte_pmd(pte_mkclean(pmd_pte(pmd)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #define pmd_write(pmd)		pte_write(pmd_pte(pmd))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #define pmd_young(pmd)		pte_young(pmd_pte(pmd))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) #define pmd_pfn(pmd)		pte_pfn(pmd_pte(pmd))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #define pmd_dirty(pmd)		pte_dirty(pmd_pte(pmd))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #define mk_pmd(page, prot)	pte_pmd(mk_pte(page, prot))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) #define pmd_trans_huge(pmd)	(pmd_val(pmd) & _PAGE_HW_SZ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #define pfn_pmd(pfn, prot)	(__pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)         /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)          * open-coded pte_modify() with additional retaining of HW_SZ bit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)          * so that pmd_trans_huge() remains true for this PMD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)          */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)         return __pmd((pmd_val(pmd) & (_PAGE_CHG_MASK | _PAGE_HW_SZ)) | pgprot_val(newprot));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 			      pmd_t *pmdp, pmd_t pmd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) 	*pmdp = pmd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) extern void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) 				 pmd_t *pmd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) /* Generic variants assume pgtable_t is struct page *, hence need for these */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) #define __HAVE_ARCH_PGTABLE_DEPOSIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) extern void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) 				       pgtable_t pgtable);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) #define __HAVE_ARCH_PGTABLE_WITHDRAW
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) extern pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) #define __HAVE_ARCH_FLUSH_PMD_TLB_RANGE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) extern void flush_pmd_tlb_range(struct vm_area_struct *vma, unsigned long start,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) 				unsigned long end);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) /* We don't have hardware dirty/accessed bits, generic_pmdp_establish is fine.*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) #define pmdp_establish generic_pmdp_establish
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) #endif