Phoenix
Object-oriented orthogonally persistent operating system
|
Kernel virtual memory manager implementation. More...
Classes | |
struct | KmemDebugOverhead |
Overhead for dynamically allocated memory chunks for storing debug information. More... | |
Functions | |
static void | MapHeap () |
Map all pages starting from the last mapped heap address till the current heap pointer. | |
static void * | KmemAllocate (size_t size, size_t align=0) |
Kernel dynamic memory allocation. | |
static void | KmemFree (void *ptr) |
Kernel dynamic memory freeing. | |
void * | __operator_new (size_t size, const char *file, int line, bool isArray, size_t align) |
Back-end for operator new which should be implemented by each environment. | |
void * | __operator_new (size_t size, bool isArray, size_t align) |
Back-end for operator new which should be implemented by each environment. | |
void | __operator_delete (void *ptr, bool isArray) |
Back-end for operator delete which should be implemented by each environment. | |
Variables | |
static vaddr_t | tmpHeap |
Temporal location for heap pointer (during vm::MM::IS_INITIAL phase). | |
static vaddr_t | tmpQuickMap |
Temporal location for quick map pages address (during vm::MM::IS_INITIAL phase). | |
static void ** | tmpQuickMapPte |
Temporal location for quick map PTEs (during vm::MM::IS_INITIAL phase). | |
static paddr_t | tmpDefaultLatRoot |
Temporal location for defaultLatEntryroot table (during vm::MM::IS_INITIAL phase). | |
static vaddr_t | tmpLastMappedHeap |
Temporal location for last mapped heap address. |
Kernel virtual memory manager implementation.
void __operator_delete | ( | void * | ptr, |
bool | isArray = false |
||
) |
Back-end for operator delete which should be implemented by each environment.
ptr | Pointer to the memory block being freed. |
isArray | true if delete[] operator was invoked, false otherwise. |
void* __operator_new | ( | size_t | size, |
bool | isArray = false , |
||
size_t | align = 0 |
||
) |
Back-end for operator new which should be implemented by each environment.
This version is invoked in release builds.
size | Allocation size. |
isArray | true if new[] operator was invoked, false otherwise. |
align | Alignment value. Zero indicates that no specific alignment required. |
void* __operator_new | ( | size_t | size, |
const char * | file, | ||
int | line, | ||
bool | isArray = false , |
||
size_t | align = 0 |
||
) |
Back-end for operator new which should be implemented by each environment.
This version is invoked in debug builds with source code location in arguments.
size | Allocation size. |
file | Source file name where from the operator is invoked. |
line | Line number in the source file where from the operator is invoked. |
isArray | true if new[] operator was invoked, false otherwise. |
align | Alignment value. Zero indicates that no specific alignment required. |
static void* KmemAllocate | ( | size_t | size, |
size_t | align = 0 |
||
) | [inline, static] |
Kernel dynamic memory allocation.
This function can be used only by new operators. All the rest code must use new operators for all dynamic memory allocations.
size | Size of memory chunk to allocate. |
align | Alignment of memory chunk. Must be power of two. Zero for default alignment. |
static void KmemFree | ( | void * | ptr | ) | [inline, static] |
Kernel dynamic memory freeing.
This function can be used only by delete operators. All the rest code must use delete operators for all dynamic memory freeings.
ptr | Pointer to dynamically allocated memory chunk. Nothing is done if it is zero. |
static void MapHeap | ( | ) | [static] |
Map all pages starting from the last mapped heap address till the current heap pointer.
This function is used only during vm::MM::IS_INITIAL phase.
paddr_t tmpDefaultLatRoot [static] |
Temporal location for defaultLatEntryroot table (during vm::MM::IS_INITIAL phase).
Temporal location for heap pointer (during vm::MM::IS_INITIAL phase).
vaddr_t tmpLastMappedHeap [static] |
Temporal location for last mapped heap address.
Heap is mapped up to this address. The value is valid during vm::MM::IS_INITIAL phase.
vaddr_t tmpQuickMap [static] |
Temporal location for quick map pages address (during vm::MM::IS_INITIAL phase).
void** tmpQuickMapPte [static] |
Temporal location for quick map PTEs (during vm::MM::IS_INITIAL phase).