Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
pgtable.c File Reference
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/mm.h>
#include <linux/swap.h>
#include <linux/highmem.h>
#include <linux/slab.h>
#include <linux/pagemap.h>
#include <linux/spinlock.h>
#include <linux/cpumask.h>
#include <linux/module.h>
#include <linux/io.h>
#include <linux/vmalloc.h>
#include <linux/smp.h>
#include <asm/pgtable.h>
#include <asm/pgalloc.h>
#include <asm/fixmap.h>
#include <asm/tlb.h>
#include <asm/tlbflush.h>
#include <asm/homecache.h>

Go to the source code of this file.

Macros

#define K(x)   ((x) << (PAGE_SHIFT-10))
 
#define KERNEL_PGD_INDEX_START   pgd_index(PAGE_OFFSET)
 
#define KERNEL_PGD_PTRS   (PTRS_PER_PGD - KERNEL_PGD_INDEX_START)
 
#define L2_USER_PGTABLE_PAGES   (1 << L2_USER_PGTABLE_ORDER)
 

Functions

void show_mem (unsigned int filter)
 
void __set_fixmap (enum fixed_addresses idx, unsigned long phys, pgprot_t flags)
 
void shatter_huge_page (unsigned long addr)
 
 DEFINE_SPINLOCK (pgd_lock)
 
 LIST_HEAD (pgd_list)
 
pgd_tpgd_alloc (struct mm_struct *mm)
 
void pgd_free (struct mm_struct *mm, pgd_t *pgd)
 
struct pagepgtable_alloc_one (struct mm_struct *mm, unsigned long address, int order)
 
void pgtable_free (struct mm_struct *mm, struct page *p, int order)
 
void __pgtable_free_tlb (struct mmu_gather *tlb, struct page *pte, unsigned long address, int order)
 
int ptep_test_and_clear_young (struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
 
void ptep_set_wrprotect (struct mm_struct *mm, unsigned long addr, pte_t *ptep)
 
pte_tvirt_to_pte (struct mm_struct *mm, unsigned long addr)
 
pgprot_t set_remote_cache_cpu (pgprot_t prot, int cpu)
 
int get_remote_cache_cpu (pgprot_t prot)
 
int va_to_cpa_and_pte (void *va, unsigned long long *cpa, pte_t *pte)
 
 EXPORT_SYMBOL (va_to_cpa_and_pte)
 
void __set_pte (pte_t *ptep, pte_t pte)
 
void set_pte (pte_t *ptep, pte_t pte)
 
void start_mm_caching (struct mm_struct *mm)
 
void check_mm_caching (struct mm_struct *prev, struct mm_struct *next)
 

Macro Definition Documentation

#define K (   x)    ((x) << (PAGE_SHIFT-10))

Definition at line 37 of file pgtable.c.

#define KERNEL_PGD_INDEX_START   pgd_index(PAGE_OFFSET)

Definition at line 230 of file pgtable.c.

#define KERNEL_PGD_PTRS   (PTRS_PER_PGD - KERNEL_PGD_INDEX_START)

Definition at line 231 of file pgtable.c.

#define L2_USER_PGTABLE_PAGES   (1 << L2_USER_PGTABLE_ORDER)

Definition at line 281 of file pgtable.c.

Function Documentation

void __pgtable_free_tlb ( struct mmu_gather tlb,
struct page pte,
unsigned long  address,
int  order 
)

Definition at line 326 of file pgtable.c.

void __set_fixmap ( enum fixed_addresses  idx,
unsigned long  phys,
pgprot_t  flags 
)

Definition at line 124 of file pgtable.c.

void __set_pte ( pte_t ptep,
pte_t  pte 
)

Definition at line 436 of file pgtable.c.

void check_mm_caching ( struct mm_struct prev,
struct mm_struct next 
)

Definition at line 519 of file pgtable.c.

DEFINE_SPINLOCK ( pgd_lock  )
EXPORT_SYMBOL ( va_to_cpa_and_pte  )
int get_remote_cache_cpu ( pgprot_t  prot)

Definition at line 410 of file pgtable.c.

LIST_HEAD ( pgd_list  )
pgd_t* pgd_alloc ( struct mm_struct mm)

Definition at line 266 of file pgtable.c.

void pgd_free ( struct mm_struct mm,
pgd_t pgd 
)

Definition at line 274 of file pgtable.c.

struct page* pgtable_alloc_one ( struct mm_struct mm,
unsigned long  address,
int  order 
)
read

Definition at line 283 of file pgtable.c.

void pgtable_free ( struct mm_struct mm,
struct page p,
int  order 
)

Definition at line 313 of file pgtable.c.

void ptep_set_wrprotect ( struct mm_struct mm,
unsigned long  addr,
pte_t ptep 
)

Definition at line 365 of file pgtable.c.

int ptep_test_and_clear_young ( struct vm_area_struct vma,
unsigned long  addr,
pte_t ptep 
)

Definition at line 346 of file pgtable.c.

void set_pte ( pte_t ptep,
pte_t  pte 
)

Definition at line 456 of file pgtable.c.

pgprot_t set_remote_cache_cpu ( pgprot_t  prot,
int  cpu 
)

Definition at line 398 of file pgtable.c.

void shatter_huge_page ( unsigned long  addr)

shatter_huge_page() - ensure a given address is mapped by a small page.

This function converts a huge PTE mapping kernel LOWMEM into a bunch of small PTEs with the same caching. No cache flush required, but we must do a global TLB flush.

Any caller that wishes to modify a kernel mapping that might have been made with a huge page should call this function, since doing so properly avoids race conditions with installing the newly-shattered page and then flushing all the TLB entries.

: Address at which to shatter any existing huge page.

Definition at line 149 of file pgtable.c.

void show_mem ( unsigned int  filter)

Definition at line 43 of file pgtable.c.

void start_mm_caching ( struct mm_struct mm)

Definition at line 484 of file pgtable.c.

int va_to_cpa_and_pte ( void va,
unsigned long long cpa,
pte_t pte 
)

Definition at line 422 of file pgtable.c.

pte_t* virt_to_pte ( struct mm_struct mm,
unsigned long  addr 
)

Definition at line 377 of file pgtable.c.