Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
bootmem.h File Reference
#include <linux/mmzone.h>
#include <asm/dma.h>

Go to the source code of this file.

Data Structures

struct  bootmem_data
 

Macros

#define BOOTMEM_DEFAULT   0
 
#define BOOTMEM_EXCLUSIVE   (1<<0)
 
#define BOOTMEM_LOW_LIMIT   __pa(MAX_DMA_ADDRESS)
 
#define alloc_bootmem(x)   __alloc_bootmem(x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT)
 
#define alloc_bootmem_align(x, align)   __alloc_bootmem(x, align, BOOTMEM_LOW_LIMIT)
 
#define alloc_bootmem_nopanic(x)   __alloc_bootmem_nopanic(x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT)
 
#define alloc_bootmem_pages(x)   __alloc_bootmem(x, PAGE_SIZE, BOOTMEM_LOW_LIMIT)
 
#define alloc_bootmem_pages_nopanic(x)   __alloc_bootmem_nopanic(x, PAGE_SIZE, BOOTMEM_LOW_LIMIT)
 
#define alloc_bootmem_node(pgdat, x)   __alloc_bootmem_node(pgdat, x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT)
 
#define alloc_bootmem_node_nopanic(pgdat, x)   __alloc_bootmem_node_nopanic(pgdat, x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT)
 
#define alloc_bootmem_pages_node(pgdat, x)   __alloc_bootmem_node(pgdat, x, PAGE_SIZE, BOOTMEM_LOW_LIMIT)
 
#define alloc_bootmem_pages_node_nopanic(pgdat, x)   __alloc_bootmem_node_nopanic(pgdat, x, PAGE_SIZE, BOOTMEM_LOW_LIMIT)
 
#define alloc_bootmem_low(x)   __alloc_bootmem_low(x, SMP_CACHE_BYTES, 0)
 
#define alloc_bootmem_low_pages(x)   __alloc_bootmem_low(x, PAGE_SIZE, 0)
 
#define alloc_bootmem_low_pages_node(pgdat, x)   __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0)
 
#define HASH_EARLY   0x00000001 /* Allocating during early boot? */
 
#define HASH_SMALL
 
#define HASHDIST_DEFAULT   0
 

Typedefs

typedef struct bootmem_data bootmem_data_t
 

Functions

unsigned long bootmem_bootmap_pages (unsigned long)
 
unsigned long init_bootmem_node (pg_data_t *pgdat, unsigned long freepfn, unsigned long startpfn, unsigned long endpfn)
 
unsigned long init_bootmem (unsigned long addr, unsigned long memend)
 
unsigned long free_low_memory_core_early (int nodeid)
 
unsigned long free_all_bootmem_node (pg_data_t *pgdat)
 
unsigned long free_all_bootmem (void)
 
void free_bootmem_node (pg_data_t *pgdat, unsigned long addr, unsigned long size)
 
void free_bootmem (unsigned long addr, unsigned long size)
 
void free_bootmem_late (unsigned long addr, unsigned long size)
 
int reserve_bootmem (unsigned long addr, unsigned long size, int flags)
 
int reserve_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size, int flags)
 
void__alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal)
 
void__alloc_bootmem_nopanic (unsigned long size, unsigned long align, unsigned long goal)
 
void__alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal)
 
void__alloc_bootmem_node_high (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal)
 
void__alloc_bootmem_node_nopanic (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal)
 
void___alloc_bootmem_node_nopanic (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal, unsigned long limit)
 
void__alloc_bootmem_low (unsigned long size, unsigned long align, unsigned long goal)
 
void__alloc_bootmem_low_node (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal)
 
int reserve_bootmem_generic (unsigned long addr, unsigned long size, int flags)
 
voidalloc_large_system_hash (const char *tablename, unsigned long bucketsize, unsigned long numentries, int scale, int flags, unsigned int *_hash_shift, unsigned int *_hash_mask, unsigned long low_limit, unsigned long high_limit)
 

Variables

unsigned long max_low_pfn
 
unsigned long min_low_pfn
 
unsigned long max_pfn
 
bootmem_data_t bootmem_node_data []
 
int hashdist
 

Macro Definition Documentation

#define alloc_bootmem (   x)    __alloc_bootmem(x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT)

Definition at line 114 of file bootmem.h.

#define alloc_bootmem_align (   x,
  align 
)    __alloc_bootmem(x, align, BOOTMEM_LOW_LIMIT)

Definition at line 116 of file bootmem.h.

#define alloc_bootmem_low (   x)    __alloc_bootmem_low(x, SMP_CACHE_BYTES, 0)

Definition at line 133 of file bootmem.h.

#define alloc_bootmem_low_pages (   x)    __alloc_bootmem_low(x, PAGE_SIZE, 0)

Definition at line 135 of file bootmem.h.

#define alloc_bootmem_low_pages_node (   pgdat,
  x 
)    __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0)

Definition at line 137 of file bootmem.h.

#define alloc_bootmem_node (   pgdat,
  x 
)    __alloc_bootmem_node(pgdat, x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT)

Definition at line 124 of file bootmem.h.

#define alloc_bootmem_node_nopanic (   pgdat,
  x 
)    __alloc_bootmem_node_nopanic(pgdat, x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT)

Definition at line 126 of file bootmem.h.

#define alloc_bootmem_nopanic (   x)    __alloc_bootmem_nopanic(x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT)

Definition at line 118 of file bootmem.h.

#define alloc_bootmem_pages (   x)    __alloc_bootmem(x, PAGE_SIZE, BOOTMEM_LOW_LIMIT)

Definition at line 120 of file bootmem.h.

#define alloc_bootmem_pages_node (   pgdat,
  x 
)    __alloc_bootmem_node(pgdat, x, PAGE_SIZE, BOOTMEM_LOW_LIMIT)

Definition at line 128 of file bootmem.h.

#define alloc_bootmem_pages_node_nopanic (   pgdat,
  x 
)    __alloc_bootmem_node_nopanic(pgdat, x, PAGE_SIZE, BOOTMEM_LOW_LIMIT)

Definition at line 130 of file bootmem.h.

#define alloc_bootmem_pages_nopanic (   x)    __alloc_bootmem_nopanic(x, PAGE_SIZE, BOOTMEM_LOW_LIMIT)

Definition at line 122 of file bootmem.h.

#define BOOTMEM_DEFAULT   0

Definition at line 65 of file bootmem.h.

#define BOOTMEM_EXCLUSIVE   (1<<0)

Definition at line 66 of file bootmem.h.

#define BOOTMEM_LOW_LIMIT   __pa(MAX_DMA_ADDRESS)

Definition at line 111 of file bootmem.h.

#define HASH_EARLY   0x00000001 /* Allocating during early boot? */

Definition at line 162 of file bootmem.h.

#define HASH_SMALL
Value:
0x00000002 /* sub-page allocation allowed, min
* shift passed via *_hash_shift */

Definition at line 163 of file bootmem.h.

#define HASHDIST_DEFAULT   0

Definition at line 171 of file bootmem.h.

Typedef Documentation

Function Documentation

void* ___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* __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* __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* __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* __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* __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* __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* __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.

void* alloc_large_system_hash ( const char tablename,
unsigned long  bucketsize,
unsigned long  numentries,
int  scale,
int  flags,
unsigned int _hash_shift,
unsigned int _hash_mask,
unsigned long  low_limit,
unsigned long  high_limit 
)

Definition at line 5401 of file page_alloc.c.

unsigned long 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.

unsigned long 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 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 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 free_bootmem_late ( unsigned long  addr,
unsigned long  size 
)

Definition at line 157 of file bootmem.c.

void 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 free_low_memory_core_early ( int  nodeid)

Definition at line 123 of file nobootmem.c.

unsigned long 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_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 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 reserve_bootmem_generic ( unsigned long  addr,
unsigned long  size,
int  flags 
)

Definition at line 442 of file bootmem.c.

int 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

bootmem_data_t bootmem_node_data[]
int hashdist

Definition at line 5382 of file page_alloc.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.