Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
pgtable_32.h File Reference
#include <linux/const.h>
#include <asm-generic/4level-fixup.h>
#include <linux/spinlock.h>
#include <linux/swap.h>
#include <asm/types.h>
#include <asm/pgtsrmmu.h>
#include <asm/vaddrs.h>
#include <asm/oplib.h>
#include <asm/cpu_type.h>
#include <asm-generic/pgtable.h>

Go to the source code of this file.

Macros

#define pte_ERROR(e)   __builtin_trap()
 
#define pmd_ERROR(e)   __builtin_trap()
 
#define pgd_ERROR(e)   __builtin_trap()
 
#define PMD_SHIFT   22
 
#define PMD_SIZE   (1UL << PMD_SHIFT)
 
#define PMD_MASK   (~(PMD_SIZE-1))
 
#define PMD_ALIGN(__addr)   (((__addr) + ~PMD_MASK) & PMD_MASK)
 
#define PGDIR_SHIFT   SRMMU_PGDIR_SHIFT
 
#define PGDIR_SIZE   SRMMU_PGDIR_SIZE
 
#define PGDIR_MASK   SRMMU_PGDIR_MASK
 
#define PTRS_PER_PTE   1024
 
#define PTRS_PER_PMD   SRMMU_PTRS_PER_PMD
 
#define PTRS_PER_PGD   SRMMU_PTRS_PER_PGD
 
#define USER_PTRS_PER_PGD   PAGE_OFFSET / SRMMU_PGDIR_SIZE
 
#define FIRST_USER_ADDRESS   0
 
#define PTE_SIZE   (PTRS_PER_PTE*4)
 
#define PAGE_NONE   SRMMU_PAGE_NONE
 
#define PAGE_SHARED   SRMMU_PAGE_SHARED
 
#define PAGE_COPY   SRMMU_PAGE_COPY
 
#define PAGE_READONLY   SRMMU_PAGE_RDONLY
 
#define PAGE_KERNEL   SRMMU_PAGE_KERNEL
 
#define swapper_pg_dir   NULL
 
#define __P000   PAGE_NONE
 
#define __P001   PAGE_READONLY
 
#define __P010   PAGE_COPY
 
#define __P011   PAGE_COPY
 
#define __P100   PAGE_READONLY
 
#define __P101   PAGE_READONLY
 
#define __P110   PAGE_COPY
 
#define __P111   PAGE_COPY
 
#define __S000   PAGE_NONE
 
#define __S001   PAGE_READONLY
 
#define __S010   PAGE_SHARED
 
#define __S011   PAGE_SHARED
 
#define __S100   PAGE_READONLY
 
#define __S101   PAGE_READONLY
 
#define __S110   PAGE_SHARED
 
#define __S111   PAGE_SHARED
 
#define ZERO_PAGE(vaddr)   (virt_to_page(&empty_zero_page))
 
#define set_pte_at(mm, addr, ptep, pteval)   set_pte(ptep,pteval)
 
#define pte_mkspecial(pte)   (pte)
 
#define pfn_pte(pfn, prot)   mk_pte(pfn_to_page(pfn), prot)
 
#define pte_page(pte)   pfn_to_page(pte_pfn(pte))
 
#define pgprot_noncached   pgprot_noncached
 
#define pgd_index(address)   ((address) >> PGDIR_SHIFT)
 
#define pgd_offset(mm, address)   ((mm)->pgd + pgd_index(address))
 
#define pgd_offset_k(address)   pgd_offset(&init_mm, address)
 
#define pte_offset_map(d, a)   pte_offset_kernel(d,a)
 
#define pte_unmap(pte)   do{}while(0)
 
#define FAULT_CODE_PROT   0x1
 
#define FAULT_CODE_WRITE   0x2
 
#define FAULT_CODE_USER   0x4
 
#define update_mmu_cache(vma, address, ptep)   do { } while (0)
 
#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   24
 
#define kern_addr_valid(addr)   (test_bit(__pa((unsigned long)(addr))>>20, sparc_valid_addr_bitmap))
 
#define MK_IOSPACE_PFN(space, pfn)   (pfn | (space << (BITS_PER_LONG - 4)))
 
#define GET_IOSPACE(pfn)   (pfn >> (BITS_PER_LONG - 4))
 
#define GET_PFN(pfn)   (pfn & 0x0fffffffUL)
 
#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
 
#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty)
 
#define VMALLOC_START   _AC(0xfe600000,UL)
 
#define VMALLOC_END   _AC(0xffc00000,UL)
 
#define HAVE_ARCH_UNMAPPED_AREA
 
#define pgtable_cache_init()   do { } while (0)
 

Functions

void load_mmu (void)
 
unsigned long calc_highpages (void)
 
void paging_init (void)
 
pte_tpte_offset_kernel (pmd_t *dir, unsigned long address)
 
void mmu_info (struct seq_file *m)
 
void srmmu_mapiorange (unsigned int bus, unsigned long xpa, unsigned long xva, unsigned int len)
 
void srmmu_unmapiorange (unsigned long virt_addr, unsigned int len)
 
int remap_pfn_range (struct vm_area_struct *, unsigned long, unsigned long, unsigned long, pgprot_t)
 

Variables

unsigned long ptr_in_current_pgd
 
unsigned long phys_base
 
unsigned long pfn_base
 
unsigned long empty_zero_page
 
unsigned longsparc_valid_addr_bitmap
 

Macro Definition Documentation

#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS

Definition at line 447 of file pgtable_32.h.

#define __P000   PAGE_NONE

Definition at line 64 of file pgtable_32.h.

#define __P001   PAGE_READONLY

Definition at line 65 of file pgtable_32.h.

#define __P010   PAGE_COPY

Definition at line 66 of file pgtable_32.h.

#define __P011   PAGE_COPY

Definition at line 67 of file pgtable_32.h.

#define __P100   PAGE_READONLY

Definition at line 68 of file pgtable_32.h.

#define __P101   PAGE_READONLY

Definition at line 69 of file pgtable_32.h.

#define __P110   PAGE_COPY

Definition at line 70 of file pgtable_32.h.

#define __P111   PAGE_COPY

Definition at line 71 of file pgtable_32.h.

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

Definition at line 374 of file pgtable_32.h.

#define __S000   PAGE_NONE

Definition at line 73 of file pgtable_32.h.

#define __S001   PAGE_READONLY

Definition at line 74 of file pgtable_32.h.

#define __S010   PAGE_SHARED

Definition at line 75 of file pgtable_32.h.

#define __S011   PAGE_SHARED

Definition at line 76 of file pgtable_32.h.

#define __S100   PAGE_READONLY

Definition at line 77 of file pgtable_32.h.

#define __S101   PAGE_READONLY

Definition at line 78 of file pgtable_32.h.

#define __S110   PAGE_SHARED

Definition at line 79 of file pgtable_32.h.

#define __S111   PAGE_SHARED

Definition at line 80 of file pgtable_32.h.

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

Definition at line 375 of file pgtable_32.h.

#define FAULT_CODE_PROT   0x1

Definition at line 346 of file pgtable_32.h.

#define FAULT_CODE_USER   0x4

Definition at line 348 of file pgtable_32.h.

#define FAULT_CODE_WRITE   0x2

Definition at line 347 of file pgtable_32.h.

#define FIRST_USER_ADDRESS   0

Definition at line 46 of file pgtable_32.h.

#define GET_IOSPACE (   pfn)    (pfn >> (BITS_PER_LONG - 4))

Definition at line 428 of file pgtable_32.h.

#define GET_PFN (   pfn)    (pfn & 0x0fffffffUL)

Definition at line 429 of file pgtable_32.h.

#define HAVE_ARCH_UNMAPPED_AREA

Definition at line 466 of file pgtable_32.h.

#define kern_addr_valid (   addr)    (test_bit(__pa((unsigned long)(addr))>>20, sparc_valid_addr_bitmap))

Definition at line 420 of file pgtable_32.h.

#define MK_IOSPACE_PFN (   space,
  pfn 
)    (pfn | (space << (BITS_PER_LONG - 4)))

Definition at line 427 of file pgtable_32.h.

#define PAGE_COPY   SRMMU_PAGE_COPY

Definition at line 51 of file pgtable_32.h.

#define PAGE_KERNEL   SRMMU_PAGE_KERNEL

Definition at line 53 of file pgtable_32.h.

#define PAGE_NONE   SRMMU_PAGE_NONE

Definition at line 49 of file pgtable_32.h.

#define PAGE_READONLY   SRMMU_PAGE_RDONLY

Definition at line 52 of file pgtable_32.h.

#define PAGE_SHARED   SRMMU_PAGE_SHARED

Definition at line 50 of file pgtable_32.h.

#define pfn_pte (   pfn,
  prot 
)    mk_pte(pfn_to_page(pfn), prot)

Definition at line 268 of file pgtable_32.h.

#define pgd_ERROR (   e)    __builtin_trap()

Definition at line 33 of file pgtable_32.h.

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

Definition at line 318 of file pgtable_32.h.

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

Definition at line 321 of file pgtable_32.h.

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

Definition at line 324 of file pgtable_32.h.

#define PGDIR_MASK   SRMMU_PGDIR_MASK

Definition at line 41 of file pgtable_32.h.

#define PGDIR_SHIFT   SRMMU_PGDIR_SHIFT

Definition at line 39 of file pgtable_32.h.

#define PGDIR_SIZE   SRMMU_PGDIR_SIZE

Definition at line 40 of file pgtable_32.h.

#define pgprot_noncached   pgprot_noncached

Definition at line 304 of file pgtable_32.h.

#define pgtable_cache_init (   void)    do { } while (0)

Definition at line 471 of file pgtable_32.h.

#define PMD_ALIGN (   __addr)    (((__addr) + ~PMD_MASK) & PMD_MASK)

Definition at line 38 of file pgtable_32.h.

#define pmd_ERROR (   e)    __builtin_trap()

Definition at line 32 of file pgtable_32.h.

#define PMD_MASK   (~(PMD_SIZE-1))

Definition at line 37 of file pgtable_32.h.

#define PMD_SHIFT   22

Definition at line 35 of file pgtable_32.h.

#define PMD_SIZE   (1UL << PMD_SHIFT)

Definition at line 36 of file pgtable_32.h.

#define pte_ERROR (   e)    __builtin_trap()

Definition at line 31 of file pgtable_32.h.

#define PTE_FILE_MAX_BITS   24

Definition at line 391 of file pgtable_32.h.

#define pte_mkspecial (   pte)    (pte)

Definition at line 266 of file pgtable_32.h.

#define pte_offset_map (   d,
  a 
)    pte_offset_kernel(d,a)

Definition at line 339 of file pgtable_32.h.

#define pte_page (   pte)    pfn_to_page(pte_pfn(pte))

Definition at line 283 of file pgtable_32.h.

#define PTE_SIZE   (PTRS_PER_PTE*4)

Definition at line 47 of file pgtable_32.h.

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

Definition at line 340 of file pgtable_32.h.

#define ptep_set_access_flags (   __vma,
  __address,
  __ptep,
  __entry,
  __dirty 
)
Value:
({ \
int __changed = !pte_same(*(__ptep), __entry); \
if (__changed) { \
set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \
flush_tlb_page(__vma, __address); \
} \
__changed; \
})

Definition at line 448 of file pgtable_32.h.

#define PTRS_PER_PGD   SRMMU_PTRS_PER_PGD

Definition at line 44 of file pgtable_32.h.

#define PTRS_PER_PMD   SRMMU_PTRS_PER_PMD

Definition at line 43 of file pgtable_32.h.

#define PTRS_PER_PTE   1024

Definition at line 42 of file pgtable_32.h.

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

Definition at line 118 of file pgtable_32.h.

#define swapper_pg_dir   NULL

Definition at line 57 of file pgtable_32.h.

#define update_mmu_cache (   vma,
  address,
  ptep 
)    do { } while (0)

Definition at line 350 of file pgtable_32.h.

#define USER_PTRS_PER_PGD   PAGE_OFFSET / SRMMU_PGDIR_SIZE

Definition at line 45 of file pgtable_32.h.

#define VMALLOC_END   _AC(0xffc00000,UL)

Definition at line 463 of file pgtable_32.h.

#define VMALLOC_START   _AC(0xfe600000,UL)

Definition at line 462 of file pgtable_32.h.

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

Definition at line 95 of file pgtable_32.h.

Function Documentation

unsigned long calc_highpages ( void  )

Definition at line 69 of file init_32.c.

void load_mmu ( void  )

Definition at line 1765 of file srmmu.c.

void mmu_info ( struct seq_file m)

Definition at line 431 of file init_64.c.

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.

pte_t* pte_offset_kernel ( pmd_t dir,
unsigned long  address 
)
inline

Definition at line 313 of file pgtable.h.

int remap_pfn_range ( struct vm_area_struct vma,
unsigned long  addr,
unsigned long  pfn,
unsigned long  size,
pgprot_t  prot 
)

remap_pfn_range - remap kernel memory to userspace : user vma to map to : target user address to start at : physical address of kernel memory : size of map area : page protection flags for this mapping

Note: this is only safe if the mm semaphore is held when called.

Definition at line 2292 of file memory.c.

void srmmu_mapiorange ( unsigned int  bus,
unsigned long  xpa,
unsigned long  xva,
unsigned int  len 
)

Definition at line 497 of file srmmu.c.

void srmmu_unmapiorange ( unsigned long  virt_addr,
unsigned int  len 
)

Definition at line 523 of file srmmu.c.

Variable Documentation

unsigned long empty_zero_page

Definition at line 42 of file mmu.c.

unsigned long pfn_base

Definition at line 44 of file init_32.c.

unsigned long phys_base

Definition at line 41 of file init_32.c.

unsigned long ptr_in_current_pgd
unsigned long* sparc_valid_addr_bitmap

Definition at line 38 of file init_32.c.