Changes

1,840 bytes added ,  20:33, 7 January 2020
Page cleanup - the end
Line 3: Line 3:  
= System calls =
 
= System calls =
 
{| class=wikitable
 
{| class=wikitable
! Id || Name || In || Out
+
! Id || Name
 
|-
 
|-
|  0x1 || [[#SetHeapSize]] || ||
+
|  0x1 || [[#SetHeapSize]]
 
|-
 
|-
|  0x2 || [[#SetMemoryPermission]] || ||
+
|  0x2 || [[#SetMemoryPermission]]
 
|-
 
|-
|  0x3 || [[#SetMemoryAttribute]] || ||
+
|  0x3 || [[#SetMemoryAttribute]]
 
|-
 
|-
|  0x4 || [[#MapMemory]] || ||
+
|  0x4 || [[#MapMemory]]
 
|-
 
|-
|  0x5 || [[#UnmapMemory]] || ||
+
|  0x5 || [[#UnmapMemory]]
 
|-
 
|-
|  0x6 || [[#QueryMemory]] || ||
+
|  0x6 || [[#QueryMemory]]
 
|-
 
|-
|  0x7 || [[#ExitProcess]] || ||
+
|  0x7 || [[#ExitProcess]]
 
|-
 
|-
|  0x8 || [[#CreateThread]] || ||
+
|  0x8 || [[#CreateThread]]
 
|-
 
|-
|  0x9 || [[#StartThread]] || ||
+
|  0x9 || [[#StartThread]]
 
|-
 
|-
|  0xA || [[#ExitThread]] || ||
+
|  0xA || [[#ExitThread]]
 
|-
 
|-
|  0xB || [[#SleepThread]] || ||
+
|  0xB || [[#SleepThread]]
 
|-
 
|-
|  0xC || [[#GetThreadPriority]] || ||
+
|  0xC || [[#GetThreadPriority]]
 
|-
 
|-
|  0xD || [[#SetThreadPriority]] || ||
+
|  0xD || [[#SetThreadPriority]]
 
|-
 
|-
|  0xE || [[#GetThreadCoreMask]] || ||
+
|  0xE || [[#GetThreadCoreMask]]
 
|-
 
|-
|  0xF || [[#SetThreadCoreMask]] || ||
+
|  0xF || [[#SetThreadCoreMask]]
 
|-
 
|-
| 0x10 || [[#GetCurrentProcessorNumber]] || ||
+
| 0x10 || [[#GetCurrentProcessorNumber]]
 
|-
 
|-
| 0x11 || [[#SignalEvent]] || ||
+
| 0x11 || [[#SignalEvent]]
 
|-
 
|-
| 0x12 || [[#ClearEvent]] || ||
+
| 0x12 || [[#ClearEvent]]
 
|-
 
|-
| 0x13 || [[#MapSharedMemory]] || ||
+
| 0x13 || [[#MapSharedMemory]]
 
|-
 
|-
| 0x14 || [[#UnmapSharedMemory]] || ||
+
| 0x14 || [[#UnmapSharedMemory]]
 
|-
 
|-
| 0x15 || [[#CreateTransferMemory]] || ||
+
| 0x15 || [[#CreateTransferMemory]]
 
|-
 
|-
| 0x16 || [[#CloseHandle]] || ||
+
| 0x16 || [[#CloseHandle]]
 
|-
 
|-
| 0x17 || [[#ResetSignal]] || ||
+
| 0x17 || [[#ResetSignal]]
 
|-
 
|-
| 0x18 || [[#WaitSynchronization]] || ||
+
| 0x18 || [[#WaitSynchronization]]
 
|-
 
|-
| 0x19 || [[#CancelSynchronization]] || ||
+
| 0x19 || [[#CancelSynchronization]]
 
|-
 
|-
| 0x1A || [[#ArbitrateLock]] || ||
+
| 0x1A || [[#ArbitrateLock]]
 
|-
 
|-
| 0x1B || [[#ArbitrateUnlock]] || ||
+
| 0x1B || [[#ArbitrateUnlock]]
 
|-
 
|-
| 0x1C || [[#WaitProcessWideKeyAtomic]] || ||
+
| 0x1C || [[#WaitProcessWideKeyAtomic]]
 
|-
 
|-
| 0x1D || [[#SignalProcessWideKey]] || ||
+
| 0x1D || [[#SignalProcessWideKey]]
 
|-
 
|-
| 0x1E || [[#GetSystemTick]] || ||
+
| 0x1E || [[#GetSystemTick]]
 
|-
 
|-
| 0x1F || [[#ConnectToNamedPort]] || ||
+
| 0x1F || [[#ConnectToNamedPort]]
 
|-
 
|-
| 0x20 || [[#SendSyncRequestLight]] || ||
+
| 0x20 || [[#SendSyncRequestLight]]
 
|-
 
|-
| 0x21 || [[#SendSyncRequest]] || ||
+
| 0x21 || [[#SendSyncRequest]]
 
|-
 
|-
| 0x22 || [[#SendSyncRequestWithUserBuffer]] || ||
+
| 0x22 || [[#SendSyncRequestWithUserBuffer]]
 
|-
 
|-
| 0x23 || [[#SendAsyncRequestWithUserBuffer]] || ||
+
| 0x23 || [[#SendAsyncRequestWithUserBuffer]]
 
|-
 
|-
| 0x24 || [[#GetProcessId]] || ||
+
| 0x24 || [[#GetProcessId]]
 
|-
 
|-
| 0x25 || [[#GetThreadId]] || ||
+
| 0x25 || [[#GetThreadId]]
 
|-
 
|-
| 0x26 || [[#Break]] || ||
+
| 0x26 || [[#Break]]
 
|-
 
|-
| 0x27 || [[#OutputDebugString]] || ||
+
| 0x27 || [[#OutputDebugString]]
 
|-
 
|-
| 0x28 || [[#ReturnFromException]] || ||
+
| 0x28 || [[#ReturnFromException]]
 
|-
 
|-
| 0x29 || [[#GetInfo]] || ||
+
| 0x29 || [[#GetInfo]]
 
|-
 
|-
| 0x2A || [[#FlushEntireDataCache]] || ||
+
| 0x2A || [[#FlushEntireDataCache]]
 
|-
 
|-
| 0x2B || [[#FlushDataCache]] || ||
+
| 0x2B || [[#FlushDataCache]]
 
|-
 
|-
| 0x2C || [3.0.0+] [[#MapPhysicalMemory]] || ||
+
| 0x2C || [3.0.0+] [[#MapPhysicalMemory]]
 
|-
 
|-
| 0x2D || [3.0.0+] [[#UnmapPhysicalMemory]] || ||
+
| 0x2D || [3.0.0+] [[#UnmapPhysicalMemory]]
 
|-
 
|-
| 0x2E || [5.0.0+] [[#GetFutureThreadInfo]] || ||
+
| 0x2E || [5.0.0+] [[#GetFutureThreadInfo]]
 
|-
 
|-
| 0x2F || [[#GetLastThreadInfo]] || ||
+
| 0x2F || [[#GetLastThreadInfo]]
 
|-
 
|-
| 0x30 || [[#GetResourceLimitLimitValue]] || ||
+
| 0x30 || [[#GetResourceLimitLimitValue]]
 
|-
 
|-
| 0x31 || [[#GetResourceLimitCurrentValue]] || ||
+
| 0x31 || [[#GetResourceLimitCurrentValue]]
 
|-
 
|-
| 0x32 || [[#SetThreadActivity]] || ||
+
| 0x32 || [[#SetThreadActivity]]
 
|-
 
|-
| 0x33 || [[#GetThreadContext3]] || ||
+
| 0x33 || [[#GetThreadContext3]]
 
|-
 
|-
| 0x34 || [4.0.0+] [[#WaitForAddress]] || ||
+
| 0x34 || [4.0.0+] [[#WaitForAddress]]
 
|-
 
|-
| 0x35 || [4.0.0+] [[#SignalToAddress]] || ||
+
| 0x35 || [4.0.0+] [[#SignalToAddress]]
 
|-
 
|-
| 0x36 || [8.0.0+] [[#SynchronizePreemptionState]] || ||
+
| 0x36 || [8.0.0+] [[#SynchronizePreemptionState]]
 
|- style="border-top: double"
 
|- style="border-top: double"
| 0x3C || [4.0.0+] [[#KernelDebug]] ([1.0.0-3.0.2] [[#DumpInfo]]) || ||
+
| 0x3C || [4.0.0+] [[#KernelDebug]] ([1.0.0-3.0.2] [[#DumpInfo]])
 
|-
 
|-
| 0x3D || [4.0.0+] [[#ChangeKernelTraceState]] || ||
+
| 0x3D || [4.0.0+] [[#ChangeKernelTraceState]]
 
|- style="border-top: double"
 
|- style="border-top: double"
| 0x40 || [[#CreateSession]] || ||
+
| 0x40 || [[#CreateSession]]
 
|-
 
|-
| 0x41 || [[#AcceptSession]] || ||
+
| 0x41 || [[#AcceptSession]]
 
|-
 
|-
| 0x42 || [[#ReplyAndReceiveLight]] || ||
+
| 0x42 || [[#ReplyAndReceiveLight]]
 
|-
 
|-
| 0x43 || [[#ReplyAndReceive]] || ||
+
| 0x43 || [[#ReplyAndReceive]]
 
|-
 
|-
| 0x44 || [[#ReplyAndReceiveWithUserBuffer]] || ||
+
| 0x44 || [[#ReplyAndReceiveWithUserBuffer]]
 
|-
 
|-
| 0x45 || [[#CreateEvent]] || ||
+
| 0x45 || [[#CreateEvent]]
 
|- style="border-top: double"
 
|- style="border-top: double"
| 0x48 || [5.0.0+] [[#MapPhysicalMemoryUnsafe]] || ||
+
| 0x48 || [5.0.0+] [[#MapPhysicalMemoryUnsafe]]
 
|-
 
|-
| 0x49 || [5.0.0+] [[#UnmapPhysicalMemoryUnsafe]] || ||
+
| 0x49 || [5.0.0+] [[#UnmapPhysicalMemoryUnsafe]]
 
|-
 
|-
| 0x4A || [5.0.0+] [[#SetUnsafeLimit]] || ||
+
| 0x4A || [5.0.0+] [[#SetUnsafeLimit]]
 
|-
 
|-
| 0x4B || [4.0.0+] [[#CreateCodeMemory]] || ||
+
| 0x4B || [4.0.0+] [[#CreateCodeMemory]]
 
|-
 
|-
| 0x4C || [4.0.0+] [[#ControlCodeMemory]] || ||
+
| 0x4C || [4.0.0+] [[#ControlCodeMemory]]
 
|-
 
|-
| 0x4D || [[#SleepSystem]] || ||
+
| 0x4D || [[#SleepSystem]]
 
|-
 
|-
| 0x4E || [[#ReadWriteRegister]] || ||
+
| 0x4E || [[#ReadWriteRegister]]
 
|-
 
|-
| 0x4F || [[#SetProcessActivity]] || ||
+
| 0x4F || [[#SetProcessActivity]]
 
|-
 
|-
| 0x50 || [[#CreateSharedMemory]] || ||
+
| 0x50 || [[#CreateSharedMemory]]
 
|-
 
|-
| 0x51 || [[#MapTransferMemory]] || ||
+
| 0x51 || [[#MapTransferMemory]]
 
|-
 
|-
| 0x52 || [[#UnmapTransferMemory]] || ||
+
| 0x52 || [[#UnmapTransferMemory]]
 
|-
 
|-
| 0x53 || [[#CreateInterruptEvent]] || ||
+
| 0x53 || [[#CreateInterruptEvent]]
 
|-
 
|-
| 0x54 || [[#QueryPhysicalAddress]] || ||
+
| 0x54 || [[#QueryPhysicalAddress]]
 
|-
 
|-
| 0x55 || [[#QueryIoMapping]] || ||
+
| 0x55 || [[#QueryIoMapping]]
 
|-
 
|-
| 0x56 || [[#CreateDeviceAddressSpace]] || ||
+
| 0x56 || [[#CreateDeviceAddressSpace]]
 
|-
 
|-
| 0x57 || [[#AttachDeviceAddressSpace]] || ||
+
| 0x57 || [[#AttachDeviceAddressSpace]]
 
|-
 
|-
| 0x58 || [[#DetachDeviceAddressSpace]] || ||
+
| 0x58 || [[#DetachDeviceAddressSpace]]
 
|-
 
|-
| 0x59 || [[#MapDeviceAddressSpaceByForce]] || ||
+
| 0x59 || [[#MapDeviceAddressSpaceByForce]]
 
|-
 
|-
| 0x5A || [[#MapDeviceAddressSpaceAligned]] || ||
+
| 0x5A || [[#MapDeviceAddressSpaceAligned]]
 
|-
 
|-
| 0x5B || [[#MapDeviceAddressSpace]] || ||
+
| 0x5B || [[#MapDeviceAddressSpace]]
 
|-
 
|-
| 0x5C || [[#UnmapDeviceAddressSpace]] || ||
+
| 0x5C || [[#UnmapDeviceAddressSpace]]
 
|-
 
|-
| 0x5D || [[#InvalidateProcessDataCache]] || ||
+
| 0x5D || [[#InvalidateProcessDataCache]]
 
|-
 
|-
| 0x5E || [[#StoreProcessDataCache]] || ||
+
| 0x5E || [[#StoreProcessDataCache]]
 
|-
 
|-
| 0x5F || [[#FlushProcessDataCache]] || ||
+
| 0x5F || [[#FlushProcessDataCache]]
 
|-
 
|-
| 0x60 || [[#DebugActiveProcess]] || ||
+
| 0x60 || [[#DebugActiveProcess]]
 
|-
 
|-
| 0x61 || [[#BreakDebugProcess]] || ||
+
| 0x61 || [[#BreakDebugProcess]]
 
|-
 
|-
| 0x62 || [[#TerminateDebugProcess]] || ||
+
| 0x62 || [[#TerminateDebugProcess]]
 
|-
 
|-
| 0x63 || [[#GetDebugEvent]] || ||
+
| 0x63 || [[#GetDebugEvent]]
 
|-
 
|-
| 0x64 || [[#ContinueDebugEvent]] || ||
+
| 0x64 || [[#ContinueDebugEvent]]
 
|-
 
|-
| 0x65 || [[#GetProcessList]] || ||
+
| 0x65 || [[#GetProcessList]]
 
|-
 
|-
| 0x66 || [[#GetThreadList]] || ||
+
| 0x66 || [[#GetThreadList]]
 
|-
 
|-
| 0x67 || [[#GetDebugThreadContext]] || ||
+
| 0x67 || [[#GetDebugThreadContext]]
 
|-
 
|-
| 0x68 || [[#SetDebugThreadContext]] || ||
+
| 0x68 || [[#SetDebugThreadContext]]
 
|-
 
|-
| 0x69 || [[#QueryDebugProcessMemory]] || ||
+
| 0x69 || [[#QueryDebugProcessMemory]]
 
|-
 
|-
| 0x6A || [[#ReadDebugProcessMemory]] || ||
+
| 0x6A || [[#ReadDebugProcessMemory]]
 
|-
 
|-
| 0x6B || [[#WriteDebugProcessMemory]] || ||
+
| 0x6B || [[#WriteDebugProcessMemory]]
 
|-
 
|-
| 0x6C || [[#SetHardwareBreakPoint]] || ||
+
| 0x6C || [[#SetHardwareBreakPoint]]
 
|-
 
|-
| 0x6D || [[#GetDebugThreadParam]] || ||
+
| 0x6D || [[#GetDebugThreadParam]]
 
|- style="border-top: double"
 
|- style="border-top: double"
| 0x6F || [5.0.0+] [[#GetSystemInfo]] || ||
+
| 0x6F || [5.0.0+] [[#GetSystemInfo]]
 
|-
 
|-
| 0x70 || CreatePort || W2=max_sessions, W3=is_light, X4=name_ptr
+
| 0x70 || [[#CreatePort]]
R0=name_ptr, R2=max_sessions, R3=is_light
  −
|| W0=result, W1=serverport_handle, W2=clientport_handle
   
|-
 
|-
| 0x71 || ManageNamedPort || X1=name_ptr, W2=max_sessions || W0=result, W1=serverport_handle
+
| 0x71 || [[#ManageNamedPort]]
 
|-
 
|-
| 0x72 || ConnectToPort || W1=clientport_handle || W0=result, W1=session_handle
+
| 0x72 || [[#ConnectToPort]]
 
|-
 
|-
| 0x73 || [[#SetProcessMemoryPermission]] || W0=process_handle, X1=addr, X2=size, W3=perm
+
| 0x73 || [[#SetProcessMemoryPermission]]
R0=process_handle, R1=size_lower32, R2=addr_lower32, R3=addr_upper32, R4=size_upper32, R5=perm
  −
|| W0=result
   
|-
 
|-
| 0x74 || [[#MapProcessMemory]] || X0=dstaddr, W1=process_handle, X2=srcaddr, X3=size
+
| 0x74 || [[#MapProcessMemory]]
R0=dstaddr, R1=process_handle, R2=srcaddr_lower32, R3=srcaddr_upper32, R4=size
  −
|| W0=result
   
|-
 
|-
| 0x75 || [[#UnmapProcessMemory]] || X0=dstaddr, W1=process_handle, X2=srcaddr, X3=size
+
| 0x75 || [[#UnmapProcessMemory]]
R0=dstaddr, R1=process_handle, R2=srcaddr_lower32, R3=srcaddr_upper32, R4=size
  −
|| W0=result
   
|-
 
|-
| 0x76 || [[#QueryProcessMemory]] || X0=meminfo_ptr, W2=process_handle, X3=addr
+
| 0x76 || [[#QueryProcessMemory]]
R0=meminfo_ptr, R1=addr_lower32, R2=process_handle, R3=addr_upper32
  −
|| W0=result, W1=pageinfo
   
|-
 
|-
| 0x77 || [[#MapProcessCodeMemory]] || W0=process_handle, X1=dstaddr, X2=srcaddr, X3=size
+
| 0x77 || [[#MapProcessCodeMemory]]
R0=process_handle, R1=srcaddr_lower32, R2=dstaddr_lower32, R3=dstaddr_upper32, R4=srcaddr_lower32, R5=size_lower32, R6=size_upper32
  −
|| W0=result
   
|-
 
|-
| 0x78 || [[#UnmapProcessCodeMemory]] || W0=process_handle, X1=dstaddr, X2=srcaddr, X3=size
+
| 0x78 || [[#UnmapProcessCodeMemory]]
R0=process_handle, R1=srcaddr_lower32, R2=dstaddr_lower32, R3=dstaddr_upper32, R4=srcaddr_lower32, R5=size_lower32, R6=size_upper32
  −
|| W0=result
   
|-
 
|-
| 0x79 || [[#CreateProcess]] || X1=procinfo_ptr, X2=caps_ptr, W3=cap_num ||  W0=result, W1=process_handle
+
| 0x79 || [[#CreateProcess]]
 
|-
 
|-
| 0x7A || StartProcess || W0=process_handle, W1=main_thread_prio, W2=default_cpuid, W3=main_thread_stacksz
+
| 0x7A || [[#StartProcess]]
R0=process_handle, R1=main_thread_prio, R2=default_cpuid, R3=main_thread_stacksz_lower32, R4=main_thread_stacksz_upper32
  −
|| W0=result
   
|-
 
|-
| 0x7B || TerminateProcess || W0=process_handle || W0=result
+
| 0x7B || [[#TerminateProcess]]
 
|-
 
|-
| 0x7C || [[#GetProcessInfo]] || W0=process_handle, W1=[[#ProcessInfoType]]
+
| 0x7C || [[#GetProcessInfo]]
R1=process_handle, R2=[[#ProcessInfoType]]
  −
|| W0=result, X1=[[#ProcessState]]
  −
R0=result, R1=[[#ProcessState]]_lower32, R2=[[#ProcessState]]_upper32
   
|-
 
|-
| 0x7D || CreateResourceLimit || None || W0=result, W1=reslimit_handle
+
| 0x7D || [[#CreateResourceLimit]]
 
|-
 
|-
| 0x7E || SetResourceLimitLimitValue || W0=reslimit_handle, W1=[[#LimitableResource]], X2=value
+
| 0x7E || [[#SetResourceLimitLimitValue]]
R0=reslimit_handle, R1=[[#LimitableResource]], R2=value_lower32, R3=value_upper32
  −
|| W0=result
   
|-
 
|-
| 0x7F || [[#CallSecureMonitor]] || X0=smc_sub_id, X1,X2,X3,X4,X5,X6,X7=smc_args
+
| 0x7F || [[#CallSecureMonitor]]
R0=smc_sub_id, R1, R2, R3=smc_args
  −
|| X0,X1,X2,X3,X4,X5,X6,X7=result
  −
R0,R1,R2,R3=result
   
|}
 
|}
   Line 270: Line 246:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) W1 || u64 || Size
+
| (In) W1 || uint32_t || Size
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
 
|-
 
|-
| (Out) X1 || u64 || OutAddr
+
| (Out) X1 || void* || HeapAddress
 
|}
 
|}
 
</div>
 
</div>
Line 282: Line 258:  
Size must be a multiple of 0x200000 (2MB).
 
Size must be a multiple of 0x200000 (2MB).
   −
On success, the heap base-address (which is fixed by kernel, aslr'd, and always in the Heap memory region) is written to OutAddr.
+
On success, the heap base-address (which is fixed by kernel, aslr'd, and always in the Heap memory region) is written to HeapAddress.
    
Uses current process pool partition. The memory allocated counts towards the caller's process Memory ResourceLimit.
 
Uses current process pool partition. The memory allocated counts towards the caller's process Memory ResourceLimit.
Line 307: Line 283:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) X0 || void* || Addr
+
| (In) X0 || void* || Address
 
|-
 
|-
| (In) X1 || u64 || Size
+
| (In) X1 || uint64_t || Size
 
|-
 
|-
| (In) W2 || [[#Permission]] || Prot
+
| (In) W2 || [[#MemoryPermission]] || MemoryPermission
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 344: Line 320:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) X0 || void* || Addr
+
| (In) X0 || void* || Address
 
|-
 
|-
| (In) X1 || u64 || Size
+
| (In) X1 || uint64_t || Size
 
|-
 
|-
| (In) W2 || u32 || State0
+
| (In) W2 || uint32_t || State0
 
|-
 
|-
| (In) W3 || u32 || State1
+
| (In) W3 || uint32_t || State1
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 378: Line 354:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) X0 || void* || DstAddr
+
| (In) X0 || void* || DstAddress
 
|-
 
|-
| (In) X1 || void* || SrcAddr
+
| (In) X1 || void* || SrcAddress
 
|-
 
|-
| (In) X2 || u64 || Size
+
| (In) X2 || uint64_t || Size
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 410: Line 386:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) X0 || void* || DstAddr
+
| (In) X0 || void* || DstAddress
 
|-
 
|-
| (In) X1 || void* || SrcAddr
+
| (In) X1 || void* || SrcAddress
 
|-
 
|-
| (In) X2 || u64 || Size
+
| (In) X2 || uint64_t || Size
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 432: Line 408:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) X0 || [[#MemoryInfo]]* || MemInfo
+
| (In) X0 || [[#MemoryInfo]]* || MemoryInfo
 
|-
 
|-
| (In) X2 || void* || Addr
+
| (In) X2 || void* || Address
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
 
|-
 
|-
| (Out) W1 || PageInfo || PageInfo
+
| (Out) W1 || [[#PageInfo]] || PageInfo
 
|}
 
|}
 
</div>
 
</div>
Line 472: Line 448:  
| (In) X3 || R3 || void* || StackTop
 
| (In) X3 || R3 || void* || StackTop
 
|-
 
|-
| (In) W4 || R0 || u32 || Priority
+
| (In) W4 || R0 || int32_t || Priority
 
|-
 
|-
| (In) W5 || R4 || u32 || ProcessorId
+
| (In) W5 || R4 || int32_t || ProcessorId
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
 
|-
 
|-
| (Out) W1 || R1 || Handle<Thread> || Handle
+
| (Out) W1 || R1 || Handle<Thread> || ThreadHandle
 
|}
 
|}
 
</div>
 
</div>
Line 484: Line 460:  
Creates a thread in the current process.
 
Creates a thread in the current process.
   −
Processor_id must be 0,1,2,3 or -2, where -2 uses the default cpuid for process.
+
ProcessorId must be 0,1,2,3 or -2, where -2 uses the default CpuId for process.
    
== StartThread ==
 
== StartThread ==
Line 492: Line 468:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) W0 || Handle<Thread> || Handle
+
| (In) W0 || Handle<Thread> || ThreadHandle
 
|-
 
|-
 
| (Out) None ||  ||
 
| (Out) None ||  ||
Line 520: Line 496:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) X0 || R0, R1 || s64 || Nanoseconds
+
| (In) X0 || R0, R1 || uint64_t || Nanoseconds
 
|}
 
|}
 
</div>
 
</div>
Line 547: Line 523:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) W1|| Handle<Thread> || Handle
+
| (In) W1|| Handle<Thread> || ThreadHandle
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
 
|-
 
|-
| (Out) W1 || u64 || Priority
+
| (Out) W1 || int32_t || Priority
 
|}
 
|}
 
</div>
 
</div>
Line 563: Line 539:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) W0|| Handle<Thread> || Handle
+
| (In) W0|| Handle<Thread> || ThreadHandle
 
|-
 
|-
| (In) W1|| u32 || Priority
+
| (In) W1|| int32_t || Priority
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 581: Line 557:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) W2 || R2 || Handle<Thread> || Handle
+
| (In) W2 || R2 || Handle<Thread> || ThreadHandle
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
 
|-
 
|-
| (Out) W1 || R1 || u32 || CoreMask0
+
| (Out) W1 || R1 || int32_t || CoreMask0
 
|-
 
|-
| (Out) X2 || R2, R3 || u64 || CoreMask1
+
| (Out) X2 || R2, R3 || uint64_t || CoreMask1
 
|}
 
|}
 
</div>
 
</div>
Line 599: Line 575:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) W0 || R0 || Handle<Thread> || Handle
+
| (In) W0 || R0 || Handle<Thread> || ThreadHandle
 
|-
 
|-
| (In) W1 || R1 || u32 || CoreMask0
+
| (In) W1 || R1 || int32_t || CoreMask0
 
|-
 
|-
| (In) X2 || R2, R3 || u64 || CoreMask1
+
| (In) X2 || R2, R3 || uint64_t || CoreMask1
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
Line 619: Line 595:  
| (In) None || ||  
 
| (In) None || ||  
 
|-
 
|-
| (Out) W0/X0 || u64 || CpuId
+
| (Out) W0 || uint32_t || CpuId
 
|}
 
|}
 
</div>
 
</div>
Line 633: Line 609:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) W0 || Handle<WritableEvent> || Event
+
| (In) W0 || Handle<WritableEvent> || EventHandle
 
|-
 
|-
 
| (Out) X0 || [[#Result]] || Result
 
| (Out) X0 || [[#Result]] || Result
Line 656: Line 632:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) W0 || Handle<WritableEvent> or Handle<ReadableEvent> || Event
+
| (In) W0 || Handle<WritableEvent> or Handle<ReadableEvent> || EventHandle
 
|-
 
|-
 
| (Out) X0 || [[#Result]] || Result
 
| (Out) X0 || [[#Result]] || Result
Line 677: Line 653:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) W0 || Handle<SharedMemory> || MemHandle
+
| (In) W0 || Handle<SharedMemory> || SharedMemoryHandle
 
|-
 
|-
| (In) X1 || void* || Addr
+
| (In) X1 || void* || Address
 
|-
 
|-
| (In) X2 || u64 || Size
+
| (In) X2 || uint64_t || Size
 
|-
 
|-
| (In) W3 || [[#Permission]] || Permissions
+
| (In) W3 || [[#MemoryPermission]] || MemoryPermission
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 699: Line 675:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) W0 || Handle<SharedMemory> || MemHandle
+
| (In) W0 || Handle<SharedMemory> || SharedMemoryHandle
 
|-
 
|-
| (In) X1 || void* || Addr
+
| (In) X1 || void* || Address
 
|-
 
|-
| (In) X2 || u64 || Size
+
| (In) X2 || uint64_t || Size
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 715: Line 691:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) X1 || void* || Addr
+
| (In) X1 || void* || Address
 
|-
 
|-
| (In) X2 || u64 || Size
+
| (In) X2 || uint64_t || Size
 
|-
 
|-
| (In) W3 || [[#Permission]] || Permissions
+
| (In) W3 || [[#MemoryPermission]] || MemoryPermission
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
 
|-
 
|-
| (Out) W1 || Handle<TransferMemory> || Handle
+
| (Out) W1 || Handle<TransferMemory> || TransferMemoryHandle
 
|}
 
|}
 
</div>
 
</div>
Line 776: Line 752:  
| (In) X1 || R1 || Handle* || HandlesPtr
 
| (In) X1 || R1 || Handle* || HandlesPtr
 
|-
 
|-
| (In) W2 || R2 || u64 || HandlesNum
+
| (In) W2 || R2 || int32_t || HandlesNum
 
|-
 
|-
| (In) X3 || R0, R3 || u64 || Timeout
+
| (In) X3 || R0, R3 || int64_t || Timeout
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
 
|-
 
|-
| (Out) W1 || R1 || u64 || HandleIndex
+
| (Out) W1 || R1 || uint64_t || HandleIndex
 
|}
 
|}
 
</div>
 
</div>
   −
Works with num_handles <= 0x40.
+
Works with HandlesNum <= 0x40.
    
When zero handles are passed, this will wait forever until either timeout or cancellation occurs.
 
When zero handles are passed, this will wait forever until either timeout or cancellation occurs.
Line 799: Line 775:  
'''KProcess:''' signals when the process undergoes a state change (retrievable via [[#GetProcessInfo]]).
 
'''KProcess:''' signals when the process undergoes a state change (retrievable via [[#GetProcessInfo]]).
   −
'''KReadableEvent:''' signals when the event's corresponding KWritableEvent has been signaled via SignalEvent.
+
'''KReadableEvent:''' signals when the event's corresponding KWritableEvent has been signaled via [[#SignalEvent]].
    
'''KServerPort:''' signals when there is an incoming connection waiting to be [[#AcceptSession|accepted]].
 
'''KServerPort:''' signals when there is an incoming connection waiting to be [[#AcceptSession|accepted]].
Line 828: Line 804:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) W0 || Handle<Thread> || Handle
+
| (In) W0 || Handle<Thread> || ThreadHandle
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 850: Line 826:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) W0 || Handle<Thread> || Handle
+
| (In) W0 || Handle<Thread> || ThreadHandle
 
|-
 
|-
| (In) X1 || void* || Addr
+
| (In) X1 || void* || Address
 
|-
 
|-
| (In) W2 || u32 || Tag
+
| (In) W2 || uint32_t || Tag
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 866: Line 842:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) X0 || void* || Addr
+
| (In) X0 || void* || Address
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 878: Line 854:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) X0 || R0 || void* || KeyAddr
+
| (In) X0 || R0 || void* || KeyAddress
 
|-
 
|-
| (In) X1 || R1 || void* || TagAddr
+
| (In) X1 || R1 || void* || TagAddress
 
|-
 
|-
| (In) W2 || R2 || u32 || Tag
+
| (In) W2 || R2 || uint32_t || Tag
 
|-
 
|-
| (In) X3 || R3, R4 || u64 || Timeout
+
| (In) X3 || R3, R4 || int64_t || Timeout
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
Line 896: Line 872:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) X0 || void* || Addr
+
| (In) X0 || void* || Address
 
|-
 
|-
| (In) W1 || u32 || Value
+
| (In) W1 || int32_t || Value
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 910: Line 886:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (Out) X0 || R0, R1 || u64 || Ticks
+
| (Out) X0 || R0, R1 || uint64_t || Ticks
 
|}
 
|}
 
</div>
 
</div>
Line 930: Line 906:  
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
 
|-
 
|-
| (Out) W1 || Handle<Session> || Handle
+
| (Out) W1 || Handle<Session> || SessionHandle
 
|}
 
|}
 
</div>
 
</div>
Line 940: Line 916:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) W0 || Handle<Session> || Handle
+
| (In) W0 || Handle<Session> || SessionHandle
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 952: Line 928:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) W0 || Handle<Session> || Handle
+
| (In) W0 || Handle<Session> || SessionHandle
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 964: Line 940:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) X0 || void* || CmdPtr
+
| (In) X0 || void* || Address
 
|-
 
|-
| (In) X1 || u64 || Size
+
| (In) X1 || uint64_t || Size
 
|-
 
|-
| (In) W2 || Handle<Session> || Handle
+
| (In) W2 || Handle<Session> || SessionHandle
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 974: Line 950:  
</div>
 
</div>
   −
Size and CmdPtr must be 0x1000-aligned.
+
Size and Address must be 0x1000-aligned.
    
=== Result codes ===
 
=== Result codes ===
 
'''0x0:''' Success.
 
'''0x0:''' Success.
   −
'''0xcc01:''' CmdPtr is not 0x1000-aligned.
+
'''0xcc01:''' Address is not 0x1000-aligned.
    
'''0xca01:''' Size is not 0x1000-aligned.
 
'''0xca01:''' Size is not 0x1000-aligned.
Line 993: Line 969:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) X1 || void* || CmdPtr
+
| (In) X1 || void* || Address
 
|-
 
|-
| (In) X2 || u64 || Size
+
| (In) X2 || uint64_t || Size
 
|-
 
|-
| (In) W3 || Handle<Session> || Handle
+
| (In) W3 || Handle<Session> || SessionHandle
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
 
|-
 
|-
| (Out) W1 || Handle<ReadableEvent> || Event
+
| (Out) W1 || Handle<ReadableEvent> || EventHandle
 
|}
 
|}
 
</div>
 
</div>
   −
Size and CmdPtr must be 0x1000-aligned.
+
Size and Address must be 0x1000-aligned.
 
  −
|-
  −
| 0x23 || || X1=cmdbufptr, X2=size, X3=handle || W0=result, W1=revent_handle
  −
|-
      
== GetProcessId ==
 
== GetProcessId ==
Line 1,017: Line 989:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) W1 || R1 || Handle<Process> || Handle
+
| (In) W1 || R1 || Handle<Process> || ProcessHandle
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
 
|-
 
|-
| (Out) X1 || R1, R2 || u64 || ProcessId
+
| (Out) X1 || R1, R2 || uint64_t || ProcessId
 
|}
 
|}
 
</div>
 
</div>
Line 1,031: Line 1,003:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) W1 || R1 || Handle<Thread> || Handle
+
| (In) W1 || R1 || Handle<Thread> || ThreadHandle
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
 
|-
 
|-
| (Out) X1 || R1, R2 || u64 || ThreadId
+
| (Out) X1 || R1, R2 || uint64_t || ThreadId
 
|}
 
|}
 
</div>
 
</div>
Line 1,045: Line 1,017:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) X0 || u64 || Break Reason
+
| (In) X0 || [[#BreakReason]] || BreakReason
 
|-
 
|-
| (In) X1 || u64 ||
+
| (In) X1 || uint64_t ||
 
|-
 
|-
| (In) X2 || u64 || Info
+
| (In) X2 || uint64_t || Info
 
|-
 
|-
| (Out) W0 || [[#Result]] || 0 (Success)
+
| (Out) W0 || [[#Result]] || Result
 
|}
 
|}
 
</div>
 
</div>
   −
If the process is attached, report the Break event. Then, if ContinueDebugEvent didn't apply IgnoreException on the thread: if TPIDR_EL0 is 0, adjust ELR_EL1 to retry to svc instruction (and set TPIDR_EL0 to 1).
+
If the process is attached, report the Break event. Then, if [[#ContinueDebugEvent]] didn't apply IgnoreException on the thread: if TPIDR_EL0 is 0, adjust ELR_EL1 to retry to svc instruction (and set TPIDR_EL0 to 1).
    
Otherwise, if bit31 in reason isn't set, perform crash reporting (see Exception Handling section below), if it doesn't terminate the process adjust ELR_EL1 as well.
 
Otherwise, if bit31 in reason isn't set, perform crash reporting (see Exception Handling section below), if it doesn't terminate the process adjust ELR_EL1 as well.
Line 1,069: Line 1,041:  
| (In) X0 || char* || String
 
| (In) X0 || char* || String
 
|-
 
|-
| (In) X1 || u64 || Size
+
| (In) X1 || uint64_t || Size
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 1,081: Line 1,053:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (Out) X0 || [[#Result]] || Result
+
| (In) W0 || [[#Result]] || Result
 
|}
 
|}
 
</div>
 
</div>
Line 1,091: Line 1,063:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) W1 || R1 || u32 || InfoId0
+
| (In) W1 || R1 || [[#InfoType]] || InfoType
 
|-
 
|-
 
| (In) W2 || R2 || Handle || Handle
 
| (In) W2 || R2 || Handle || Handle
 
|-
 
|-
| (In) X3 || R0, R3 || u64 || InfoId1
+
| (In) X3 || R0, R3 || uint64_t || InfoSubType
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
 
|-
 
|-
| (Out) X1 || R1, R2 || u64 || Out
+
| (Out) X1 || R1, R2 || uint64_t || Info
 
|}
 
|}
 
</div>
 
</div>
   −
{| class=wikitable
+
== FlushEntireDataCache ==
! Handle type || InfoId0 || InfoId1 || Description
+
<div style="display: inline-block;">
 +
{| class="wikitable" border="1"
 
|-
 
|-
| Process || 0 || 0 || AllowedCpuIdBitmask
+
! Argument || Type || Name
 
|-
 
|-
| Process || 1 || 0 || AllowedThreadPrioBitmask
+
| (In) None || ||
 
|-
 
|-
| Process || 2 || 0 || AliasRegionBaseAddr
+
| (Out) None || ||
 +
|}
 +
</div>
 +
 
 +
== FlushDataCache ==
 +
<div style="display: inline-block;">
 +
{| class="wikitable" border="1"
 
|-
 
|-
| Process || 3 || 0 || AliasRegionSize
+
! Argument || Type || Name
|-
  −
| Process || 4 || 0 || HeapRegionBaseAddr
   
|-
 
|-
| Process || 5 || 0 || HeapRegionSize
+
| (In) X0 || void* || Address
 
|-
 
|-
| Process || 6 || 0 || TotalMemoryAvailable. Total memory available(free+used).
+
| (In) X1 || uint64_t || Size
 
|-
 
|-
| Process || 7 || 0 || TotalMemoryUsage. Total used size of codebin memory + main-thread stack + allocated heap.
+
| (Out) W0 || [[#Result]] || Result
 +
|}
 +
</div>
 +
 
 +
== MapPhysicalMemory ==
 +
<div style="display: inline-block;">
 +
{| class="wikitable" border="1"
 
|-
 
|-
| Zero    || 8 || 0 || IsCurrentProcessBeingDebugged
+
! Argument || Type || Name
 
|-
 
|-
| Zero    || 9 || 0 || Returns ResourceLimit handle for current process. Used by [[Process_Manager_services|PM]].
+
| (In) X0 || void* || Address
 
|-
 
|-
| Zero    || 10 || -1, {current coreid} || IdleTickCount
+
| (In) X1 || uint64_t || Size
 
|-
 
|-
| Zero    || 11 || 0-3 || RandomEntropy from current process. TRNG. Used to seed usermode PRNGs.
+
| (Out) W0 || [[#Result]] || Result
 +
|}
 +
</div>
 +
 
 +
Acts like [[#SetHeapSize]] except you can allocate heap at any address you'd like.
 +
 
 +
Uses current process pool partition.
 +
 
 +
== UnmapPhysicalMemory ==
 +
<div style="display: inline-block;">
 +
{| class="wikitable" border="1"
 
|-
 
|-
| Process || 12 || 0 || [2.0.0+] AddressSpaceBaseAddr
+
! Argument || Type || Name
|-
  −
| Process || 13 || 0 || [2.0.0+] AddressSpaceSize
   
|-
 
|-
| Process || 14 || 0 || [2.0.0+] StackRegionBaseAddr
+
| (In) X0 || void* || Address
 
|-
 
|-
| Process || 15 || 0 || [2.0.0+] StackRegionSize
+
| (In) X1 || uint64_t || Size
 
|-
 
|-
| Process || 16 || 0 || [3.0.0+] PersonalMmHeapSize
+
| (Out) W0 || [[#Result]] || Result
 +
|}
 +
</div>
 +
 
 +
== GetFutureThreadInfo ==
 +
<div style="display: inline-block;">
 +
{| class="wikitable" border="1"
 
|-
 
|-
| Process || 17 || 0 || [3.0.0+] PersonalMmHeapUsage
+
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| Process || 18 || 0 || [3.0.0+] TitleId
+
| (In) X3 || R0, R1 || uint64_t || Timeout
 
|-
 
|-
| Zero    || 19 || 0 || [4.0.0-4.1.0] PrivilegedProcessId_LowerBound
+
| (Out) W0 || R0 || [[#Result]] || Result
 
|-
 
|-
| Zero    || 19 || 1 || [4.0.0-4.1.0] PrivilegedProcessId_UpperBound
+
| (Out) X1 || uint64_t || LastThreadContextParam0
 
|-
 
|-
| Process || 20 || 0 || [5.0.0+] UserExceptionContextAddr
+
| (Out) X2 || uint64_t || LastThreadContextParam1
 
|-
 
|-
| Process || 21 || 0 || [6.0.0+] TotalMemoryAvailableWithoutMmHeap
+
| (Out) X3 || uint64_t || LastThreadContextParam2
 
|-
 
|-
| Process || 22 || 0 || [6.0.0+] TotalMemoryUsedWithoutMmHeap
+
| (Out) X4 || uint64_t || LastThreadContextParam3
 
|-
 
|-
| Process || 23 || 0 || [9.0.0+] IsApplication
+
| (Out) X5 || uint64_t ||
 
|-
 
|-
| Thread  || 0xF0000002 || 0-3, -1 || Thread Ticks. When 0-3 are passed, gets specific core CPU ticks spent on thread. When -1 is passed, gets total CPU ticks spent on thread.
+
| (Out) W6 || uint32_t ||
 
|}
 
|}
 +
</div>
   −
== FlushEntireDataCache ==
+
== GetLastThreadInfo ==
 
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 1,165: Line 1,163:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) None || ||
+
| (In) None || ||  
 +
|-
 +
| (Out) W0 || [[#Result]] || Result
 +
|-
 +
| (Out) X1 || uint64_t || LastThreadContextParam0
 
|-
 
|-
| (Out) None || ||
+
| (Out) X2 || uint64_t || LastThreadContextParam1
|}
  −
</div>
  −
 
  −
== FlushDataCache ==
  −
<div style="display: inline-block;">
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Argument || Type || Name
+
| (Out) X3 || uint64_t || LastThreadContextParam2
 
|-
 
|-
| (In) X0 || u64 || Address
+
| (Out) X4 || uint64_t || LastThreadContextParam3
 
|-
 
|-
| (In) X1 || u64 || Size
+
| (Out) X5 || uint64_t ||
 
|-
 
|-
| (Out) W0 || [[#Result]] || Result
+
| (Out) W6 || uint32_t ||
 
|}
 
|}
 
</div>
 
</div>
   −
== MapPhysicalMemory ==
+
== GetResourceLimitLimitValue ==
 
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Argument || Type || Name
+
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) X0 || u64 || Address
+
| (In) W1 || R1 || Handle<ResourceLimit> || ResourceLimitHandle
 
|-
 
|-
| (In) X1 || u64 || Size
+
| (In) W2 || R2 || [[#LimitableResource]] || LimitableResource
 
|-
 
|-
| (Out) W0 || [[#Result]] || Result
+
| (Out) W0 || R0 || [[#Result]] || Result
 +
|-
 +
| (Out) X1 || R1, R2 || int64_t || LimitValue
 
|}
 
|}
 
</div>
 
</div>
   −
Acts like [[#SetHeapSize]] except you can allocate heap at any address you'd like.
+
== GetResourceLimitCurrentValue ==
 
  −
Uses current process pool partition.
  −
 
  −
== UnmapPhysicalMemory ==
   
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Argument || Type || Name
+
! Argument64 || Argument32 || Type || Name
 +
|-
 +
| (In) W1 || R1 || Handle<ResourceLimit> || ResourceLimitHandle
 
|-
 
|-
| (In) X0 || u64 || Address
+
| (In) W2 || R2 || [[#LimitableResource]] || LimitableResource
 
|-
 
|-
| (In) X1 || u64 || Size
+
| (Out) W0 || R0 || [[#Result]] || Result
 
|-
 
|-
| (Out) W0 || [[#Result]] || Result
+
| (Out) X1 || R1, R2 || int64_t || CurrentValue
 
|}
 
|}
 
</div>
 
</div>
   −
== GetFutureThreadInfo ==
+
== SetThreadActivity ==
 
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Argument64 || Argument32 || Type || Name
+
! Argument || Type || Name
 
|-
 
|-
| (In) X3 || R0, R1 || u64 || Timeout
+
| (In) W0 || Handle<Thread> || ThreadHandle
|-
  −
| (Out) W0 || R0 || [[#Result]] || Result
   
|-
 
|-
| (Out) X1 || u64 || LastThreadContextParam0
+
| (In) W1 || [[#ThreadActivity]] || ThreadActivity
 
|-
 
|-
| (Out) X2 || u64 || LastThreadContextParam1
+
| (Out) W0 || [[#Result]] || Result
|-
  −
| (Out) X3 || u64 || LastThreadContextParam2
  −
|-
  −
| (Out) X4 || u64 || LastThreadContextParam3
  −
|-
  −
| (Out) X5 || u64 ||
  −
|-
  −
| (Out) W6 || u32 ||
   
|}
 
|}
 
</div>
 
</div>
   −
== GetLastThreadInfo ==
+
== GetThreadContext3 ==
 
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 1,247: Line 1,233:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) None || ||  
+
| (In) X0 || [[#ThreadContext]]* || ThreadContext
 +
|-
 +
| (In) W1 || Handle<Thread> || ThreadHandle
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
|-
  −
| (Out) X1 || u64 || LastThreadContextParam0
  −
|-
  −
| (Out) X2 || u64 || LastThreadContextParam1
  −
|-
  −
| (Out) X3 || u64 || LastThreadContextParam2
  −
|-
  −
| (Out) X4 || u64 || LastThreadContextParam3
  −
|-
  −
| (Out) X5 || u64 ||
  −
|-
  −
| (Out) W6 || u32 ||
   
|}
 
|}
 
</div>
 
</div>
   −
== GetResourceLimitLimitValue ==
+
== WaitForAddress ==
 
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 1,271: Line 1,247:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) W1 || R1 || Handle<ResourceLimit> || Handle
+
| (In) X0 || R0 || void* || Address
 +
|-
 +
| (In) W1 || R1 || [[#ArbitrationType]] || ArbitrationType
 
|-
 
|-
| (In) W2 || R2 || [[#LimitableResource]] || LimitableResource
+
| (In) W2 || R2 || uint32_t || Value
 
|-
 
|-
| (Out) W0 || R0 || [[#Result]] || Result
+
| (In) X3 || R3, R4 || uint64_t || Timeout
 
|-
 
|-
| (Out) X1 || R1, R2 || u64 || LimitValue
+
| (Out) None || || ||
 
|}
 
|}
 
</div>
 
</div>
   −
== GetResourceLimitCurrentValue ==
+
== SignalToAddress ==
 
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 1,287: Line 1,265:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) W1 || R1 || Handle<ResourceLimit> || Handle
+
| (In) X0 || R0 || void* || Address
 
|-
 
|-
| (In) W2 || R2 || [[#LimitableResource]] || LimitableResource
+
| (In) W1 || R1 || [[#SignalType]] || SignalType
 +
|-
 +
| (In) W2 || R2 || uint32_t || Value
 
|-
 
|-
| (Out) W0 || R0 || [[#Result]] || Result
+
| (In) W3 || R3 || uint32_t || NumToSignal
 
|-
 
|-
| (Out) X1 || R1, R2 || u64 || CurrentValue
+
| (Out) None || || ||
 
|}
 
|}
 
</div>
 
</div>
   −
== SetThreadActivity ==
+
== SynchronizePreemptionState ==
 
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 1,303: Line 1,283:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) W0 || Handle<Thread> || ThreadHandle
+
| (In) None || ||  
 
|-
 
|-
| (In) W1 || ThreadActivity || ThreadActivity
+
| (Out) None || ||  
|-
  −
| (Out) W0 || [[#Result]] || Result
   
|}
 
|}
 
</div>
 
</div>
   −
== GetThreadContext3 ==
+
== DumpInfo ==
 
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 1,317: Line 1,295:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) X0 || [[#ThreadContext]]* || ThreadContext
+
| (In) X0 || [[#DumpInfoType]] || DumpInfoType
 
|-
 
|-
| (In) W1 || Handle<Thread> || ThreadHandle
+
| (In) X1 || uint64_t || DumpInfoSubType
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 1,325: Line 1,303:  
</div>
 
</div>
   −
== WaitForAddress ==
+
Stubbed in retail kernel.
 +
 
 +
[4.0.0+] This function was removed and replaced by [[#KernelDebug]].
 +
 
 +
== KernelDebug ==
 
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Argument64 || Argument32 || Type || Name
+
! Argument || Type || Name
 
|-
 
|-
| (In) X0 || R0 || u64 || Address
+
| (In) W0 || [[#KernelDebugType]] || KernelDebugType
 
|-
 
|-
| (In) W1 || R1 || [[#ArbitrationType]] || ArbitrationType
+
| (In) X1 || uint64_t ||  
 
|-
 
|-
| (In) W2 || R2 || u32 || Value
+
| (In) X2 || uint64_t ||  
 
|-
 
|-
| (In) X3 || R3, R4 || u64 || Timeout
+
| (In) X3 || uint64_t ||  
 
|-
 
|-
| (Out) None || || ||
+
| (Out) W0 || [[#Result]] || Result
 
|}
 
|}
 
</div>
 
</div>
   −
== SignalToAddress ==
+
Stubbed in retail kernel.
 +
 
 +
== ChangeKernelTraceState ==
 
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Argument64 || Argument32 || Type || Name
+
! Argument || Type || Name
 
|-
 
|-
| (In) X0 || R0 || u64 || Address
+
| (In) W0 || [[#KernelTraceState]] || KernelTraceState
 
|-
 
|-
| (In) W1 || R1 || [[#SignalType]] || SignalType
+
| (Out) W0 || [[#Result]] || Result
|-
  −
| (In) W2 || R2 || u32 || Value
  −
|-
  −
| (In) W3 || R3 || u32 || NumToSignal
  −
|-
  −
| (Out) None || || ||
   
|}
 
|}
 
</div>
 
</div>
   −
== SynchronizePreemptionState ==
+
Stubbed in retail kernel.
 +
 
 +
== CreateSession ==
 
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 1,367: Line 1,347:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) None || ||  
+
| (In) W2 || bool || IsLight
 +
|-
 +
| (In) X3 || uint64_t || Name
 
|-
 
|-
| (Out) None || ||  
+
| (Out) W0 || [[#Result]] || Result
|}
  −
</div>
  −
 
  −
== DumpInfo ==
  −
<div style="display: inline-block;">
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Argument || Type || Name
+
| (Out) W1 || Handle<ServerSession> || ServerSessionHandle
|-
  −
| (In) X0 || DumpInfoType || DumpInfoType
  −
|-
  −
| (In) X1 || u64 ||  
   
|-
 
|-
| (Out) W0 || [[#Result]] || Result
+
| (Out) W2 || Handle<ClientSession> || ClientSessionHandle
 
|}
 
|}
 
</div>
 
</div>
   −
Stubbed in retail kernel.
+
== AcceptSession ==
 
  −
[4.0.0+] This function was removed and replaced by [[#KernelDebug]].
  −
 
  −
== KernelDebug ==
   
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 1,397: Line 1,365:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) W0 || KernelDebugType || KernelDebugType
+
| (In) W1 || Handle<Port> || PortHandle
 
|-
 
|-
| (In) X1 || u64 ||  
+
| (Out) W0 || [[#Result]] || Result
 
|-
 
|-
| (In) X2 || u64 ||
+
| (Out) W1 || Handle<ServerSession> || ServerSessionHandle
|-
  −
| (In) X3 || u64 ||
  −
|-
  −
| (Out) W0 || [[#Result]] || Result
   
|}
 
|}
 
</div>
 
</div>
   −
Stubbed in retail kernel.
+
=== Result codes ===
 +
'''0xf201:''' No session waiting to be accepted
   −
== ChangeKernelTraceState ==
+
== ReplyAndReceiveLight ==
 
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 1,417: Line 1,382:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) W0 || KernelTraceState || KernelTraceState
+
| (In) W0 || Handle<Port> or Handle<ServerSession> || Handle
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 1,423: Line 1,388:  
</div>
 
</div>
   −
Stubbed in retail kernel.
+
== ReplyAndReceive ==
 
  −
== CreateSession ==
   
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Argument || Type || Name
+
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) W2 || bool || IsLight
+
| (In) W1 || R1 || Handle<Port>* or Handle<ServerSession>* || Handles
 
|-
 
|-
| (In) X3 || u64 || Name
+
| (In) W2 || R2 || uint32_t || NumHandles
 
|-
 
|-
| (Out) W0 || [[#Result]] || Result
+
| (In) W3 || R3 || Handle<ServerSession> || ReplyTargetSessionHandle
 
|-
 
|-
| (Out) W1 || Handle<ServerSession> || ServerHandle
+
| (In) X4 || R0, R4 || uint64_t || Timeout
 
|-
 
|-
| (Out) W2 || Handle<ClientSession> || ClientHandle
+
| (Out) W0 || R0 || [[#Result]] || Result
 +
|-
 +
| (Out) W1 || R1 || uint32_t || HandleIndex
 
|}
 
|}
 
</div>
 
</div>
   −
== AcceptSession ==
+
If ReplyTargetSessionHandle is not zero, a reply from the TLS will be sent to that session.
 +
Then it will wait until either of the passed sessions has an incoming message, is closed, a passed port has an incoming connection, or the timeout expires.
 +
If there is an incoming message, it is copied to the TLS.
 +
 
 +
If ReplyTargetSessionHandle is zero, the TLS should contain a blank message. If this message has a C descriptor, the buffer it points to will be used as the pointer buffer. See [[IPC_Marshalling#IPC_buffers]]. Note that a pointer buffer cannot be specified if ReplyTargetSessionHandle is not zero.
 +
 
 +
After being validated, passed handles will be enumerated in order; even if a session has been closed, if one that appears earlier in the list has an incoming message, it will take priority and a result code of 0x0 will be returned.
 +
 
 +
=== Result codes ===
 +
'''0x0:''' Success. Either a session has an incoming message or a port has an incoming connection. HandleIndex is set appropriately.
 +
 
 +
'''0xea01:''' Timeout. No handles were signalled before the timeout expired. HandleIndex is not updated.
 +
 
 +
'''0xf601:''' Port remote dead. One of the sessions has been closed. HandleIndex is set appropriately.
 +
 
 +
== ReplyAndReceiveWithUserBuffer ==
 
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Argument || Type || Name
+
! Argument64 || Argument32 || Type || Name
 +
|-
 +
| (In) X1 || R1 || void* || Address
 +
|-
 +
| (In) X2 || R2 || uint64_t || Size
 +
|-
 +
| (In) X3 || R3 || Handle<Port>* or Handle<ServerSession>* || Handles
 +
|-
 +
| (In) W4 || R0 || uint32_t || NumHandles
 +
|-
 +
| (In) W5 || R4 || Handle<ServerSession> || ReplyTargetSessionHandle
 
|-
 
|-
| (In) W1 || Handle<Port> || Port
+
| (In) X6 || R5, R6 || uint64_t || Timeout
 
|-
 
|-
| (Out) W0 || [[#Result]] || Result
+
| (Out) W0 || R0 || [[#Result]] || Result
 
|-
 
|-
| (Out) W1 || Handle<ServerSession> || Session
+
| (Out) W1 || R1 || uint32_t || HandleIndex
 
|}
 
|}
 
</div>
 
</div>
   −
=== Result codes ===
+
== CreateEvent ==
'''0xf201:''' No session waiting to be accepted
  −
 
  −
== ReplyAndReceiveLight ==
   
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 1,466: Line 1,453:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) W0 || Handle<Port> or Handle<ServerSession> || Handle
+
| (In) None || ||
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
 +
|-
 +
| (Out) W1 || Handle<WritableEvent> || WritableEventHandle
 +
|-
 +
| (Out) W2 || Handle<ReadableEvent> || ReadableEventHandle
 
|}
 
|}
 
</div>
 
</div>
   −
== ReplyAndReceive ==
+
== MapPhysicalMemoryUnsafe ==
 
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Argument64 || Argument32 || Type || Name
+
! Argument || Type || Name
 
|-
 
|-
| (In) W1 || R1 || Handle<Port>* or Handle<ServerSession>* || Handles
+
| (In) X0 || void* || Address
 
|-
 
|-
| (In) W2 || R2 || u32 || NumHandles
+
| (In) X1 || uint64_t || Size
 
|-
 
|-
| (In) W3 || R3 || Handle<ServerSession> || ReplyTarget
+
| (Out) W0 || [[#Result]] || Result
|-
  −
| (In) X4 || R0, R4 || u64 || Timeout
  −
|-
  −
| (Out) W0 || R0 || [[#Result]] || Result
  −
|-
  −
| (Out) W1 || R1 || u32 || HandleIndex
   
|}
 
|}
 
</div>
 
</div>
   −
If ReplyTarget is not zero, a reply from the TLS will be sent to that session.
+
Same as [[#MapPhysicalMemory]] except it always uses pool partition 0.
Then it will wait until either of the passed sessions has an incoming message, is closed, a passed port has an incoming connection, or the timeout expires.
  −
If there is an incoming message, it is copied to the TLS.
     −
If ReplyTarget is zero, the TLS should contain a blank message. If this message has a C descriptor, the buffer it points to will be used as the pointer buffer. See [[IPC_Marshalling#IPC_buffers]]. Note that a pointer buffer cannot be specified if ReplyTarget is not zero.
+
== UnmapPhysicalMemoryUnsafe ==
 
  −
After being validated, passed handles will be enumerated in order; even if a session has been closed, if one that appears earlier in the list has an incoming message, it will take priority and a result code of 0x0 will be returned.
  −
 
  −
=== Result codes ===
  −
'''0x0:''' Success. Either a session has an incoming message or a port has an incoming connection. HandleIndex is set appropriately.
  −
 
  −
'''0xea01:''' Timeout. No handles were signalled before the timeout expired. HandleIndex is not updated.
  −
 
  −
'''0xf601:''' Port remote dead. One of the sessions has been closed. HandleIndex is set appropriately.
  −
 
  −
== ReplyAndReceiveWithUserBuffer ==
   
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Argument64 || Argument32 || Type || Name
+
! Argument || Type || Name
 
|-
 
|-
| (In) X1 || R1 || u64 || Address
+
| (In) X0 || void* || Address
 
|-
 
|-
| (In) X2 || R2 || u64 || Size
+
| (In) X1 || uint64_t || Size
 
|-
 
|-
| (In) X3 || R3 || Handle<Port>* or Handle<ServerSession>* || Handles
+
| (Out) W0 || [[#Result]] || Result
|-
  −
| (In) W4 || R0 || u32 || NumHandles
  −
|-
  −
| (In) W5 || R4 || Handle<ServerSession> || ReplyTarget
  −
|-
  −
| (In) X6 || R5, R6 || u64 || Timeout
  −
|-
  −
| (Out) W0 || R0 || [[#Result]] || Result
  −
|-
  −
| (Out) W1 || R1 || u32 || HandleIndex
   
|}
 
|}
 
</div>
 
</div>
   −
== CreateEvent ==
+
== SetUnsafeLimit ==
 
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 1,537: Line 1,499:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) None || ||
+
| (In) X0 || uint64_t || Limit
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
|-
  −
| (Out) W1 || Handle<WritableEvent> || WritableEvent
  −
|-
  −
| (Out) W2 || Handle<ReadableEvent> || ReadableEvent
   
|}
 
|}
 
</div>
 
</div>
   −
== MapPhysicalMemoryUnsafe ==
+
== CreateCodeMemory ==
 
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 1,553: Line 1,511:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) X0 || u64 || Address
+
| (In) X1 || void* || Address
 
|-
 
|-
| (In) X1 || u64 || Size
+
| (In) X2 || uint64_t || Size
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
 +
|-
 +
| (Out) W1 || Handle<CodeMemory> || CodeMemoryHandle
 
|}
 
|}
 
</div>
 
</div>
   −
Same as [[#MapPhysicalMemory]] except it always uses pool partition 0.
+
Takes an address range with backing memory to create the code memory object.
 +
 
 +
The memory is initially memset to 0xFF after being locked.
   −
== UnmapPhysicalMemoryUnsafe ==
+
== ControlCodeMemory ==
 
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Argument || Type || Name
+
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) X0 || u64 || Address
+
| (In) W0 || R0 || Handle<CodeMemory> || CodeMemoryHandle
 
|-
 
|-
| (In) X1 || u64 || Size
+
| (In) W1 || R1 || [[#CodeMemoryOperation]] || CodeMemoryOperation
 
|-
 
|-
| (Out) W0 || [[#Result]] || Result
+
| (In) X2 || R2, R3 || void* || Address
|}
  −
</div>
  −
 
  −
== SetUnsafeLimit ==
  −
<div style="display: inline-block;">
  −
{| class="wikitable" border="1"
   
|-
 
|-
! Argument || Type || Name
+
| (In) X3 || R4, R5 || uint64_t || Size
 
|-
 
|-
| (In) X0 || u64 || Limit
+
| (In) W4 || R6 || [[#MemoryPermission]] || MemoryPermission
 
|-
 
|-
| (Out) W0 || [[#Result]] || Result
+
| (Out) W0 || R0 || [[#Result]] || Result
 
|}
 
|}
 
</div>
 
</div>
   −
== CreateCodeMemory ==
+
Maps the backing memory for a CodeMemory object into the current process.
<div style="display: inline-block;">
  −
{| class="wikitable" border="1"
  −
|-
  −
! Argument || Type || Name
  −
|-
  −
| (In) X1 || u64 || Address
  −
|-
  −
| (In) X2 || u64 || Size
  −
|-
  −
| (Out) W0 || [[#Result]] || Result
  −
|-
  −
| (Out) W1 || Handle<CodeMemory> || Handle
  −
|}
  −
</div>
     −
Takes an address range with backing memory to create the code memory object.
+
For [[#CodeMemoryOperation|MapOwner]], memory permission must be RW-.
   −
The memory is initially memset to 0xFF after being locked.
+
For [[#CodeMemoryOperation|MapSlave]], memory permission must be R-- or R-X.
   −
== ControlCodeMemory ==
+
Operations [[#CodeMemoryOperation|UnmapOwner/UnmapSlave]] unmap memory that was previously mapped this way.
<div style="display: inline-block;">
  −
{| class="wikitable" border="1"
  −
|-
  −
! Argument64 || Argument32 || Type || Name
  −
|-
  −
| (In) W0 || R0 || Handle<CodeMemory> || Handle
  −
|-
  −
| (In) W1 || R1 || [[#CodeMemoryOperation]] || CodeMemoryOperation
  −
|-
  −
| (In) X2 || R2, R3 || u64 || Address
  −
|-
  −
| (In) X3 || R4, R5 || u64 || Size
  −
|-
  −
| (In) W4 || R6 || MemoryPermission || Permission
  −
|-
  −
| (Out) W0 || R0 || [[#Result]] || Result
  −
|}
  −
</div>
  −
 
  −
Maps the backing memory for a Code memory object into the current process.
  −
 
  −
For [[#CodeMemoryOperation|CodeMemoryOperation_MapOwner]], memory permission must be RW-.
  −
 
  −
For [[#CodeMemoryOperation|CodeMemoryOperation_MapSlave]], memory permission must be R-- or R-X.
  −
 
  −
Operations [[#CodeMemoryOperation|CodeMemoryOperation_UnmapOwner/CodeMemoryOperation_UnmapSlave]] unmap memory that was previously mapped this way.
      
This allows one "secure JIT" process to map the code memory as RW-, and the other "slave" process to map it R-X.
 
This allows one "secure JIT" process to map the code memory as RW-, and the other "slave" process to map it R-X.
Line 1,659: Line 1,575:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) X1 || R2, R3 || u64 || RegAddr
+
| (In) X1 || R2, R3 || uint64_t || RegisterAddress
 
|-
 
|-
| (In) W2 || R0 || u64 || RwMask
+
| (In) W2 || R0 || uint32_t || RwMask
 
|-
 
|-
| (In) W3 || R1 || u64 || InValue
+
| (In) W3 || R1 || uint32_t || InValue
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
 
|-
 
|-
| (Out) W1 || R1 || u64 || OutValue
+
| (Out) W1 || R1 || uint32_t || OutValue
 
|}
 
|}
 
</div>
 
</div>
Line 1,703: Line 1,619:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) W0 || Handle<Process> ||  
+
| (In) W0 || Handle<Process> || ProcessHandle
 
|-
 
|-
| (In) W1 || ProcessActivity || ProcessActivity
+
| (In) W1 || [[#ProcessActivity]] || ProcessActivity
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 1,717: Line 1,633:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) W1 || u64 || Size
+
| (In) W1 || uint64_t || Size
 
|-
 
|-
| (In) W2 || MemoryPermission || LocalPerm
+
| (In) W2 || [[#MemoryPermission]] || LocalMemoryPermission
 
|-
 
|-
| (In) W3 || MemoryPermission || RemotePerm
+
| (In) W3 || [[#MemoryPermission]] || RemoteMemoryPermission
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
 
|-
 
|-
| (Out) W1 || Handle<SharedMemory> || MemHandle
+
| (Out) W1 || Handle<SharedMemory> || SharedMemoryHandle
 
|}
 
|}
 
</div>
 
</div>
Line 1,739: Line 1,655:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) X0 || Handle<TransferMemory> || MemHandle
+
| (In) X0 || Handle<TransferMemory> || TransferMemoryHandle
 
|-
 
|-
| (In) X1 || void* || Addr
+
| (In) X1 || void* || Address
 
|-
 
|-
| (In) X2 || u64 || Size
+
| (In) X2 || uint64_t || Size
 
|-
 
|-
| (In) W3 || MemoryPermission || Permission
+
| (In) W3 || [[#MemoryPermission]] || MemoryPermission
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 1,761: Line 1,677:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) X0 || Handle<TransferMemory> || MemHandle
+
| (In) X0 || Handle<TransferMemory> || TransferMemoryHandle
 
|-
 
|-
| (In) X1 || void* || Addr
+
| (In) X1 || void* || Address
 
|-
 
|-
| (In) X2 || u64 || Size
+
| (In) X2 || uint64_t || Size
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 1,779: Line 1,695:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) X1 || u64 || IrqNum
+
| (In) X1 || [[#Interrupt]] || Interrupt
 
|-
 
|-
| (In) W2 || bool || Flags
+
| (In) W2 || [[#InterruptType]] || InterruptType
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 1,789: Line 1,705:  
</div>
 
</div>
   −
Creates an event handle for the given IRQ number. Waiting on this handle will wait until the IRQ is triggered. The flags argument configures the triggering. If it is false, the IRQ is active HIGH level sensitive, if it is true it is rising-edge sensitive.
+
Creates an event handle for the given IRQ number. Waiting on this handle will wait until the IRQ is triggered. The InterruptType argument configures the triggering. If it is 0, the IRQ is active HIGH level sensitive, if it is 1 it is rising-edge sensitive.
    
=== Result codes ===
 
=== Result codes ===
Line 1,810: Line 1,726:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) X1 || u64 || Addr
+
| (In) X1 || void* || VirtualAddress
 
|-
 
|-
 
| (Out) W0 || [[#Result]]|| Result
 
| (Out) W0 || [[#Result]]|| Result
 
|-
 
|-
| (Out) X1 || u64 || PhysAddr
+
| (Out) X1 || uint64_t || PhysicalMemoryInfoAddress
 
|-
 
|-
| (Out) X2 || u64 || BaseAddr
+
| (Out) X2 || uint64_t || PhysicalMemoryInfoBaseAddress
 
|-
 
|-
| (Out) X3 || u64 || Size
+
| (Out) X3 || uint64_t || PhysicalMemoryInfoSize
 
|}
 
|}
 
</div>
 
</div>
Line 1,824: Line 1,740:  
Queries the physical address of a virtual address. Will always fetch the lowest page-aligned mapping that contains the provided physical address.
 
Queries the physical address of a virtual address. Will always fetch the lowest page-aligned mapping that contains the provided physical address.
   −
The returned BaseAddr is the virtual address of that page-aligned mapping, while PhysAddr is the physical address of that page. Size is the amount of continuous physical memory in that mapping.
+
The returned PhysicalMemoryInfoBaseAddress is the virtual address of that page-aligned mapping, while PhysicalMemoryInfoAddress is the physical address of that page. PhysicalMemoryInfoSize is the amount of continuous physical memory in that mapping.
    
== QueryIoMapping ==
 
== QueryIoMapping ==
Line 1,832: Line 1,748:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) X1 || R2, R3 || u64 || PhysAddr
+
| (In) X1 || R2, R3 || uint64_t || IoAddress
 
|-
 
|-
| (In) X2 || R0 || u64 || Size
+
| (In) X2 || R0 || uint64_t || Size
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
 
|-
 
|-
| (Out) X1 || R1 || void* || VirtAddr
+
| (Out) X1 || R1 || void* || VirtualAddress
 
|}
 
|}
 
</div>
 
</div>
Line 1,850: Line 1,766:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) X1 || R2, R3 || u64 || StartAddr
+
| (In) X1 || R2, R3 || uint64_t || DeviceAddressSpaceStartAddress
 
|-
 
|-
| (In) X2 || R0, R1 || u64 || EndAddr
+
| (In) X2 || R0, R1 || uint64_t || DeviceAddressSpaceEndAddress
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
 
|-
 
|-
| (Out) W1 || R1 || Handle<DeviceAddressSpace> || AddressSpaceHandle
+
| (Out) W1 || R1 || Handle<DeviceAddressSpace> || DeviceAddressSpaceHandle
 
|}
 
|}
 
</div>
 
</div>
Line 1,870: Line 1,786:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) W0 || [[#DeviceName]] || DeviceId
+
| (In) W0 || [[#DeviceName]] || DeviceName
 
|-
 
|-
| (In) X1 || Handle<DeviceAddressSpace> || DeviceAsHandle
+
| (In) X1 || Handle<DeviceAddressSpace> || DeviceAddressSpaceHandle
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 1,886: Line 1,802:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) W0 || [[#DeviceName]] || DeviceId
+
| (In) W0 || [[#DeviceName]] || DeviceName
 
|-
 
|-
| (In) X1 || Handle<DeviceAddressSpace> || DeviceAsHandle
+
| (In) X1 || Handle<DeviceAddressSpace> || DeviceAddressSpaceHandle
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 1,902: Line 1,818:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) W0 || R0 || Handle<DeviceAddressSpace> || DeviceAsHandle
+
| (In) W0 || R0 || Handle<DeviceAddressSpace> || DeviceAddressSpaceHandle
 
|-
 
|-
 
| (In) W1 || R1 || Handle<Process> || ProcessHandle
 
| (In) W1 || R1 || Handle<Process> || ProcessHandle
 
|-
 
|-
| (In) X2 || R2, R3 || void* || SrcAddr
+
| (In) X2 || R2, R3 || void* || Address
 
|-
 
|-
| (In) X3 || R4 || u64 || DeviceAsSize
+
| (In) X3 || R4 || uint64_t || DeviceAddressSpaceSize
 
|-
 
|-
| (In) X4 || R5, R6 || u64 || DeviceAsAddr
+
| (In) X4 || R5, R6 || uint64_t || DeviceAddressSpaceAddress
 
|-
 
|-
| (In) W5 || R7 || MemoryPermission || Permissions
+
| (In) W5 || R7 || [[#MemoryPermission]] || MemoryPermission
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
Line 1,920: Line 1,836:  
Maps an attached device address space to an userspace address.
 
Maps an attached device address space to an userspace address.
   −
dev_map_addr is the userspace destination address, while dev_as_addr is the source address between dev_as_start_addr and dev_as_end_addr (passed to [[#CreateDeviceAddressSpace]]).
+
Address is the userspace destination address, while DeviceAddressSpaceAddress is the source address between DeviceAddressSpaceStartAddress and DeviceAddressSpaceEndAddress (passed to [[#CreateDeviceAddressSpace]]).
    
The userspace destination address must have the [[SVC#MemoryState|MapDeviceAllowed]] bit set. Bit [[SVC#MemoryAttribute|IsDeviceMapped]] will be set after mapping.
 
The userspace destination address must have the [[SVC#MemoryState|MapDeviceAllowed]] bit set. Bit [[SVC#MemoryAttribute|IsDeviceMapped]] will be set after mapping.
Line 1,930: Line 1,846:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) W0 || R0 || Handle<DeviceAddressSpace> || DeviceAsHandle
+
| (In) W0 || R0 || Handle<DeviceAddressSpace> || DeviceAddressSpaceHandle
 
|-
 
|-
 
| (In) W1 || R1 || Handle<Process> || ProcessHandle
 
| (In) W1 || R1 || Handle<Process> || ProcessHandle
 
|-
 
|-
| (In) X2 || R2, R3 || void* || SrcAddr
+
| (In) X2 || R2, R3 || void* || Address
 
|-
 
|-
| (In) X3 || R4 || u64 || DeviceAsSize
+
| (In) X3 || R4 || uint64_t || DeviceAddressSpaceSize
 
|-
 
|-
| (In) X4 || R5, R6 || u64 || DeviceAsAddr
+
| (In) X4 || R5, R6 || uint64_t || DeviceAddressSpaceAddress
 
|-
 
|-
| (In) W5 || R7 || MemoryPermission || Permission
+
| (In) W5 || R7 || [[#MemoryPermission]] || MemoryPermission
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
Line 1,956: Line 1,872:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) W1 || R1 || Handle<DeviceAddressSpace> || DeviceAsHandle
+
| (In) W1 || R1 || Handle<DeviceAddressSpace> || DeviceAddressSpaceHandle
 
|-
 
|-
 
| (In) W2 || R2 || Handle<Process> || ProcessHandle
 
| (In) W2 || R2 || Handle<Process> || ProcessHandle
 
|-
 
|-
| (In) X3 || R0, R3 || u64 || SrcAddr
+
| (In) X3 || R0, R3 || void* || Address
 
|-
 
|-
| (In) X4 || R4 || u64 || DeviceAsSize
+
| (In) X4 || R4 || uint64_t || DeviceAddressSpaceSize
 
|-
 
|-
| (In) X5 || R5, R6 || u64 || DeviceAsAddr
+
| (In) X5 || R5, R6 || uint64_t || DeviceAddressSpaceAddress
 
|-
 
|-
| (In) W6 || R7 || MemoryPermission || Permission
+
| (In) W6 || R7 || [[#MemoryPermission]] || MemoryPermission
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
 
|-
 
|-
| (Out) X1 || R1 || u64 || MappedSize
+
| (Out) X1 || R1 || uint64_t || Size
 
|}
 
|}
 
</div>
 
</div>
Line 1,980: Line 1,896:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) W0 || R0 || Handle<DeviceAddressSpace> || DeviceAsHandle
+
| (In) W0 || R0 || Handle<DeviceAddressSpace> || DeviceAddressSpaceHandle
 
|-
 
|-
 
| (In) W1 || R1 || Handle<Process> || ProcessHandle
 
| (In) W1 || R1 || Handle<Process> || ProcessHandle
 
|-
 
|-
| (In) X2 || R2, R3 || void* || SrcAddr
+
| (In) X2 || R2, R3 || void* || Address
 
|-
 
|-
| (In) X3 || R4 || u64 || DeviceAsSize
+
| (In) X3 || R4 || uint64_t || DeviceAddressSpaceSize
 
|-
 
|-
| (In) X4 || R5, R6 || u64 || DeviceAsAddr
+
| (In) X4 || R5, R6 || uint64_t || DeviceAddressSpaceAddress
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
Line 2,004: Line 1,920:  
| (In) W0 || R0 || Handle<Process> || ProcessHandle
 
| (In) W0 || R0 || Handle<Process> || ProcessHandle
 
|-
 
|-
| (In) X1 || R2, R3 || u64 || Address
+
| (In) X1 || R2, R3 || void* || Address
 
|-
 
|-
| (In) X2 || R1, R4 || u64 || Size
+
| (In) X2 || R1, R4 || uint64_t || Size
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
Line 2,020: Line 1,936:  
| (In) W0 || R0 || Handle<Process> || ProcessHandle
 
| (In) W0 || R0 || Handle<Process> || ProcessHandle
 
|-
 
|-
| (In) X1 || R2, R3 || u64 || Address
+
| (In) X1 || R2, R3 || void* || Address
 
|-
 
|-
| (In) X2 || R1, R4 || u64 || Size
+
| (In) X2 || R1, R4 || uint64_t || Size
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
Line 2,036: Line 1,952:  
| (In) W0 || R0 || Handle<Process> || ProcessHandle
 
| (In) W0 || R0 || Handle<Process> || ProcessHandle
 
|-
 
|-
| (In) X1 || R2, R3 || u64 || Address
+
| (In) X1 || R2, R3 || void* || Address
 
|-
 
|-
| (In) X2 || R1, R4 || u64 || Size
+
| (In) X2 || R1, R4 || uint64_t || Size
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
Line 2,050: Line 1,966:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) X1 || R2, R3 || u64 || ProcessId
+
| (In) X1 || R2, R3 || uint64_t || ProcessId
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
Line 2,088: Line 2,004:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) X0 || [[#DebugEventInfo]]* || DebugEvents
+
| (In) X0 || [[#DebugEventInfo]]* || DebugEventInfo
 
|-
 
|-
 
| (In) W1 || Handle<Debug> || DebugHandle
 
| (In) W1 || Handle<Debug> || DebugHandle
Line 2,104: Line 2,020:  
| (In) W0 || R0 || Handle<Debug> || DebugHandle
 
| (In) W0 || R0 || Handle<Debug> || DebugHandle
 
|-
 
|-
| (In) W1 || R1 || [[#ContinueDebugFlags]] ([1.0.0-2.3.0] [[#ContinueDebugFlagsOld]]) || DebugFlags
+
| (In) W1 || R1 || uint32_t || [[#ContinueDebugFlags]] ([1.0.0-2.3.0] [[#ContinueDebugFlagsOld]])
 
|-
 
|-
| (In) X2 || R2 ([1.0.0-2.3.0] R2, R3) || u64* ([1.0.0-2.3.0] u64)|| ThreadIdList ([1.0.0-2.3.0] ThreadId)
+
| (In) X2 || R2 ([1.0.0-2.3.0] R2, R3) || uint64_t* ([1.0.0-2.3.0] uint64_t)|| ThreadIdList ([1.0.0-2.3.0] ThreadId)
 
|-
 
|-
| (In) X3 || R3 || size_t || [3.0.0+] NumTids
+
| (In) X3 || R3 || uint64_t || [3.0.0+] NumThreadIds
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
Line 2,114: Line 2,030:  
</div>
 
</div>
   −
Maximum NumTids is 64. 0 means "all threads".
+
Maximum NumThreadIds is 64. 0 means "all threads".
    
=== Result codes ===
 
=== Result codes ===
Line 2,129: Line 2,045:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) X1 || R1 || u64* || ProcessIdBuffer
+
| (In) X1 || R1 || uint64_t* || ProcessIdBuffer
 
|-
 
|-
| (In) W2 || R2 || size_t || ProcessIdBufferSize
+
| (In) W2 || R2 || uint32_t || ProcessIdBufferSize
 
|-
 
|-
 
| (Out) X0 || R0 || [[#Result]] || Result
 
| (Out) X0 || R0 || [[#Result]] || Result
 
|-
 
|-
| (Out) W1 || R1 || size_t || NumProcesses
+
| (Out) W1 || R1 || uint32_t || NumProcesses
 
|}
 
|}
 
</div>
 
</div>
Line 2,141: Line 2,057:  
Fills the provided array with the pids of currently living processes. A process "lives" so long as it is currently running or a handle to it still exists.
 
Fills the provided array with the pids of currently living processes. A process "lives" so long as it is currently running or a handle to it still exists.
   −
It returns the total number of processes currently alive. If this number is bigger than the size of PidBuffer, the user won't have all the pids.
+
It returns the total number of processes currently alive. If this number is bigger than the size of ProcessIdBuffer, the user won't have all the pids.
    
=== Result codes ===
 
=== Result codes ===
Line 2,158: Line 2,074:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) X1 || R1 || u64* || ThreadIdBuffer
+
| (In) X1 || R1 || uint64_t* || ThreadIdBuffer
 
|-
 
|-
| (In) W2 || R2 || size_t || ThreadIdBufferSize
+
| (In) W2 || R2 || uint32_t || ThreadIdBufferSize
 
|-
 
|-
 
| (In) W3 || R3 || Handle<Debug> || DebugHandle
 
| (In) W3 || R3 || Handle<Debug> || DebugHandle
Line 2,166: Line 2,082:  
| (Out) X0 || R0 || [[#Result]] || Result
 
| (Out) X0 || R0 || [[#Result]] || Result
 
|-
 
|-
| (Out) W1 || R1 || size_t || NumThreads
+
| (Out) W1 || R1 || uint32_t || NumThreads
 
|}
 
|}
 
</div>
 
</div>
Line 2,176: Line 2,092:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) X0 || R0 || ThreadContext* || ThreadContextBuffer
+
| (In) X0 || R0 || [[#ThreadContext]]* || ThreadContext
 
|-
 
|-
 
| (In) X1 || R1 || Handle<Debug> || DebugHandle
 
| (In) X1 || R1 || Handle<Debug> || DebugHandle
 
|-
 
|-
| (In) X2 || R2, R3 || u64 || ThreadId
+
| (In) X2 || R2, R3 || uint64_t || ThreadId
 
|-
 
|-
| (In) W3 || R4 || u32 || [[#ThreadContextFlags]]
+
| (In) W3 || R4 || uint32_t || [[#ThreadContextFlags]]
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
Line 2,196: Line 2,112:  
| (In) W0 || R0 || Handle<Debug> || DebugHandle
 
| (In) W0 || R0 || Handle<Debug> || DebugHandle
 
|-
 
|-
| (In) X1 || R2, R3 || u64 || ThreadId
+
| (In) X1 || R2, R3 || uint64_t || ThreadId
 
|-
 
|-
| (In) X2 || R1 || ThreadContext* || ThreadContextBuffer
+
| (In) X2 || R1 || [[#ThreadContext]]* || ThreadContext
 
|-
 
|-
| (In) W3 || R4 || u32 || [[#ThreadContextFlags]]
+
| (In) W3 || R4 || uint32_t || [[#ThreadContextFlags]]
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
Line 2,212: Line 2,128:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) X0 || [[#MemoryInfo]]* || MemoryInfoBuffer
+
| (In) X0 || [[#MemoryInfo]]* || MemoryInfo
 
|-
 
|-
 
| (In) W2 || Handle<Debug> || DebugHandle
 
| (In) W2 || Handle<Debug> || DebugHandle
 
|-
 
|-
| (In) X3 || u64 || Address
+
| (In) X3 || void* || Address
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
 
|-
 
|-
| (Out) W1 || PageInfo || PageInfo
+
| (Out) W1 || [[#PageInfo]] || PageInfo
 
|}
 
|}
 
</div>
 
</div>
Line 2,230: Line 2,146:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) X0 || u64 || MemoryBuffer
+
| (In) X0 || void* || MemoryBufferAddress
 
|-
 
|-
 
| (In) W1 || Handle<Debug> || DebugHandle
 
| (In) W1 || Handle<Debug> || DebugHandle
 
|-
 
|-
| (In) X2 || u64 || SrcAddress
+
| (In) X2 || void* || SrcAddress
 
|-
 
|-
| (In) X3 || u64 || Size
+
| (In) X3 || uint64_t || Size
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 2,250: Line 2,166:  
| (In) W0 || Handle<Debug> || DebugHandle
 
| (In) W0 || Handle<Debug> || DebugHandle
 
|-
 
|-
| (In) X1 || u64 || MemoryBuffer
+
| (In) X1 || void* || MemoryBufferAddress
 
|-
 
|-
| (In) X2 || u64 || DstAddress
+
| (In) X2 || void* || DstAddress
 
|-
 
|-
| (In) X3 || u64 || Size
+
| (In) X3 || uint64_t || Size
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 2,266: Line 2,182:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) W0 || R0 || HardwareBreakPointRegisterName || Name
+
| (In) W0 || R0 || [[#HardwareBreakPointRegisterName]] || Name
 
|-
 
|-
| (In) X1 || R2, R3 || u64 || Flags
+
| (In) X1 || R2, R3 || uint64_t || Flags
 
|-
 
|-
| (In) X2 || R1, R4 || u64 || Value
+
| (In) X2 || R1, R4 || uint64_t || Value
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
Line 2,294: Line 2,210:  
| (In) X2 || R2 || Handle<Debug> || DebugHandle
 
| (In) X2 || R2 || Handle<Debug> || DebugHandle
 
|-
 
|-
| (In) X3 || R0, R1 || u64 || ThreadId
+
| (In) X3 || R0, R1 || uint64_t || ThreadId
 
|-
 
|-
| (In) W4 || R3 || [[#DebugThreadParam]] || Param
+
| (In) W4 || R3 || [[#DebugThreadParam]] || DebugThreadParam
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
 
|-
 
|-
| (Out) X1 || R1, R2 || u64 || Out0
+
| (Out) X1 || R1, R2 || uint64_t || Out0
 
|-
 
|-
| (Out) W2 || R3 || u32 || Out1
+
| (Out) W2 || R3 || uint32_t || Out1
 
|}
 
|}
 
</div>
 
</div>
Line 2,312: Line 2,228:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) X1 || u64 || InfoId
+
| (In) X1 || [[#SystemInfoType]] || SystemInfoType
 
|-
 
|-
 
| (In) W2 || Handle || Handle
 
| (In) W2 || Handle || Handle
 
|-
 
|-
| (In) X3 || u64 || InfoSubId
+
| (In) X3 || uint64_t || SystemInfoSubType
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
 
|-
 
|-
| (Out) X1 || u64 || Out
+
| (Out) X1 || uint64_t || SystemInfo
 
|}
 
|}
 
</div>
 
</div>
   −
{| class=wikitable
+
== CreatePort ==
! Handle type || Id0 || Id1 || Description
+
<div style="display: inline-block;">
 +
{| class="wikitable" border="1"
 
|-
 
|-
| Zero    || 0 || 0 || TotalMemorySize_Application
+
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| Zero    || 0 || 1 || TotalMemorySize_Applet
+
| (In) W2 || R2 || int32_t || MaxSessions
 
|-
 
|-
| Zero    || 0 || 2 || TotalMemorySize_System
+
| (In) W3 || R3 || bool || IsLight
 
|-
 
|-
| Zero    || 0 || 3 || TotalMemorySize_SystemUnsafe
+
| (In) X4 || R0 || uint64_t || Name
 
|-
 
|-
| Zero    || 1 || 0 || CurrentMemorySize_Application
+
| (Out) W0 || R0 || [[#Result]] || Result
|-
  −
| Zero    || 1 || 1 || CurrentMemorySize_Applet
  −
|-
  −
| Zero    || 1 || 2 || CurrentMemorySize_System
  −
|-
  −
| Zero    || 1 || 3 || CurrentMemorySize_SystemUnsafe
   
|-
 
|-
| Zero    || 2 || 0 || PrivilegedProcessId_LowerBound
+
| (Out) W1 || R1 || Handle<Port> || ServerPortHandle
 
|-
 
|-
| Zero    || 2 || 1 || PrivilegedProcessId_UpperBound
+
| (Out) W2 || R2 || Handle<Port> || ClientPortHandle
 
|}
 
|}
 +
</div>
   −
== SetProcessMemoryPermission ==
+
== ManageNamedPort ==
 
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Argument64 || Argument32 || Type || Name
+
! Argument || Type || Name
|-
  −
| (In) W0 || R0 || Handle<Process> || ProcessHandle
   
|-
 
|-
| (In) X1 || R2, R3 || u64 || Addr
+
| (In) X1 || char* || Name
 
|-
 
|-
| (In) X2 || R1, R4 || u64 || Size
+
| (In) W2 || int32_t || MaxSessions
 
|-
 
|-
| (In) W3 || R5 || void* || Perm
+
| (Out) W0 || [[#Result]] || Result
 
|-
 
|-
| (Out) W0 || R0 || [[#Result]] || Result
+
| (Out) W1 || Handle<Port> || ServerPortHandle
 
|}
 
|}
 
</div>
 
</div>
   −
This sets the memory permissions for the specified memory with the supplied process handle.
+
== ConnectToPort ==
 
  −
This throws an error(0xD801) when the input perm is >0x5, hence -WX and RWX are not allowed.
  −
 
  −
== MapProcessMemory ==
   
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Argument64 || Argument32 || Type || Name
+
! Argument || Type || Name
 
|-
 
|-
| (In) X0 || R0 || u64 || DstAddr
+
| (In) W1 || Handle<Port> || ClientPortHandle
 +
|-
 +
| (Out) W0 || [[#Result]] || Result
 +
|-
 +
| (Out) W1 || Handle<Session> || SessionHandle
 +
|}
 +
</div>
 +
 
 +
== SetProcessMemoryPermission ==
 +
<div style="display: inline-block;">
 +
{| class="wikitable" border="1"
 +
|-
 +
! Argument64 || Argument32 || Type || Name
 +
|-
 +
| (In) W0 || R0 || Handle<Process> || ProcessHandle
 +
|-
 +
| (In) X1 || R2, R3 || void* || Addr
 +
|-
 +
| (In) X2 || R1, R4 || uint64_t || Size
 +
|-
 +
| (In) W3 || R5 || [[#MemoryPermission]] || MemoryPermission
 +
|-
 +
| (Out) W0 || R0 || [[#Result]] || Result
 +
|}
 +
</div>
 +
 
 +
This sets the memory permissions for the specified memory with the supplied process handle.
 +
 
 +
This throws an error(0xD801) when the input perm is >0x5, hence -WX and RWX are not allowed.
 +
 
 +
== MapProcessMemory ==
 +
<div style="display: inline-block;">
 +
{| class="wikitable" border="1"
 +
|-
 +
! Argument64 || Argument32 || Type || Name
 +
|-
 +
| (In) X0 || R0 || void* || DstAddress
 
|-
 
|-
 
| (In) W1 || R1 || Handle<Process> || ProcessHandle
 
| (In) W1 || R1 || Handle<Process> || ProcessHandle
 
|-
 
|-
| (In) X2 || R2, R3 || void* || SrcAddr
+
| (In) X2 || R2, R3 || void* || SrcAddress
 
|-
 
|-
| (In) X3 || R4 || u64 || Size
+
| (In) X3 || R4 || uint64_t || Size
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
Line 2,398: Line 2,340:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) X0 || R0 || void* || DstAddr
+
| (In) X0 || R0 || void* || DstAddress
 
|-
 
|-
 
| (In) W1 || R1 || Handle<Process> || ProcessHandle
 
| (In) W1 || R1 || Handle<Process> || ProcessHandle
 
|-
 
|-
| (In) X2 || R2, R3 || u64 || SrcAddr
+
| (In) X2 || R2, R3 || void* || SrcAddress
 
|-
 
|-
| (In) X3 || R4 || u64 || Size
+
| (In) X3 || R4 || uint64_t || Size
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
Line 2,418: Line 2,360:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) X0 || R0 || [[#MemoryInfo]]* || MemInfoPtr
+
| (In) X0 || R0 || [[#MemoryInfo]]* || MemoryInfo
 
|-
 
|-
 
| (In) W2 || R2 || Handle<Process> || ProcessHandle
 
| (In) W2 || R2 || Handle<Process> || ProcessHandle
 
|-
 
|-
| (In) X3 || R1, R3 || u64 || Addr
+
| (In) X3 || R1, R3 || void* || Address
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
 
|-
 
|-
| (Out) W1 || R1 || PageInfo || PageInfo
+
| (Out) W1 || R1 || [[#PageInfo]] || PageInfo
 
|}
 
|}
 
</div>
 
</div>
Line 2,440: Line 2,382:  
| (In) W0 || R0 || Handle<Process> || ProcessHandle
 
| (In) W0 || R0 || Handle<Process> || ProcessHandle
 
|-
 
|-
| (In) X1 || R2, R3 || u64 || DstAddr
+
| (In) X1 || R2, R3 || void* || DstAddress
 
|-
 
|-
| (In) X2 || R1, R4 || u64 || SrcAddr
+
| (In) X2 || R1, R4 || void* || SrcAddress
 
|-
 
|-
| (In) X3 || R5, R6 || u64 || Size
+
| (In) X3 || R5, R6 || uint64_t || Size
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
Line 2,460: Line 2,402:  
| (In) W0 || R0 || Handle<Process> || ProcessHandle
 
| (In) W0 || R0 || Handle<Process> || ProcessHandle
 
|-
 
|-
| (In) X1 || R2, R3 || u64 || DstAddr
+
| (In) X1 || R2, R3 || void* || DstAddress
 
|-
 
|-
| (In) X2 || R1, R4 || u64 || SrcAddr
+
| (In) X2 || R1, R4 || void* || SrcAddress
 
|-
 
|-
| (In) X3 || R5, R6 || u64 || Size
+
| (In) X3 || R5, R6 || uint64_t || Size
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
Line 2,478: Line 2,420:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) X1 || [[#CreateProcessInfo]]* || InfoPtr
+
| (In) X1 || [[#CreateProcessParameter]]* || CreateProcessParameter
 
|-
 
|-
| (In) X2 || u32* || CapabilitiesPtr
+
| (In) X2 || uint32_t* || Capabilities
 
|-
 
|-
| (In) X3 || u64 || CapabilitiesNum
+
| (In) X3 || int32_t || CapabilitiesNum
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 2,490: Line 2,432:  
</div>
 
</div>
   −
Takes a [[#CreateProcessInfo]] as input.
+
Takes a [[#CreateProcessParameter]] as input.
CapabilitiesPtr points to an array of [[NPDM#Kernel_Access_Control|kernel capabilities]].
+
Capabilities points to an array of [[NPDM#Kernel_Access_Control|kernel capabilities]].
CapabilitiesNum is a number of capabilities in the CapabilitiesPtr array (number of element, not number of bytes).
+
CapabilitiesNum is a number of capabilities in the Capabilities array (number of element, not number of bytes).
    
=== Result codes ===
 
=== Result codes ===
Line 2,509: Line 2,451:  
'''0xF001:''' Unused bits are set in mmuflags. Unknown address space type used.
 
'''0xF001:''' Unused bits are set in mmuflags. Unknown address space type used.
   −
== GetProcessInfo ==
+
== StartProcess ==
 
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 2,515: Line 2,457:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) W0 || R1 || Handle<Process> || ProcessHandle
+
| (In) W0 || R0 || Handle<Process> || ProcessHandle
 +
|-
 +
| (In) W1 || R1 || int32_t || MainThreadPriority
 +
|-
 +
| (In) W2 || R2 || int32_t || DefaultCpuId
 
|-
 
|-
| (In) W1 || R2 || [[#ProcessInfoType]] || InfoType
+
| (In) X3 || R3, R4 || uint64_t || MainThreadStackSize
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
 +
|}
 +
</div>
 +
 +
== TerminateProcess ==
 +
<div style="display: inline-block;">
 +
{| class="wikitable" border="1"
 
|-
 
|-
| (Out) X1 || R1, R2 || [[#ProcessState]] || State
+
! Argument || Type || Name
 +
|-
 +
| (In) W0 || Handle<Process> || ProcessHandle
 +
|-
 +
| (Out) W0 || [[#Result]] || Result
 
|}
 
|}
 
</div>
 
</div>
   −
Returns an enum with value 0-7.
+
== GetProcessInfo ==
 
  −
== CallSecureMonitor ==
   
<div style="display: inline-block;">
 
<div style="display: inline-block;">
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 2,533: Line 2,487:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) X0 || R0 || u64 || [[SMC#ID_0|Function ID]]
+
| (In) W0 || R1 || Handle<Process> || ProcessHandle
 
|-
 
|-
| (In) X1-X7 || R1-R7 || u64 || SMC sub-arguments
+
| (In) W1 || R2 || [[#ProcessInfoType]] || ProcessInfoType
 
|-
 
|-
| (Out) X0 || R0 || [[SMC#Errors|SMC Result]] || Result of SMC
+
| (Out) W0 || R0 || [[#Result]] || Result
 
|-
 
|-
| (Out) X1-X7 || R1-R7 || u64 || SMC sub-output
+
| (Out) X1 || R1, R2 || uint64_t || [[#ProcessState]]
 
|}
 
|}
 
</div>
 
</div>
   −
Takes in a SMC function ID in X0, and arguments for that SMC function in X1-X7.
+
Returns an enum with value 0-7.
   −
Passing an invalid SMC function ID or calling from a core other than core 3 will result in a secure monitor panic.
+
== CreateResourceLimit ==
 +
<div style="display: inline-block;">
 +
{| class="wikitable" border="1"
 +
|-
 +
! Argument || Type || Name
 +
|-
 +
| (In) None || ||
 +
|-
 +
| (Out) W0 || [[#Result]] || Result
 +
|-
 +
| (Out) W1 || Handle<ResourceLimit> || ResourceLimitHandle
 +
|}
 +
</div>
 +
 
 +
== SetResourceLimitLimitValue ==
 +
<div style="display: inline-block;">
 +
{| class="wikitable" border="1"
 +
|-
 +
! Argument64 || Argument32 || Type || Name
 +
|-
 +
| (In) W0 || R0 || Handle<ResourceLimit> || ResourceLimitHandle
 +
|-
 +
| (In) W1 || R1 || [[#LimitableResource]] || LimitableResource
 +
|-
 +
| (In) X2 || R2, R3 || int64_t || LimitValue
 +
|-
 +
| (Out) W0 || R0 || [[#Result]] || Result
 +
|}
 +
</div>
 +
 
 +
== CallSecureMonitor ==
 +
<div style="display: inline-block;">
 +
{| class="wikitable" border="1"
 +
|-
 +
! Argument64 || Argument32 || Type || Name
 +
|-
 +
| (In) X0 || R0 || uint64_t || [[SMC#Secure_Monitor_calls|FunctionId]]
 +
|-
 +
| (In) X1-X7 || R1-R7 || uint64_t || SMC arguments
 +
|-
 +
| (Out) X0 || R0 || [[SMC#Result|Result]] || SMC result
 +
|-
 +
| (Out) X1-X7 || R1-R7 || uint64_t || SMC output
 +
|}
 +
</div>
 +
 
 +
Takes in a SMC function ID in X0, and arguments for that SMC function in X1-X7.
 +
 
 +
Passing an invalid SMC function ID or calling from a core other than core 3 will result in a secure monitor panic.
    
The kernel parses bits 9-15 in the passed SMC function ID (per the ARM SMC calling convention), and when set uses as an indicator to translate a pointer in the associated register (X1-X7) to a physical address. The kernel will translate any address mapped as R-W, other addresses (R--, R-X, or invalid pointers) will be translated as 0/NULL.
 
The kernel parses bits 9-15 in the passed SMC function ID (per the ARM SMC calling convention), and when set uses as an indicator to translate a pointer in the associated register (X1-X7) to a physical address. The kernel will translate any address mapped as R-W, other addresses (R--, R-X, or invalid pointers) will be translated as 0/NULL.
Line 2,563: Line 2,565:     
= Enum/Structures =
 
= Enum/Structures =
== ThreadContextFlags ==
+
== InfoType ==
Bitfield of one of more of these:
  −
 
   
{| class=wikitable
 
{| class=wikitable
! Bit || Bitmask || Name || Description
+
! Handle type || InfoType || InfoSubType || Description
 
|-
 
|-
| 0 || 1 || General-purpose registers || If in 64-bit mode, GPRs 0–28 will be read/written. If in 32-bit mode, GPRs 0–12 will be read/written.
+
| Process || 0 || 0 || AllowedCpuIdBitmask
 
|-
 
|-
| 1 || 2 || Control registers || Reads/writes the FP, LR, PC, SP, PSTATE, and TPIDR registers.
+
| Process || 1 || 0 || AllowedThreadPrioBitmask
 
|-
 
|-
| 2 || 4 || Floating-point registers || Reads/writes the floating-point vector registers.
+
| Process || 2 || 0 || AliasRegionBaseAddr
 
|-
 
|-
| 3 || 8 || Floating-point control registers || Reads/writes the FPCR and FPSR registers.
+
| Process || 3 || 0 || AliasRegionSize
|}
  −
 
  −
== DeviceName ==
  −
{| class=wikitable
  −
! Value || Name
   
|-
 
|-
| 0 || AFI
+
| Process || 4 || 0 || HeapRegionBaseAddr
 
|-
 
|-
| 1 || AVPC
+
| Process || 5 || 0 || HeapRegionSize
 
|-
 
|-
| 2 || DC
+
| Process || 6 || 0 || TotalMemoryAvailable. Total memory available(free+used).
 
|-
 
|-
| 3 || DCB
+
| Process || 7 || 0 || TotalMemoryUsage. Total used size of codebin memory + main-thread stack + allocated heap.
 
|-
 
|-
| 4 || HC
+
| Zero    || 8 || 0 || IsCurrentProcessBeingDebugged
 
|-
 
|-
| 5 || HDA
+
| Zero    || 9 || 0 || Returns ResourceLimit handle for current process. Used by [[Process_Manager_services|PM]].
 
|-
 
|-
| 6 || ISP2
+
| Zero    || 10 || -1, {current coreid} || IdleTickCount
 
|-
 
|-
| 7 || MSENCNVENC
+
| Zero    || 11 || 0-3 || RandomEntropy from current process. TRNG. Used to seed usermode PRNGs.
 
|-
 
|-
| 8 || NV
+
| Process || 12 || 0 || [2.0.0+] AddressSpaceBaseAddr
 
|-
 
|-
| 9 || NV2
+
| Process || 13 || 0 || [2.0.0+] AddressSpaceSize
 
|-
 
|-
| 10 || PPCS
+
| Process || 14 || 0 || [2.0.0+] StackRegionBaseAddr
 
|-
 
|-
| 11 || SATA
+
| Process || 15 || 0 || [2.0.0+] StackRegionSize
 +
|-
 +
| Process || 16 || 0 || [3.0.0+] PersonalMmHeapSize
 +
|-
 +
| Process || 17 || 0 || [3.0.0+] PersonalMmHeapUsage
 +
|-
 +
| Process || 18 || 0 || [3.0.0+] ProgramId
 +
|-
 +
| Zero    || 19 || 0 || [4.0.0-4.1.0] PrivilegedProcessId_LowerBound
 +
|-
 +
| Zero    || 19 || 1 || [4.0.0-4.1.0] PrivilegedProcessId_UpperBound
 +
|-
 +
| Process || 20 || 0 || [5.0.0+] UserExceptionContextAddr
 +
|-
 +
| Process || 21 || 0 || [6.0.0+] TotalMemoryAvailableWithoutMmHeap
 +
|-
 +
| Process || 22 || 0 || [6.0.0+] TotalMemoryUsedWithoutMmHeap
 +
|-
 +
| Process || 23 || 0 || [9.0.0+] IsApplication
 +
|-
 +
| Thread  || 0xF0000002 || 0-3, -1 || Thread Ticks. When 0-3 are passed, gets specific core CPU ticks spent on thread. When -1 is passed, gets total CPU ticks spent on thread.
 +
|}
 +
 
 +
== SystemInfoType ==
 +
{| class=wikitable
 +
! Handle type || SystemInfoType || SystemInfoSubType|| Description
 +
|-
 +
| Zero    || 0 || 0 || TotalMemorySize_Application
 +
|-
 +
| Zero    || 0 || 1 || TotalMemorySize_Applet
 +
|-
 +
| Zero    || 0 || 2 || TotalMemorySize_System
 +
|-
 +
| Zero    || 0 || 3 || TotalMemorySize_SystemUnsafe
 +
|-
 +
| Zero    || 1 || 0 || CurrentMemorySize_Application
 +
|-
 +
| Zero    || 1 || 1 || CurrentMemorySize_Applet
 +
|-
 +
| Zero    || 1 || 2 || CurrentMemorySize_System
 +
|-
 +
| Zero    || 1 || 3 || CurrentMemorySize_SystemUnsafe
 +
|-
 +
| Zero    || 2 || 0 || PrivilegedProcessId_LowerBound
 +
|-
 +
| Zero    || 2 || 1 || PrivilegedProcessId_UpperBound
 +
|}
 +
 
 +
== ThreadContextFlags ==
 +
Bitfield of one of more of these:
 +
 
 +
{| class=wikitable
 +
! Bit || Bitmask || Name || Description
 +
|-
 +
| 0 || 1 || General-purpose registers || If in 64-bit mode, GPRs 0–28 will be read/written. If in 32-bit mode, GPRs 0–12 will be read/written.
 +
|-
 +
| 1 || 2 || Control registers || Reads/writes the FP, LR, PC, SP, PSTATE, and TPIDR registers.
 +
|-
 +
| 2 || 4 || Floating-point registers || Reads/writes the floating-point vector registers.
 +
|-
 +
| 3 || 8 || Floating-point control registers || Reads/writes the FPCR and FPSR registers.
 +
|}
 +
 
 +
== DeviceName ==
 +
{| class=wikitable
 +
! Value || Name
 +
|-
 +
| 0 || AFI
 +
|-
 +
| 1 || AVPC
 +
|-
 +
| 2 || DC
 +
|-
 +
| 3 || DCB
 +
|-
 +
| 4 || HC
 +
|-
 +
| 5 || HDA
 +
|-
 +
| 6 || ISP2
 +
|-
 +
| 7 || MSENCNVENC
 +
|-
 +
| 8 || NV
 +
|-
 +
| 9 || NV2
 +
|-
 +
| 10 || PPCS
 +
|-
 +
| 11 || SATA
 +
|-
 +
| 12 || VI
 +
|-
 +
| 13 || VIC
 +
|-
 +
| 14 || XUSB_HOST
 +
|-
 +
| 15 || XUSB_DEV
 +
|-
 +
| 16 || TSEC
 +
|-
 +
| 17 || PPCS1
 +
|-
 +
| 18 || DC1
 +
|-
 +
| 19 || SDMMC1A
 +
|-
 +
| 20 || SDMMC2A
 +
|-
 +
| 21 || SDMMC3A
 +
|-
 +
| 22 || SDMMC4A
 +
|-
 +
| 23 || ISP2B
 +
|-
 +
| 24 || GPU
 +
|-
 +
| 25 || GPUB
 +
|-
 +
| 26 || PPCS2
 +
|-
 +
| 27 || NVDEC
 +
|-
 +
| 28 || APE
 +
|-
 +
| 29 || SE
 +
|-
 +
| 30 || NVJPG
 +
|-
 +
| 31 || HC1
 +
|-
 +
| 32 || SE1
 +
|-
 +
| 33 || AXIAP
 +
|-
 +
| 34 || ETR
 +
|-
 +
| 35 || TSECB
 +
|-
 +
| 36 || TSEC1
 +
|-
 +
| 37 || TSECB1
 
|-
 
|-
| 12 || VI
+
| 38 || NVDEC1
 +
|}
 +
 
 +
== CodeMemoryOperation ==
 +
{| class=wikitable
 +
! Value || Name
 
|-
 
|-
| 13 || VIC
+
| 0 || MapOwner
 
|-
 
|-
| 14 || XUSB_HOST
+
| 1 || MapSlave
 
|-
 
|-
| 15 || XUSB_DEV
+
| 2 || UnmapOwner
 
|-
 
|-
| 16 || TSEC
+
| 3 || UnmapSlave
 +
|}
 +
 
 +
== LimitableResource ==
 +
{| class=wikitable
 +
! Value || Name || Description
 
|-
 
|-
| 17 || PPCS1
+
| 0 || PhysicalMemoryMax || Bytes of memory a process may allocate.
 
|-
 
|-
| 18 || DC1
+
| 1 || ThreadCountMax || Amount of threads a process can create.
 
|-
 
|-
| 19 || SDMMC1A
+
| 2 || EventCountMax || Amount of events a process can create through [[#CreateEvent]] or [[#SendAsyncRequestWithUserBuffer]].
 
|-
 
|-
| 20 || SDMMC2A
+
| 3 || TransferMemoryCountMax || Amount of TransferMemory a process can create through [[#CreateTransferMemory]].
 
|-
 
|-
| 21 || SDMMC3A
+
| 4 || SessionCountMax || Amount of session a process can create through [[#CreateSession]], [[#ConnectToPort]] or [[#ConnectToNamedPort]].
 +
|}
 +
 
 +
= ThreadActivity =
 +
{| class=wikitable
 +
! Value || Name
 
|-
 
|-
| 22 || SDMMC4A
+
| 0 || None
 
|-
 
|-
| 23 || ISP2B
+
| 1 || Runnable
|-
+
|}
| 24 || GPU
  −
|-
  −
| 25 || GPUB
  −
|-
  −
| 26 || PPCS2
  −
|-
  −
| 27 || NVDEC
  −
|-
  −
| 28 || APE
  −
|-
  −
| 29 || SE
  −
|-
  −
| 30 || NVJPG
  −
|-
  −
| 31 || HC1
  −
|-
  −
| 32 || SE1
  −
|-
  −
| 33 || AXIAP
  −
|-
  −
| 34 || ETR
  −
|-
  −
| 35 || TSECB
  −
|-
  −
| 36 || TSEC1
  −
|-
  −
| 37 || TSECB1
  −
|-
  −
| 38 || NVDEC1
  −
|}
     −
== CodeMemoryOperation ==
+
== ProcessActivity ==
 
{| class=wikitable
 
{| class=wikitable
 
! Value || Name
 
! Value || Name
 
|-
 
|-
| 0 || MapOwner
+
| 0 || None
|-
  −
| 1 || MapSlave
  −
|-
  −
| 2 || UnmapOwner
   
|-
 
|-
| 3 || UnmapSlave
+
| 1 || Runnable
|}
  −
 
  −
== LimitableResource ==
  −
{| class=wikitable
  −
! Value || Name || Note
  −
|-
  −
| 0 || Memory || Bytes of memory a process may allocate.
  −
|-
  −
| 1 || Threads || Amount of threads a process can create.
  −
|-
  −
| 2 || Events || Amount of events a process can create through [[#CreateEvent]] or [[#SendAsyncRequestWithUserBuffer]].
  −
|-
  −
| 3 || TransferMemories || Amount of TransferMemory a process can create through [[#CreateTransferMemory]].
  −
|-
  −
| 4 || Sessions || Amount of session a process can create through [[#CreateSession]], [[#ConnectToPort]] or [[#ConnectToNamedPort]].
   
|}
 
|}
   Line 2,706: Line 2,808:  
| 2 || Started ||
 
| 2 || Started ||
 
|-
 
|-
| 3 || Crashed || Processes will not enter this state unless they were created with [[#CreateProcessInfo|EnableDebug]].
+
| 3 || Crashed || Processes will not enter this state unless they were created with [[#CreateProcessParameter|EnableDebug]].
 
|-
 
|-
 
| 4 || StartedAttached ||
 
| 4 || StartedAttached ||
Line 2,743: Line 2,845:  
AffinityMask: output in out1
 
AffinityMask: output in out1
   −
== CreateProcessInfo ==
+
== CreateProcessParameter ==
 
{| class=wikitable
 
{| class=wikitable
 
! Offset || Length || Bits || Description
 
! Offset || Length || Bits || Description
Line 2,759: Line 2,861:  
| 0x24 || 4 || || Flags
 
| 0x24 || 4 || || Flags
 
|-
 
|-
| || || Bit0 || IsAarch64
+
| || || Bit0 || Is64BitInstruction
 
|-
 
|-
 
| || || Bit3-1 || [[#AddressSpaceType]]
 
| || || Bit3-1 || [[#AddressSpaceType]]
Line 2,771: Line 2,873:  
| || || Bit7 || [4.0.0] UseSecureMemory
 
| || || Bit7 || [4.0.0] UseSecureMemory
 
|-
 
|-
| || || Bit10-7 || [5.0.0+] PoolPartition (0=Application, 1=Applet, 2=Sysmodule, 3=Nvservices)
+
| || || Bit10-7 || [5.0.0+] MemoryRegion (0 = Application, 1 = Applet, 2 = SecureSystem, 3 = NonSecureSystem)
 
|-
 
|-
| || || Bit11 || [7.0.0+] OptimizeMemoryAllocation (Only allowed in combination with IsApplication).
+
| || || Bit11 || [7.0.0+] OptimizeMemoryAllocation (only allowed in combination with IsApplication)
 
|-
 
|-
| 0x28 || 4 || || ResourceLimitHandle or zero
+
| 0x28 || 4 || || ResourceLimitHandle (can be zero)
 
|-
 
|-
 
| 0x2C || 4 || || [3.0.0+] SystemResourceNumPages
 
| 0x2C || 4 || || [3.0.0+] SystemResourceNumPages
 
|}
 
|}
   −
On [1.0.0] there's only one pool.
+
On [1.0.0] there's only one MemoryRegion.
   −
On [2.0.0-4.0.0] PoolPartition is 1 for built-ins and 0 for rest.
+
On [2.0.0-4.0.0] MemoryRegion is 1 for built-ins and 0 for rest.
   −
On [5.0.0] PoolPartition is specified in CreateProcessArgs. There are now 4 pool partitions.
+
On [5.0.0] MemoryRegion is specified in CreateProcessArgs. There are now 4 pool partitions.
    
On [5.0.0] (maybe lower?) a zero ResourceLimitHandle defaults to sysmodule limits and 0x12300000 bytes of memory.
 
On [5.0.0] (maybe lower?) a zero ResourceLimitHandle defaults to sysmodule limits and 0x12300000 bytes of memory.
Line 2,797: Line 2,899:  
! Type || Name || Width || Description
 
! Type || Name || Width || Description
 
|-
 
|-
| 0 || Normal_32Bit || 32 ||
+
| 0 || AddressSpace32Bit || 32 ||
 
|-
 
|-
| 1 || Normal_36Bit || 36 ||
+
| 1 || AddressSpace64BitOld || 36 ||
 
|-
 
|-
| 2 || WithoutMap_32Bit || 32 || Appears to be missing map region [?]
+
| 2 || AddressSpace32BitNoReserved || 32 || Appears to be missing map region [?]
 
|-
 
|-
| 3 || [2.0.0+] Normal_39Bit || 39 ||
+
| 3 || [2.0.0+] AddressSpace64Bit || 39 ||
 
|}
 
|}
   Line 2,814: Line 2,916:  
| 8 || 8 || Size
 
| 8 || 8 || Size
 
|-
 
|-
| 0x10 || 4 || MemoryType: lower 8 bits of [[#MemoryState]]
+
| 0x10 || 4 || [[#MemoryType]]
 
|-
 
|-
 
| 0x14 || 4 || [[#MemoryAttribute]]
 
| 0x14 || 4 || [[#MemoryAttribute]]
 
|-
 
|-
| 0x18 || 4 || Permission (bit0: R, bit1: W, bit2: X)
+
| 0x18 || 4 || [[#MemoryPermission]]
 
|-
 
|-
 
| 0x1C || 4 || IpcRefCount
 
| 0x1C || 4 || IpcRefCount
Line 2,825: Line 2,927:  
|-
 
|-
 
| 0x24 || 4 || Padding: always zero
 
| 0x24 || 4 || Padding: always zero
 +
|}
 +
 +
== MemoryPermission ==
 +
{| class=wikitable
 +
! Bits || Name || Description
 +
|-
 +
| 0 || Read || Can be set by [[#SetMemoryPermission]].
 +
|-
 +
| 1 || Write || Can be set by [[#SetMemoryPermission]].
 +
|-
 +
| 2 || Execute || Can be set by [[#SetProcessMemoryPermission]] and [[#ControlCodeMemory]].
 
|}
 
|}
   Line 2,831: Line 2,944:  
! Bits || Name || Description
 
! Bits || Name || Description
 
|-
 
|-
| 0 || IsBorrowed || Used by MapMemory, as an async IPC user buffer,
+
| 0 || IsMapped || Used by MapMemory, as an async IPC user buffer.
 
|-
 
|-
| 1 || IsIpcLocked || True when IpcRefCount > 0
+
| 1 || IpcLocked || True when IpcRefCount > 0.
 
|-
 
|-
| 2 || IsDeviceShared || True when DeviceRefCount > 0
+
| 2 || DeviceShared || True when DeviceRefCount > 0.
 
|-
 
|-
 
| 3 || IsUncached ||  
 
| 3 || IsUncached ||  
Line 2,885: Line 2,998:  
! Value || Type || Meaning
 
! Value || Type || Meaning
 
|-
 
|-
| 0x00000000 || Unmapped ||
+
| 0x00000000 || Free ||
 
|-
 
|-
 
| 0x00002001 || Io || Mapped by kernel capability parsing in [[#CreateProcess]].  
 
| 0x00002001 || Io || Mapped by kernel capability parsing in [[#CreateProcess]].  
 
|-
 
|-
| 0x00042002 || Normal || Mapped by kernel capability parsing in [[#CreateProcess]].
+
| 0x00042002 || Static || Mapped by kernel capability parsing in [[#CreateProcess]].
 
|-
 
|-
| 0x00DC7E03 || CodeStatic || Mapped during [[#CreateProcess]].
+
| 0x00DC7E03 || Code || Mapped during [[#CreateProcess]].
 
|-
 
|-
 
| [1.0.0+]
 
| [1.0.0+]
Line 2,900: Line 3,013:     
0x03FEBD04
 
0x03FEBD04
|| CodeMutable || Transition from 0xDC7E03 performed by [[#SetProcessMemoryPermission]].
+
|| CodeData || Transition from 0xDC7E03 performed by [[#SetProcessMemoryPermission]].
 
|-
 
|-
 
| [1.0.0+]
 
| [1.0.0+]
Line 2,908: Line 3,021:     
0x037EBD05
 
0x037EBD05
|| Heap || Mapped using [[#SetHeapSize]].
+
|| Normal || Mapped using [[#SetHeapSize]].
 
|-
 
|-
| 0x00402006 || SharedMemory || Mapped using [[#MapSharedMemory]].
+
| 0x00402006 || Shared || Mapped using [[#MapSharedMemory]].
 
|-
 
|-
 
| 0x00482907 || [1.0.0] Alias || Mapped using [[#MapMemory]].
 
| 0x00482907 || [1.0.0] Alias || Mapped using [[#MapMemory]].
 
|-
 
|-
| 0x00DD7E08 || ModuleCodeStatic || Mapped using [[#MapProcessCodeMemory]].
+
| 0x00DD7E08 || AliasCode || Mapped using [[#MapProcessCodeMemory]].
 
|-
 
|-
 
| [1.0.0+]
 
| [1.0.0+]
Line 2,923: Line 3,036:     
0x03FFBD09
 
0x03FFBD09
|| ModuleCodeMutable || Transition from 0xDD7E08 performed by [[#SetProcessMemoryPermission]].
+
|| AliasCodeData || Transition from 0xDD7E08 performed by [[#SetProcessMemoryPermission]].
 
|-
 
|-
 
| 0x005C3C0A || [[IPC_Marshalling|Ipc]] || IPC buffers with descriptor flags=0.
 
| 0x005C3C0A || [[IPC_Marshalling|Ipc]] || IPC buffers with descriptor flags=0.
Line 2,931: Line 3,044:  
| 0x0040200C || [[Thread Local Storage|ThreadLocal]] || Mapped during [[#CreateThread]].
 
| 0x0040200C || [[Thread Local Storage|ThreadLocal]] || Mapped during [[#CreateThread]].
 
|-
 
|-
| 0x015C3C0D || TransferMemoryIsolated || Mapped using [[#MapTransferMemory]] when the owning process has perm=0.
+
| 0x015C3C0D || Transfered || Mapped using [[#MapTransferMemory]] when the owning process has perm=0.
 
|-
 
|-
| 0x005C380E || TransferMemory || Mapped using [[#MapTransferMemory]] when the owning process has perm!=0.
+
| 0x005C380E || ShTransfered || Mapped using [[#MapTransferMemory]] when the owning process has perm!=0.
 
|-
 
|-
| 0x0040380F || ProcessMemory || Mapped using [[#MapProcessMemory]].
+
| 0x0040380F || SharedCode || Mapped using [[#MapProcessMemory]].
 
|-
 
|-
 
| 0x00000010 || Reserved ||
 
| 0x00000010 || Reserved ||