NV services: Difference between revisions
No edit summary |
|||
Line 34: | Line 34: | ||
| 6 || [[#GetStatus]] | | 6 || [[#GetStatus]] | ||
|- | |- | ||
| 7 || [[# | | 7 || [[#SetAruidWithoutCheck]] | ||
|- | |- | ||
| 8 || [[#SetAruid]] | | 8 || [[#SetAruid]] | ||
Line 88: | Line 88: | ||
Takes no input. Returns 0x10-bytes and an output u32 ('''error_code'''). | Takes no input. Returns 0x10-bytes and an output u32 ('''error_code'''). | ||
== | == SetAruidWithoutCheck == | ||
Takes an input u64 which must [[IPC_Marshalling|match]] the user-process PID ([[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]]). Returns an output u32 ('''error_code'''). | Takes an input u64 which must [[IPC_Marshalling|match]] the user-process PID ([[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]]). Returns an output u32 ('''error_code'''). | ||
Line 152: | Line 152: | ||
|- | |- | ||
| 10 | | 10 | ||
| Can use [[# | | Can use [[#SetAruidWithoutCheck|SetAruidWithoutCheck]]. | ||
|- | |- | ||
| 11 | | 11 | ||
Line 203: | Line 203: | ||
| 0xC183001B || Inout || 387 || [[#NVHOST_IOCTL_CTRL_GET_CONFIG]] | | 0xC183001B || Inout || 387 || [[#NVHOST_IOCTL_CTRL_GET_CONFIG]] | ||
|- | |- | ||
| 0xC004001C || Inout || 4 || [[# | | 0xC004001C || Inout || 4 || [[#NVHOST_IOCTL_CTRL_SYNCPT_CLEAR_EVENT_WAIT]] | ||
|- | |- | ||
| 0xC010001D || Inout || 16 || [[# | | 0xC010001D || Inout || 16 || [[#NVHOST_IOCTL_CTRL_SYNCPT_EVENT_WAIT]] | ||
|- | |- | ||
| 0xC010001E || Inout || 16 || [[# | | 0xC010001E || Inout || 16 || [[#NVHOST_IOCTL_CTRL_SYNCPT_EVENT_WAIT_ASYNC]] | ||
|- | |- | ||
| 0xC004001F || Inout || 4 || [[# | | 0xC004001F || Inout || 4 || [[#NVHOST_IOCTL_CTRL_SYNCPT_REGISTER_EVENT]] | ||
|- | |- | ||
| 0xC0040020 || Inout || 4 || [[# | | 0xC0040020 || Inout || 4 || [[#NVHOST_IOCTL_CTRL_SYNCPT_UNREGISTER_EVENT]] | ||
|- | |- | ||
| 0x40080021 || In || 8 || [[# | | 0x40080021 || In || 8 || [[#NVHOST_IOCTL_CTRL_SYNCPT_FREE_EVENTS]] | ||
|- | |- | ||
| 0xC0040022 || Inout || 4 || [[#NVHOST_IOCTL_CTRL_GET_MAX_EVENT_FIFO_CHANNEL]] | | 0xC0040022 || Inout || 4 || [[#NVHOST_IOCTL_CTRL_GET_MAX_EVENT_FIFO_CHANNEL]] | ||
Line 289: | Line 289: | ||
}; | }; | ||
=== | === NVHOST_IOCTL_CTRL_SYNCPT_CLEAR_EVENT_WAIT === | ||
Clears the wait signal of an event. Exclusive to the Switch. | |||
struct { | struct { | ||
__in u32 | __in u32 event_slot; // ranges from 0x00 to 0x3F | ||
}; | }; | ||
=== | === NVHOST_IOCTL_CTRL_SYNCPT_EVENT_WAIT === | ||
Waits on an event. If waiting fails, returns error code 0x05 (Timeout) and sets '''value''' to (('''syncpt_id''' << 0x10) | 0x10000000). | Waits on an event. If waiting fails, returns error code 0x05 (Timeout) and sets '''value''' to (('''syncpt_id''' << 0x10) | 0x10000000). | ||
Depending on '''threshold''', an ''' | Depending on '''threshold''', an '''event_slot''' may be returned for using with other event ioctls. | ||
struct { | struct { | ||
Line 305: | Line 305: | ||
__in u32 threshold; | __in u32 threshold; | ||
__in s32 timeout; | __in s32 timeout; | ||
__inout u32 value; // in= | __inout u32 value; // in=event_slot (ignored); out=syncpt_value or event_slot | ||
}; | }; | ||
=== | === NVHOST_IOCTL_CTRL_SYNCPT_EVENT_WAIT_ASYNC === | ||
Waits on an event (async version). If waiting fails, returns error code 0x0B (BadValue). | Waits on an event (async version). If waiting fails, returns error code 0x0B (BadValue). | ||
Depending on '''threshold''', an ''' | Depending on '''threshold''', an '''event_slot''' may be returned for using with other event ioctls. | ||
struct { | struct { | ||
Line 317: | Line 317: | ||
__in u32 threshold; | __in u32 threshold; | ||
__in u32 timeout; | __in u32 timeout; | ||
__inout u32 value; // in= | __inout u32 value; // in=event_slot (ignored); out=syncpt_value or event_slot | ||
}; | }; | ||
=== | === NVHOST_IOCTL_CTRL_SYNCPT_REGISTER_EVENT === | ||
Registers an | Registers an event. Exclusive to the Switch. | ||
struct { | struct { | ||
__in u32 | __in u32 event_slot; // ranges from 0x00 to 0x3F | ||
}; | }; | ||
=== | === NVHOST_IOCTL_CTRL_SYNCPT_UNREGISTER_EVENT === | ||
Unregisters an | Unregisters an event. Exclusive to the Switch. | ||
struct { | struct { | ||
__in u32 | __in u32 event_slot; // ranges from 0x00 to 0x3F | ||
}; | }; | ||
=== | === NVHOST_IOCTL_CTRL_SYNCPT_FREE_EVENTS === | ||
Frees events. Exclusive to the Switch. | |||
struct { | struct { | ||
__in u64 | __in u64 events; // 64-bit bitfield where each bit represents one event | ||
}; | }; | ||
Line 345: | Line 345: | ||
struct { | struct { | ||
__out u32 max_channel; | __out u32 max_channel; // 0x00 (FIFO disabled) or 0x60 (FIFO enabled) | ||
}; | }; | ||
Line 514: | Line 514: | ||
! Value || Direction || Size || Description | ! Value || Direction || Size || Description | ||
|- | |- | ||
| 0x80040212 || Out || 4 || | | 0x80040212 || Out || 4 || NVDISP_CTRL_NUM_OUTPUTS | ||
|- | |- | ||
| 0xC0140213 || Inout || 20 || | | 0xC0140213 || Inout || 20 || NVDISP_CTRL_GET_DISPLAY_PROPERTIES | ||
|- | |- | ||
| 0xC1100214 || Inout || 272 || | | 0xC1100214 || Inout || 272 || NVDISP_CTRL_QUERY_EDID | ||
|- | |- | ||
| 0xC0080216</br>([1.0.0-3.0.0] 0xC0040216) || Inout || 8</br>([1.0.0-3.0.0] 4) || NVDISP_CTRL_GET_EXT_HPD_IN_OUT_EVENTS</br>([1.0.0-3.0.0] NVDISP_CTRL_GET_EXT_HPD_IN_EVENT) | | 0xC0080216</br>([1.0.0-3.0.0] 0xC0040216) || Inout || 8</br>([1.0.0-3.0.0] 4) || NVDISP_CTRL_GET_EXT_HPD_IN_OUT_EVENTS</br>([1.0.0-3.0.0] NVDISP_CTRL_GET_EXT_HPD_IN_EVENT) | ||
Line 528: | Line 528: | ||
| 0xC0100219 || Inout || 16 || NVDISP_CTRL_GET_VBLANK_HEAD1_EVENT | | 0xC0100219 || Inout || 16 || NVDISP_CTRL_GET_VBLANK_HEAD1_EVENT | ||
|- | |- | ||
| 0xC0040220 || Inout || 4 || | | 0xC0040220 || Inout || 4 || NVDISP_CTRL_SUSPEND | ||
|} | |} | ||
Line 547: | Line 547: | ||
| 0x430C0206 || In || 780 || NVDISP_SET_LUT | | 0x430C0206 || In || 780 || NVDISP_SET_LUT | ||
|- | |- | ||
| 0x40010207 || In || 1 || | | 0x40010207 || In || 1 || NVDISP_CONFIG_CRC | ||
|- | |- | ||
| 0x80040208 || Out || 4 || NVDISP_GET_CRC | | 0x80040208 || Out || 4 || NVDISP_GET_CRC | ||
Line 611: | Line 611: | ||
! Value || Direction || Size || Description | ! Value || Direction || Size || Description | ||
|- | |- | ||
| 0xC4880401 || Inout || 1160 || | | 0xC4880401 || Inout || 1160 || NVHDCP_READ_STATUS | ||
|- | |- | ||
| 0xC4880402 || Inout || 1160 || | | 0xC4880402 || Inout || 1160 || NVHDCP_READ_M | ||
|- | |- | ||
| 0x40010403 || In || 1 || | | 0x40010403 || In || 1 || NVHDCP_USER_ENABLE | ||
|- | |- | ||
| 0xC0080404 || Inout || 8 || NVHDCP_READ_EVENT | | 0xC0080404 || Inout || 8 || NVHDCP_READ_EVENT | ||
|- | |- | ||
| 0xC0010405 || Inout || 1 || | | 0xC0010405 || Inout || 1 || NVHDCP_EVENTS_ENABLE | ||
|} | |} | ||
Line 626: | Line 626: | ||
! Value || Direction || Size || Description | ! Value || Direction || Size || Description | ||
|- | |- | ||
| 0x40010501 || In || 1 || | | 0x40010501 || In || 1 || NVDCUTIL_SW_HOTPLUG | ||
|- | |- | ||
| 0x40010502 || In || 1 || | | 0x40010502 || In || 1 || NVDCUTIL_VIRTUAL_EDID_ENABLE | ||
|- | |- | ||
| 0x42040503 || In || 1056 || NVDCUTIL_VIRTUAL_EDID_SET_DATA | | 0x42040503 || In || 1056 || NVDCUTIL_VIRTUAL_EDID_SET_DATA | ||
Line 634: | Line 634: | ||
| 0x803C0504 || Out || 60 || NVDCUTIL_GET_MODE | | 0x803C0504 || Out || 60 || NVDCUTIL_GET_MODE | ||
|- | |- | ||
| 0x40010505 || In || 1 || | | 0x40010505 || In || 1 || NVDCUTIL_TELEMETRY_TEST_ENABLE | ||
|- | |- | ||
| 0x400C0506 || In || 12 || NVDCUTIL_DSI_PACKET_SHORT_WRITE | | 0x400C0506 || In || 12 || NVDCUTIL_DSI_PACKET_SHORT_WRITE | ||
Line 685: | Line 685: | ||
| 0x4008060F || In || 8 || [[#NVSCHED_CTRL_DETACH_APPLICATION]] | | 0x4008060F || In || 8 || [[#NVSCHED_CTRL_DETACH_APPLICATION]] | ||
|- | |- | ||
| 0x40100610 || In || 16 || | | 0x40100610 || In || 16 || NVSCHED_CTRL_SET_APPLICATION_MAX_DEBT | ||
|- | |- | ||
| 0x40100611 || In || 16 || | | 0x40100611 || In || 16 || NVSCHED_CTRL_SET_RUNLIST_MAX_DEBT | ||
|- | |- | ||
| 0x40010612 || In || 1 || | | 0x40010612 || In || 1 || NVSCHED_CTRL_OVERRUN_EVENTS_ENABLE | ||
|} | |} | ||
Line 887: | Line 887: | ||
| 0xC0284106 || Inout || 40 || [[#NVGPU_AS_IOCTL_MODIFY]] | | 0xC0284106 || Inout || 40 || [[#NVGPU_AS_IOCTL_MODIFY]] | ||
|- | |- | ||
| 0x40104107 || In || 16 || [[# | | 0x40104107 || In || 16 || [[#NVGPU_AS_IOCTL_ALLOC_AS]] | ||
|- | |- | ||
| 0xC0404108 || Inout || 64 || [[#NVGPU_AS_IOCTL_GET_VA_REGIONS]] | | 0xC0404108 || Inout || 64 || [[#NVGPU_AS_IOCTL_GET_VA_REGIONS]] | ||
|- | |- | ||
| 0x40284109 || In || 40 || [[# | | 0x40284109 || In || 40 || [[#NVGPU_AS_IOCTL_ALLOC_AS_EX]] | ||
|- | |- | ||
| 0xC038410A || Inout || 56 || [[#NVGPU_AS_IOCTL_MAP_BUFFER_EX]] | | 0xC038410A || Inout || 56 || [[#NVGPU_AS_IOCTL_MAP_BUFFER_EX]] | ||
Line 968: | Line 968: | ||
}; | }; | ||
=== | === NVGPU_AS_IOCTL_ALLOC_AS === | ||
Nintendo's custom implementation | Nintendo's custom implementation for allocating an address space. | ||
struct { | struct { | ||
Line 995: | Line 995: | ||
}; | }; | ||
=== | === NVGPU_AS_IOCTL_ALLOC_AS_EX === | ||
Nintendo's custom implementation | Nintendo's custom implementation for allocating an address space with extra params. | ||
struct { | struct { | ||
Line 1,927: | Line 1,927: | ||
| 0 || Initialize | | 0 || Initialize | ||
|- | |- | ||
| 1 || | | 1 || GetEventHandle | ||
|- | |- | ||
| 2 || | | 2 || ControlNotification | ||
|- | |- | ||
| 3 || | | 3 || SetNotificationPerm | ||
|- | |- | ||
| 4 || | | 4 || SetCoreDumpPerm | ||
|- | |- | ||
| 5 || [1.0.0-4.1.0] GetAruid | | 5 || [1.0.0-4.1.0] GetAruid | ||
|- | |- | ||
| 6 || | | 6 || Reset | ||
|- | |- | ||
| 7 || [3.0.0+] | | 7 || [3.0.0+] | ||
Line 1,953: | Line 1,953: | ||
| 1 || GetAruid | | 1 || GetAruid | ||
|- | |- | ||
| 2 || [1.0.0-8.1.0] | | 2 || [1.0.0-8.1.0] ReadNextBlock | ||
|- | |- | ||
| 3 || [8.0.0+] | | 3 || [8.0.0+] |