Switch 2: GSV services: Difference between revisions

From Nintendo Switch Brew
Jump to navigation Jump to search
No edit summary
Line 10: Line 10:
| 1 || Gsv || [[#BootWithTransferMemory|BootWithTransferMemory]]  
| 1 || Gsv || [[#BootWithTransferMemory|BootWithTransferMemory]]  
|-
|-
| 4 || Gsv || [[#BootWithRemoteMemory|BootWithRemoteMemory]]]  
| 4 || Gsv || [[#BootWithRemoteMemory|BootWithRemoteMemory]]  
|-
|-
| 11 || || [[#SetCurrentProcessHandle|SetCurrentProcessHandle]]
| 11 || || [[#SetCurrentProcessHandle|SetCurrentProcessHandle]]

Revision as of 03:01, 13 April 2026

UserSession

This is a TIPC interface so the command numbers are subtracted by 16.

This multiplexes several interfaces into a single session that can be acquired through am.

Cmd Interface Name
1 Gsv BootWithTransferMemory
4 Gsv BootWithRemoteMemory
11 SetCurrentProcessHandle
12
101 CreateContext
111 NativeMemory CreateNativeMemory
112 NativeMemory DestroyNativeMemory
113 NativeMemory CreateNativeMemoryBlockByTransferMemory
114 NativeMemory CreateNativeMemoryBlock
115 NativeMemory BootNativeMemoryManagement
187 NativeMemory QueryNativeMemoryNvsNvRmMemIdForDebug
201 Syncpt CreateSyncptContext
202 Syncpt InitializeSyncptContext
211 Syncpt CreateDebugSyncDevice
213 Syncpt CreateDebugSyncCounter
214 Syncpt DestroyDebugSyncCounter
215 Syncpt ReportDebugSyncCounterValue
301 Display CreateDisplayContext
303 Display DestroyDisplayContext
305 Display InitializeDisplayContext
311 Display
312 Display
314 Display
315 Display
321 Display
327 Display
391 Display CalculateRequiredBufferMemory
401 Gpu CreateGpuContext
402 Gpu InitializeGpuContext
423 Gpu
426 Gpu MapNativeImage
427 Gpu UnmapNativeImage
428 Gpu QueryNativeImage
429 Gpu CreateNativeImage
430 Gpu DestroyNativeImage
434 Gpu ExistsAddressSpace
435 Gpu CalculateNativeImageSize
437 Gpu CreateNativeMemoryWithGpukMemHandle
493 Gpu CreateUserlandDebuggerSession
494 Gpu
496 Gpu CreateGpuManagerSessionWithTransferMemory
497 Gpu CreateGpuManagerSessionWithRemoteMemory
498 Gpu TryQueryDonatedTransferMemoryUsage
601 Camera CreateCameraContext
602 Camera InitializeCameraContext
603 Camera DestroyCameraContext
612 Camera DestroyOutputBufferPool
613 Camera CreateAliasOutputBufferPool
614 Camera DestroyAliasOutputBufferPool
615 Camera CreateOutputBufferPool
616 Camera ReadFrameDataAsync
620 Camera InitializeB
621 Camera FinalizeB
622 Camera ListCameras
623 Camera OpenCamera
624 Camera CloseCamera
626 Camera ListSensorMode
627 Camera SetSensorMode
628 Camera GetAvailableStreams
629 Camera GetRequiredWorkBufferSize
630 Camera CreateStream
632 Camera GetReadDoneEvent
633 Camera GetStreamOutputSize
634 Camera DestroyStream
636 Camera ReadFrameDataAsync
637 Camera GetAttachedEvent
638 Camera GetDetachedEvent
639 Camera GetFrameInfo
640 Camera GetFrameInfo2
641 Camera GetConnectionChangedEvent
650 Camera SetPictureQualityConfig
651 Camera GetPictureQualityConfig
652 Camera SetDigitalWindow
653 Camera GetDigitalWindow
654 Camera GetDigitalWindowCapability
655 Camera GetSupportedFunctions
656 Camera GetSupportedDebugFunctions
657 Camera GetCameraPrivacyCoverStatus
658 Camera GetCameraDeviceTemperature
659 Camera GetDeviceUniqueId
660 Camera GetSensorMode
661 Camera GetStride
662 Camera UnlinkSensor
663 Camera GetDeviceModel
664 Camera SetRawSensorMode
665 Camera GetAccessAllowed
666 Camera GetHostDrivenAeRegion
667 Camera SetHostDrivenAeRegion
691 Camera CalculateImageArraySize
901 VideoDecoder CreateVideoDecoderContext
902 VideoDecoder InitializeVideoDecoderContext
903 VideoDecoder DestroyVideoDecoderContext
904 VideoDecoder InitializeVideoDecoderContextForSystem
905 VideoDecoder
911 VideoDecoder InitializeDecoderImagePool
912 VideoDecoder FinalizeDecoderImagePool
921 VideoDecoderForSystem InitializeDecoderAliasImagePool
922 VideoDecoderForSystem FinalizeDecoderAliasImagePool
961 VideoDecoderForSystem ReadDecoderOutput
991 VideoDecoderForSystem CalculateDecoderImagePoolBuffer
1001 VideoEncoder CreateVideoEncoderContext
1002 VideoEncoder InitializeVideoEncoderContext
1003 VideoEncoder DestroyVideoEncoderContext
1004 VideoEncoder InitializeVideoEncoderContextForSystem
1011 VideoEncoder InitializeEncoderImagePool
1012 VideoEncoder FinalizeEncoderImagePool
1021 VideoEncoderForSystem InitializeEncoderAliasImagePool
1022 VideoEncoderForSystem FinalizeEncoderAliasImagePool
1061 VideoEncoderForSystem WriteEncoderInput
1091 VideoEncoderForSystem CalculateEncoderImagePoolBuffer
1101 GraphicsFrame CreateGraphicsFrameContext
1102 GraphicsFrame InitializeGraphicsFrameContext
1111 GraphicsFrame SetGraphicsFrameLengthMode
1112 GraphicsFrame SetGraphicsFrameRestartMode
1113 GraphicsFrame SetGraphicsFrameGpuTimesliceMode
1201 Chat CreateChatContext
1202 Chat InitializeChatContext
1203 Chat DestroyChatContext
1211 Chat CreateImagePool
1212 Chat DestroyImagePool
1291 Chat CalculateRequiredBufferMemory
1301 Adraw CreateAdrawContext
1302 Adraw InitializeAdrawContext
1325 Adraw GetAdrawFrameBufferHandle
1326 Adraw GetAdrawImageHandle
1401 NvDrv CreateNvDrv2UserSessionWithTransferMemory
1402 NvDrv CreateNvDrv2UserSessionWithRemoteMemory
1411 NvDrv GetNvDrv2UserTransferMemoryUsage
1501 InterModuleImage CreateInterModuleImageContext
1502 InterModuleImage InitializeInterModuleImageContext
1601
1602
1603
1611
1612
1691

BootWithTransferMemory

Unofficial name.

Takes a TransferMemory handle, an input AppletResourceUserId and an input u64 TransferMemorySize. No output.

BootWithRemoteMemory

Unofficial name.

Takes a Process handle, an input 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 InfoType 31 or 32 and the remaining u64s are all 0.

SetCurrentProcessHandle

Unofficial name.

Takes a Process handle. No output.

Called directly after #BootWithTransferMemory or #BootWithRemoteMemory.

CreateContext

Unofficial name.

No input/output.

Called directly after #SetCurrentProcessHandle.

CreateGpuContext

Unofficial name.

No input/output.

Called directly after #CreateGpuManagerSessionWithTransferMemory or #CreateGpuManagerSessionWithRemoteMemory.

InitializeGpuContext

Unofficial name.

No input/output.

Called directly after #CreateGpuContext.

GetImageInfo

Unofficial name.

Takes an input u32 ImageHandle. Returns an ImageInfo.

CreateGpuManagerSessionWithTransferMemory

Unofficial name.

Takes a TransferMemory handle and two input u64s Version and TransferMemorySize. Returns a #GpuManagerSession.

[19.0.0] Version must be 2.

CreateGpuManagerSessionWithRemoteMemory

Unofficial name.

Takes an input u64 Version. Returns a #GpuManagerSession.

[19.0.0] Version must be 2.

CreateAdrawContext

Unofficial name.

No input/output.

InitializeAdrawContext

Unofficial name.

No input/output.

Called directly after #CreateAdrawContext.

GetAdrawFrameBufferHandle

Unofficial name.

Takes an input u64. Returns an output u32 FrameBufferHandle.

Official software sends the Id obtained with GetFrameBufferInfo from adraw.

GetAdrawImageHandle

Unofficial name.

Takes seven input u64s, two input u16s and two input u32s. Returns an output u32 ImageHandle.

Official software sends 0x100000000 in the first u64, 0 in all remaining u64s, Width and Height in the two u16s, BlockCount int the first u32 and the FrameBufferHandle from GetAdrawFrameBufferHandle in the last u32.

CreateNvDrv2UserSessionWithTransferMemory

Unofficial name.

Takes a TransferMemory handle, an input u64 TransferMemorySize and an input u8. Returns an INvDrv2User.

CreateNvDrv2UserSessionWithRemoteMemory

Unofficial name.

No input. Returns an INvDrv2User.

Only one session can be open at a time, otherwise returns error 0x200f3.

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.

Cmd Name
11 GetEventIdRange
12 CreateEvent
21 RequestKUserWorkerSession
22 GetKUserWorkerSession
33 CreateGpuAddressSpace
41 CreateGraphicsDevice
42 DestroyGraphicsDevice
102
200 SynchronizeGpuAddressSpace
201 GetUserPartitionGpuAddress
202 GetGsvPartitionGpuAddress

GetEventIdRange

Unofficial name.

No input. Returns two u32s EventIdMin and EventIdMax.

CreateEvent

Unofficial name.

Takes an input u32 EventId. Returns an output Event handle.

RequestKUserWorkerSession

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.

GetKUserWorkerSession

Unofficial name.

No input. Returns a #GetKUserWorkerSession.

Called after #RequestKUserWorkerSession and the Event handle has been signalled.

KUserWorkerSession

This is "nn::gpuk::impl::kuser::KUserWorkerSession".

This is a TIPC interface so the command numbers are subtracted by 16.

Cmd Name
101 CreateGpuMemory
102 DestroyGpuMemory
171 EnsureGpuMemoryComptags
172 SetGpuMemoryUserDebugLabel
173 SetGpuMemorySdkDebugLabel
201 [19.0.0-19.1.0] NormalMapGpuMemory4K
202 [19.0.0-19.1.0] NormalUnmapGpuMemory4K
203 [19.0.0-19.1.0] CreateSparseRegion
204 [19.0.0-19.1.0] DestroySparseRegion
205 [19.0.0-19.1.0] ExecuteSparseMapRequests
207 [19.0.0-19.1.0] NormalModifyMemoryKind4K
209 [20.0.0+] SetGpuSegmentUserDebugLabel
210 [20.0.0+] SetGpuSegmentSdkDebugLabel
211 [20.0.0+] NormalMapGpuMemory4K
212 [20.0.0+] NormalModifyMemoryKind4K
213 [20.0.0+] NormalUnmapGpuMemory4K
214 [20.0.0+] CreateSparseRegion
215 [20.0.0+] DestroySparseRegion
216 [20.0.0+] ExecuteSparseMapRequests

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 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.