Main Page | Modules | Class List | File List | Class Members | File Members | Related Pages

Page Allocation/Deallocation
[Memory Management]

Page allocation just triggers mapping and deallocation triggers unmapping. More...

Functions

unsigned long FASTCALL (__get_free_pages(unsigned int gfp_mask, unsigned int order))
 Allocate Free Memory Pages.

unsigned long FASTCALL (get_zeroed_page(unsigned int gfp_mask))
 Allocate Free, Zeroed Memory Page.

void FASTCALL (free_pages(unsigned long addr, unsigned int order))
 Release Memory Pages.


Detailed Description

Page allocation just triggers mapping and deallocation triggers unmapping.

DDE does not keep track of these mappings (addresses and sizes). So all knowledge remains in the drivers themselves.

Memory allocations by get/free_pages are kmem!

All these are Linux' FASTCALL()s. That means for i386 and successors an extra GCC attribute (regparm(3)) is added. I will keep it here.


Function Documentation

void FASTCALL free_pages(unsigned long addr, unsigned int order)   ) 
 

Release Memory Pages.

Parameters:
addr start address of region
order log2(size)
Release 2^order contiguous pages.

Todo:
implementation

Definition at line 138 of file page.c.

unsigned long FASTCALL get_zeroed_page(unsigned int gfp_mask)   ) 
 

Allocate Free, Zeroed Memory Page.

Parameters:
gfp_mask flags
Returns:
0 on error, start address otherwise

Definition at line 116 of file page.c.

unsigned long FASTCALL __get_free_pages(unsigned int gfp_mask, unsigned int order)   ) 
 

Allocate Free Memory Pages.

Parameters:
gfp_mask flags
order log2(size)
Returns:
0 on error, start address otherwise
Allocate 2^order physical contiguous pages. (inherently aligned!)

Todo:
Physical alignment is not yet ensured.

Definition at line 62 of file page.c.

References address_add_region(), DEBUG_ERRORS, DEBUG_MSG, and DEBUG_PALLOC.


Linux DDE, written by Christian Helmuth  © 2003 Technische Universitaet Dresden