libnx
virtmem.h
Go to the documentation of this file.
1 /**
2  * @file virtmem.h
3  * @brief Virtual memory mapping utilities
4  * @author plutoo
5  * @copyright libnx Authors
6  */
7 #pragma once
8 #include "../types.h"
9 
10 /**
11  * @brief Reserves a slice of general purpose address space.
12  * @param size The size of the slice of address space that will be reserved (rounded up to page alignment).
13  * @return Pointer to the slice of address space, or NULL on failure.
14  */
15 void* virtmemReserve(size_t size);
16 
17 /**
18  * @brief Relinquishes a slice of address space reserved with virtmemReserve (currently no-op).
19  * @param addr Pointer to the slice.
20  * @param size Size of the slice.
21  */
22 void virtmemFree(void* addr, size_t size);
23 
24 /**
25  * @brief Reserves a slice of address space inside the alias memory mapping region(s) (for use with svcMapMemory).
26  * @param size The size of the slice of address space that will be reserved (rounded up to page alignment).
27  * @return Pointer to the slice of address space, or NULL on failure.
28  */
29 void* virtmemReserveMap(size_t size);
30 
31 /**
32  * @brief Relinquishes a slice of address space reserved with virtmemReserveMap (currently no-op).
33  * @param addr Pointer to the slice.
34  * @param size Size of the slice.
35  */
36 void virtmemFreeMap(void* addr, size_t size);
void * virtmemReserve(size_t size)
Reserves a slice of general purpose address space.
void virtmemFreeMap(void *addr, size_t size)
Relinquishes a slice of address space reserved with virtmemReserveMap (currently no-op).
void virtmemFree(void *addr, size_t size)
Relinquishes a slice of address space reserved with virtmemReserve (currently no-op).
void * virtmemReserveMap(size_t size)
Reserves a slice of address space inside the alias memory mapping region(s) (for use with svcMapMemor...