Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
pgtable.h File Reference
#include <asm/cpu-regs.h>
#include <asm/processor.h>
#include <asm/cache.h>
#include <linux/threads.h>
#include <asm/bitops.h>
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/spinlock.h>
#include <asm-generic/pgtable.h>

Go to the source code of this file.

Macros

#define ZERO_PAGE(vaddr)   (virt_to_page(empty_zero_page))
 
#define PGDIR_SHIFT   22
 
#define PTRS_PER_PGD   1024
 
#define PTRS_PER_PUD   1 /* we don't really have any PUD physically */
 
#define PTRS_PER_PMD   1 /* we don't really have any PMD physically */
 
#define PTRS_PER_PTE   1024
 
#define PGD_SIZE   PAGE_SIZE
 
#define PMD_SIZE   (1UL << PMD_SHIFT)
 
#define PGDIR_SIZE   (1UL << PGDIR_SHIFT)
 
#define PGDIR_MASK   (~(PGDIR_SIZE - 1))
 
#define USER_PTRS_PER_PGD   (TASK_SIZE / PGDIR_SIZE)
 
#define FIRST_USER_ADDRESS   0
 
#define USER_PGD_PTRS   (PAGE_OFFSET >> PGDIR_SHIFT)
 
#define KERNEL_PGD_PTRS   (PTRS_PER_PGD - USER_PGD_PTRS)
 
#define TWOLEVEL_PGDIR_SHIFT   22
 
#define BOOT_USER_PGD_PTRS   (__PAGE_OFFSET >> TWOLEVEL_PGDIR_SHIFT)
 
#define BOOT_KERNEL_PGD_PTRS   (1024 - BOOT_USER_PGD_PTRS)
 
#define VMALLOC_OFFSET   (8UL * 1024 * 1024)
 
#define VMALLOC_START   (0x70000000UL)
 
#define VMALLOC_END   (0x7C000000UL)
 
#define _PAGE_BIT_VALID   xPTEL2_V_BIT
 
#define _PAGE_BIT_CACHE   xPTEL2_C_BIT
 
#define _PAGE_BIT_PRESENT   xPTEL2_PV_BIT
 
#define _PAGE_BIT_DIRTY   xPTEL2_D_BIT
 
#define _PAGE_BIT_GLOBAL   xPTEL2_G_BIT
 
#define _PAGE_BIT_ACCESSED   xPTEL2_UNUSED1_BIT /* mustn't be loaded into IPTEL2/DPTEL2 */
 
#define _PAGE_VALID   xPTEL2_V
 
#define _PAGE_CACHE   xPTEL2_C
 
#define _PAGE_PRESENT   xPTEL2_PV
 
#define _PAGE_DIRTY   xPTEL2_D
 
#define _PAGE_PROT   xPTEL2_PR
 
#define _PAGE_PROT_RKNU   xPTEL2_PR_ROK
 
#define _PAGE_PROT_WKNU   xPTEL2_PR_RWK
 
#define _PAGE_PROT_RKRU   xPTEL2_PR_ROK_ROU
 
#define _PAGE_PROT_WKRU   xPTEL2_PR_RWK_ROU
 
#define _PAGE_PROT_WKWU   xPTEL2_PR_RWK_RWU
 
#define _PAGE_GLOBAL   xPTEL2_G
 
#define _PAGE_PS_MASK   xPTEL2_PS
 
#define _PAGE_PS_4Kb   xPTEL2_PS_4Kb
 
#define _PAGE_PS_128Kb   xPTEL2_PS_128Kb
 
#define _PAGE_PS_1Kb   xPTEL2_PS_1Kb
 
#define _PAGE_PS_4Mb   xPTEL2_PS_4Mb
 
#define _PAGE_PSE   xPTEL2_PS_4Mb /* 4MB page */
 
#define _PAGE_CACHE_WT   xPTEL2_CWT
 
#define _PAGE_ACCESSED   xPTEL2_UNUSED1
 
#define _PAGE_NX   0 /* no-execute bit */
 
#define _PAGE_FILE   xPTEL2_C /* set:pagecache unset:swap */
 
#define _PAGE_PROTNONE   0x000 /* If not present */
 
#define __PAGE_PROT_UWAUX   0x010
 
#define __PAGE_PROT_USER   0x020
 
#define __PAGE_PROT_WRITE   0x040
 
#define _PAGE_PRESENTV   (_PAGE_PRESENT|_PAGE_VALID)
 
#define VMALLOC_VMADDR(x)   ((unsigned long)(x))
 
#define _PAGE_TABLE   (_PAGE_PRESENTV | _PAGE_PROT_WKNU | _PAGE_ACCESSED | _PAGE_DIRTY)
 
#define _PAGE_CHG_MASK   (PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
 
#define __PAGE_NONE   (_PAGE_PRESENTV | _PAGE_PROT_RKNU | _PAGE_ACCESSED | _PAGE_CACHE)
 
#define __PAGE_SHARED   (_PAGE_PRESENTV | _PAGE_PROT_WKWU | _PAGE_ACCESSED | _PAGE_CACHE)
 
#define __PAGE_COPY   (_PAGE_PRESENTV | _PAGE_PROT_RKRU | _PAGE_ACCESSED | _PAGE_CACHE)
 
#define __PAGE_READONLY   (_PAGE_PRESENTV | _PAGE_PROT_RKRU | _PAGE_ACCESSED | _PAGE_CACHE)
 
#define PAGE_NONE   __pgprot(__PAGE_NONE | _PAGE_NX)
 
#define PAGE_SHARED_NOEXEC   __pgprot(__PAGE_SHARED | _PAGE_NX)
 
#define PAGE_COPY_NOEXEC   __pgprot(__PAGE_COPY | _PAGE_NX)
 
#define PAGE_READONLY_NOEXEC   __pgprot(__PAGE_READONLY | _PAGE_NX)
 
#define PAGE_SHARED_EXEC   __pgprot(__PAGE_SHARED)
 
#define PAGE_COPY_EXEC   __pgprot(__PAGE_COPY)
 
#define PAGE_READONLY_EXEC   __pgprot(__PAGE_READONLY)
 
#define PAGE_COPY   PAGE_COPY_NOEXEC
 
#define PAGE_READONLY   PAGE_READONLY_NOEXEC
 
#define PAGE_SHARED   PAGE_SHARED_EXEC
 
#define __PAGE_KERNEL_BASE   (_PAGE_PRESENTV | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_GLOBAL)
 
#define __PAGE_KERNEL   (__PAGE_KERNEL_BASE | _PAGE_PROT_WKNU | _PAGE_CACHE | _PAGE_NX)
 
#define __PAGE_KERNEL_NOCACHE   (__PAGE_KERNEL_BASE | _PAGE_PROT_WKNU | _PAGE_NX)
 
#define __PAGE_KERNEL_EXEC   (__PAGE_KERNEL & ~_PAGE_NX)
 
#define __PAGE_KERNEL_RO   (__PAGE_KERNEL_BASE | _PAGE_PROT_RKNU | _PAGE_CACHE | _PAGE_NX)
 
#define __PAGE_KERNEL_LARGE   (__PAGE_KERNEL | _PAGE_PSE)
 
#define __PAGE_KERNEL_LARGE_EXEC   (__PAGE_KERNEL_EXEC | _PAGE_PSE)
 
#define PAGE_KERNEL   __pgprot(__PAGE_KERNEL)
 
#define PAGE_KERNEL_RO   __pgprot(__PAGE_KERNEL_RO)
 
#define PAGE_KERNEL_EXEC   __pgprot(__PAGE_KERNEL_EXEC)
 
#define PAGE_KERNEL_NOCACHE   __pgprot(__PAGE_KERNEL_NOCACHE)
 
#define PAGE_KERNEL_LARGE   __pgprot(__PAGE_KERNEL_LARGE)
 
#define PAGE_KERNEL_LARGE_EXEC   __pgprot(__PAGE_KERNEL_LARGE_EXEC)
 
#define __PAGE_USERIO   (__PAGE_KERNEL_BASE | _PAGE_PROT_WKWU | _PAGE_NX)
 
#define PAGE_USERIO   __pgprot(__PAGE_USERIO)
 
#define __P000   PAGE_NONE
 
#define __P001   PAGE_READONLY_NOEXEC
 
#define __P010   PAGE_COPY_NOEXEC
 
#define __P011   PAGE_COPY_NOEXEC
 
#define __P100   PAGE_READONLY_EXEC
 
#define __P101   PAGE_READONLY_EXEC
 
#define __P110   PAGE_COPY_EXEC
 
#define __P111   PAGE_COPY_EXEC
 
#define __S000   PAGE_NONE
 
#define __S001   PAGE_READONLY_NOEXEC
 
#define __S010   PAGE_SHARED_NOEXEC
 
#define __S011   PAGE_SHARED_NOEXEC
 
#define __S100   PAGE_READONLY_EXEC
 
#define __S101   PAGE_READONLY_EXEC
 
#define __S110   PAGE_SHARED_EXEC
 
#define __S111   PAGE_SHARED_EXEC
 
#define pte_present(x)   (pte_val(x) & _PAGE_VALID)
 
#define pte_clear(mm, addr, xp)
 
#define pmd_none(x)   (!pmd_val(x))
 
#define pmd_present(x)   (!pmd_none(x))
 
#define pmd_clear(xp)   do { set_pmd(xp, __pmd(0)); } while (0)
 
#define pmd_bad(x)   0
 
#define pages_to_mb(x)   ((x) >> (20 - PAGE_SHIFT))
 
#define pte_ERROR(e)
 
#define pgd_ERROR(e)
 
#define pgd_clear(xp)   do { } while (0)
 
#define set_pte(pteptr, pteval)   (*(pteptr) = pteval)
 
#define set_pte_at(mm, addr, ptep, pteval)   set_pte((ptep), (pteval))
 
#define set_pte_atomic(pteptr, pteval)   set_pte((pteptr), (pteval))
 
#define set_pmd(pmdptr, pmdval)   (*(pmdptr) = pmdval)
 
#define ptep_get_and_clear(mm, addr, ptep)   __pte(xchg(&(ptep)->pte, 0))
 
#define pte_same(a, b)   (pte_val(a) == pte_val(b))
 
#define pte_page(x)   pfn_to_page(pte_pfn(x))
 
#define pte_none(x)   (!pte_val(x))
 
#define pte_pfn(x)   ((unsigned long) (pte_val(x) >> PAGE_SHIFT))
 
#define __pfn_addr(pfn)   ((pfn) << PAGE_SHIFT)
 
#define pfn_pte(pfn, prot)   __pte(__pfn_addr(pfn) | pgprot_val(prot))
 
#define pfn_pmd(pfn, prot)   __pmd(__pfn_addr(pfn) | pgprot_val(prot))
 
#define PTE_FILE_MAX_BITS   30
 
#define pte_to_pgoff(pte)   (pte_val(pte) >> 2)
 
#define pgoff_to_pte(off)   __pte((off) << 2 | _PAGE_FILE)
 
#define __swp_type(x)   (((x).val >> 2) & 0x3f)
 
#define __swp_offset(x)   ((x).val >> 8)
 
#define __swp_entry(type, offset)   ((swp_entry_t) { ((type) << 2) | ((offset) << 8) })
 
#define __pte_to_swp_entry(pte)   ((swp_entry_t) { pte_val(pte) })
 
#define __swp_entry_to_pte(x)   __pte((x).val)
 
#define pgprot_noncached(prot)   __pgprot(pgprot_val(prot) & ~_PAGE_CACHE)
 
#define pgprot_through(prot)   __pgprot(pgprot_val(prot) | _PAGE_CACHE_WT)
 
#define mk_pte(page, pgprot)   pfn_pte(page_to_pfn(page), (pgprot))
 
#define mk_pte_huge(entry)   ((entry).pte |= _PAGE_PRESENT | _PAGE_PSE | _PAGE_VALID)
 
#define page_pte(page)   page_pte_prot((page), __pgprot(0))
 
#define pmd_page_kernel(pmd)   ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
 
#define pmd_page(pmd)   pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)
 
#define pmd_large(pmd)
 
#define pgd_index(address)   (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1))
 
#define pgd_offset(mm, address)   ((mm)->pgd + pgd_index(address))
 
#define pgd_offset_k(address)   pgd_offset(&init_mm, address)
 
#define pmd_index(address)   (((address) >> PMD_SHIFT) & (PTRS_PER_PMD - 1))
 
#define pte_index(address)   (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
 
#define pte_offset_kernel(dir, address)   ((pte_t *) pmd_page_kernel(*(dir)) + pte_index(address))
 
#define pte_offset_map(dir, address)   ((pte_t *) page_address(pmd_page(*(dir))) + pte_index(address))
 
#define pte_unmap(pte)   do {} while (0)
 
#define kern_addr_valid(addr)   (1)
 
#define io_remap_pfn_range(vma, vaddr, pfn, size, prot)   remap_pfn_range((vma), (vaddr), (pfn), (size), (prot))
 
#define MK_IOSPACE_PFN(space, pfn)   (pfn)
 
#define GET_IOSPACE(pfn)   0
 
#define GET_PFN(pfn)   (pfn)
 
#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
 
#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
 
#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
 
#define __HAVE_ARCH_PTEP_SET_WRPROTECT
 
#define __HAVE_ARCH_PTEP_MKDIRTY
 
#define __HAVE_ARCH_PTE_SAME
 

Functions

void pmd_ctor (void *, struct kmem_cache *, unsigned long)
 
void pgtable_cache_init (void)
 
void paging_init (void)
 
void update_mmu_cache (struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
 

Variables

unsigned long empty_zero_page [1024]
 
spinlock_t pgd_lock
 
struct pagepgd_list
 
pgd_t swapper_pg_dir [PTRS_PER_PGD]
 
pte_t kernel_vmalloc_ptes [(VMALLOC_END-VMALLOC_START)/PAGE_SIZE]
 

Macro Definition Documentation

#define __HAVE_ARCH_PTE_SAME

Definition at line 501 of file pgtable.h.

#define __HAVE_ARCH_PTEP_GET_AND_CLEAR

Definition at line 498 of file pgtable.h.

#define __HAVE_ARCH_PTEP_MKDIRTY

Definition at line 500 of file pgtable.h.

#define __HAVE_ARCH_PTEP_SET_WRPROTECT

Definition at line 499 of file pgtable.h.

#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY

Definition at line 497 of file pgtable.h.

#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG

Definition at line 496 of file pgtable.h.

#define __P000   PAGE_NONE

Definition at line 193 of file pgtable.h.

#define __P001   PAGE_READONLY_NOEXEC

Definition at line 194 of file pgtable.h.

#define __P010   PAGE_COPY_NOEXEC

Definition at line 195 of file pgtable.h.

#define __P011   PAGE_COPY_NOEXEC

Definition at line 196 of file pgtable.h.

#define __P100   PAGE_READONLY_EXEC

Definition at line 197 of file pgtable.h.

#define __P101   PAGE_READONLY_EXEC

Definition at line 198 of file pgtable.h.

#define __P110   PAGE_COPY_EXEC

Definition at line 199 of file pgtable.h.

#define __P111   PAGE_COPY_EXEC

Definition at line 200 of file pgtable.h.

#define __PAGE_COPY   (_PAGE_PRESENTV | _PAGE_PROT_RKRU | _PAGE_ACCESSED | _PAGE_CACHE)

Definition at line 155 of file pgtable.h.

#define __PAGE_KERNEL   (__PAGE_KERNEL_BASE | _PAGE_PROT_WKNU | _PAGE_CACHE | _PAGE_NX)

Definition at line 171 of file pgtable.h.

#define __PAGE_KERNEL_BASE   (_PAGE_PRESENTV | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_GLOBAL)

Definition at line 169 of file pgtable.h.

#define __PAGE_KERNEL_EXEC   (__PAGE_KERNEL & ~_PAGE_NX)

Definition at line 173 of file pgtable.h.

#define __PAGE_KERNEL_LARGE   (__PAGE_KERNEL | _PAGE_PSE)

Definition at line 175 of file pgtable.h.

#define __PAGE_KERNEL_LARGE_EXEC   (__PAGE_KERNEL_EXEC | _PAGE_PSE)

Definition at line 176 of file pgtable.h.

#define __PAGE_KERNEL_NOCACHE   (__PAGE_KERNEL_BASE | _PAGE_PROT_WKNU | _PAGE_NX)

Definition at line 172 of file pgtable.h.

#define __PAGE_KERNEL_RO   (__PAGE_KERNEL_BASE | _PAGE_PROT_RKNU | _PAGE_CACHE | _PAGE_NX)

Definition at line 174 of file pgtable.h.

#define __PAGE_NONE   (_PAGE_PRESENTV | _PAGE_PROT_RKNU | _PAGE_ACCESSED | _PAGE_CACHE)

Definition at line 153 of file pgtable.h.

#define __PAGE_PROT_USER   0x020

Definition at line 141 of file pgtable.h.

#define __PAGE_PROT_UWAUX   0x010

Definition at line 140 of file pgtable.h.

#define __PAGE_PROT_WRITE   0x040

Definition at line 142 of file pgtable.h.

#define __PAGE_READONLY   (_PAGE_PRESENTV | _PAGE_PROT_RKRU | _PAGE_ACCESSED | _PAGE_CACHE)

Definition at line 156 of file pgtable.h.

#define __PAGE_SHARED   (_PAGE_PRESENTV | _PAGE_PROT_WKWU | _PAGE_ACCESSED | _PAGE_CACHE)

Definition at line 154 of file pgtable.h.

#define __PAGE_USERIO   (__PAGE_KERNEL_BASE | _PAGE_PROT_WKWU | _PAGE_NX)

Definition at line 185 of file pgtable.h.

#define __pfn_addr (   pfn)    ((pfn) << PAGE_SHIFT)

Definition at line 321 of file pgtable.h.

#define __pte_to_swp_entry (   pte)    ((swp_entry_t) { pte_val(pte) })

Definition at line 351 of file pgtable.h.

#define __S000   PAGE_NONE

Definition at line 202 of file pgtable.h.

#define __S001   PAGE_READONLY_NOEXEC

Definition at line 203 of file pgtable.h.

#define __S010   PAGE_SHARED_NOEXEC

Definition at line 204 of file pgtable.h.

#define __S011   PAGE_SHARED_NOEXEC

Definition at line 205 of file pgtable.h.

#define __S100   PAGE_READONLY_EXEC

Definition at line 206 of file pgtable.h.

#define __S101   PAGE_READONLY_EXEC

Definition at line 207 of file pgtable.h.

#define __S110   PAGE_SHARED_EXEC

Definition at line 208 of file pgtable.h.

#define __S111   PAGE_SHARED_EXEC

Definition at line 209 of file pgtable.h.

#define __swp_entry (   type,
  offset 
)    ((swp_entry_t) { ((type) << 2) | ((offset) << 8) })

Definition at line 349 of file pgtable.h.

#define __swp_entry_to_pte (   x)    __pte((x).val)

Definition at line 352 of file pgtable.h.

#define __swp_offset (   x)    ((x).val >> 8)

Definition at line 348 of file pgtable.h.

#define __swp_type (   x)    (((x).val >> 2) & 0x3f)

Definition at line 347 of file pgtable.h.

#define _PAGE_ACCESSED   xPTEL2_UNUSED1

Definition at line 133 of file pgtable.h.

#define _PAGE_BIT_ACCESSED   xPTEL2_UNUSED1_BIT /* mustn't be loaded into IPTEL2/DPTEL2 */

Definition at line 113 of file pgtable.h.

#define _PAGE_BIT_CACHE   xPTEL2_C_BIT

Definition at line 109 of file pgtable.h.

#define _PAGE_BIT_DIRTY   xPTEL2_D_BIT

Definition at line 111 of file pgtable.h.

#define _PAGE_BIT_GLOBAL   xPTEL2_G_BIT

Definition at line 112 of file pgtable.h.

#define _PAGE_BIT_PRESENT   xPTEL2_PV_BIT

Definition at line 110 of file pgtable.h.

#define _PAGE_BIT_VALID   xPTEL2_V_BIT

Definition at line 108 of file pgtable.h.

#define _PAGE_CACHE   xPTEL2_C

Definition at line 116 of file pgtable.h.

#define _PAGE_CACHE_WT   xPTEL2_CWT

Definition at line 132 of file pgtable.h.

#define _PAGE_CHG_MASK   (PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)

Definition at line 151 of file pgtable.h.

#define _PAGE_DIRTY   xPTEL2_D

Definition at line 118 of file pgtable.h.

#define _PAGE_FILE   xPTEL2_C /* set:pagecache unset:swap */

Definition at line 137 of file pgtable.h.

#define _PAGE_GLOBAL   xPTEL2_G

Definition at line 125 of file pgtable.h.

#define _PAGE_NX   0 /* no-execute bit */

Definition at line 134 of file pgtable.h.

#define _PAGE_PRESENT   xPTEL2_PV

Definition at line 117 of file pgtable.h.

#define _PAGE_PRESENTV   (_PAGE_PRESENT|_PAGE_VALID)

Definition at line 144 of file pgtable.h.

#define _PAGE_PROT   xPTEL2_PR

Definition at line 119 of file pgtable.h.

#define _PAGE_PROT_RKNU   xPTEL2_PR_ROK

Definition at line 120 of file pgtable.h.

#define _PAGE_PROT_RKRU   xPTEL2_PR_ROK_ROU

Definition at line 122 of file pgtable.h.

#define _PAGE_PROT_WKNU   xPTEL2_PR_RWK

Definition at line 121 of file pgtable.h.

#define _PAGE_PROT_WKRU   xPTEL2_PR_RWK_ROU

Definition at line 123 of file pgtable.h.

#define _PAGE_PROT_WKWU   xPTEL2_PR_RWK_RWU

Definition at line 124 of file pgtable.h.

#define _PAGE_PROTNONE   0x000 /* If not present */

Definition at line 138 of file pgtable.h.

#define _PAGE_PS_128Kb   xPTEL2_PS_128Kb

Definition at line 128 of file pgtable.h.

#define _PAGE_PS_1Kb   xPTEL2_PS_1Kb

Definition at line 129 of file pgtable.h.

#define _PAGE_PS_4Kb   xPTEL2_PS_4Kb

Definition at line 127 of file pgtable.h.

#define _PAGE_PS_4Mb   xPTEL2_PS_4Mb

Definition at line 130 of file pgtable.h.

#define _PAGE_PS_MASK   xPTEL2_PS

Definition at line 126 of file pgtable.h.

#define _PAGE_PSE   xPTEL2_PS_4Mb /* 4MB page */

Definition at line 131 of file pgtable.h.

#define _PAGE_TABLE   (_PAGE_PRESENTV | _PAGE_PROT_WKNU | _PAGE_ACCESSED | _PAGE_DIRTY)

Definition at line 150 of file pgtable.h.

#define _PAGE_VALID   xPTEL2_V

Definition at line 115 of file pgtable.h.

#define BOOT_KERNEL_PGD_PTRS   (1024 - BOOT_USER_PGD_PTRS)

Definition at line 75 of file pgtable.h.

#define BOOT_USER_PGD_PTRS   (__PAGE_OFFSET >> TWOLEVEL_PGDIR_SHIFT)

Definition at line 74 of file pgtable.h.

#define FIRST_USER_ADDRESS   0

Definition at line 68 of file pgtable.h.

#define GET_IOSPACE (   pfn)    0

Definition at line 493 of file pgtable.h.

#define GET_PFN (   pfn)    (pfn)

Definition at line 494 of file pgtable.h.

#define io_remap_pfn_range (   vma,
  vaddr,
  pfn,
  size,
  prot 
)    remap_pfn_range((vma), (vaddr), (pfn), (size), (prot))

Definition at line 489 of file pgtable.h.

#define kern_addr_valid (   addr)    (1)

Definition at line 487 of file pgtable.h.

#define KERNEL_PGD_PTRS   (PTRS_PER_PGD - USER_PGD_PTRS)

Definition at line 71 of file pgtable.h.

#define MK_IOSPACE_PFN (   space,
  pfn 
)    (pfn)

Definition at line 492 of file pgtable.h.

#define mk_pte (   page,
  pgprot 
)    pfn_pte(page_to_pfn(page), (pgprot))

Definition at line 400 of file pgtable.h.

#define mk_pte_huge (   entry)    ((entry).pte |= _PAGE_PRESENT | _PAGE_PSE | _PAGE_VALID)

Definition at line 401 of file pgtable.h.

#define PAGE_COPY   PAGE_COPY_NOEXEC

Definition at line 165 of file pgtable.h.

#define PAGE_COPY_EXEC   __pgprot(__PAGE_COPY)

Definition at line 163 of file pgtable.h.

#define PAGE_COPY_NOEXEC   __pgprot(__PAGE_COPY | _PAGE_NX)

Definition at line 160 of file pgtable.h.

#define PAGE_KERNEL   __pgprot(__PAGE_KERNEL)

Definition at line 178 of file pgtable.h.

#define PAGE_KERNEL_EXEC   __pgprot(__PAGE_KERNEL_EXEC)

Definition at line 180 of file pgtable.h.

#define PAGE_KERNEL_LARGE   __pgprot(__PAGE_KERNEL_LARGE)

Definition at line 182 of file pgtable.h.

#define PAGE_KERNEL_LARGE_EXEC   __pgprot(__PAGE_KERNEL_LARGE_EXEC)

Definition at line 183 of file pgtable.h.

#define PAGE_KERNEL_NOCACHE   __pgprot(__PAGE_KERNEL_NOCACHE)

Definition at line 181 of file pgtable.h.

#define PAGE_KERNEL_RO   __pgprot(__PAGE_KERNEL_RO)

Definition at line 179 of file pgtable.h.

#define PAGE_NONE   __pgprot(__PAGE_NONE | _PAGE_NX)

Definition at line 158 of file pgtable.h.

#define page_pte (   page)    page_pte_prot((page), __pgprot(0))

Definition at line 411 of file pgtable.h.

#define PAGE_READONLY   PAGE_READONLY_NOEXEC

Definition at line 166 of file pgtable.h.

#define PAGE_READONLY_EXEC   __pgprot(__PAGE_READONLY)

Definition at line 164 of file pgtable.h.

#define PAGE_READONLY_NOEXEC   __pgprot(__PAGE_READONLY | _PAGE_NX)

Definition at line 161 of file pgtable.h.

#define PAGE_SHARED   PAGE_SHARED_EXEC

Definition at line 167 of file pgtable.h.

#define PAGE_SHARED_EXEC   __pgprot(__PAGE_SHARED)

Definition at line 162 of file pgtable.h.

#define PAGE_SHARED_NOEXEC   __pgprot(__PAGE_SHARED | _PAGE_NX)

Definition at line 159 of file pgtable.h.

#define PAGE_USERIO   __pgprot(__PAGE_USERIO)

Definition at line 186 of file pgtable.h.

#define pages_to_mb (   x)    ((x) >> (20 - PAGE_SHIFT))

Definition at line 229 of file pgtable.h.

#define pfn_pmd (   pfn,
  prot 
)    __pmd(__pfn_addr(pfn) | pgprot_val(prot))

Definition at line 323 of file pgtable.h.

#define pfn_pte (   pfn,
  prot 
)    __pte(__pfn_addr(pfn) | pgprot_val(prot))

Definition at line 322 of file pgtable.h.

#define pgd_clear (   xp)    do { } while (0)

Definition at line 298 of file pgtable.h.

#define pgd_ERROR (   e)
Value:
printk(KERN_ERR "%s:%d: bad pgd %08lx.\n", \
__FILE__, __LINE__, pgd_val(e))

Definition at line 289 of file pgtable.h.

#define pgd_index (   address)    (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1))

Definition at line 428 of file pgtable.h.

#define pgd_offset (   mm,
  address 
)    ((mm)->pgd + pgd_index(address))

Definition at line 434 of file pgtable.h.

#define pgd_offset_k (   address)    pgd_offset(&init_mm, address)

Definition at line 440 of file pgtable.h.

#define PGD_SIZE   PAGE_SIZE

Definition at line 62 of file pgtable.h.

#define PGDIR_MASK   (~(PGDIR_SIZE - 1))

Definition at line 65 of file pgtable.h.

#define PGDIR_SHIFT   22

Definition at line 56 of file pgtable.h.

#define PGDIR_SIZE   (1UL << PGDIR_SHIFT)

Definition at line 64 of file pgtable.h.

#define pgoff_to_pte (   off)    __pte((off) << 2 | _PAGE_FILE)

Definition at line 344 of file pgtable.h.

#define pgprot_noncached (   prot)    __pgprot(pgprot_val(prot) & ~_PAGE_CACHE)

Definition at line 387 of file pgtable.h.

#define pgprot_through (   prot)    __pgprot(pgprot_val(prot) | _PAGE_CACHE_WT)

Definition at line 393 of file pgtable.h.

#define pmd_bad (   x)    0

Definition at line 226 of file pgtable.h.

#define pmd_clear (   xp)    do { set_pmd(xp, __pmd(0)); } while (0)

Definition at line 225 of file pgtable.h.

#define pmd_index (   address)    (((address) >> PMD_SHIFT) & (PTRS_PER_PMD - 1))

Definition at line 448 of file pgtable.h.

#define pmd_large (   pmd)
Value:

Definition at line 418 of file pgtable.h.

#define pmd_none (   x)    (!pmd_val(x))

Definition at line 223 of file pgtable.h.

#define pmd_page (   pmd)    pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)

Definition at line 416 of file pgtable.h.

#define pmd_page_kernel (   pmd)    ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))

Definition at line 413 of file pgtable.h.

#define pmd_present (   x)    (!pmd_none(x))

Definition at line 224 of file pgtable.h.

#define PMD_SIZE   (1UL << PMD_SHIFT)

Definition at line 63 of file pgtable.h.

#define pte_clear (   mm,
  addr,
  xp 
)
Value:
do { \
set_pte_at((mm), (addr), (xp), __pte(0)); \
} while (0)

Definition at line 218 of file pgtable.h.

#define pte_ERROR (   e)
Value:
printk(KERN_ERR "%s:%d: bad pte %08lx.\n", \
__FILE__, __LINE__, pte_val(e))

Definition at line 286 of file pgtable.h.

#define PTE_FILE_MAX_BITS   30

Definition at line 341 of file pgtable.h.

#define pte_index (   address)    (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))

Definition at line 457 of file pgtable.h.

#define pte_none (   x)    (!pte_val(x))

Definition at line 319 of file pgtable.h.

#define pte_offset_kernel (   dir,
  address 
)    ((pte_t *) pmd_page_kernel(*(dir)) + pte_index(address))

Definition at line 460 of file pgtable.h.

#define pte_offset_map (   dir,
  address 
)    ((pte_t *) page_address(pmd_page(*(dir))) + pte_index(address))

Definition at line 474 of file pgtable.h.

#define pte_page (   x)    pfn_to_page(pte_pfn(x))

Definition at line 318 of file pgtable.h.

#define pte_pfn (   x)    ((unsigned long) (pte_val(x) >> PAGE_SHIFT))

Definition at line 320 of file pgtable.h.

#define pte_present (   x)    (pte_val(x) & _PAGE_VALID)

Definition at line 217 of file pgtable.h.

#define pte_same (   a,
  b 
)    (pte_val(a) == pte_val(b))

Definition at line 317 of file pgtable.h.

#define pte_to_pgoff (   pte)    (pte_val(pte) >> 2)

Definition at line 343 of file pgtable.h.

#define pte_unmap (   pte)    do {} while (0)

Definition at line 476 of file pgtable.h.

#define ptep_get_and_clear (   mm,
  addr,
  ptep 
)    __pte(xchg(&(ptep)->pte, 0))

Definition at line 315 of file pgtable.h.

#define PTRS_PER_PGD   1024

Definition at line 57 of file pgtable.h.

#define PTRS_PER_PMD   1 /* we don't really have any PMD physically */

Definition at line 59 of file pgtable.h.

#define PTRS_PER_PTE   1024

Definition at line 60 of file pgtable.h.

#define PTRS_PER_PUD   1 /* we don't really have any PUD physically */

Definition at line 58 of file pgtable.h.

#define set_pmd (   pmdptr,
  pmdval 
)    (*(pmdptr) = pmdval)

Definition at line 313 of file pgtable.h.

#define set_pte (   pteptr,
  pteval 
)    (*(pteptr) = pteval)

Definition at line 305 of file pgtable.h.

#define set_pte_at (   mm,
  addr,
  ptep,
  pteval 
)    set_pte((ptep), (pteval))

Definition at line 306 of file pgtable.h.

#define set_pte_atomic (   pteptr,
  pteval 
)    set_pte((pteptr), (pteval))

Definition at line 307 of file pgtable.h.

#define TWOLEVEL_PGDIR_SHIFT   22

Definition at line 73 of file pgtable.h.

#define USER_PGD_PTRS   (PAGE_OFFSET >> PGDIR_SHIFT)

Definition at line 70 of file pgtable.h.

#define USER_PTRS_PER_PGD   (TASK_SIZE / PGDIR_SIZE)

Definition at line 67 of file pgtable.h.

#define VMALLOC_END   (0x7C000000UL)

Definition at line 96 of file pgtable.h.

#define VMALLOC_OFFSET   (8UL * 1024 * 1024)

Definition at line 94 of file pgtable.h.

#define VMALLOC_START   (0x70000000UL)

Definition at line 95 of file pgtable.h.

#define VMALLOC_VMADDR (   x)    ((unsigned long)(x))

Definition at line 148 of file pgtable.h.

#define ZERO_PAGE (   vaddr)    (virt_to_page(empty_zero_page))

Definition at line 41 of file pgtable.h.

Function Documentation

void paging_init ( void  )

paging_init - setup page tables

paging_init() sets up the page tables for each node of the system and frees the bootmem allocator memory for general use.

Definition at line 238 of file init.c.

void pgtable_cache_init ( void  )

Definition at line 145 of file pgalloc.c.

void pmd_ctor ( void ,
struct kmem_cache ,
unsigned  long 
)
void update_mmu_cache ( struct vm_area_struct vma,
unsigned long  address,
pte_t ptep 
)
inline

Definition at line 330 of file pgtable.h.

Variable Documentation

unsigned long empty_zero_page[1024]

Definition at line 42 of file mmu.c.

pte_t kernel_vmalloc_ptes[(VMALLOC_END-VMALLOC_START)/PAGE_SIZE]
struct page* pgd_list

Definition at line 83 of file pgalloc.c.

spinlock_t pgd_lock
pgd_t swapper_pg_dir[PTRS_PER_PGD]

Definition at line 36 of file init.c.