Function ctru_sys::svcControlMemory
source · pub unsafe extern "C" fn svcControlMemory(
addr_out: *mut u32_,
addr0: u32_,
addr1: u32_,
size: u32_,
op: MemOp,
perm: MemPerm
) -> Result
Expand description
Memory management
§*
- Controls memory mapping
§Arguments
-
addr_out
(direction out) - The virtual address resulting from the operation. Usually the same as addr0. -
addr0
- The virtual address to be used for the operation. -
addr1
- The virtual address to be (un)mirrored byaddr0
when using MEMOP_MAP or MEMOP_UNMAP. It has to be pointing to a RW memory. -
Use NULL if the operation is MEMOP_FREE or MEMOP_ALLOC.
-
size
- The requested size for MEMOP_ALLOC and MEMOP_ALLOC_LINEAR. -
op
- Operation flags. See MemOp. -
perm
- A combination of MEMPERM_READ and MEMPERM_WRITE. Using MEMPERM_EXECUTE will return an error. Value 0 is used when unmapping memory. -
If a memory is mapped for two or more addresses, you have to use MEMOP_UNMAP before being able to MEMOP_FREE it.
-
MEMOP_MAP will fail if
addr1
was already mapped to another address. -
More information is available at http://3dbrew.org/wiki/SVC#Memory_Mapping.