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

TOMOYO Linux Cross Reference
Linux/arch/powerpc/include/asm/nohash/32/hugetlb-8xx.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 */
  2 #ifndef _ASM_POWERPC_NOHASH_32_HUGETLB_8XX_H
  3 #define _ASM_POWERPC_NOHASH_32_HUGETLB_8XX_H
  4 
  5 #define PAGE_SHIFT_8M           23
  6 
  7 static inline void flush_hugetlb_page(struct vm_area_struct *vma,
  8                                       unsigned long vmaddr)
  9 {
 10         flush_tlb_page(vma, vmaddr);
 11 }
 12 
 13 static inline int check_and_get_huge_psize(int shift)
 14 {
 15         return shift_to_mmu_psize(shift);
 16 }
 17 
 18 #define __HAVE_ARCH_HUGE_SET_HUGE_PTE_AT
 19 void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep,
 20                      pte_t pte, unsigned long sz);
 21 
 22 #define __HAVE_ARCH_HUGE_PTEP_GET
 23 static inline pte_t huge_ptep_get(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
 24 {
 25         if (ptep_is_8m_pmdp(mm, addr, ptep))
 26                 ptep = pte_offset_kernel((pmd_t *)ptep, ALIGN_DOWN(addr, SZ_8M));
 27         return ptep_get(ptep);
 28 }
 29 
 30 #define __HAVE_ARCH_HUGE_PTE_CLEAR
 31 static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr,
 32                                   pte_t *ptep, unsigned long sz)
 33 {
 34         pte_update(mm, addr, ptep, ~0UL, 0, 1);
 35 }
 36 
 37 #define __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT
 38 static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
 39                                            unsigned long addr, pte_t *ptep)
 40 {
 41         unsigned long clr = ~pte_val(pte_wrprotect(__pte(~0)));
 42         unsigned long set = pte_val(pte_wrprotect(__pte(0)));
 43 
 44         pte_update(mm, addr, ptep, clr, set, 1);
 45 }
 46 
 47 #ifdef CONFIG_PPC_4K_PAGES
 48 static inline pte_t arch_make_huge_pte(pte_t entry, unsigned int shift, vm_flags_t flags)
 49 {
 50         size_t size = 1UL << shift;
 51 
 52         if (size == SZ_16K)
 53                 return __pte(pte_val(entry) | _PAGE_SPS);
 54         else
 55                 return __pte(pte_val(entry) | _PAGE_SPS | _PAGE_HUGE);
 56 }
 57 #define arch_make_huge_pte arch_make_huge_pte
 58 #endif
 59 
 60 #endif /* _ASM_POWERPC_NOHASH_32_HUGETLB_8XX_H */
 61 

~ [ 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