mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 13:02:38 +02:00
svc: add MapInsecureMemory/UnmapInsecureMemory
This commit is contained in:
parent
328d041c5c
commit
1543e84627
@ -40,6 +40,8 @@ typedef enum {
|
|||||||
MemType_KernelStack=0x13, ///< Mapped in kernel during \ref svcCreateThread.
|
MemType_KernelStack=0x13, ///< Mapped in kernel during \ref svcCreateThread.
|
||||||
MemType_CodeReadOnly=0x14, ///< Mapped in kernel during \ref svcControlCodeMemory.
|
MemType_CodeReadOnly=0x14, ///< Mapped in kernel during \ref svcControlCodeMemory.
|
||||||
MemType_CodeWritable=0x15, ///< Mapped in kernel during \ref svcControlCodeMemory.
|
MemType_CodeWritable=0x15, ///< Mapped in kernel during \ref svcControlCodeMemory.
|
||||||
|
MemType_Coverage=0x16, ///< Not available.
|
||||||
|
MemType_Insecure=0x17, ///< Mapped in kernel during \ref svcMapInsecureMemory.
|
||||||
} MemoryType;
|
} MemoryType;
|
||||||
|
|
||||||
/// Memory state bitmasks.
|
/// Memory state bitmasks.
|
||||||
@ -1568,3 +1570,22 @@ Result svcSetResourceLimitLimitValue(Handle reslimit, LimitableResource which, u
|
|||||||
void svcCallSecureMonitor(SecmonArgs* regs);
|
void svcCallSecureMonitor(SecmonArgs* regs);
|
||||||
|
|
||||||
///@}
|
///@}
|
||||||
|
|
||||||
|
///@name Memory management
|
||||||
|
///@{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Maps new insecure memory at the desired address. [15.0.0+]
|
||||||
|
* @return Result code.
|
||||||
|
* @note Syscall number 0x90.
|
||||||
|
*/
|
||||||
|
Result svcMapInsecureMemory(void *address, u64 size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Undoes the effects of \ref svcMapInsecureMemory. [15.0.0+]
|
||||||
|
* @return Result code.
|
||||||
|
* @note Syscall number 0x91.
|
||||||
|
*/
|
||||||
|
Result svcUnmapInsecureMemory(void *address, u64 size);
|
||||||
|
|
||||||
|
///@}
|
@ -798,3 +798,13 @@ SVC_BEGIN svcCallSecureMonitor
|
|||||||
stp x6, x7, [x8, #0x30]
|
stp x6, x7, [x8, #0x30]
|
||||||
ret
|
ret
|
||||||
SVC_END
|
SVC_END
|
||||||
|
|
||||||
|
SVC_BEGIN svcMapInsecureMemory
|
||||||
|
svc 0x90
|
||||||
|
ret
|
||||||
|
SVC_END
|
||||||
|
|
||||||
|
SVC_BEGIN svcUnmapInsecureMemory
|
||||||
|
svc 0x91
|
||||||
|
ret
|
||||||
|
SVC_END
|
||||||
|
Loading…
Reference in New Issue
Block a user