Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * arch/arm/include/asm/hugetlb-3level.h
0004  *
0005  * Copyright (C) 2012 ARM Ltd.
0006  *
0007  * Based on arch/x86/include/asm/hugetlb.h.
0008  */
0009 
0010 #ifndef _ASM_ARM_HUGETLB_3LEVEL_H
0011 #define _ASM_ARM_HUGETLB_3LEVEL_H
0012 
0013 
0014 /*
0015  * If our huge pte is non-zero then mark the valid bit.
0016  * This allows pte_present(huge_ptep_get(ptep)) to return true for non-zero
0017  * ptes.
0018  * (The valid bit is automatically cleared by set_pte_at for PROT_NONE ptes).
0019  */
0020 #define __HAVE_ARCH_HUGE_PTEP_GET
0021 static inline pte_t huge_ptep_get(pte_t *ptep)
0022 {
0023     pte_t retval = *ptep;
0024     if (pte_val(retval))
0025         pte_val(retval) |= L_PTE_VALID;
0026     return retval;
0027 }
0028 
0029 #endif /* _ASM_ARM_HUGETLB_3LEVEL_H */