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

TOMOYO Linux Cross Reference
Linux/include/asm-generic/pgtable-nopmd.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ 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 _PGTABLE_NOPMD_H
  3 #define _PGTABLE_NOPMD_H
  4 
  5 #ifndef __ASSEMBLY__
  6 
  7 #include <asm-generic/pgtable-nopud.h>
  8 
  9 struct mm_struct;
 10 
 11 #define __PAGETABLE_PMD_FOLDED 1
 12 
 13 /*
 14  * Having the pmd type consist of a pud gets the size right, and allows
 15  * us to conceptually access the pud entry that this pmd is folded into
 16  * without casting.
 17  */
 18 typedef struct { pud_t pud; } pmd_t;
 19 
 20 #define PMD_SHIFT       PUD_SHIFT
 21 #define PTRS_PER_PMD    1
 22 #define PMD_SIZE        (1UL << PMD_SHIFT)
 23 #define PMD_MASK        (~(PMD_SIZE-1))
 24 
 25 /*
 26  * The "pud_xxx()" functions here are trivial for a folded two-level
 27  * setup: the pmd is never bad, and a pmd always exists (as it's folded
 28  * into the pud entry)
 29  */
 30 static inline int pud_none(pud_t pud)           { return 0; }
 31 static inline int pud_bad(pud_t pud)            { return 0; }
 32 static inline int pud_present(pud_t pud)        { return 1; }
 33 static inline int pud_user(pud_t pud)           { return 0; }
 34 static inline int pud_leaf(pud_t pud)           { return 0; }
 35 static inline void pud_clear(pud_t *pud)        { }
 36 #define pmd_ERROR(pmd)                          (pud_ERROR((pmd).pud))
 37 
 38 #define pud_populate(mm, pmd, pte)              do { } while (0)
 39 
 40 /*
 41  * (pmds are folded into puds so this doesn't get actually called,
 42  * but the define is needed for a generic inline function.)
 43  */
 44 #define set_pud(pudptr, pudval)                 set_pmd((pmd_t *)(pudptr), (pmd_t) { pudval })
 45 
 46 static inline pmd_t * pmd_offset(pud_t * pud, unsigned long address)
 47 {
 48         return (pmd_t *)pud;
 49 }
 50 #define pmd_offset pmd_offset
 51 
 52 #define pmd_val(x)                              (pud_val((x).pud))
 53 #define __pmd(x)                                ((pmd_t) { __pud(x) } )
 54 
 55 #define pud_page(pud)                           (pmd_page((pmd_t){ pud }))
 56 #define pud_pgtable(pud)                        ((pmd_t *)(pmd_page_vaddr((pmd_t){ pud })))
 57 
 58 /*
 59  * allocating and freeing a pmd is trivial: the 1-entry pmd is
 60  * inside the pud, so has no extra memory associated with it.
 61  */
 62 #define pmd_alloc_one(mm, address)              NULL
 63 static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
 64 {
 65 }
 66 #define pmd_free_tlb(tlb, x, a)         do { } while (0)
 67 
 68 #undef  pmd_addr_end
 69 #define pmd_addr_end(addr, end)                 (end)
 70 
 71 #endif /* __ASSEMBLY__ */
 72 
 73 #endif /* _PGTABLE_NOPMD_H */
 74 

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