Implement svcGetSystemInfo, optimize svcCreatePort.

This commit is contained in:
Michael Scire 2018-04-24 07:21:21 -06:00
parent 35ac78053b
commit 18d3a30864
2 changed files with 28 additions and 4 deletions

View File

@ -671,6 +671,24 @@ Result svcWriteDebugProcessMemory(Handle debug, void* buffer, u64 addr, u64 size
///@}
///@name Miscellaneous
///@{
/**
* @brief Retrieves privileged information about the system, or a certain kernel object.
* @param[out] out Variable to which store the information.
* @param[in] id0 First ID of the property to retrieve.
* @param[in] handle Handle of the object to retrieve information from, or \ref INVALID_HANDLE to retrieve information about the system.
* @param[in] id1 Second ID of the property to retrieve.
* @return Result code.
* @remark The full list of property IDs can be found on the <a href="http://switchbrew.org/index.php?title=SVC#svcGetSystemInfo">switchbrew.org wiki</a>.
* @note Syscall number 0x6F.
* @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
*/
Result svcGetSystemInfo(u64* out, u64 id0, Handle handle, u64 id1);
///@}
///@name Inter-process communication (IPC)
///@{

View File

@ -345,14 +345,20 @@ SVC_BEGIN svcWriteDebugProcessMemory
ret
SVC_END
SVC_BEGIN svcGetSystemInfo
str x0, [sp, #-16]!
svc 0x6F
ldr x2, [sp], #16
str x1, [x2]
ret
SVC_END
SVC_BEGIN svcCreatePort
stp x0, x1, [sp, #-16]!
svc 0x70
ldr x3, [sp]
ldp x3, x4, [sp], #16
str w1, [x3]
ldr x3, [sp, #8]
str w2, [x3]
add sp, sp, #16
str w2, [x4]
ret
SVC_END