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.
void FASTCALL (__free_pages(struct page *page, 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(struct page *page, unsigned int order)   ) 

Release Memory Pages.

Parameters:
addr start address of region
order log2(size)
Release struct page * and calls free_page to release page.

Definition at line 170 of file page.c.

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.

Definition at line 133 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 113 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 59 of file page.c.


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