Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
init_64.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/string.h>
#include <linux/init.h>
#include <linux/bootmem.h>
#include <linux/mm.h>
#include <linux/hugetlb.h>
#include <linux/initrd.h>
#include <linux/swap.h>
#include <linux/pagemap.h>
#include <linux/poison.h>
#include <linux/fs.h>
#include <linux/seq_file.h>
#include <linux/kprobes.h>
#include <linux/cache.h>
#include <linux/sort.h>
#include <linux/percpu.h>
#include <linux/memblock.h>
#include <linux/mmzone.h>
#include <linux/gfp.h>
#include <asm/head.h>
#include <asm/page.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/oplib.h>
#include <asm/iommu.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/mmu_context.h>
#include <asm/tlbflush.h>
#include <asm/dma.h>
#include <asm/starfire.h>
#include <asm/tlb.h>
#include <asm/spitfire.h>
#include <asm/sections.h>
#include <asm/tsb.h>
#include <asm/hypervisor.h>
#include <asm/prom.h>
#include <asm/mdesc.h>
#include <asm/cpudata.h>
#include <asm/irq.h>
#include "init_64.h"

Go to the source code of this file.

Data Structures

struct  node_mem_mask
 

Macros

#define MAX_BANKS   32
 
#define PG_dcache_dirty   PG_arch_1
 
#define PG_dcache_cpu_shift   32UL
 
#define PG_dcache_cpu_mask   ((1UL<<ilog2(roundup_pow_of_two(NR_CPUS)))-1UL)
 
#define dcache_dirty_cpu(page)   (((page)->flags >> PG_dcache_cpu_shift) & PG_dcache_cpu_mask)
 
#define MAX_CTX_NR   (1UL << CTX_NR_BITS)
 
#define CTX_BMAP_SLOTS   BITS_TO_LONGS(MAX_CTX_NR)
 
#define numadbg(f, a...)
 
#define NUM_KTSB_DESCR   2
 
#define _PAGE_CACHE_4U   (_PAGE_CP_4U | _PAGE_CV_4U)
 
#define _PAGE_CACHE_4V   (_PAGE_CP_4V | _PAGE_CV_4V)
 
#define __DIRTY_BITS_4U   (_PAGE_MODIFIED_4U | _PAGE_WRITE_4U | _PAGE_W_4U)
 
#define __DIRTY_BITS_4V   (_PAGE_MODIFIED_4V | _PAGE_WRITE_4V | _PAGE_W_4V)
 
#define __ACCESS_BITS_4U   (_PAGE_ACCESSED_4U | _PAGE_READ_4U | _PAGE_R)
 
#define __ACCESS_BITS_4V   (_PAGE_ACCESSED_4V | _PAGE_READ_4V | _PAGE_R)
 

Functions

 EXPORT_SYMBOL (sparc64_valid_addr_bitmap)
 
 EXPORT_SYMBOL (mem_map_zero)
 
void flush_dcache_page_impl (struct page *page)
 
void update_mmu_cache (struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
 
void flush_dcache_page (struct page *page)
 
 EXPORT_SYMBOL (flush_dcache_page)
 
void __kprobes flush_icache_range (unsigned long start, unsigned long end)
 
 EXPORT_SYMBOL (flush_icache_range)
 
void mmu_info (struct seq_file *m)
 
void prom_world (int enter)
 
void __flush_dcache_range (unsigned long start, unsigned long end)
 
 EXPORT_SYMBOL (__flush_dcache_range)
 
 DEFINE_SPINLOCK (ctx_alloc_lock)
 
 DECLARE_BITMAP (mmu_context_bmap, MAX_CTX_NR)
 
void get_new_mmu_context (struct mm_struct *mm)
 
 early_param ("numa", early_numa)
 
unsigned long __init find_ecache_flush_span (unsigned long size)
 
void __cpuinit sun4v_ktsb_register (void)
 
void __init paging_init (void)
 
int __devinit page_in_phys_avail (unsigned long paddr)
 
void __init mem_init (void)
 
void free_initmem (void)
 
 EXPORT_SYMBOL (PAGE_KERNEL)
 
 EXPORT_SYMBOL (PAGE_SHARED)
 
 EXPORT_SYMBOL (_PAGE_IE)
 
 EXPORT_SYMBOL (_PAGE_E)
 
 EXPORT_SYMBOL (_PAGE_CACHE)
 
unsigned long pte_sz_bits (unsigned long sz)
 
pte_t mk_pte_io (unsigned long page, pgprot_t prot, int space, unsigned long page_size)
 
void __flush_tlb_all (void)
 
pte_tpte_alloc_one_kernel (struct mm_struct *mm, unsigned long address)
 
pgtable_t pte_alloc_one (struct mm_struct *mm, unsigned long address)
 
void pte_free_kernel (struct mm_struct *mm, pte_t *pte)
 
void pte_free (struct mm_struct *mm, pgtable_t pte)
 
void pgtable_free (void *table, bool is_page)
 

Variables

unsigned long
kern_linear_pte_xor[4] 
__read_mostly
 
unsigned long kpte_linear_bitmap [KPTE_BITMAP_BYTES/sizeof(unsigned long)]
 
struct tsb swapper_4m_tsb [KERNEL_TSB4M_NENTRIES]
 
unsigned long sparc64_valid_addr_bitmap [VALID_ADDR_BITMAP_BYTES/sizeof(unsigned long)]
 
unsigned long sparc_ramdisk_image64
 
unsigned int sparc_ramdisk_image
 
unsigned int sparc_ramdisk_size
 
int num_kernel_image_mappings
 
unsigned long kern_locked_tte_data
 
unsigned long tlb_context_cache = CTX_FIRST_VERSION - 1
 
int numa_cpu_lookup_table [NR_CPUS]
 
cpumask_t numa_cpumask_lookup_table [MAX_NUMNODES]
 
struct tsb swapper_tsb [KERNEL_TSB_NENTRIES]
 
pgd_t swapper_pg_dir [2048]
 

Macro Definition Documentation

#define __ACCESS_BITS_4U   (_PAGE_ACCESSED_4U | _PAGE_READ_4U | _PAGE_R)

Definition at line 2151 of file init_64.c.

#define __ACCESS_BITS_4V   (_PAGE_ACCESSED_4V | _PAGE_READ_4V | _PAGE_R)

Definition at line 2152 of file init_64.c.

#define __DIRTY_BITS_4U   (_PAGE_MODIFIED_4U | _PAGE_WRITE_4U | _PAGE_W_4U)

Definition at line 2149 of file init_64.c.

#define __DIRTY_BITS_4V   (_PAGE_MODIFIED_4V | _PAGE_WRITE_4V | _PAGE_W_4V)

Definition at line 2150 of file init_64.c.

#define _PAGE_CACHE_4U   (_PAGE_CP_4U | _PAGE_CV_4U)

Definition at line 2147 of file init_64.c.

#define _PAGE_CACHE_4V   (_PAGE_CP_4V | _PAGE_CV_4V)

Definition at line 2148 of file init_64.c.

#define CTX_BMAP_SLOTS   BITS_TO_LONGS(MAX_CTX_NR)

Definition at line 661 of file init_64.c.

#define dcache_dirty_cpu (   page)    (((page)->flags >> PG_dcache_cpu_shift) & PG_dcache_cpu_mask)

Definition at line 220 of file init_64.c.

#define MAX_BANKS   32

Definition at line 88 of file init_64.c.

#define MAX_CTX_NR   (1UL << CTX_NR_BITS)

Definition at line 660 of file init_64.c.

#define NUM_KTSB_DESCR   2

Definition at line 1585 of file init_64.c.

#define numadbg (   f,
  a... 
)
Value:
do { if (numa_debug) \
printk(KERN_INFO f, ## a); \
} while (0)

Definition at line 741 of file init_64.c.

#define PG_dcache_cpu_mask   ((1UL<<ilog2(roundup_pow_of_two(NR_CPUS)))-1UL)

Definition at line 217 of file init_64.c.

#define PG_dcache_cpu_shift   32UL

Definition at line 216 of file init_64.c.

#define PG_dcache_dirty   PG_arch_1

Definition at line 215 of file init_64.c.

Function Documentation

void __flush_dcache_range ( unsigned long  start,
unsigned long  end 
)

Definition at line 632 of file init_64.c.

void __flush_tlb_all ( void  )

Definition at line 2422 of file init_64.c.

DECLARE_BITMAP ( mmu_context_bmap  ,
MAX_CTX_NR   
)
DEFINE_SPINLOCK ( ctx_alloc_lock  )
early_param ( "numa"  ,
early_numa   
)
EXPORT_SYMBOL ( sparc64_valid_addr_bitmap  )
EXPORT_SYMBOL ( mem_map_zero  )
EXPORT_SYMBOL ( flush_dcache_page  )
EXPORT_SYMBOL ( flush_icache_range  )
EXPORT_SYMBOL ( __flush_dcache_range  )
EXPORT_SYMBOL ( PAGE_KERNEL  )
EXPORT_SYMBOL ( PAGE_SHARED  )
EXPORT_SYMBOL ( _PAGE_IE  )
EXPORT_SYMBOL ( _PAGE_E  )
EXPORT_SYMBOL ( _PAGE_CACHE  )
unsigned long __init find_ecache_flush_span ( unsigned long  size)

Definition at line 1536 of file init_64.c.

void flush_dcache_page ( struct page page)

Definition at line 361 of file init_64.c.

void flush_dcache_page_impl ( struct page page)
inline

Definition at line 197 of file init_64.c.

void __kprobes flush_icache_range ( unsigned long  start,
unsigned long  end 
)

flush_icache_range - Globally flush dcache and invalidate icache for region : The starting virtual address of the region. : The ending virtual address of the region.

This is used by the kernel to globally flush some code it has just written from the dcache back to RAM and then to globally invalidate the icache over that region so that that code can be run on all CPUs in the system.

Definition at line 403 of file init_64.c.

void free_initmem ( void  )

Definition at line 2091 of file init_64.c.

void get_new_mmu_context ( struct mm_struct mm)

Definition at line 674 of file init_64.c.

void __init mem_init ( void  )

Definition at line 2024 of file init_64.c.

pte_t mk_pte_io ( unsigned long  page,
pgprot_t  prot,
int  space,
unsigned long  page_size 
)

Definition at line 2395 of file init_64.c.

void mmu_info ( struct seq_file m)

Definition at line 431 of file init_64.c.

int __devinit page_in_phys_avail ( unsigned long  paddr)

Definition at line 1934 of file init_64.c.

void __init 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 1748 of file init_64.c.

void pgtable_free ( void table,
bool  is_page 
)

Definition at line 2573 of file init_64.c.

void prom_world ( int  enter)

Definition at line 624 of file init_64.c.

pgtable_t pte_alloc_one ( struct mm_struct mm,
unsigned long  address 
)
read

Definition at line 2533 of file init_64.c.

pte_t* pte_alloc_one_kernel ( struct mm_struct mm,
unsigned long  address 
)
inline

OK, this one's a bit tricky... ioremap can get called before memory is initialized (early serial console does this) and will want to alloc a page for its mapping. No userspace pages will ever get allocated before memory is initialized so this applies only to kernel pages. In the event that this is called before memory is initialized we allocate the page using the memblock infrastructure.

Definition at line 2516 of file init_64.c.

void pte_free ( struct mm_struct mm,
pgtable_t  pte 
)

Definition at line 2568 of file init_64.c.

void pte_free_kernel ( struct mm_struct mm,
pte_t pte 
)
inline

Definition at line 2552 of file init_64.c.

unsigned long pte_sz_bits ( unsigned long  sz)

Definition at line 2366 of file init_64.c.

void __cpuinit sun4v_ktsb_register ( void  )

Definition at line 1685 of file init_64.c.

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

Definition at line 323 of file init_64.c.

Variable Documentation

unsigned long _PAGE_CACHE __read_mostly

Definition at line 54 of file init_64.c.

unsigned long kern_locked_tte_data

Definition at line 474 of file init_64.c.

unsigned long kpte_linear_bitmap[KPTE_BITMAP_BYTES/sizeof(unsigned long)]

Definition at line 76 of file init_64.c.

int num_kernel_image_mappings

Definition at line 188 of file init_64.c.

int numa_cpu_lookup_table[NR_CPUS]

Definition at line 792 of file init_64.c.

cpumask_t numa_cpumask_lookup_table[MAX_NUMNODES]

Definition at line 793 of file init_64.c.

unsigned long sparc64_valid_addr_bitmap[VALID_ADDR_BITMAP_BYTES/sizeof(unsigned long)]

Definition at line 167 of file init_64.c.

unsigned int sparc_ramdisk_image
unsigned long sparc_ramdisk_image64
unsigned int sparc_ramdisk_size
struct tsb swapper_4m_tsb[KERNEL_TSB4M_NENTRIES]
pgd_t swapper_pg_dir[2048]

Definition at line 1743 of file init_64.c.

unsigned long tlb_context_cache = CTX_FIRST_VERSION - 1

Definition at line 659 of file init_64.c.