Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Typedefs | Functions | Variables
pgtable.h File Reference
#include <asm-generic/pgtable-nopmd.h>
#include <asm/page.h>
#include <asm-generic/pgtable.h>

Go to the source code of this file.

Macros

#define USER_RING   1 /* user ring level */
 
#define KERNEL_RING   0 /* kernel ring level */
 
#define PGDIR_SHIFT   22
 
#define PGDIR_SIZE   (1UL << PGDIR_SHIFT)
 
#define PGDIR_MASK   (~(PGDIR_SIZE-1))
 
#define PTRS_PER_PTE   1024
 
#define PTRS_PER_PTE_SHIFT   10
 
#define PTRS_PER_PGD   1024
 
#define PGD_ORDER   0
 
#define USER_PTRS_PER_PGD   (TASK_SIZE/PGDIR_SIZE)
 
#define FIRST_USER_ADDRESS   0
 
#define FIRST_USER_PGD_NR   (FIRST_USER_ADDRESS >> PGDIR_SHIFT)
 
#define VMALLOC_START   0xC0000000
 
#define VMALLOC_END   0xC7FEFFFF
 
#define TLBTEMP_BASE_1   0xC7FF0000
 
#define TLBTEMP_BASE_2   0xC7FF8000
 
#define _PAGE_HW_EXEC   (1<<0) /* hardware: page is executable */
 
#define _PAGE_HW_WRITE   (1<<1) /* hardware: page is writable */
 
#define _PAGE_FILE   (1<<1) /* non-linear mapping, if !present */
 
#define _PAGE_PROTNONE   (3<<0) /* special case for VM_PROT_NONE */
 
#define _PAGE_CA_BYPASS   (0<<2) /* bypass, non-speculative */
 
#define _PAGE_CA_WB   (1<<2) /* write-back */
 
#define _PAGE_CA_WT   (2<<2) /* write-through */
 
#define _PAGE_CA_MASK   (3<<2)
 
#define _PAGE_INVALID   (3<<2)
 
#define _PAGE_USER   (1<<4) /* user access (ring=1) */
 
#define _PAGE_WRITABLE_BIT   6
 
#define _PAGE_WRITABLE   (1<<6) /* software: page writable */
 
#define _PAGE_DIRTY   (1<<7) /* software: page dirty */
 
#define _PAGE_ACCESSED   (1<<8) /* software: page accessed (read) */
 
#define _PAGE_VALID   (1<<0)
 
#define _PAGE_CHG_MASK   (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
 
#define _PAGE_PRESENT   (_PAGE_VALID | _PAGE_CA_WB | _PAGE_ACCESSED)
 
#define PAGE_NONE   __pgprot(0)
 
#define PAGE_SHARED   __pgprot(0)
 
#define PAGE_COPY   __pgprot(0)
 
#define PAGE_READONLY   __pgprot(0)
 
#define PAGE_KERNEL   __pgprot(0)
 
#define __P000   PAGE_NONE /* private --- */
 
#define __P001   PAGE_READONLY /* private --r */
 
#define __P010   PAGE_COPY /* private -w- */
 
#define __P011   PAGE_COPY /* private -wr */
 
#define __P100   PAGE_READONLY_EXEC /* private x-- */
 
#define __P101   PAGE_READONLY_EXEC /* private x-r */
 
#define __P110   PAGE_COPY_EXEC /* private xw- */
 
#define __P111   PAGE_COPY_EXEC /* private xwr */
 
#define __S000   PAGE_NONE /* shared --- */
 
#define __S001   PAGE_READONLY /* shared --r */
 
#define __S010   PAGE_SHARED /* shared -w- */
 
#define __S011   PAGE_SHARED /* shared -wr */
 
#define __S100   PAGE_READONLY_EXEC /* shared x-- */
 
#define __S101   PAGE_READONLY_EXEC /* shared x-r */
 
#define __S110   PAGE_SHARED_EXEC /* shared xw- */
 
#define __S111   PAGE_SHARED_EXEC /* shared xwr */
 
#define pte_ERROR(e)   printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
 
#define pgd_ERROR(e)   printk("%s:%d: bad pgd entry %08lx.\n", __FILE__, __LINE__, pgd_val(e))
 
#define ZERO_PAGE(vaddr)   (virt_to_page(empty_zero_page))
 
#define swapper_pg_dir   NULL
 
#define pmd_page_vaddr(pmd)   ((unsigned long)(pmd_val(pmd) & PAGE_MASK))
 
#define pmd_page(pmd)   virt_to_page(pmd_val(pmd))
 
#define pte_none(pte)   (pte_val(pte) == _PAGE_INVALID)
 
#define pte_present(pte)
 
#define pte_clear(mm, addr, ptep)   do { update_pte(ptep, __pte(_PAGE_INVALID)); } while(0)
 
#define pmd_none(pmd)   (!pmd_val(pmd))
 
#define pmd_present(pmd)   (pmd_val(pmd) & PAGE_MASK)
 
#define pmd_bad(pmd)   (pmd_val(pmd) & ~PAGE_MASK)
 
#define pmd_clear(pmdp)   do { set_pmd(pmdp, __pmd(0)); } while (0)
 
#define pte_pfn(pte)   (pte_val(pte) >> PAGE_SHIFT)
 
#define pte_same(a, b)   (pte_val(a) == pte_val(b))
 
#define pte_page(x)   pfn_to_page(pte_pfn(x))
 
#define pfn_pte(pfn, prot)   __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
 
#define mk_pte(page, prot)   pfn_pte(page_to_pfn(page), prot)
 
#define pgd_offset_k(address)   pgd_offset(&init_mm, address)
 
#define pgd_offset(mm, address)   ((mm)->pgd + pgd_index(address))
 
#define pgd_index(address)   ((address) >> PGDIR_SHIFT)
 
#define pmd_offset(dir, address)   ((pmd_t*)(dir))
 
#define pte_index(address)   (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
 
#define pte_offset_kernel(dir, addr)   ((pte_t*) pmd_page_vaddr(*(dir)) + pte_index(addr))
 
#define pte_offset_map(dir, addr)   pte_offset_kernel((dir),(addr))
 
#define pte_unmap(pte)   do { } while (0)
 
#define __swp_type(entry)   (((entry).val >> 6) & 0x1f)
 
#define __swp_offset(entry)   ((entry).val >> 11)
 
#define __swp_entry(type, offs)   ((swp_entry_t) {((type) << 6) | ((offs) << 11) | _PAGE_INVALID})
 
#define __pte_to_swp_entry(pte)   ((swp_entry_t) { pte_val(pte) })
 
#define __swp_entry_to_pte(x)   ((pte_t) { (x).val })
 
#define PTE_FILE_MAX_BITS   28
 
#define pte_to_pgoff(pte)   (pte_val(pte) >> 4)
 
#define pgoff_to_pte(off)   ((pte_t) { ((off) << 4) | _PAGE_INVALID | _PAGE_FILE })
 
#define kern_addr_valid(addr)   (1)
 
#define io_remap_pfn_range(vma, from, pfn, size, prot)   remap_pfn_range(vma, from, pfn, size, prot)
 
#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
 
#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
 
#define __HAVE_ARCH_PTEP_SET_WRPROTECT
 
#define __HAVE_ARCH_PTEP_MKDIRTY
 
#define __HAVE_ARCH_PTE_SAME
 

Typedefs

typedef pte_tpte_addr_t
 

Functions

void update_mmu_cache (struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
 

Variables

unsigned long empty_zero_page [1024]
 

Macro Definition Documentation

#define __HAVE_ARCH_PTE_SAME

Definition at line 412 of file pgtable.h.

#define __HAVE_ARCH_PTEP_GET_AND_CLEAR

Definition at line 409 of file pgtable.h.

#define __HAVE_ARCH_PTEP_MKDIRTY

Definition at line 411 of file pgtable.h.

#define __HAVE_ARCH_PTEP_SET_WRPROTECT

Definition at line 410 of file pgtable.h.

#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG

Definition at line 408 of file pgtable.h.

#define __P000   PAGE_NONE /* private --- */

Definition at line 157 of file pgtable.h.

#define __P001   PAGE_READONLY /* private --r */

Definition at line 158 of file pgtable.h.

#define __P010   PAGE_COPY /* private -w- */

Definition at line 159 of file pgtable.h.

#define __P011   PAGE_COPY /* private -wr */

Definition at line 160 of file pgtable.h.

#define __P100   PAGE_READONLY_EXEC /* private x-- */

Definition at line 161 of file pgtable.h.

#define __P101   PAGE_READONLY_EXEC /* private x-r */

Definition at line 162 of file pgtable.h.

#define __P110   PAGE_COPY_EXEC /* private xw- */

Definition at line 163 of file pgtable.h.

#define __P111   PAGE_COPY_EXEC /* private xwr */

Definition at line 164 of file pgtable.h.

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

Definition at line 353 of file pgtable.h.

#define __S000   PAGE_NONE /* shared --- */

Definition at line 166 of file pgtable.h.

#define __S001   PAGE_READONLY /* shared --r */

Definition at line 167 of file pgtable.h.

#define __S010   PAGE_SHARED /* shared -w- */

Definition at line 168 of file pgtable.h.

#define __S011   PAGE_SHARED /* shared -wr */

Definition at line 169 of file pgtable.h.

#define __S100   PAGE_READONLY_EXEC /* shared x-- */

Definition at line 170 of file pgtable.h.

#define __S101   PAGE_READONLY_EXEC /* shared x-r */

Definition at line 171 of file pgtable.h.

#define __S110   PAGE_SHARED_EXEC /* shared xw- */

Definition at line 172 of file pgtable.h.

#define __S111   PAGE_SHARED_EXEC /* shared xwr */

Definition at line 173 of file pgtable.h.

#define __swp_entry (   type,
  offs 
)    ((swp_entry_t) {((type) << 6) | ((offs) << 11) | _PAGE_INVALID})

Definition at line 351 of file pgtable.h.

#define __swp_entry_to_pte (   x)    ((pte_t) { (x).val })

Definition at line 354 of file pgtable.h.

#define __swp_offset (   entry)    ((entry).val >> 11)

Definition at line 350 of file pgtable.h.

#define __swp_type (   entry)    (((entry).val >> 6) & 0x1f)

Definition at line 349 of file pgtable.h.

#define _PAGE_ACCESSED   (1<<8) /* software: page accessed (read) */

Definition at line 109 of file pgtable.h.

#define _PAGE_CA_BYPASS   (0<<2) /* bypass, non-speculative */

Definition at line 97 of file pgtable.h.

#define _PAGE_CA_MASK   (3<<2)

Definition at line 100 of file pgtable.h.

#define _PAGE_CA_WB   (1<<2) /* write-back */

Definition at line 98 of file pgtable.h.

#define _PAGE_CA_WT   (2<<2) /* write-through */

Definition at line 99 of file pgtable.h.

#define _PAGE_CHG_MASK   (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)

Definition at line 118 of file pgtable.h.

#define _PAGE_DIRTY   (1<<7) /* software: page dirty */

Definition at line 108 of file pgtable.h.

#define _PAGE_FILE   (1<<1) /* non-linear mapping, if !present */

Definition at line 93 of file pgtable.h.

#define _PAGE_HW_EXEC   (1<<0) /* hardware: page is executable */

Definition at line 90 of file pgtable.h.

#define _PAGE_HW_WRITE   (1<<1) /* hardware: page is writable */

Definition at line 91 of file pgtable.h.

#define _PAGE_INVALID   (3<<2)

Definition at line 101 of file pgtable.h.

#define _PAGE_PRESENT   (_PAGE_VALID | _PAGE_CA_WB | _PAGE_ACCESSED)

Definition at line 119 of file pgtable.h.

#define _PAGE_PROTNONE   (3<<0) /* special case for VM_PROT_NONE */

Definition at line 94 of file pgtable.h.

#define _PAGE_USER   (1<<4) /* user access (ring=1) */

Definition at line 103 of file pgtable.h.

#define _PAGE_VALID   (1<<0)

Definition at line 113 of file pgtable.h.

#define _PAGE_WRITABLE   (1<<6) /* software: page writable */

Definition at line 107 of file pgtable.h.

#define _PAGE_WRITABLE_BIT   6

Definition at line 106 of file pgtable.h.

#define FIRST_USER_ADDRESS   0

Definition at line 60 of file pgtable.h.

#define FIRST_USER_PGD_NR   (FIRST_USER_ADDRESS >> PGDIR_SHIFT)

Definition at line 61 of file pgtable.h.

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

Definition at line 401 of file pgtable.h.

#define kern_addr_valid (   addr)    (1)

Definition at line 391 of file pgtable.h.

#define KERNEL_RING   0 /* kernel ring level */

Definition at line 22 of file pgtable.h.

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

Definition at line 247 of file pgtable.h.

#define PAGE_COPY   __pgprot(0)

Definition at line 144 of file pgtable.h.

#define PAGE_KERNEL   __pgprot(0)

Definition at line 146 of file pgtable.h.

#define PAGE_NONE   __pgprot(0)

Definition at line 142 of file pgtable.h.

#define PAGE_READONLY   __pgprot(0)

Definition at line 145 of file pgtable.h.

#define PAGE_SHARED   __pgprot(0)

Definition at line 143 of file pgtable.h.

#define pfn_pte (   pfn,
  prot 
)    __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))

Definition at line 246 of file pgtable.h.

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

Definition at line 179 of file pgtable.h.

#define pgd_index (   address)    ((address) >> PGDIR_SHIFT)

Definition at line 317 of file pgtable.h.

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

Definition at line 315 of file pgtable.h.

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

Definition at line 312 of file pgtable.h.

#define PGD_ORDER   0

Definition at line 58 of file pgtable.h.

#define PGDIR_MASK   (~(PGDIR_SIZE-1))

Definition at line 49 of file pgtable.h.

#define PGDIR_SHIFT   22

Definition at line 47 of file pgtable.h.

#define PGDIR_SIZE   (1UL << PGDIR_SHIFT)

Definition at line 48 of file pgtable.h.

#define pgoff_to_pte (   off)    ((pte_t) { ((off) << 4) | _PAGE_INVALID | _PAGE_FILE })

Definition at line 358 of file pgtable.h.

#define pmd_bad (   pmd)    (pmd_val(pmd) & ~PAGE_MASK)

Definition at line 214 of file pgtable.h.

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

Definition at line 215 of file pgtable.h.

#define pmd_none (   pmd)    (!pmd_val(pmd))

Definition at line 212 of file pgtable.h.

#define pmd_offset (   dir,
  address 
)    ((pmd_t*)(dir))

Definition at line 320 of file pgtable.h.

#define pmd_page (   pmd)    virt_to_page(pmd_val(pmd))

Definition at line 200 of file pgtable.h.

#define pmd_page_vaddr (   pmd)    ((unsigned long)(pmd_val(pmd) & PAGE_MASK))

Definition at line 199 of file pgtable.h.

#define pmd_present (   pmd)    (pmd_val(pmd) & PAGE_MASK)

Definition at line 213 of file pgtable.h.

#define pte_clear (   mm,
  addr,
  ptep 
)    do { update_pte(ptep, __pte(_PAGE_INVALID)); } while(0)

Definition at line 209 of file pgtable.h.

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

Definition at line 177 of file pgtable.h.

#define PTE_FILE_MAX_BITS   28

Definition at line 356 of file pgtable.h.

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

Definition at line 323 of file pgtable.h.

#define pte_none (   pte)    (pte_val(pte) == _PAGE_INVALID)

Definition at line 205 of file pgtable.h.

#define pte_offset_kernel (   dir,
  addr 
)    ((pte_t*) pmd_page_vaddr(*(dir)) + pte_index(addr))

Definition at line 324 of file pgtable.h.

#define pte_offset_map (   dir,
  addr 
)    pte_offset_kernel((dir),(addr))

Definition at line 326 of file pgtable.h.

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

Definition at line 245 of file pgtable.h.

#define pte_pfn (   pte)    (pte_val(pte) >> PAGE_SHIFT)

Definition at line 243 of file pgtable.h.

#define pte_present (   pte)
Value:

Definition at line 206 of file pgtable.h.

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

Definition at line 244 of file pgtable.h.

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

Definition at line 357 of file pgtable.h.

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

Definition at line 327 of file pgtable.h.

#define PTRS_PER_PGD   1024

Definition at line 57 of file pgtable.h.

#define PTRS_PER_PTE   1024

Definition at line 55 of file pgtable.h.

#define PTRS_PER_PTE_SHIFT   10

Definition at line 56 of file pgtable.h.

#define swapper_pg_dir   NULL

Definition at line 191 of file pgtable.h.

#define TLBTEMP_BASE_1   0xC7FF0000

Definition at line 70 of file pgtable.h.

#define TLBTEMP_BASE_2   0xC7FF8000

Definition at line 71 of file pgtable.h.

#define USER_PTRS_PER_PGD   (TASK_SIZE/PGDIR_SIZE)

Definition at line 59 of file pgtable.h.

#define USER_RING   1 /* user ring level */

Definition at line 21 of file pgtable.h.

#define VMALLOC_END   0xC7FEFFFF

Definition at line 69 of file pgtable.h.

#define VMALLOC_START   0xC0000000

Definition at line 68 of file pgtable.h.

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

Definition at line 184 of file pgtable.h.

Typedef Documentation

typedef pte_t* pte_addr_t

Definition at line 404 of file pgtable.h.

Function Documentation

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.