Add NS_RebootSystem

This commit is contained in:
Pirater12 2018-03-09 14:57:29 +05:30 committed by fincs
parent a4210af6c2
commit a087e33414
2 changed files with 16 additions and 1 deletions

View File

@ -45,4 +45,7 @@ Result NS_RebootToTitle(u8 mediatype, u64 titleid);
* @param titleid ID of the title to terminate.
* @param timeout Timeout in nanoseconds. Pass 0 if not required.
*/
Result NS_TerminateProcessTID(u64 titleid, u64 timeout);
Result NS_TerminateProcessTID(u64 titleid, u64 timeout);
/// Reboots the system
Result NS_RebootSystem(void);

View File

@ -116,3 +116,15 @@ Result NS_TerminateProcessTID(u64 titleid, u64 timeout)
return (Result)cmdbuf[1];
}
Result NS_RebootSystem(void)
{
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0x16,0,0); // 0x160000
if(R_FAILED(ret = svcSendSyncRequest(nsHandle)))return ret;
return (Result)cmdbuf[1];
}