|
libnx v4.9.0
|
Virtual memory mapping utilities. More...
#include "../types.h"Go to the source code of this file.
Typedefs | |
| typedef struct VirtmemReservation | VirtmemReservation |
| Address space reservation type (see virtmemAddReservation) | |
Functions | |
| void | virtmemLock (void) |
| Locks the virtual memory manager mutex. | |
| void | virtmemUnlock (void) |
| Unlocks the virtual memory manager mutex. | |
| void * | virtmemFindAslr (size_t size, size_t guard_size) |
| Finds a random slice of free general purpose address space. | |
| void * | virtmemFindStack (size_t size, size_t guard_size) |
| Finds a random slice of free stack address space. | |
| void * | virtmemFindCodeMemory (size_t size, size_t guard_size) |
| Finds a random slice of free code memory address space. | |
| VirtmemReservation * | virtmemAddReservation (void *mem, size_t size) |
| Reserves a range of memory address space. | |
| void | virtmemRemoveReservation (VirtmemReservation *rv) |
| Releases a memory address space reservation. | |
Virtual memory mapping utilities.
| VirtmemReservation * virtmemAddReservation | ( | void * | mem, |
| size_t | size | ||
| ) |
Reserves a range of memory address space.
| mem | Pointer to the address space slice. |
| size | Size of the slice. |
| void * virtmemFindAslr | ( | size_t | size, |
| size_t | guard_size | ||
| ) |
Finds a random slice of free general purpose address space.
| size | Desired size of the slice (rounded up to page alignment). |
| guard_size | Desired size of the unmapped guard areas surrounding the slice (rounded up to page alignment). |
| void * virtmemFindCodeMemory | ( | size_t | size, |
| size_t | guard_size | ||
| ) |
Finds a random slice of free code memory address space.
| size | Desired size of the slice (rounded up to page alignment). |
| guard_size | Desired size of the unmapped guard areas surrounding the slice (rounded up to page alignment). |
| void * virtmemFindStack | ( | size_t | size, |
| size_t | guard_size | ||
| ) |
Finds a random slice of free stack address space.
| size | Desired size of the slice (rounded up to page alignment). |
| guard_size | Desired size of the unmapped guard areas surrounding the slice (rounded up to page alignment). |
| void virtmemRemoveReservation | ( | VirtmemReservation * | rv | ) |
Releases a memory address space reservation.
| rv | Reservation to release. |