메소드 | 설명 | |
---|---|---|
Alloc ( ) : void* |
Allocates a page of memory. This function returns null when out of memory.
|
|
Dealloc ( void page ) : void |
Deallocates the memory page pointed to by page.
|
|
Dump ( int count ) : void | ||
DumpInfo ( ) : void | ||
DumpStack ( uint stack, uint stackptr, int count ) : void | ||
GetPageAttributes ( void page, uint granularity, |
||
IsPageFree ( void page ) : bool |
Checks if a given page is allocated. If the page is allocated, the method returns true. This function starts from the current stack pointer and goes backward.
|
|
IsPageReserved ( void page ) : bool |
Returns true if the given page is reserved (that is, not available for allocation).
|
|
MapPage ( void page, void physPage, uint granularity, PageAttributes attr ) : PageAllocator.Errors |
Modifies the virtual memory mapping of the given super-page to point to the given physical super page. Both pointers must be aligned along the platform's native super-page boundaries. This function is only available on platforms which can provide super-page mapping. The Intel 386 and later processors support this using the 'page directory', which maps large 4MB sections of memory at a time (via redirection to page tables which contain 4KB blocks). |
|
ReservePage ( void page ) : bool |
Reserves a memory page so that it cannot be allocated using M:Alloc() or M:RangeAlloc(uint count).
|
|
ReservePageRange ( void firstPage, uint pages, string name ) : bool |
Reserves a range of memory pages so that they cannot be allocated using M:Alloc() or M:RangeAlloc(uint count).
|
|
SetPageAttributes ( void page, uint granularity, PageAttributes attr ) : Errors | ||
Setup ( byte kernelOffset, uint _kernelSize, uint totalKbMem ) : void |
Initializes page management and paging. Using Alloc and related management functions before calling this function results in a kernel panic. After this function is called, the ReservePage and ReservePageRange functions can be used to reserve memory that should not be allocated. You should ensure that no memory allocations have happened between calling this function and reserving memory.
|
메소드 | 설명 | |
---|---|---|
DumpReservedStack ( ReservedPages pageStack, uint stackPtr, int count ) : void | ||
GetReservedPage ( ) : ReservedPages* | ||
PopFreePage ( ) : void* |
Pops the free page from the free page stack
|
|
PrintError ( Errors error ) : void | ||
PtrToPage ( void ptr ) : void* |
Gets the page address of a given pointer.
|
|
PushFreePage ( void page ) : void |
Pushes the free page to the free page stack
|
public static Dealloc ( void page ) : void | ||
page | void | /// A pointer which is aligned along the platform's native page boundaries. /// |
리턴 | void |
public static DumpStack ( uint stack, uint stackptr, int count ) : void | ||
stack | uint | |
stackptr | uint | |
count | int | |
리턴 | void |
public static GetPageAttributes ( void page, uint granularity, |
||
page | void | |
granularity | uint | |
ret_err | ||
리턴 | PageAttributes |
public static MapPage ( void page, void physPage, uint granularity, PageAttributes attr ) : PageAllocator.Errors | ||
page | void | |
physPage | void | |
granularity | uint | |
attr | PageAttributes | /// The attributes to apply to the paging table entry for this super-page. If /// one or more flags given in this parameter are not supported by the current /// platform, the call will fail, returning false. /// |
리턴 | PageAllocator.Errors |
public static ReservePage ( void page ) : bool | ||
page | void | /// A pointer which is aligned along the platform's native page boundaries. /// |
리턴 | bool |
public static ReservePageRange ( void firstPage, uint pages, string name ) : bool | ||
firstPage | void | |
pages | uint | /// The amount of pages to reserve. /// |
name | string | |
리턴 | bool |
public static SetPageAttributes ( void page, uint granularity, PageAttributes attr ) : Errors | ||
page | void | |
granularity | uint | |
attr | PageAttributes | |
리턴 | Errors |
public static Setup ( byte kernelOffset, uint _kernelSize, uint totalKbMem ) : void | ||
kernelOffset | byte | |
_kernelSize | uint | |
totalKbMem | uint | |
리턴 | void |