Applet Manager services: Difference between revisions
No edit summary |
|||
(9 intermediate revisions by 2 users not shown) | |||
Line 2,229: | Line 2,229: | ||
|- | |- | ||
| 1000 || [7.0.0+] [[#GetDebugStorageChannel]] | | 1000 || [7.0.0+] [[#GetDebugStorageChannel]] | ||
|- | |||
| 2000 || [S2] [[#GetGraphicsInterface]] | |||
|- | |||
| 2100 || [S2] | |||
|} | |} | ||
Line 2,459: | Line 2,463: | ||
The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, otherwise an error is returned. | The cached value loaded from [[System_Settings|system-setting]] <code>am.debug!dev_function</code> must be set to 0x1 with size 0x1, otherwise an error is returned. | ||
=== GetGraphicsInterface === | |||
Unofficial name. This is exclusive to S2. | |||
No input. Returns an output TIPC handle to [[#(S2) GraphicsInterface|GraphicsInterface]]. | |||
== IStorageChannel == | == IStorageChannel == | ||
Line 3,093: | Line 3,102: | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || [[#OpenApplicationProxy]] | | 0 || [[#OpenApplicationProxy]] | ||
|} | |} | ||
This is used by all regular-applications, including [[flog]] and "Retail Interactive Display Menu". Only one session can be open for this service at a time. | This is used by all regular-applications, including [[flog]] and "Retail Interactive Display Menu". Only one session can be open for this service at a time. | ||
== OpenApplicationProxy == | == OpenApplicationProxy == | ||
Takes a reserved input u64 (official user-processes use hard-coded value 0), a PID, and a process copy-handle (cur-proc handle alias). Returns an [[#IApplicationProxy]]. | |||
Takes a | |||
On failure, official user-processes will retry using this command in a loop while the retval is 0x19280, with svcSleepThread(10000000) being called first. | On failure, official user-processes will retry using this command in a loop while the retval is 0x19280, with svcSleepThread(10000000) being called first. | ||
= idle:sys = | = idle:sys = | ||
Line 3,607: | Line 3,372: | ||
| 2 || [8.0.0+] SetCpuOverclockEnabled | | 2 || [8.0.0+] SetCpuOverclockEnabled | ||
|} | |} | ||
= (S2) adraw:a = | |||
This is "nn::appletdraw::sfif::IAppletRoot". This is exclusive to S2. | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 1 || [[#OpenResourceSession]] | |||
|- | |||
| 2 || [[#OpenAppletSession]] | |||
|} | |||
== OpenResourceSession == | |||
Unofficial name. | |||
Takes a PID and an u64. Returns a [[#IResourceSession]]. | |||
== OpenAppletSession == | |||
Unofficial name. This is exclusive to S2. | |||
Takes a PID and an u64. Returns a [[#IAppletSession]]. | |||
== IResourceSession == | |||
This is "nn::appletdraw::sfif::IResourceSession". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 1 || | |||
|- | |||
| 10 || | |||
|- | |||
| 11 || | |||
|} | |||
=== Cmd1 === | |||
Takes a u64. Returns a u64. | |||
=== Cmd10 === | |||
Takes a handle, a u64 and an int. Returns a handle. | |||
=== Cmd11 === | |||
No input/output. | |||
== IAppletSession == | |||
This is "nn::appletdraw::sfif::IAppletSession". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 1 || | |||
|- | |||
| 2 || | |||
|- | |||
| 3 || | |||
|- | |||
| 10 || | |||
|- | |||
| 11 || | |||
|- | |||
| 12 || | |||
|- | |||
| 13 || | |||
|- | |||
| 15 || | |||
|- | |||
| 16 || | |||
|- | |||
| 17 || | |||
|- | |||
| 18 || | |||
|- | |||
| 19 || | |||
|- | |||
| 21 || | |||
|- | |||
| 22 || | |||
|- | |||
| 23 || | |||
|- | |||
| 24 || | |||
|- | |||
| 31 || | |||
|- | |||
| 8001 || | |||
|- | |||
| 8004 || | |||
|} | |||
=== Cmd1 === | |||
Takes a u64. Returns a u64. | |||
=== Cmd2 === | |||
Returns a handle. | |||
=== Cmd3 === | |||
Takes a handle. | |||
=== Cmd10 === | |||
Takes an int. | |||
=== Cmd11 === | |||
Takes an int. | |||
=== Cmd12 === | |||
Takes a u64. Returns an int. | |||
=== Cmd13 === | |||
Takes an int. Returns an int. | |||
=== Cmd15 === | |||
Takes an int. Returns an int, an int, an int. | |||
=== Cmd16 === | |||
Returns an int. | |||
=== Cmd17 === | |||
Takes an int. Returns an int, a u16. | |||
=== Cmd18 === | |||
Takes an int. Returns 3x int, a u16. | |||
=== Cmd19 === | |||
Takes an int. Returns an int, a u16. | |||
=== Cmd21 === | |||
Takes an int. Returns a struct of size 0x40. | |||
=== Cmd22 === | |||
Takes a struct of size 0x20. Returns a struct of size 0x40. | |||
=== Cmd23 === | |||
Returns a struct of size 0xC8. | |||
=== Cmd24 === | |||
Sends an ipc-buf with size 0xD8. | |||
=== Cmd31 === | |||
Returns a struct with 0x28, a struct with size 0x10. | |||
=== Cmd8001 === | |||
Returns a struct with 0x28, a struct with size 0x10. | |||
=== Cmd8004 === | |||
Takes an int. Returns a u64. | |||
= (S2) appletOE = | |||
This is "nn::am::service::IApplicationProxyServiceForNxCompat". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || [[#OpenApplicationProxy]] | |||
|- | |||
| 2000 || [[#OpenCompatApplicationFunctions]] | |||
|} | |||
== OpenCompatApplicationFunctions == | |||
No input. Returns an [[#INxCompatApplicationFunctions]]. | |||
== INxCompatApplicationFunctions == | |||
This is "nn::am::service::INxCompatApplicationFunctions". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 2000 || [[#GetGraphicsInterfaceForNxCompat]] | |||
|- | |||
| 2001 || | |||
|- | |||
| 2002 || | |||
|- | |||
| 2003 || [[#SetCopyright]] | |||
|- | |||
| 2004 || | |||
|- | |||
| 2010 || | |||
|- | |||
| 2020 || [[#Initialize]] | |||
|- | |||
| 2030 || [[#GetVsyncEvent]] | |||
|- | |||
| 2040 || [[#GetVsyncTimestamp]] | |||
|- | |||
| 2050 || | |||
|- | |||
| 2060 || | |||
|- | |||
| 2070 || [[#CreateMovieMaker]] | |||
|} | |||
=== GetGraphicsInterfaceForNxCompat === | |||
Unofficial name. | |||
No input. Returns an output TIPC handle to [[#(S2) GraphicsInterface|GraphicsInterface]]. | |||
Same as [[#GetGraphicsInterface]] but for compat mode. | |||
=== SetCopyright === | |||
Unofficial name. | |||
Takes an input bool. No output. | |||
Called directly after "nn::vi::WriteToCopyrightFramebuffer". | |||
=== Initialize === | |||
Unofficial name. | |||
No input/output. | |||
Called during init. | |||
=== GetVsyncEvent === | |||
Unofficial name. | |||
No input. Returns an Event handle. | |||
=== GetVsyncTimestamp === | |||
Unofficial name. | |||
No input. Returns an output u64. | |||
When event from [[#GetVsyncEvent]] triggers, this returns a timestamp. | |||
= (S2) GraphicsInterface = | |||
Unofficial name. This is a TIPC interface so the command numbers are subtracted by 16. | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 1 || [[#InitializeGraphicsWithTransferMemory]] | |||
|- | |||
| 4 || [[#InitializeGraphics]] | |||
|- | |||
| 11 || [[#SetCurrentProcessHandle]] | |||
|- | |||
| 12 || | |||
|- | |||
| 101 || [[#StartGraphics]] | |||
|- | |||
| 111 || | |||
|- | |||
| 112 || | |||
|- | |||
| 114 || | |||
|- | |||
| 115 || | |||
|- | |||
| 187 || | |||
|- | |||
| 201 || | |||
|- | |||
| 301 || | |||
|- | |||
| 303 || | |||
|- | |||
| 311 || | |||
|- | |||
| 312 || | |||
|- | |||
| 314 || | |||
|- | |||
| 315 || | |||
|- | |||
| 321 || | |||
|- | |||
| 327 || | |||
|- | |||
| 391 || | |||
|- | |||
| 401 || [[#PrepareGpuManagerSession]] | |||
|- | |||
| 402 || [[#StartGpuManagerSession]] | |||
|- | |||
| 423 || | |||
|- | |||
| 434 || | |||
|- | |||
| 494 || | |||
|- | |||
| 496 || [[#CreateGpuManagerSessionWithTransferMemory]] | |||
|- | |||
| 497 || [[#CreateGpuManagerSession]] | |||
|- | |||
| 901 || | |||
|- | |||
| 902 || | |||
|- | |||
| 903 || | |||
|- | |||
| 905 || | |||
|- | |||
| 911 || | |||
|- | |||
| 912 || | |||
|- | |||
| 922 || | |||
|- | |||
| 961 || | |||
|- | |||
| 991 || | |||
|- | |||
| 1001 || | |||
|- | |||
| 1002 || | |||
|- | |||
| 1003 || | |||
|- | |||
| 1101 || | |||
|- | |||
| 1102 || | |||
|- | |||
| 1401 || [[#CreateNvDrv2UserSessionWithTransferMemory]] | |||
|- | |||
| 1402 || [[#CreateNvDrv2UserSession]] | |||
|- | |||
| 1411 || [[#GetNvDrv2UserTransferMemoryUsage]] | |||
|- | |||
| 1501 || | |||
|- | |||
| 1502 || | |||
|- | |||
| 1601 || | |||
|- | |||
| 1602 || | |||
|- | |||
| 1603 || | |||
|- | |||
| 1611 || | |||
|- | |||
| 1612 || | |||
|- | |||
| 1691 || | |||
|} | |||
== InitializeGraphicsWithTransferMemory == | |||
Unofficial name. | |||
Takes a TransferMemory handle, an input [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]] and an input u64 '''TransferMemorySize'''. No output. | |||
== InitializeGraphics == | |||
Unofficial name. | |||
Takes a Process handle, an input [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]] and five input u64s. No output. | |||
The first u64 appears to be a version ([19.0.0] 0x8000000000000001, [20.1.1] 0x8000000000000005), the last u64 is the output from new [[SVC#InfoType|InfoType]] 31 or 32 and the remaining u64s are all 0. | |||
== SetCurrentProcessHandle == | |||
Unofficial name. | |||
Takes a Process handle. No output. | |||
Called directly after [[#InitializeGraphicsWithTransferMemory]] or [[#InitializeGraphics]]. | |||
== StartGraphics == | |||
Unofficial name. | |||
No input/output. | |||
Called directly after [[#SetCurrentProcessHandle]]. | |||
== PrepareGpuManagerSession == | |||
Unofficial name. | |||
No input/output. | |||
Called directly after [[#CreateGpuManagerSessionWithTransferMemory]] or [[#CreateGpuManagerSession]]. | |||
== StartGpuManagerSession == | |||
Unofficial name. | |||
No input/output. | |||
Called directly after [[#PrepareGpuManagerSession]]. | |||
== CreateGpuManagerSessionWithTransferMemory == | |||
Unofficial name. | |||
Takes a TransferMemory handle and two input u64s '''Version''' and '''TransferMemorySize'''. Returns a [[#GpuManagerSession]]. | |||
[19.0.0] '''Version''' must be 2. | |||
== CreateGpuManagerSession == | |||
Unofficial name. | |||
Takes an input u64 '''Version'''. Returns a [[#GpuManagerSession]]. | |||
[19.0.0] '''Version''' must be 2. | |||
== CreateNvDrv2UserSessionWithTransferMemory == | |||
Unofficial name. | |||
Takes a TransferMemory handle, an input u64 '''TransferMemorySize''' and an input u8. Returns an [[NV_services#(S2)_INvDrv2User|INvDrv2User]]. | |||
== CreateNvDrv2UserSession == | |||
Unofficial name. | |||
No input. Returns an [[NV_services#(S2)_INvDrv2User|INvDrv2User]]. | |||
== GetNvDrv2UserTransferMemoryUsage == | |||
Unofficial name. | |||
No input. Returns three u64s '''TotalTransferMemorySize''', '''UsedTransferMemorySize''' and '''MaxTransferMemorySize'''. | |||
== GpuManagerSession == | |||
Unofficial name. This is a TIPC interface so the command numbers are subtracted by 16. | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 11 || [[#GetEventIdRange]] | |||
|- | |||
| 12 || [[#CreateEvent]] | |||
|- | |||
| 21 || [[#RequestGpuSession]] | |||
|- | |||
| 22 || [[#GetGpuSession]] | |||
|- | |||
| 33 || | |||
|- | |||
| 41 || | |||
|- | |||
| 42 || | |||
|- | |||
| 102 || | |||
|- | |||
| 200 || | |||
|- | |||
| 201 || | |||
|- | |||
| 202 || | |||
|} | |||
=== GetEventIdRange === | |||
Unofficial name. | |||
No input. Returns two u32s '''EventIdMin''' and '''EventIdMax'''. | |||
=== CreateEvent === | |||
Unofficial name. | |||
Takes an input u32 '''EventId'''. Returns an output Event handle. | |||
=== RequestGpuSession === | |||
Unofficial name. | |||
Takes an input u32 '''EventId'''. No output. | |||
'''EventId''' must have been previously passed to [[#CreateEvent]] and the returned Event handle will be signalled when the session is ready. | |||
=== GetGpuSession === | |||
Unofficial name. | |||
No input. Returns a [[#GpuSession]]. | |||
Called after [[#RequestGpuSession]] and the Event handle has been signalled. | |||
=== GpuSession === | |||
Unofficial name. This is a TIPC interface so the command numbers are subtracted by 16. | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 101 || [[#CreateGpuMemory]] | |||
|- | |||
| 102 || [[#DestroyGpuMemory]] | |||
|- | |||
| 201 || [19.0.0-19.1.0] MapMemory | |||
|- | |||
| 202 || [19.0.0-19.1.0] UnmapMemory | |||
|- | |||
| 203 || [19.0.0-19.1.0] AllocateAddressSpace | |||
|- | |||
| 204 || [19.0.0-19.1.0] FreeAddressSpace | |||
|- | |||
| 205 || [19.0.0-19.1.0] RemapMemory | |||
|- | |||
| 207 || [19.0.0-19.1.0] ModifyMemoryMapping | |||
|- | |||
| 211 || [20.1.1+] MapMemoryV2 | |||
|- | |||
| 212 || [20.1.1+] ModifyMemoryMappingV2 | |||
|- | |||
| 213 || [20.1.1+] UnmapMemoryV2 | |||
|- | |||
| 214 || [20.1.1+] AllocateAddressSpaceV2 | |||
|- | |||
| 215 || [20.1.1+] FreeAddressSpaceV2 | |||
|- | |||
| 216 || [20.1.1+] RemapMemoryV2 | |||
|} | |||
==== CreateGpuMemory ==== | |||
Unofficial name. | |||
Takes two input u64s '''MemoryAddressStart''' and '''MemoryAddressEnd''' and two u8s. Returns an output u32 '''GpuMemoryHandle'''. | |||
The memory region between '''MemoryAddressStart''' and '''MemoryAddressEnd''' must have been passed to [[#SVC|SVC]] 0x80 with attribute 0x20. | |||
==== DestroyGpuMemory ==== | |||
Unofficial name. | |||
Takes two input u32s '''GpuMemoryHandle''' and '''EventId'''. No output. | |||
The Event handle associated with '''EventId''' will be signalled when the memory is released. | |||
= Library Applets = | = Library Applets = |