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

TOMOYO Linux Cross Reference
Linux/include/asm-generic/pgtable-nop4d.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 _PGTABLE_NOP4D_H
  3 #define _PGTABLE_NOP4D_H
  4 
  5 #ifndef __ASSEMBLY__
  6 
  7 #define __PAGETABLE_P4D_FOLDED 1
  8 
  9 typedef struct { pgd_t pgd; } p4d_t;
 10 
 11 #define P4D_SHIFT               PGDIR_SHIFT
 12 #define PTRS_PER_P4D            1
 13 #define P4D_SIZE                (1UL << P4D_SHIFT)
 14 #define P4D_MASK                (~(P4D_SIZE-1))
 15 
 16 /*
 17  * The "pgd_xxx()" functions here are trivial for a folded two-level
 18  * setup: the p4d is never bad, and a p4d always exists (as it's folded
 19  * into the pgd entry)
 20  */
 21 static inline int pgd_none(pgd_t pgd)           { return 0; }
 22 static inline int pgd_bad(pgd_t pgd)            { return 0; }
 23 static inline int pgd_present(pgd_t pgd)        { return 1; }
 24 static inline void pgd_clear(pgd_t *pgd)        { }
 25 #define p4d_ERROR(p4d)                          (pgd_ERROR((p4d).pgd))
 26 
 27 #define pgd_populate(mm, pgd, p4d)              do { } while (0)
 28 #define pgd_populate_safe(mm, pgd, p4d)         do { } while (0)
 29 /*
 30  * (p4ds are folded into pgds so this doesn't get actually called,
 31  * but the define is needed for a generic inline function.)
 32  */
 33 #define set_pgd(pgdptr, pgdval) set_p4d((p4d_t *)(pgdptr), (p4d_t) { pgdval })
 34 
 35 static inline p4d_t *p4d_offset(pgd_t *pgd, unsigned long address)
 36 {
 37         return (p4d_t *)pgd;
 38 }
 39 
 40 #define p4d_val(x)                              (pgd_val((x).pgd))
 41 #define __p4d(x)                                ((p4d_t) { __pgd(x) })
 42 
 43 #define pgd_page(pgd)                           (p4d_page((p4d_t){ pgd }))
 44 #define pgd_page_vaddr(pgd)                     ((unsigned long)(p4d_pgtable((p4d_t){ pgd })))
 45 
 46 /*
 47  * allocating and freeing a p4d is trivial: the 1-entry p4d is
 48  * inside the pgd, so has no extra memory associated with it.
 49  */
 50 #define p4d_alloc_one(mm, address)              NULL
 51 #define p4d_free(mm, x)                         do { } while (0)
 52 #define p4d_free_tlb(tlb, x, a)                 do { } while (0)
 53 
 54 #undef  p4d_addr_end
 55 #define p4d_addr_end(addr, end)                 (end)
 56 
 57 #endif /* __ASSEMBLY__ */
 58 #endif /* _PGTABLE_NOP4D_H */
 59 

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