Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
bootmem.c File Reference
#include <linux/init.h>
#include <linux/pfn.h>
#include <linux/slab.h>
#include <linux/bootmem.h>
#include <linux/export.h>
#include <linux/kmemleak.h>
#include <linux/range.h>
#include <linux/memblock.h>
#include <asm/bug.h>
#include <asm/io.h>
#include <asm/processor.h>
#include "internal.h"

Go to the source code of this file.

Macros

#define bdebug(fmt, args...)
 
#define ARCH_LOW_ADDRESS_LIMIT   0xffffffffUL
 

Functions

 EXPORT_SYMBOL (contig_page_data)
 
 early_param ("bootmem_debug", bootmem_debug_setup)
 
unsigned long __init bootmem_bootmap_pages (unsigned long pages)
 
unsigned long __init init_bootmem_node (pg_data_t *pgdat, unsigned long freepfn, unsigned long startpfn, unsigned long endpfn)
 
unsigned long __init init_bootmem (unsigned long start, unsigned long pages)
 
void __init free_bootmem_late (unsigned long addr, unsigned long size)
 
unsigned long __init free_all_bootmem_node (pg_data_t *pgdat)
 
unsigned long __init free_all_bootmem (void)
 
void __init free_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size)
 
void __init free_bootmem (unsigned long addr, unsigned long size)
 
int __init reserve_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size, int flags)
 
int __init reserve_bootmem (unsigned long addr, unsigned long size, int flags)
 
int __weak __init reserve_bootmem_generic (unsigned long phys, unsigned long len, int flags)
 
void *__init __alloc_bootmem_nopanic (unsigned long size, unsigned long align, unsigned long goal)
 
void *__init __alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal)
 
void *__init ___alloc_bootmem_node_nopanic (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal, unsigned long limit)
 
void *__init __alloc_bootmem_node_nopanic (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal)
 
void *__init ___alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal, unsigned long limit)
 
void *__init __alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal)
 
void *__init __alloc_bootmem_node_high (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal)
 
void *__init __alloc_bootmem_low (unsigned long size, unsigned long align, unsigned long goal)
 
void *__init __alloc_bootmem_low_node (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal)
 

Variables

struct pglist_data __refdata contig_page_data
 
unsigned long max_low_pfn
 
unsigned long min_low_pfn
 
unsigned long max_pfn
 
bootmem_data_t
bootmem_node_data[MAX_NUMNODES
__initdata = LIST_HEAD_INIT(bdata_list)
 

Macro Definition Documentation

#define ARCH_LOW_ADDRESS_LIMIT   0xffffffffUL

Definition at line 811 of file bootmem.c.

#define bdebug (   fmt,
  args... 
)
Value:
({ \
if (unlikely(bootmem_debug)) \
printk(KERN_INFO \
"bootmem::%s " fmt, \
__func__, ## args); \
})

Definition at line 50 of file bootmem.c.

Function Documentation

void* __init ___alloc_bootmem_node ( pg_data_t pgdat,
unsigned long  size,
unsigned long  align,
unsigned long  goal,
unsigned long  limit 
)

Definition at line 742 of file bootmem.c.

void* __init ___alloc_bootmem_node_nopanic ( pg_data_t pgdat,
unsigned long  size,
unsigned long  align,
unsigned long  goal,
unsigned long  limit 
)

Definition at line 701 of file bootmem.c.

void* __init __alloc_bootmem ( unsigned long  size,
unsigned long  align,
unsigned long  goal 
)

__alloc_bootmem - allocate boot memory : size of the request in bytes : alignment of the region : preferred starting address of the region

The goal is dropped if it can not be satisfied and the allocation will fall back to memory below .

Allocation may happen on any node in the system.

The function panics if the request can not be satisfied.

Definition at line 693 of file bootmem.c.

void* __init __alloc_bootmem_low ( unsigned long  size,
unsigned long  align,
unsigned long  goal 
)

__alloc_bootmem_low - allocate low boot memory : size of the request in bytes : alignment of the region : preferred starting address of the region

The goal is dropped if it can not be satisfied and the allocation will fall back to memory below .

Allocation may happen on any node in the system.

The function panics if the request can not be satisfied.

Definition at line 827 of file bootmem.c.

void* __init __alloc_bootmem_low_node ( pg_data_t pgdat,
unsigned long  size,
unsigned long  align,
unsigned long  goal 
)

__alloc_bootmem_low_node - allocate low boot memory from a specific node : node to allocate from : size of the request in bytes : alignment of the region : preferred starting address of the region

The goal is dropped if it can not be satisfied and the allocation will fall back to memory below .

Allocation may fall back to any node in the system if the specified node can not hold the requested memory.

The function panics if the request can not be satisfied.

Definition at line 848 of file bootmem.c.

void* __init __alloc_bootmem_node ( pg_data_t pgdat,
unsigned long  size,
unsigned long  align,
unsigned long  goal 
)

__alloc_bootmem_node - allocate boot memory from a specific node : node to allocate from : size of the request in bytes : alignment of the region : preferred starting address of the region

The goal is dropped if it can not be satisfied and the allocation will fall back to memory below .

Allocation may fall back to any node in the system if the specified node can not hold the requested memory.

The function panics if the request can not be satisfied.

Definition at line 772 of file bootmem.c.

void* __init __alloc_bootmem_node_high ( pg_data_t pgdat,
unsigned long  size,
unsigned long  align,
unsigned long  goal 
)

Definition at line 781 of file bootmem.c.

void* __init __alloc_bootmem_node_nopanic ( pg_data_t pgdat,
unsigned long  size,
unsigned long  align,
unsigned long  goal 
)

Definition at line 733 of file bootmem.c.

void* __init __alloc_bootmem_nopanic ( unsigned long  size,
unsigned long  align,
unsigned long  goal 
)

__alloc_bootmem_nopanic - allocate boot memory without panicking : size of the request in bytes : alignment of the region : preferred starting address of the region

The goal is dropped if it can not be satisfied and the allocation will fall back to memory below .

Allocation may happen on any node in the system.

Returns NULL on failure.

Definition at line 657 of file bootmem.c.

unsigned long __init bootmem_bootmap_pages ( unsigned long  pages)

bootmem_bootmap_pages - calculate bitmap size in pages : number of pages the bitmap has to represent

Definition at line 68 of file bootmem.c.

early_param ( "bootmem_debug"  ,
bootmem_debug_setup   
)
EXPORT_SYMBOL ( contig_page_data  )
unsigned long __init free_all_bootmem ( void  )

free_all_bootmem - release free pages to the buddy allocator

Returns the number of pages actually released.

Definition at line 249 of file bootmem.c.

unsigned long __init free_all_bootmem_node ( pg_data_t pgdat)

free_all_bootmem_node - release a node's free pages to the buddy allocator : node to be released

Returns the number of pages actually released.

Definition at line 238 of file bootmem.c.

void __init free_bootmem ( unsigned long  addr,
unsigned long  size 
)

free_bootmem - mark a page range as usable : starting address of the range : size of the range in bytes

Partial pages will be considered reserved and left as they are.

The range must be contiguous but may span node boundaries.

Definition at line 387 of file bootmem.c.

void __init free_bootmem_late ( unsigned long  addr,
unsigned long  size 
)

Definition at line 157 of file bootmem.c.

void __init free_bootmem_node ( pg_data_t pgdat,
unsigned long  physaddr,
unsigned long  size 
)

free_bootmem_node - mark a page range as usable : node the range resides on : starting address of the range : size of the range in bytes

Partial pages will be considered reserved and left as they are.

The range must reside completely on the specified node.

Definition at line 365 of file bootmem.c.

unsigned long __init init_bootmem ( unsigned long  start,
unsigned long  pages 
)

init_bootmem - register boot memory : pfn where the bitmap is to be placed : number of available physical pages

Returns the number of bytes needed to hold the bitmap.

Definition at line 141 of file bootmem.c.

unsigned long __init init_bootmem_node ( pg_data_t pgdat,
unsigned long  freepfn,
unsigned long  startpfn,
unsigned long  endpfn 
)

init_bootmem_node - register a node as boot memory : node to register : pfn where the bitmap for this node is to be placed : first pfn on the node : first pfn after the node

Returns the number of bytes needed to hold the bitmap for this node.

Definition at line 128 of file bootmem.c.

int __init reserve_bootmem ( unsigned long  addr,
unsigned long  size,
int  flags 
)

reserve_bootmem - mark a page range as reserved : starting address of the range : size of the range in bytes : reservation flags (see linux/bootmem.h)

Partial pages will be reserved.

The range must be contiguous but may span node boundaries.

Definition at line 431 of file bootmem.c.

int __weak __init reserve_bootmem_generic ( unsigned long  phys,
unsigned long  len,
int  flags 
)

Definition at line 442 of file bootmem.c.

int __init reserve_bootmem_node ( pg_data_t pgdat,
unsigned long  physaddr,
unsigned long  size,
int  flags 
)

reserve_bootmem_node - mark a page range as reserved : node the range resides on : starting address of the range : size of the range in bytes : reservation flags (see linux/bootmem.h)

Partial pages will be reserved.

The range must reside completely on the specified node.

Definition at line 410 of file bootmem.c.

Variable Documentation

struct list_head bdata_list __initdata = LIST_HEAD_INIT(bdata_list)

Definition at line 37 of file bootmem.c.

struct pglist_data __refdata contig_page_data
Initial value:
= {
.bdata = &bootmem_node_data[0]
}

Definition at line 27 of file bootmem.c.

unsigned long max_low_pfn

Definition at line 33 of file bootmem.c.

unsigned long max_pfn

Definition at line 35 of file bootmem.c.

unsigned long min_low_pfn

Definition at line 34 of file bootmem.c.