~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arc/include/asm/hugepage.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

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

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php