Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
pgtable-64.h File Reference
#include <linux/compiler.h>
#include <linux/linkage.h>
#include <asm/addrspace.h>
#include <asm/page.h>
#include <asm/cachectl.h>
#include <asm/fixmap.h>
#include <asm-generic/pgtable-nopud.h>

Go to the source code of this file.

Data Structures

struct  pmd_t
 

Macros

#define PMD_SHIFT   (PAGE_SHIFT + (PAGE_SHIFT + PTE_ORDER - 3))
 
#define PMD_SIZE   (1UL << PMD_SHIFT)
 
#define PMD_MASK   (~(PMD_SIZE-1))
 
#define PGDIR_SHIFT   (PMD_SHIFT + (PAGE_SHIFT + PMD_ORDER - 3))
 
#define PGDIR_SIZE   (1UL << PGDIR_SHIFT)
 
#define PGDIR_MASK   (~(PGDIR_SIZE-1))
 
#define PTRS_PER_PGD   ((PAGE_SIZE << PGD_ORDER) / sizeof(pgd_t))
 
#define PTRS_PER_PMD   ((PAGE_SIZE << PMD_ORDER) / sizeof(pmd_t))
 
#define PTRS_PER_PTE   ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t))
 
#define USER_PTRS_PER_PGD   (1)
 
#define FIRST_USER_ADDRESS   0UL
 
#define VMALLOC_START   (MAP_BASE + (2 * PAGE_SIZE))
 
#define VMALLOC_END
 
#define pte_ERROR(e)   printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e))
 
#define pmd_ERROR(e)   printk("%s:%d: bad pmd %016lx.\n", __FILE__, __LINE__, pmd_val(e))
 
#define pgd_ERROR(e)   printk("%s:%d: bad pgd %016lx.\n", __FILE__, __LINE__, pgd_val(e))
 
#define pmd_val(x)   ((x).pmd)
 
#define __pmd(x)   ((pmd_t) { (x) } )
 
#define pte_page(x)   pfn_to_page(pte_pfn(x))
 
#define pte_pfn(x)   ((unsigned long)((x).pte >> _PFN_SHIFT))
 
#define pfn_pte(pfn, prot)   __pte(((pfn) << _PFN_SHIFT) | pgprot_val(prot))
 
#define __pgd_offset(address)   pgd_index(address)
 
#define __pud_offset(address)   (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
 
#define __pmd_offset(address)   pmd_index(address)
 
#define pgd_offset_k(address)   pgd_offset(&init_mm, address)
 
#define pgd_index(address)   (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
 
#define pmd_index(address)   (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
 
#define pgd_offset(mm, addr)   ((mm)->pgd + pgd_index(addr))
 
#define pud_phys(pud)   virt_to_phys((void *)pud_val(pud))
 
#define pud_page(pud)   (pfn_to_page(pud_phys(pud) >> PAGE_SHIFT))
 
#define __pte_offset(address)   (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
 
#define pte_offset(dir, address)   ((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
 
#define pte_offset_kernel(dir, address)   ((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))
 
#define pte_offset_map(dir, address)   ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset(address))
 
#define pte_unmap(pte)   ((void)(pte))
 
#define __swp_type(x)   (((x).val >> 32) & 0xff)
 
#define __swp_offset(x)   ((x).val >> 40)
 
#define __swp_entry(type, offset)   ((swp_entry_t) { pte_val(mk_swap_pte((type), (offset))) })
 
#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   56
 
#define pte_to_pgoff(_pte)   ((_pte).pte >> 8)
 
#define pgoff_to_pte(off)   ((pte_t) { ((off) << 8) | _PAGE_FILE })
 

Functions

void pgd_init (unsigned long page)
 
void pmd_init (unsigned long page, unsigned long pagetable)
 

Variables

pte_t invalid_pte_table [PTRS_PER_PTE]
 
pte_t empty_bad_page_table [PTRS_PER_PTE]
 
pmd_t invalid_pmd_table [PTRS_PER_PMD]
 

Macro Definition Documentation

#define __pgd_offset (   address)    pgd_index(address)

Definition at line 235 of file pgtable-64.h.

#define __pmd (   x)    ((pmd_t) { (x) } )

Definition at line 162 of file pgtable-64.h.

#define __pmd_offset (   address)    pmd_index(address)

Definition at line 237 of file pgtable-64.h.

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

Definition at line 264 of file pgtable-64.h.

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

Definition at line 290 of file pgtable-64.h.

#define __pud_offset (   address)    (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))

Definition at line 236 of file pgtable-64.h.

#define __swp_entry (   type,
  offset 
)    ((swp_entry_t) { pte_val(mk_swap_pte((type), (offset))) })

Definition at line 289 of file pgtable-64.h.

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

Definition at line 291 of file pgtable-64.h.

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

Definition at line 288 of file pgtable-64.h.

#define __swp_type (   x)    (((x).val >> 32) & 0xff)

Definition at line 287 of file pgtable-64.h.

#define FIRST_USER_ADDRESS   0UL

Definition at line 122 of file pgtable-64.h.

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

Definition at line 232 of file pgtable-64.h.

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

Definition at line 148 of file pgtable-64.h.

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

Definition at line 242 of file pgtable-64.h.

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

Definition at line 246 of file pgtable-64.h.

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

Definition at line 240 of file pgtable-64.h.

#define PGDIR_MASK   (~(PGDIR_SIZE-1))

Definition at line 60 of file pgtable-64.h.

#define PGDIR_SHIFT   (PMD_SHIFT + (PAGE_SHIFT + PMD_ORDER - 3))

Definition at line 57 of file pgtable-64.h.

#define PGDIR_SIZE   (1UL << PGDIR_SHIFT)

Definition at line 59 of file pgtable-64.h.

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

Definition at line 300 of file pgtable-64.h.

#define pmd_ERROR (   e)    printk("%s:%d: bad pmd %016lx.\n", __FILE__, __LINE__, pmd_val(e))

Definition at line 145 of file pgtable-64.h.

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

Definition at line 243 of file pgtable-64.h.

#define PMD_MASK   (~(PMD_SIZE-1))

Definition at line 54 of file pgtable-64.h.

#define PMD_SHIFT   (PAGE_SHIFT + (PAGE_SHIFT + PTE_ORDER - 3))

Definition at line 52 of file pgtable-64.h.

#define PMD_SIZE   (1UL << PMD_SHIFT)

Definition at line 53 of file pgtable-64.h.

#define pmd_val (   x)    ((x).pmd)

Definition at line 161 of file pgtable-64.h.

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

Definition at line 142 of file pgtable-64.h.

#define PTE_FILE_MAX_BITS   56

Definition at line 297 of file pgtable-64.h.

#define pte_offset (   dir,
  address 
)    ((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))

Definition at line 266 of file pgtable-64.h.

#define pte_offset_kernel (   dir,
  address 
)    ((pte_t *) pmd_page_vaddr(*(dir)) + __pte_offset(address))

Definition at line 268 of file pgtable-64.h.

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

Definition at line 270 of file pgtable-64.h.

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

Definition at line 225 of file pgtable-64.h.

#define pte_pfn (   x)    ((unsigned long)((x).pte >> _PFN_SHIFT))

Definition at line 231 of file pgtable-64.h.

#define pte_to_pgoff (   _pte)    ((_pte).pte >> 8)

Definition at line 299 of file pgtable-64.h.

#define pte_unmap (   pte)    ((void)(pte))

Definition at line 272 of file pgtable-64.h.

#define PTRS_PER_PGD   ((PAGE_SIZE << PGD_ORDER) / sizeof(pgd_t))

Definition at line 111 of file pgtable-64.h.

#define PTRS_PER_PMD   ((PAGE_SIZE << PMD_ORDER) / sizeof(pmd_t))

Definition at line 113 of file pgtable-64.h.

#define PTRS_PER_PTE   ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t))

Definition at line 115 of file pgtable-64.h.

#define pud_page (   pud)    (pfn_to_page(pud_phys(pud) >> PAGE_SHIFT))

Definition at line 254 of file pgtable-64.h.

#define pud_phys (   pud)    virt_to_phys((void *)pud_val(pud))

Definition at line 253 of file pgtable-64.h.

#define USER_PTRS_PER_PGD   (1)

Definition at line 118 of file pgtable-64.h.

#define VMALLOC_END
Value:
(1UL << cpu_vmbits)) - (1UL << 32))

Definition at line 130 of file pgtable-64.h.

#define VMALLOC_START   (MAP_BASE + (2 * PAGE_SIZE))

Definition at line 129 of file pgtable-64.h.

Function Documentation

void pgd_init ( unsigned long  page)

Definition at line 16 of file pgtable-32.c.

void pmd_init ( unsigned long  page,
unsigned long  pagetable 
)

Definition at line 43 of file pgtable-64.c.

Variable Documentation

pte_t empty_bad_page_table[PTRS_PER_PTE]
pmd_t invalid_pmd_table[PTRS_PER_PMD]
pte_t invalid_pte_table[PTRS_PER_PTE]