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

TOMOYO Linux Cross Reference
Linux/arch/powerpc/include/asm/pgtable-types.h

Version: ~ [ linux-5.11 ] ~ [ linux-5.10.17 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.99 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.176 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.221 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.257 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.257 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ 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.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _ASM_POWERPC_PGTABLE_TYPES_H
  3 #define _ASM_POWERPC_PGTABLE_TYPES_H
  4 
  5 /* PTE level */
  6 #if defined(CONFIG_PPC_8xx) && defined(CONFIG_PPC_16K_PAGES)
  7 typedef struct { pte_basic_t pte, pte1, pte2, pte3; } pte_t;
  8 #else
  9 typedef struct { pte_basic_t pte; } pte_t;
 10 #endif
 11 #define __pte(x)        ((pte_t) { (x) })
 12 static inline pte_basic_t pte_val(pte_t x)
 13 {
 14         return x.pte;
 15 }
 16 
 17 /* PMD level */
 18 #ifdef CONFIG_PPC64
 19 typedef struct { unsigned long pmd; } pmd_t;
 20 #define __pmd(x)        ((pmd_t) { (x) })
 21 static inline unsigned long pmd_val(pmd_t x)
 22 {
 23         return x.pmd;
 24 }
 25 
 26 /* 64 bit always use 4 level table. */
 27 typedef struct { unsigned long pud; } pud_t;
 28 #define __pud(x)        ((pud_t) { (x) })
 29 static inline unsigned long pud_val(pud_t x)
 30 {
 31         return x.pud;
 32 }
 33 #endif /* CONFIG_PPC64 */
 34 
 35 /* PGD level */
 36 typedef struct { unsigned long pgd; } pgd_t;
 37 #define __pgd(x)        ((pgd_t) { (x) })
 38 static inline unsigned long pgd_val(pgd_t x)
 39 {
 40         return x.pgd;
 41 }
 42 
 43 /* Page protection bits */
 44 typedef struct { unsigned long pgprot; } pgprot_t;
 45 #define pgprot_val(x)   ((x).pgprot)
 46 #define __pgprot(x)     ((pgprot_t) { (x) })
 47 
 48 /*
 49  * With hash config 64k pages additionally define a bigger "real PTE" type that
 50  * gathers the "second half" part of the PTE for pseudo 64k pages
 51  */
 52 #ifdef CONFIG_PPC_64K_PAGES
 53 typedef struct { pte_t pte; unsigned long hidx; } real_pte_t;
 54 #else
 55 typedef struct { pte_t pte; } real_pte_t;
 56 #endif
 57 
 58 #ifdef CONFIG_PPC_BOOK3S_64
 59 #include <asm/cmpxchg.h>
 60 
 61 static inline bool pte_xchg(pte_t *ptep, pte_t old, pte_t new)
 62 {
 63         unsigned long *p = (unsigned long *)ptep;
 64 
 65         /* See comment in switch_mm_irqs_off() */
 66         return pte_val(old) == __cmpxchg_u64(p, pte_val(old), pte_val(new));
 67 }
 68 #endif
 69 
 70 typedef struct { unsigned long pd; } hugepd_t;
 71 #define __hugepd(x) ((hugepd_t) { (x) })
 72 static inline unsigned long hpd_val(hugepd_t x)
 73 {
 74         return x.pd;
 75 }
 76 
 77 #endif /* _ASM_POWERPC_PGTABLE_TYPES_H */
 78 

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp