Changes

Jump to navigation Jump to search
5,241 bytes added ,  20:08, 16 May 2019
Line 30: Line 30:  
| 6 || [[#GetStatus]]
 
| 6 || [[#GetStatus]]
 
|-
 
|-
| 7 || [[#ForceSetClientPID]]
+
| 7 || [[#SetAruid]]
 
|-
 
|-
| 8 || [[#SetClientPID]]
+
| 8 || [[#SetAruidByPID]]
 
|-
 
|-
 
| 9 || [[#DumpGraphicsMemoryInfo]]
 
| 9 || [[#DumpGraphicsMemoryInfo]]
 
|-
 
|-
| 10 || [3.0.0+]
+
| 10 || [3.0.0+] [[#InitializeDevtools]]
 
|-
 
|-
 
| 11 || [3.0.0+] [[#Ioctl2]]
 
| 11 || [3.0.0+] [[#Ioctl2]]
Line 42: Line 42:  
| 12 || [3.0.0+] [[#Ioctl3]]
 
| 12 || [3.0.0+] [[#Ioctl3]]
 
|-
 
|-
| 13 || [3.0.0+]
+
| 13 || [3.0.0+] [[#FinishInitialize]]
 
|}
 
|}
   Line 63: Line 63:  
== QueryEvent ==
 
== QueryEvent ==
 
Takes two input u32s ('''fd''' and '''event_id'''), with the second word immediately after the first one. Returns an output u32 ('''error_code''') and a copy-handle ('''event_handle''').
 
Takes two input u32s ('''fd''' and '''event_id'''), with the second word immediately after the first one. Returns an output u32 ('''error_code''') and a copy-handle ('''event_handle''').
 +
 +
QueryEvent is only supported on (and implemented differently on):
 +
* /dev/nvhost-gpu
 +
** 1: SmException_BptIntReport
 +
** 2: SmException_BptPauseReport
 +
** 3: ErrorNotifierEvent
 +
* /dev/nvhost-ctrl: Used to get events for SyncPts.
 +
** If bit31-28 is 1, then lower 16-bits contain event_slot, bit27-16 contain syncpt_number.
 +
** If bit31-28 is 0, then lower 4-bits contain event_slot, bit31-4 contains syncpt_number.
 +
* /dev/nvhost-ctrl-gpu
 +
** 1: Returns error_event_handle.
 +
** 2: Returns unknown event.
 +
* /dev/nvhost-dbg-gpu
 +
** Ignores event_id.
    
== MapSharedMem ==
 
== MapSharedMem ==
Line 70: Line 84:  
Takes no input. Returns 0x10-bytes and an output u32 ('''error_code''').
 
Takes no input. Returns 0x10-bytes and an output u32 ('''error_code''').
   −
== ForceSetClientPID ==
+
== SetAruid ==
 
Takes an input u64 which must [[IPC_Marshalling|match]] the user-process PID ([[AM_services|AppletResourceUserId]]). Returns an output u32 ('''error_code''').
 
Takes an input u64 which must [[IPC_Marshalling|match]] the user-process PID ([[AM_services|AppletResourceUserId]]). Returns an output u32 ('''error_code''').
   −
== SetClientPID ==
+
== SetAruidByPID ==
 
Takes a PID-descriptor and an u64 which must [[IPC_Marshalling|match]] the user-process PID ([[AM_services|AppletResourceUserId]]). Returns an output u32 ('''error_code''').
 
Takes a PID-descriptor and an u64 which must [[IPC_Marshalling|match]] the user-process PID ([[AM_services|AppletResourceUserId]]). Returns an output u32 ('''error_code''').
   Line 79: Line 93:  
No input or output. Does nothing.
 
No input or output. Does nothing.
   −
== Cmd10 ==
+
== InitializeDevtools ==
 
Takes a copy-handle and an input u32. Returns an output u32 ('''error_code''').
 
Takes a copy-handle and an input u32. Returns an output u32 ('''error_code''').
   Line 86: Line 100:     
== Ioctl3 ==
 
== Ioctl3 ==
Same input/output as Ioctl2, except cmdhdr_word1 is 0x100B instead of 0xC0B.
+
Takes a type-0x21 buffer, a type-0x22 buffer, another type-0x22 buffer, and two input u32s. Returns an output u32 (error_code).
 +
Cmdhdr_word1 is 0x100B instead of 0xC0B.
   −
== Cmd13 ==
+
== FinishInitialize ==
 
Takes an input u64. No output.
 
Takes an input u64. No output.
 +
 +
This sets a boolean value based on the input u64 and the value of the "nv!nv_graphics_firmware_memory_margin" system configuration, but only for "nvdrv" (the other services default to false).
    
Official user-processes starting with 3.0.0 now use this at the end of nvdrv service init with value 0x1.
 
Official user-processes starting with 3.0.0 now use this at the end of nvdrv service init with value 0x1.
Line 294: Line 311:  
|-
 
|-
 
| 0x00000111 || - || 0 || || Returns NotSupported
 
| 0x00000111 || - || 0 || || Returns NotSupported
 +
|-
 +
| 0x40100112 || In || 16 || NVMAP_IOC_EXPORT_FOR_ARUID ||
 +
|-
 +
| 0x40100113 || In || 16 || NVMAP_IOC_IS_OWNED_BY_ARUID ||
 +
|-
 +
| 0x40100114 || In || 16 || NVMAP_IOC_REMOVE_EXPORT_FOR_ARUID ||
 
|}
 
|}
   Line 322: Line 345:  
     __in u8  kind;
 
     __in u8  kind;
 
     u8      pad[7];
 
     u8      pad[7];
     __in u64 addr;
+
     __inout u64 addr;
 
   };
 
   };
   Line 363: Line 386:  
| 0xC1100214 || Inout || 272 || TEGRA_DC_EXT_CONTROL_GET_OUTPUT_EDID ||
 
| 0xC1100214 || Inout || 272 || TEGRA_DC_EXT_CONTROL_GET_OUTPUT_EDID ||
 
|-
 
|-
| 0xC0040216 || Inout || 4 || TEGRA_DC_EXT_CONTROL_SET_EVENT0 ||
+
| 0xC0040216 || Inout || 4 || TEGRA_DC_EXT_CONTROL_GET_EXT_HPD_IN_EVENT ||
 
|-
 
|-
| 0xC0040217 || Inout || 4 || TEGRA_DC_EXT_CONTROL_SET_EVENT1 ||
+
| 0xC0040217 || Inout || 4 || TEGRA_DC_EXT_CONTROL_GET_EXT_HPD_OUT_EVENT ||
 
|-
 
|-
| 0xC0100218 || Inout || 16 || TEGRA_DC_EXT_CONTROL_SET_EVENT2 ||
+
| 0xC0100218 || Inout || 16 || TEGRA_DC_EXT_CONTROL_GET_VBLANK_HEAD0_EVENT ||
 
|-
 
|-
| 0xC0100219 || Inout || 16 || TEGRA_DC_EXT_CONTROL_SET_EVENT3 ||
+
| 0xC0100219 || Inout || 16 || TEGRA_DC_EXT_CONTROL_GET_VBLANK_HEAD1_EVENT ||
|-
  −
| 0xC0040220 || Inout || 4 || TEGRA_DC_EXT_CONTROL_SET_EVENT4 ||
   
|-
 
|-
 +
| 0xC0040220 || Inout || 4 || TEGRA_DC_EXT_CONTROL_GET_UNK_EVENT ||
 
|}
 
|}
   Line 421: Line 443:  
| 0x403C021C || In || 60 || TEGRA_DC_EXT_SET_MODE2 ||
 
| 0x403C021C || In || 60 || TEGRA_DC_EXT_SET_MODE2 ||
 
|-
 
|-
| 0xC03C021D || Inout || 60 || TEGRA_DC_EXT_VALIDATE_MODE2 ||
+
| 0xC03C021D || Inout || 60 || TEGRA_DC_EXT_VALIDATE_MODE2 ||
 
|-
 
|-
 
| 0xEF20021E || Inout || 12064 || TEGRA_DC_EXT_GET_MODE_DB2 ||
 
| 0xEF20021E || Inout || 12064 || TEGRA_DC_EXT_GET_MODE_DB2 ||
Line 467: Line 489:  
! Value || Direction || Size || Description || Notes
 
! Value || Direction || Size || Description || Notes
 
|-
 
|-
| 0x40010501 || In || 1 || NVDCUTIL_CRC_ENABLE_DISABLE ||
+
| 0x40010501 || In || 1 || NVDCUTIL_SW_HOTPLUG_IN_OUT ||
 
|-
 
|-
| 0x40010502 || In || 1 || NVDCUTIL_VIRTUAL_EDID_ENABLE_DISABLE ||
+
| 0x40010502 || In || 1 || NVDCUTIL_VIRTUAL_EDID_ON_OFF ||
 
|-
 
|-
 
| 0x42040503 || In || 1056 || NVDCUTIL_VIRTUAL_EDID_SET_DATA ||
 
| 0x42040503 || In || 1056 || NVDCUTIL_VIRTUAL_EDID_SET_DATA ||
 
|-
 
|-
 
| 0x803C0504 || Out || 60 || NVDCUTIL_GET_MODE ||
 
| 0x803C0504 || Out || 60 || NVDCUTIL_GET_MODE ||
 +
|-
 +
| 0x40010505 || In || 1 || NVDCUTIL_TELEMETRY_TEST_ON_OFF ||
 
|-
 
|-
 
|}
 
|}
    
== /dev/nvsched-ctrl ==
 
== /dev/nvsched-ctrl ==
 +
This is a customized scheduler device.
 +
 +
The way this device is exposed and configured is exclusive to the Switch, since other sources don't have an actual interface for the scheduler.
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
! Value || Direction || Size || Description || Notes
 
! Value || Direction || Size || Description || Notes
 
|-
 
|-
| 0x00000601 || - || 0 ||NVSCHED_CTRL_ENABLE||
+
| 0x00000601 || - || 0 || [[#NVSCHED_CTRL_ENABLE]] ||
 
|-
 
|-
| 0x00000602 || - || 0 ||NVSCHED_CTRL_DISABLE||
+
| 0x00000602 || - || 0 || [[#NVSCHED_CTRL_DISABLE]] ||
 
|-
 
|-
| 0x40180603 || In || 1056 ||NVSCHED_CTRL_ADD_APPLICATION||
+
| 0x40180603 || In || 24 || [[#NVSCHED_CTRL_ADD_APPLICATION]] ||
 
|-
 
|-
| 0x40180604 || In || 60 ||NVSCHED_CTRL_UPDATE_APPLICATION||
+
| 0x40180604 || In || 24 || [[#NVSCHED_CTRL_UPDATE_APPLICATION]] ||
 
|-
 
|-
| 0x40080605 || In || 60 ||NVSCHED_CTRL_REMOVE_APPLICATION||
+
| 0x40080605 || In || 8 || [[#NVSCHED_CTRL_REMOVE_APPLICATION]] ||
 
|-
 
|-
| 0x80080606 || Out || 60 ||NVSCHED_CTRL_GET_ID||
+
| 0x80080606 || Out || 8 || [[#NVSCHED_CTRL_GET_ID]] ||
 
|-
 
|-
| 0x80080607 || Out || 60 ||NVSCHED_CTRL_ADD_RUNLIST||
+
| 0x80080607 || Out || 8 || [[#NVSCHED_CTRL_ADD_RUNLIST]] ||
 
|-
 
|-
| 0x40180608 || In || 24 ||NVSCHED_CTRL_UPDATE_RUNLIST||
+
| 0x40180608 || In || 24 || [[#NVSCHED_CTRL_UPDATE_RUNLIST]] ||
 
|-
 
|-
| 0x40100609 || In || 16 ||NVSCHED_CTRL_LINK_RUNLIST||
+
| 0x40100609 || In || 16 || [[#NVSCHED_CTRL_LINK_RUNLIST]] ||
 
|-
 
|-
| 0x4010060A || In || 16 ||NVSCHED_CTRL_UNLINK_RUNLIST||
+
| 0x4010060A || In || 16 || [[#NVSCHED_CTRL_UNLINK_RUNLIST]] ||
 
|-
 
|-
| 0x4008060B || In || 8 ||NVSCHED_CTRL_REMOVE_RUNLIST||
+
| 0x4008060B || In || 8 || [[#NVSCHED_CTRL_REMOVE_RUNLIST]] ||
 
|-
 
|-
| 0x8001060C || Out || 1 ||NVSCHED_CTRL_HAS_OVERRUN_EVENT||
+
| 0x8001060C || Out || 1 || [[#NVSCHED_CTRL_HAS_OVERRUN_EVENT]] ||
 
|-
 
|-
| 0x8010060D || Out || 16 || ||
+
| 0x8010060D || Out || 16 || [[#NVSCHED_CTRL_GET_NEXT_OVERRUN_EVENT]] ||
 
|-
 
|-
| 0x400C060E || In || 12 ||NVSCHED_CTRL_PUT_CONDUCTOR_FLIP_FENCE||
+
| 0x400C060E || In || 12 || [[#NVSCHED_CTRL_PUT_CONDUCTOR_FLIP_FENCE]] ||
 
|-
 
|-
| 0x4008060F || In || 8 ||NVSCHED_CTRL_DETACH_APPLICATION||
+
| 0x4008060F || In || 8 || [[#NVSCHED_CTRL_DETACH_APPLICATION]] ||
 
|-
 
|-
 
| 0x40100610 || In || 16 || ||
 
| 0x40100610 || In || 16 || ||
Line 516: Line 544:  
|-
 
|-
 
|}
 
|}
 +
 +
=== NVSCHED_CTRL_ENABLE ===
 +
Enables the scheduler.
 +
 +
=== NVSCHED_CTRL_DISABLE ===
 +
Disables the scheduler.
 +
 +
=== NVSCHED_CTRL_ADD_APPLICATION ===
 +
Adds a new application to the scheduler.
 +
 +
  struct {
 +
    __in u64 application_id;
 +
    __in u64 priority;
 +
    __in u64 timeslice;
 +
  };
 +
 +
=== NVSCHED_CTRL_UPDATE_APPLICATION ===
 +
Updates the application parameters in the scheduler.
 +
 +
  struct {
 +
    __in u64 application_id;
 +
    __in u64 priority;
 +
    __in u64 timeslice;
 +
  };
 +
 +
=== NVSCHED_CTRL_REMOVE_APPLICATION ===
 +
Removes the application from the scheduler.
 +
 +
  struct {
 +
    __in u64 application_id;
 +
  };
 +
 +
=== NVSCHED_CTRL_GET_ID ===
 +
Returns the ID of the last scheduled object.
 +
 +
  struct {
 +
    __out u64 id;
 +
  };
 +
 +
=== NVSCHED_CTRL_ADD_RUNLIST ===
 +
Creates a new runlist and returns it's ID.
 +
 +
  struct {
 +
    __out u64 runlist_id;
 +
  };
 +
 +
=== NVSCHED_CTRL_UPDATE_RUNLIST ===
 +
Updates the runlist parameters in the scheduler.
 +
 +
  struct {
 +
    __in u64 runlist_id;
 +
    __in u64 priority;
 +
    __in u64 timeslice;
 +
  };
 +
 +
=== NVSCHED_CTRL_LINK_RUNLIST ===
 +
Links a runlist to a given application in the scheduler.
 +
 +
  struct {
 +
    __in u64 runlist_id;
 +
    __in u64 application_id;
 +
  };
 +
 +
=== NVSCHED_CTRL_UNLINK_RUNLIST ===
 +
Unlinks a runlist from a given application in the scheduler.
 +
 +
  struct {
 +
    __in u64 runlist_id;
 +
    __in u64 application_id;
 +
  };
 +
 +
=== NVSCHED_CTRL_REMOVE_RUNLIST ===
 +
Removes the runlist from the scheduler.
 +
 +
  struct {
 +
    __in u64 runlist_id;
 +
  };
 +
 +
=== NVSCHED_CTRL_HAS_OVERRUN_EVENT ===
 +
Returns a boolean to tell if the scheduler has an overrun event or not.
 +
 +
  struct {
 +
    __out u8 has_overrun;
 +
  };
 +
 +
=== NVSCHED_CTRL_GET_NEXT_OVERRUN_EVENT ===
 +
Returns the overrun event's data from the scheduler.
 +
 +
  struct {
 +
    __out u64 runlist_id;
 +
    __out u64 debt;
 +
  };
 +
 +
=== NVSCHED_CTRL_PUT_CONDUCTOR_FLIP_FENCE ===
 +
Installs a fence swap event?
 +
 +
  struct {
 +
    __in u32 fence_id;
 +
    __in u32 fence_value;
 +
    __in u32 swap_interval;
 +
  };
 +
 +
=== NVSCHED_CTRL_DETACH_APPLICATION ===
 +
Places the given application in detached state.
 +
 +
  struct {
 +
    __in u64 application_id;
 +
  };
    
== /dev/nverpt-ctrl ==
 
== /dev/nverpt-ctrl ==
Line 523: Line 659:  
! Value || Direction || Size || Description || Notes
 
! Value || Direction || Size || Description || Notes
 
|-
 
|-
| 0xC1280701 || Inout || 296 || ||
+
| 0xC1280701 || Inout || 296 || NVERPT_TELEMETRY_SUBMIT_DATA ||
 
|-
 
|-
| 0xCF580702 || Inout || 3928 || ||
+
| 0xCF580702 || Inout || 3928 || NVERPT_TELEMETRY_SUBMIT_DATA_EX ||
 
|-
 
|-
 
|}
 
|}
Line 580: Line 716:     
=== NVGPU_AS_IOCTL_FREE_SPACE ===
 
=== NVGPU_AS_IOCTL_FREE_SPACE ===
 +
This one frees pages from the device address space.
 +
 
   struct {
 
   struct {
 
     __in u64 offset;
 
     __in u64 offset;
Line 604: Line 742:  
=== NVGPU_AS_IOCTL_MAP_BUFFER_EX ===
 
=== NVGPU_AS_IOCTL_MAP_BUFFER_EX ===
 
Map a memory region in the device address space. Identical to Linux driver pretty much.
 
Map a memory region in the device address space. Identical to Linux driver pretty much.
 +
 +
Unaligned size will cause a [[#Panic]].
    
On success, the mapped memory region is locked by having [[SVC#MemoryState]] bit34 set.
 
On success, the mapped memory region is locked by having [[SVC#MemoryState]] bit34 set.
Line 695: Line 835:  
|-
 
|-
 
| 0x40044405 || In || 4 || NVGPU_DBG_GPU_IOCTL_SMPC_CTXSW_MODE ||
 
| 0x40044405 || In || 4 || NVGPU_DBG_GPU_IOCTL_SMPC_CTXSW_MODE ||
 +
|-
 +
| 0x40044406 || In || 4 || NVGPU_DBG_GPU_IOCTL_SUSPEND_RESUME_SM ||
 
|-
 
|-
 
| 0xC0184407 || Inout || 24 || NVGPU_DBG_GPU_IOCTL_PERFBUF_MAP ||
 
| 0xC0184407 || Inout || 24 || NVGPU_DBG_GPU_IOCTL_PERFBUF_MAP ||
Line 708: Line 850:  
| 0x8004440C || Out || 4 || NVGPU_DBG_GPU_IOCTL_GET_GR_CONTEXT_SIZE ||
 
| 0x8004440C || Out || 4 || NVGPU_DBG_GPU_IOCTL_GET_GR_CONTEXT_SIZE ||
 
|-
 
|-
| 0x0000440D || None || 0 || NVGPU_DBG_GPU_IOCTL_GET_GR_CONTEXT (uses Ioctl3) ||
+
| 0x0000440D || None || 0 || NVGPU_DBG_GPU_IOCTL_GET_GR_CONTEXT || Uses Ioctl3.
 
|-
 
|-
 
|}
 
|}
Line 715: Line 857:  
Returns [[#Errors|NotSupported]] on Open unless nn::settings::detail::GetDebugModeFlag is set.
 
Returns [[#Errors|NotSupported]] on Open unless nn::settings::detail::GetDebugModeFlag is set.
   −
{| class="wikitable" border="1"
+
This device is identical to [[#/dev/nvhost-dbg-gpu|/dev/nvhost-dbg-gpu]].
! Value || Direction || Size || Description || Notes
  −
|}
      
== /dev/nvhost-ctrl-gpu ==
 
== /dev/nvhost-ctrl-gpu ==
Line 738: Line 878:  
|-
 
|-
 
| 0x40084707 || In || 8 || [[#NVGPU_GPU_IOCTL_FLUSH_L2]] ||
 
| 0x40084707 || In || 8 || [[#NVGPU_GPU_IOCTL_FLUSH_L2]] ||
 +
|-
 +
| 0x4008470D || In || 8 || NVGPU_GPU_IOCTL_INVAL_ICACHE ||
 
|-
 
|-
 
| 0x4008470E || In || 8 || NVGPU_GPU_IOCTL_SET_MMUDEBUG_MODE ||
 
| 0x4008470E || In || 8 || NVGPU_GPU_IOCTL_SET_MMUDEBUG_MODE ||
Line 893: Line 1,035:  
! Value || Size || Description || Notes
 
! Value || Size || Description || Notes
 
|-
 
|-
| 0xC0??0001 || Variable || NVHOST_IOCTL_CHANNEL_SUBMIT ||
+
| 0xC0??0001 || Variable || NVHOST_IOCTL_CHANNEL_SUBMIT || Seen on 1.0.0.
 +
|-
 +
| 0xC0080002 || 8 || NVHOST_IOCTL_CHANNEL_GET_SYNCPOINT || Seen on 1.0.0.
 
|-
 
|-
| 0xC0080002 || 8 || NVHOST_IOCTL_CHANNEL_GET_SYNCPOINT ||
+
| 0xC0080003 || 8 || NVHOST_IOCTL_CHANNEL_GET_WAITBASE || Seen on 1.0.0.
 
|-
 
|-
| 0xC0080003 || 8 || NVHOST_IOCTL_CHANNEL_GET_WAITBASE ||
+
| 0xC0080004 || 8 || NVHOST_IOCTL_CHANNEL_SET_TIMEOUT_EX || Seen on 1.0.0. Stubbed; does a debug print and returns 0.
 
|-
 
|-
| 0xC0080004 || 8 || NVHOST_IOCTL_CHANNEL_SET_TIMEOUT_EX ||
+
| 0x40040007 || 4 || NVHOST_IOCTL_CHANNEL_SET_SUBMIT_TIMEOUT || Seen on 1.0.0.
 
|-
 
|-
| 0x40040007 || 4 || ||
+
| 0x40080008 || 8 || NVHOST_IOCTL_CHANNEL_SET_CLK_RATE || Seen on 1.0.0.
 
|-
 
|-
| 0x40080008 || 8 || NVHOST_IOCTL_CHANNEL_SET_CLK_RATE ||
+
| 0xC0??0009 || Variable || NVHOST_IOCTL_CHANNEL_MAP_CMD_BUFFER || Seen on 1.0.0.
 
|-
 
|-
| 0xC0??0009 || Variable || NVHOST_IOCTL_CHANNEL_MAP_BUFFER ||
+
| 0xC0??000A || Variable || NVHOST_IOCTL_CHANNEL_UNMAP_CMD_BUFFER || Seen on 1.0.0.
 
|-
 
|-
| 0xC0??000A || Variable || NVHOST_IOCTL_CHANNEL_UNMAP_BUFFER ||
+
| 0x00000013 || 0 || || Seen on 1.0.0. This one sets a u32, and bool based on input.
 
|-
 
|-
| 0x00000013 || 0 || ||
+
| 0xC0080014 || || NVHOST_IOCTL_CHANNEL_GET_CLK_RATE || Seen on 1.0.0.
 
|- style="border-top: double"
 
|- style="border-top: double"
| 0x40044801 || 4 || [[#NVGPU_IOCTL_CHANNEL_SET_NVMAP_FD]] ||
+
| 0x40044801 || 4 || [[#NVGPU_IOCTL_CHANNEL_SET_NVMAP_FD]] || Seen on 1.0.0.
 
|-
 
|-
| 0x40044803 || 4 || NVGPU_IOCTL_CHANNEL_SET_TIMEOUT ||
+
| 0x40044803 || 4 || NVGPU_IOCTL_CHANNEL_SET_TIMEOUT || Seen on 1.0.0.
 
|-
 
|-
| 0x40084805 || 8 || [[#NVGPU_IOCTL_CHANNEL_ALLOC_GPFIFO]] ||
+
| 0x40084805 || 8 || [[#NVGPU_IOCTL_CHANNEL_ALLOC_GPFIFO]] || Seen on 1.0.0.
 
|-
 
|-
| 0xC0044807 || 4 || NVGPU_IOCTL_CHANNEL_CYCLE_STATS ||
+
| 0x40184806 || || NVGPU_IOCTL_CHANNEL_WAIT || Seen on 1.0.0.
 
|-
 
|-
| 0xC0??4808 || Variable || [[#NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO]] ||
+
| 0xC0044807 || 4 || NVGPU_IOCTL_CHANNEL_CYCLE_STATS || Seen on 1.0.0.
 
|-
 
|-
| 0xC0104809 || 16 || [[#NVGPU_IOCTL_CHANNEL_ALLOC_OBJ_CTX]] ||
+
| 0xC0??4808 || Variable || [[#NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO]] || Seen on 1.0.0.
 
|-
 
|-
| 0xC010480B || 16 || [[#NVGPU_IOCTL_CHANNEL_ZCULL_BIND]] ||
+
| 0xC0104809 || 16 || [[#NVGPU_IOCTL_CHANNEL_ALLOC_OBJ_CTX]] || Seen on 1.0.0.
 
|-
 
|-
| 0xC018480C || 24 || [[#NVGPU_IOCTL_CHANNEL_SET_ERROR_NOTIFIER]] ||
+
| 0x4008480A || || NVHOST_IOCTL_CHANNEL_FREE_OBJ_CTX || Seen on 1.0.0.
 
|-
 
|-
| 0x4004480D || 4 || [[#NVGPU_IOCTL_CHANNEL_SET_PRIORITY]] ||
+
| 0xC010480B || 16 || [[#NVGPU_IOCTL_CHANNEL_ZCULL_BIND]] || Seen on 1.0.0.
 
|-
 
|-
| 0x0000480E || 0 || [[#NVGPU_IOCTL_CHANNEL_ENABLE]] ||
+
| 0xC018480C || 24 || [[#NVGPU_IOCTL_CHANNEL_SET_ERROR_NOTIFIER]] || Seen on 1.0.0.
 
|-
 
|-
| 0x0000480F || 0 || [[#NVGPU_IOCTL_CHANNEL_DISABLE]] ||
+
| 0x4004480D || 4 || [[#NVGPU_IOCTL_CHANNEL_SET_PRIORITY]] || Seen on 1.0.0.
 
|-
 
|-
| 0x00004810 || 0 || [[#NVGPU_IOCTL_CHANNEL_PREEMPT]] ||
+
| 0x0000480E || 0 || [[#NVGPU_IOCTL_CHANNEL_ENABLE]] || Seen on 1.0.0.
 
|-
 
|-
| 0x00004811 || 0 || [[#NVGPU_IOCTL_CHANNEL_FORCE_RESET]] ||
+
| 0x0000480F || 0 || [[#NVGPU_IOCTL_CHANNEL_DISABLE]] || Seen on 1.0.0.
 
|-
 
|-
| 0x40084812 || 8 || [[#NVGPU_IOCTL_CHANNEL_EVENT_ID_CONTROL]] ||
+
| 0x00004810 || 0 || [[#NVGPU_IOCTL_CHANNEL_PREEMPT]] || Seen on 1.0.0.
 
|-
 
|-
| 0xC0104813 || 16 || NVGPU_IOCTL_CHANNEL_CYCLE_STATS_SNAPSHOT ||
+
| 0x00004811 || 0 || [[#NVGPU_IOCTL_CHANNEL_FORCE_RESET]] || Seen on 1.0.0.
 
|-
 
|-
| 0x80804816 || 128 || NVGPU_IOCTL_CHANNEL_GET_ERROR_INFO ||
+
| 0x40084812 || 8 || [[#NVGPU_IOCTL_CHANNEL_EVENT_ID_CONTROL]] || Seen on 1.0.0.
 
|-
 
|-
| 0xC0104817 || 16 || [[#NVGPU_IOCTL_CHANNEL_GET_ERROR_NOTIFICATION]] ||
+
| 0xC0104813 || 16 || NVGPU_IOCTL_CHANNEL_CYCLE_STATS_SNAPSHOT || Seen on 1.0.0.
 
|-
 
|-
| 0x40204818 || 32 || [[#NVGPU_IOCTL_CHANNEL_ALLOC_GPFIFO_EX]] ||
+
| 0x80804816 || 128 || NVGPU_IOCTL_CHANNEL_GET_ERROR_INFO || Seen on 1.0.0.
 
|-
 
|-
| 0xC0??4819 || Variable || [[#NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO_RETRY]] ||
+
| 0xC0104817 || 16 || [[#NVGPU_IOCTL_CHANNEL_GET_ERROR_NOTIFICATION]] || Seen on 1.0.0.
 
|-
 
|-
| 0xC020481A || 32 || [[#NVGPU_IOCTL_CHANNEL_ALLOC_GPFIFO_EX2]] ||
+
| 0x40204818 || 32 || [[#NVGPU_IOCTL_CHANNEL_ALLOC_GPFIFO_EX]] || Seen on 1.0.0.
 
|-
 
|-
| 0xC018481B || 24 || (uses Ioctl2) ||
+
| 0xC0??4819 || Variable || [[#NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO_RETRY]] || Seen on 1.0.0.
 
|-
 
|-
| 0xC018481C || 24 || (uses Ioctl2) ||
+
| 0xC020481A || 32 || [[#NVGPU_IOCTL_CHANNEL_ALLOC_GPFIFO_EX2]] || Seen on 1.0.0.
 +
|-
 +
| 0xC018481B || 24 ||  || Uses Ioctl2.
 +
|-
 +
| 0xC018481C || 24 || || Uses Ioctl2.
 
|-
 
|-
 
|- style="border-top: double"
 
|- style="border-top: double"
| 0x40084714 || 8 || NVGPU_IOCTL_CHANNEL_SET_USER_DATA || Sets an unknown user context address
+
| 0x40084714 || 8 || NVGPU_IOCTL_CHANNEL_SET_USER_DATA || Sets an unknown user context address. Seen on 1.0.0.
 
|-
 
|-
| 0x80084715 || 8 || NVGPU_IOCTL_CHANNEL_GET_USER_DATA || Gets an unknown user context address
+
| 0x80084715 || 8 || NVGPU_IOCTL_CHANNEL_GET_USER_DATA || Gets an unknown user context address. Seen on 1.0.0.
 
|}
 
|}
   Line 987: Line 1,135:  
    
 
    
 
   struct gpfifo_entry {
 
   struct gpfifo_entry {
     u64 entry;                            // gpu_iova | (unk_0x02 << 0x08) | (size << 0x0A) | (unk_0x01 << 0x1F)
+
     u64 entry;                            // gpu_iova | (unk_2bits << 40) | (size << 42) | (unk_flag << 63)
 
   };
 
   };
 
    
 
    
 
   struct {
 
   struct {
     __in u64 gpfifo;                      // (ignored) pointer to gpfifo fence structs
+
     __in   u64 gpfifo;                      // (ignored) pointer to gpfifo fence structs
     __in u32 num_entries;                // number of fence objects being submitted
+
     __in   u32 num_entries;                // number of fence objects being submitted
     __in u32 flags;
+
     __in   u32 flags;
     __out struct fence fence_out;        // returned new fence object for others to wait on
+
     __inout struct fence fence_out;        // returned new fence object for others to wait on
     __in struct gpfifo_entry entries[];  // depends on num_entries
+
     __in   struct gpfifo_entry entries[];  // depends on num_entries
 
   };
 
   };
   Line 1,022: Line 1,170:     
   struct {
 
   struct {
     __in u64 offset;
+
     __in u64 offset; // ignored
     __in u64 size;
+
     __in u64 size;   // ignored
     __in u32 mem;       // not used?
+
     __in u32 mem;     // must be non-zero to initialize, zero to de-initialize
     __in u32 padding;
+
     __in u32 padding; // ignored
 
   };
 
   };
   Line 1,052: Line 1,200:  
   struct {
 
   struct {
 
     __in u32 cmd;    // 0=disable, 1=enable, 2=clear
 
     __in u32 cmd;    // 0=disable, 1=enable, 2=clear
     __in u32 id;
+
     __in u32 id;     // same id's as for [[#QueryEvent]]
 
   };
 
   };
    
=== NVGPU_IOCTL_CHANNEL_GET_ERROR_NOTIFICATION ===
 
=== NVGPU_IOCTL_CHANNEL_GET_ERROR_NOTIFICATION ===
 
Returns the current error notification caught by the error notifier. Exclusive to the Switch.
 
Returns the current error notification caught by the error notifier. Exclusive to the Switch.
 +
 +
Despite being marked as inout this is all output.
    
   struct {
 
   struct {
     __out   u64 timestamp;    // nanoseconds since Jan. 1, 1970
+
     __out u64 timestamp;    // fetched straight from armGetSystemTick
     __out   u32 info32;      // error code
+
     __out u32 info32;      // error code
     __out   u16 info16;      // additional error info
+
     __out u16 info16;      // additional error info
     __inout u16 status;      // always 0xFFFF
+
     __out u16 status;      // always 0xFFFF
 
   };
 
   };
   −
=== NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO_RETRY ===
+
=== NVGPU_IOCTL_CHANNEL_ALLOC_GPFIFO_EX ===
 
Allocates gpfifo entries with additional parameters. Exclusive to the Switch.
 
Allocates gpfifo entries with additional parameters. Exclusive to the Switch.
   Line 1,079: Line 1,229:  
   };
 
   };
   −
=== NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO_EX ===
+
=== NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO_RETRY ===
 
Submits a gpfifo object (async version). Exclusive to the Switch.
 
Submits a gpfifo object (async version). Exclusive to the Switch.
   Line 1,106: Line 1,256:  
NVIDIA memory profiler (this service is not available on retail units).  
 
NVIDIA memory profiler (this service is not available on retail units).  
 
/dev/nvhost-ctrl sends the ioctl NVHOST_IOCTL_CTRL_GET_CONFIG to check the config "nv!NV_MEMORY_PROFILER". If config_str returns "1", the applications attempts to talk to use nvmemp.
 
/dev/nvhost-ctrl sends the ioctl NVHOST_IOCTL_CTRL_GET_CONFIG to check the config "nv!NV_MEMORY_PROFILER". If config_str returns "1", the applications attempts to talk to use nvmemp.
 +
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || Cmd0
+
| 0 || Open
 
|-
 
|-
| 1 || Cmd1
+
| 1 || GetPid
 
|}
 
|}
   Line 1,127: Line 1,278:  
|-
 
|-
 
| 2 || [[#ReadLog]]
 
| 2 || [[#ReadLog]]
 +
|-
 +
| 3 ||
 +
|-
 +
| 4 ||
 
|}
 
|}
   Line 1,137: Line 1,292:  
== ReadLog ==
 
== ReadLog ==
 
Takes fd and reads log into a type-6 buffer.
 
Takes fd and reads log into a type-6 buffer.
 +
 +
= nvgem:c =
 +
This is "nv::gemcontrol::INvGemControl".
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 0 ||
 +
|-
 +
| 1 ||
 +
|-
 +
| 2 ||
 +
|-
 +
| 3 ||
 +
|-
 +
| 4 ||
 +
|-
 +
| [1.0.0-4.1.0] 5 ||
 +
|-
 +
| 6 ||
 +
|-
 +
| 7 || [3.0.0+]
 +
|}
 +
 +
= nvgem:cd =
 +
This is "nv::gemcoredump::INvGemCoreDump".
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 0 ||
 +
|-
 +
| 1 ||
 +
|-
 +
| 2 ||
 +
|-
 +
| 3 || [8.0.0+]
 +
|-
 +
| 4 || [8.0.0+]
 +
|}
    
= Errors =
 
= Errors =

Navigation menu