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

TOMOYO Linux Cross Reference
Linux/arch/m32r/include/asm/pgtable-2level.h

Version: ~ [ linux-5.4-rc3 ] ~ [ linux-5.3.6 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.79 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.149 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.196 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.196 ] ~ [ 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.75 ] ~ [ 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-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ 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 #ifndef _ASM_M32R_PGTABLE_2LEVEL_H
  2 #define _ASM_M32R_PGTABLE_2LEVEL_H
  3 #ifdef __KERNEL__
  4 
  5 /*
  6  * traditional M32R two-level paging structure:
  7  */
  8 
  9 #define PGDIR_SHIFT     22
 10 #define PTRS_PER_PGD    1024
 11 
 12 /*
 13  * the M32R is two-level, so we don't really have any
 14  * PMD directory physically.
 15  */
 16 #define __PAGETABLE_PMD_FOLDED
 17 #define PMD_SHIFT       22
 18 #define PTRS_PER_PMD    1
 19 
 20 #define PTRS_PER_PTE    1024
 21 
 22 #define pte_ERROR(e) \
 23         printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
 24 #define pmd_ERROR(e) \
 25         printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))
 26 #define pgd_ERROR(e) \
 27         printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
 28 
 29 /*
 30  * The "pgd_xxx()" functions here are trivial for a folded two-level
 31  * setup: the pgd is never bad, and a pmd always exists (as it's folded
 32  * into the pgd entry)
 33  */
 34 static inline int pgd_none(pgd_t pgd)   { return 0; }
 35 static inline int pgd_bad(pgd_t pgd)    { return 0; }
 36 static inline int pgd_present(pgd_t pgd)        { return 1; }
 37 #define pgd_clear(xp)                           do { } while (0)
 38 
 39 /*
 40  * Certain architectures need to do special things when PTEs
 41  * within a page table are directly modified.  Thus, the following
 42  * hook is made available.
 43  */
 44 #define set_pte(pteptr, pteval) (*(pteptr) = pteval)
 45 #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
 46 
 47 /*
 48  * (pmds are folded into pgds so this doesn't get actually called,
 49  * but the define is needed for a generic inline function.)
 50  */
 51 #define set_pmd(pmdptr, pmdval) (*(pmdptr) = pmdval)
 52 #define set_pgd(pgdptr, pgdval) (*(pgdptr) = pgdval)
 53 
 54 #define pgd_page_vaddr(pgd) \
 55 ((unsigned long) __va(pgd_val(pgd) & PAGE_MASK))
 56 
 57 #ifndef CONFIG_DISCONTIGMEM
 58 #define pgd_page(pgd)   (mem_map + ((pgd_val(pgd) >> PAGE_SHIFT) - PFN_BASE))
 59 #endif /* !CONFIG_DISCONTIGMEM */
 60 
 61 static inline pmd_t *pmd_offset(pgd_t * dir, unsigned long address)
 62 {
 63         return (pmd_t *) dir;
 64 }
 65 
 66 #define ptep_get_and_clear(mm,addr,xp)  __pte(xchg(&(xp)->pte, 0))
 67 #define pte_same(a, b)          (pte_val(a) == pte_val(b))
 68 #define pte_page(x)             pfn_to_page(pte_pfn(x))
 69 #define pte_none(x)             (!pte_val(x))
 70 #define pte_pfn(x)              (pte_val(x) >> PAGE_SHIFT)
 71 #define pfn_pte(pfn, prot)      __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
 72 #define pfn_pmd(pfn, prot)      __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
 73 
 74 #endif /* __KERNEL__ */
 75 #endif /* _ASM_M32R_PGTABLE_2LEVEL_H */
 76 

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