Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
pgtable_32.h File Reference

Go to the source code of this file.

Macros

#define _PAGE_WT   0x001 /* WT-bit on SH-4, 0 on SH-3 */
 
#define _PAGE_HW_SHARED   0x002 /* SH-bit : shared among processes */
 
#define _PAGE_DIRTY   0x004 /* D-bit : page changed */
 
#define _PAGE_CACHABLE   0x008 /* C-bit : cachable */
 
#define _PAGE_SZ0   0x010 /* SZ0-bit : Size of page */
 
#define _PAGE_RW   0x020 /* PR0-bit : write access allowed */
 
#define _PAGE_USER   0x040 /* PR1-bit : user space access allowed*/
 
#define _PAGE_SZ1   0x080 /* SZ1-bit : Size of page (on SH-4) */
 
#define _PAGE_PRESENT   0x100 /* V-bit : page is valid */
 
#define _PAGE_PROTNONE   0x200 /* software: if not present */
 
#define _PAGE_ACCESSED   0x400 /* software: page referenced */
 
#define _PAGE_FILE   _PAGE_WT /* software: pagecache or swap? */
 
#define _PAGE_SPECIAL   0x800 /* software: special page */
 
#define _PAGE_SZ_MASK   (_PAGE_SZ0 | _PAGE_SZ1)
 
#define _PAGE_PR_MASK   (_PAGE_RW | _PAGE_USER)
 
#define _PAGE_EXT_ESZ0   0x0010 /* ESZ0-bit: Size of page */
 
#define _PAGE_EXT_ESZ1   0x0020 /* ESZ1-bit: Size of page */
 
#define _PAGE_EXT_ESZ2   0x0040 /* ESZ2-bit: Size of page */
 
#define _PAGE_EXT_ESZ3   0x0080 /* ESZ3-bit: Size of page */
 
#define _PAGE_EXT_USER_EXEC   0x0100 /* EPR0-bit: User space executable */
 
#define _PAGE_EXT_USER_WRITE   0x0200 /* EPR1-bit: User space writable */
 
#define _PAGE_EXT_USER_READ   0x0400 /* EPR2-bit: User space readable */
 
#define _PAGE_EXT_KERN_EXEC   0x0800 /* EPR3-bit: Kernel space executable */
 
#define _PAGE_EXT_KERN_WRITE   0x1000 /* EPR4-bit: Kernel space writable */
 
#define _PAGE_EXT_KERN_READ   0x2000 /* EPR5-bit: Kernel space readable */
 
#define _PAGE_EXT_WIRED   0x4000 /* software: Wire TLB entry */
 
#define _PAGE_EXT(x)   ((unsigned long long)(x) << 32)
 
#define _PAGE_PCC_AREA5   0x00000000 /* use BSC registers for area5 */
 
#define _PAGE_PCC_AREA6   0x80000000 /* use BSC registers for area6 */
 
#define _PAGE_PCC_IODYN   0x00000001 /* IO space, dynamically sized bus */
 
#define _PAGE_PCC_IO8   0x20000000 /* IO space, 8 bit bus */
 
#define _PAGE_PCC_IO16   0x20000001 /* IO space, 16 bit bus */
 
#define _PAGE_PCC_COM8   0x40000000 /* Common Memory space, 8 bit bus */
 
#define _PAGE_PCC_COM16   0x40000001 /* Common Memory space, 16 bit bus */
 
#define _PAGE_PCC_ATR8   0x60000000 /* Attribute Memory space, 8 bit bus */
 
#define _PAGE_PCC_ATR16   0x60000001 /* Attribute Memory space, 6 bit bus */
 
#define _PAGE_PCC_MASK   0xe0000001
 
#define _PAGE_CLEAR_FLAGS   (_PAGE_PROTNONE | _PAGE_ACCESSED | _PAGE_FILE)
 
#define _PAGE_FLAGS_HARDWARE_MASK   (phys_addr_mask() & ~(_PAGE_CLEAR_FLAGS))
 
#define _PAGE_FLAGS_HARD   0ULL
 
#define _PAGE_WIRED   (0)
 
#define _PAGE_SZHUGE   (_PAGE_FLAGS_HARD)
 
#define _PAGE_CHG_MASK
 
#define PAGE_NONE   __pgprot(0)
 
#define PAGE_SHARED   __pgprot(0)
 
#define PAGE_COPY   __pgprot(0)
 
#define PAGE_EXECREAD   __pgprot(0)
 
#define PAGE_RWX   __pgprot(0)
 
#define PAGE_READONLY   __pgprot(0)
 
#define PAGE_WRITEONLY   __pgprot(0)
 
#define PAGE_KERNEL   __pgprot(0)
 
#define PAGE_KERNEL_NOCACHE   __pgprot(0)
 
#define PAGE_KERNEL_RO   __pgprot(0)
 
#define PAGE_KERNEL_PCC(slot, type)   __pgprot(0)
 
#define set_pte(pteptr, pteval)   (*(pteptr) = pteval)
 
#define set_pte_at(mm, addr, ptep, pteval)   set_pte(ptep,pteval)
 
#define set_pmd(pmdptr, pmdval)   (*(pmdptr) = pmdval)
 
#define pfn_pte(pfn, prot)   __pte(((unsigned long long)(pfn) << PAGE_SHIFT) | pgprot_val(prot))
 
#define pfn_pmd(pfn, prot)   __pmd(((unsigned long long)(pfn) << PAGE_SHIFT) | pgprot_val(prot))
 
#define pte_none(x)   (!pte_val(x))
 
#define pte_present(x)   ((x).pte_low & (_PAGE_PRESENT | _PAGE_PROTNONE))
 
#define pte_clear(mm, addr, xp)   do { set_pte_at(mm, addr, xp, __pte(0)); } while (0)
 
#define pmd_none(x)   (!pmd_val(x))
 
#define pmd_present(x)   (pmd_val(x))
 
#define pmd_clear(xp)   do { set_pmd(xp, __pmd(0)); } while (0)
 
#define pmd_bad(x)   (pmd_val(x) & ~PAGE_MASK)
 
#define pages_to_mb(x)   ((x) >> (20-PAGE_SHIFT))
 
#define pte_page(x)   pfn_to_page(pte_pfn(x))
 
#define pte_not_present(pte)   (!((pte).pte_low & _PAGE_PRESENT))
 
#define pte_dirty(pte)   ((pte).pte_low & _PAGE_DIRTY)
 
#define pte_young(pte)   ((pte).pte_low & _PAGE_ACCESSED)
 
#define pte_file(pte)   ((pte).pte_low & _PAGE_FILE)
 
#define pte_special(pte)   ((pte).pte_low & _PAGE_SPECIAL)
 
#define pte_write(pte)   ((pte).pte_low & _PAGE_RW)
 
#define PTE_BIT_FUNC(h, fn, op)   static inline pte_t pte_##fn(pte_t pte) { pte.pte_##h op; return pte; }
 
#define pgprot_writecombine(prot)   __pgprot(pgprot_val(prot) & ~_PAGE_CACHABLE)
 
#define pgprot_noncached   pgprot_writecombine
 
#define mk_pte(page, pgprot)   pfn_pte(page_to_pfn(page), (pgprot))
 
#define pmd_page_vaddr(pmd)   ((unsigned long)pmd_val(pmd))
 
#define pmd_page(pmd)   (virt_to_page(pmd_val(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(address)   pgd_index(address)
 
#define pgd_offset_k(address)   pgd_offset(&init_mm, address)
 
#define __pud_offset(address)   (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
 
#define __pmd_offset(address)   (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
 
#define pte_index(address)   ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
 
#define __pte_offset(address)   pte_index(address)
 
#define pte_offset_kernel(dir, address)   ((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(address))
 
#define pte_offset_map(dir, address)   pte_offset_kernel(dir, address)
 
#define pte_unmap(pte)   do { } while (0)
 
#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 %08lx.\n", __FILE__, __LINE__, pgd_val(e))
 
#define __swp_type(x)   ((x).val & 0xff)
 
#define __swp_offset(x)   ((x).val >> 10)
 
#define __swp_entry(type, offset)   ((swp_entry_t){(type) | (offset) <<10})
 
#define __pte_to_swp_entry(pte)   ((swp_entry_t) { pte_val(pte) >> 1 })
 
#define __swp_entry_to_pte(x)   ((pte_t) { (x).val << 1 })
 
#define PTE_FILE_MAX_BITS   29
 
#define pte_to_pgoff(pte)   (pte_val(pte) >> 1)
 
#define pgoff_to_pte(off)   ((pte_t) { ((off) << 1) | _PAGE_FILE })
 

Functions

 PTE_BIT_FUNC (low, wrprotect,&=~_PAGE_RW)
 
 PTE_BIT_FUNC (low, mkwrite,|=_PAGE_RW)
 
 PTE_BIT_FUNC (low, mkhuge,|=_PAGE_SZHUGE)
 
 PTE_BIT_FUNC (low, mkclean,&=~_PAGE_DIRTY)
 
 PTE_BIT_FUNC (low, mkdirty,|=_PAGE_DIRTY)
 
 PTE_BIT_FUNC (low, mkold,&=~_PAGE_ACCESSED)
 
 PTE_BIT_FUNC (low, mkyoung,|=_PAGE_ACCESSED)
 
 PTE_BIT_FUNC (low, mkspecial,|=_PAGE_SPECIAL)
 

Macro Definition Documentation

#define __pgd_offset (   address)    pgd_index(address)

Definition at line 414 of file pgtable_32.h.

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

Definition at line 420 of file pgtable_32.h.

#define __pte_offset (   address)    pte_index(address)

Definition at line 424 of file pgtable_32.h.

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

Definition at line 486 of file pgtable_32.h.

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

Definition at line 419 of file pgtable_32.h.

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

Definition at line 484 of file pgtable_32.h.

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

Definition at line 487 of file pgtable_32.h.

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

Definition at line 483 of file pgtable_32.h.

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

Definition at line 482 of file pgtable_32.h.

#define _PAGE_ACCESSED   0x400 /* software: page referenced */

Definition at line 53 of file pgtable_32.h.

#define _PAGE_CACHABLE   0x008 /* C-bit : cachable */

Definition at line 46 of file pgtable_32.h.

#define _PAGE_CHG_MASK
Value:

Definition at line 172 of file pgtable_32.h.

#define _PAGE_CLEAR_FLAGS   (_PAGE_PROTNONE | _PAGE_ACCESSED | _PAGE_FILE)

Definition at line 115 of file pgtable_32.h.

#define _PAGE_DIRTY   0x004 /* D-bit : page changed */

Definition at line 45 of file pgtable_32.h.

#define _PAGE_EXT (   x)    ((unsigned long long)(x) << 32)

Definition at line 77 of file pgtable_32.h.

#define _PAGE_EXT_ESZ0   0x0010 /* ESZ0-bit: Size of page */

Definition at line 61 of file pgtable_32.h.

#define _PAGE_EXT_ESZ1   0x0020 /* ESZ1-bit: Size of page */

Definition at line 62 of file pgtable_32.h.

#define _PAGE_EXT_ESZ2   0x0040 /* ESZ2-bit: Size of page */

Definition at line 63 of file pgtable_32.h.

#define _PAGE_EXT_ESZ3   0x0080 /* ESZ3-bit: Size of page */

Definition at line 64 of file pgtable_32.h.

#define _PAGE_EXT_KERN_EXEC   0x0800 /* EPR3-bit: Kernel space executable */

Definition at line 70 of file pgtable_32.h.

#define _PAGE_EXT_KERN_READ   0x2000 /* EPR5-bit: Kernel space readable */

Definition at line 72 of file pgtable_32.h.

#define _PAGE_EXT_KERN_WRITE   0x1000 /* EPR4-bit: Kernel space writable */

Definition at line 71 of file pgtable_32.h.

#define _PAGE_EXT_USER_EXEC   0x0100 /* EPR0-bit: User space executable */

Definition at line 66 of file pgtable_32.h.

#define _PAGE_EXT_USER_READ   0x0400 /* EPR2-bit: User space readable */

Definition at line 68 of file pgtable_32.h.

#define _PAGE_EXT_USER_WRITE   0x0200 /* EPR1-bit: User space writable */

Definition at line 67 of file pgtable_32.h.

#define _PAGE_EXT_WIRED   0x4000 /* software: Wire TLB entry */

Definition at line 74 of file pgtable_32.h.

#define _PAGE_FILE   _PAGE_WT /* software: pagecache or swap? */

Definition at line 54 of file pgtable_32.h.

#define _PAGE_FLAGS_HARD   0ULL

Definition at line 122 of file pgtable_32.h.

#define _PAGE_FLAGS_HARDWARE_MASK   (phys_addr_mask() & ~(_PAGE_CLEAR_FLAGS))

Definition at line 118 of file pgtable_32.h.

#define _PAGE_HW_SHARED   0x002 /* SH-bit : shared among processes */

Definition at line 44 of file pgtable_32.h.

#define _PAGE_PCC_AREA5   0x00000000 /* use BSC registers for area5 */

Definition at line 84 of file pgtable_32.h.

#define _PAGE_PCC_AREA6   0x80000000 /* use BSC registers for area6 */

Definition at line 85 of file pgtable_32.h.

#define _PAGE_PCC_ATR16   0x60000001 /* Attribute Memory space, 6 bit bus */

Definition at line 94 of file pgtable_32.h.

#define _PAGE_PCC_ATR8   0x60000000 /* Attribute Memory space, 8 bit bus */

Definition at line 93 of file pgtable_32.h.

#define _PAGE_PCC_COM16   0x40000001 /* Common Memory space, 16 bit bus */

Definition at line 92 of file pgtable_32.h.

#define _PAGE_PCC_COM8   0x40000000 /* Common Memory space, 8 bit bus */

Definition at line 91 of file pgtable_32.h.

#define _PAGE_PCC_IO16   0x20000001 /* IO space, 16 bit bus */

Definition at line 90 of file pgtable_32.h.

#define _PAGE_PCC_IO8   0x20000000 /* IO space, 8 bit bus */

Definition at line 89 of file pgtable_32.h.

#define _PAGE_PCC_IODYN   0x00000001 /* IO space, dynamically sized bus */

Definition at line 88 of file pgtable_32.h.

#define _PAGE_PCC_MASK   0xe0000001

Definition at line 96 of file pgtable_32.h.

#define _PAGE_PR_MASK   (_PAGE_RW | _PAGE_USER)

Definition at line 58 of file pgtable_32.h.

#define _PAGE_PRESENT   0x100 /* V-bit : page is valid */

Definition at line 51 of file pgtable_32.h.

#define _PAGE_PROTNONE   0x200 /* software: if not present */

Definition at line 52 of file pgtable_32.h.

#define _PAGE_RW   0x020 /* PR0-bit : write access allowed */

Definition at line 48 of file pgtable_32.h.

#define _PAGE_SPECIAL   0x800 /* software: special page */

Definition at line 55 of file pgtable_32.h.

#define _PAGE_SZ0   0x010 /* SZ0-bit : Size of page */

Definition at line 47 of file pgtable_32.h.

#define _PAGE_SZ1   0x080 /* SZ1-bit : Size of page (on SH-4) */

Definition at line 50 of file pgtable_32.h.

#define _PAGE_SZ_MASK   (_PAGE_SZ0 | _PAGE_SZ1)

Definition at line 57 of file pgtable_32.h.

#define _PAGE_SZHUGE   (_PAGE_FLAGS_HARD)

Definition at line 166 of file pgtable_32.h.

#define _PAGE_USER   0x040 /* PR1-bit : user space access allowed*/

Definition at line 49 of file pgtable_32.h.

#define _PAGE_WIRED   (0)

Definition at line 158 of file pgtable_32.h.

#define _PAGE_WT   0x001 /* WT-bit on SH-4, 0 on SH-3 */

Definition at line 43 of file pgtable_32.h.

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

Definition at line 394 of file pgtable_32.h.

#define PAGE_COPY   __pgprot(0)

Definition at line 280 of file pgtable_32.h.

#define PAGE_EXECREAD   __pgprot(0)

Definition at line 281 of file pgtable_32.h.

#define PAGE_KERNEL   __pgprot(0)

Definition at line 285 of file pgtable_32.h.

#define PAGE_KERNEL_NOCACHE   __pgprot(0)

Definition at line 286 of file pgtable_32.h.

#define PAGE_KERNEL_PCC (   slot,
  type 
)    __pgprot(0)

Definition at line 289 of file pgtable_32.h.

#define PAGE_KERNEL_RO   __pgprot(0)

Definition at line 287 of file pgtable_32.h.

#define PAGE_NONE   __pgprot(0)

Definition at line 278 of file pgtable_32.h.

#define PAGE_READONLY   __pgprot(0)

Definition at line 283 of file pgtable_32.h.

#define PAGE_RWX   __pgprot(0)

Definition at line 282 of file pgtable_32.h.

#define PAGE_SHARED   __pgprot(0)

Definition at line 279 of file pgtable_32.h.

#define PAGE_WRITEONLY   __pgprot(0)

Definition at line 284 of file pgtable_32.h.

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

Definition at line 336 of file pgtable_32.h.

#define pfn_pmd (   pfn,
  prot 
)    __pmd(((unsigned long long)(pfn) << PAGE_SHIFT) | pgprot_val(prot))

Definition at line 323 of file pgtable_32.h.

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

Definition at line 321 of file pgtable_32.h.

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

Definition at line 440 of file pgtable_32.h.

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

Definition at line 412 of file pgtable_32.h.

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

Definition at line 413 of file pgtable_32.h.

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

Definition at line 417 of file pgtable_32.h.

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

Definition at line 494 of file pgtable_32.h.

#define pgprot_noncached   pgprot_writecombine

Definition at line 386 of file pgtable_32.h.

#define pgprot_writecombine (   prot)    __pgprot(pgprot_val(prot) & ~_PAGE_CACHABLE)

Definition at line 383 of file pgtable_32.h.

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

Definition at line 334 of file pgtable_32.h.

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

Definition at line 333 of file pgtable_32.h.

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

Definition at line 331 of file pgtable_32.h.

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

Definition at line 409 of file pgtable_32.h.

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

Definition at line 408 of file pgtable_32.h.

#define pmd_present (   x)    (pmd_val(x))

Definition at line 332 of file pgtable_32.h.

#define PTE_BIT_FUNC (   h,
  fn,
  op 
)    static inline pte_t pte_##fn(pte_t pte) { pte.pte_##h op; return pte; }

Definition at line 356 of file pgtable_32.h.

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

Definition at line 329 of file pgtable_32.h.

#define pte_dirty (   pte)    ((pte).pte_low & _PAGE_DIRTY)

Definition at line 344 of file pgtable_32.h.

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

Definition at line 438 of file pgtable_32.h.

#define pte_file (   pte)    ((pte).pte_low & _PAGE_FILE)

Definition at line 346 of file pgtable_32.h.

#define PTE_FILE_MAX_BITS   29

Definition at line 492 of file pgtable_32.h.

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

Definition at line 423 of file pgtable_32.h.

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

Definition at line 326 of file pgtable_32.h.

#define pte_not_present (   pte)    (!((pte).pte_low & _PAGE_PRESENT))

Definition at line 343 of file pgtable_32.h.

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

Definition at line 426 of file pgtable_32.h.

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

Definition at line 428 of file pgtable_32.h.

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

Definition at line 337 of file pgtable_32.h.

#define pte_present (   x)    ((x).pte_low & (_PAGE_PRESENT | _PAGE_PROTNONE))

Definition at line 327 of file pgtable_32.h.

#define pte_special (   pte)    ((pte).pte_low & _PAGE_SPECIAL)

Definition at line 347 of file pgtable_32.h.

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

Definition at line 493 of file pgtable_32.h.

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

Definition at line 429 of file pgtable_32.h.

#define pte_write (   pte)    ((pte).pte_low & _PAGE_RW)

Definition at line 353 of file pgtable_32.h.

#define pte_young (   pte)    ((pte).pte_low & _PAGE_ACCESSED)

Definition at line 345 of file pgtable_32.h.

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

Definition at line 319 of file pgtable_32.h.

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

Definition at line 310 of file pgtable_32.h.

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

Definition at line 313 of file pgtable_32.h.

Function Documentation

PTE_BIT_FUNC ( low  ,
wrprotect  ,
= ~_PAGE_RW 
)
PTE_BIT_FUNC ( low  ,
mkwrite  ,
= _PAGE_RW 
)
PTE_BIT_FUNC ( low  ,
mkhuge  ,
= _PAGE_SZHUGE 
)
PTE_BIT_FUNC ( low  ,
mkclean  ,
= ~_PAGE_DIRTY 
)
PTE_BIT_FUNC ( low  ,
mkdirty  ,
= _PAGE_DIRTY 
)
PTE_BIT_FUNC ( low  ,
mkold  ,
= ~_PAGE_ACCESSED 
)
PTE_BIT_FUNC ( low  ,
mkyoung  ,
= _PAGE_ACCESSED 
)
PTE_BIT_FUNC ( low  ,
mkspecial  ,
= _PAGE_SPECIAL 
)