https://switchbrew.org/w/api.php?action=feedcontributions&user=Thog&feedformat=atom
Nintendo Switch Brew - User contributions [en]
2024-03-28T09:22:48Z
User contributions
MediaWiki 1.35.8
https://switchbrew.org/w/index.php?title=NV_services&diff=8585
NV services
2019-12-25T07:53:14Z
<p>Thog: </p>
<hr />
<div>The Switch uses a customized NVIDIA driver.<br />
<br />
= nvdrv, nvdrv:a, nvdrv:s, nvdrv:t =<br />
This is "nns::nvdrv::INvDrvServices".<br />
<br />
Main NVIDIA driver service.<br />
<br />
Each service is used by:<br />
* "nvdrv": regular applications<br />
* "nvdrv:a": applets<br />
* "nvdrv:s": sysmodules<br />
* "nvdrv:t": factory titles<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#Open]]<br />
|-<br />
| 1 || [[#Ioctl]]<br />
|-<br />
| 2 || [[#Close]]<br />
|-<br />
| 3 || [[#Initialize]]<br />
|-<br />
| 4 || [[#QueryEvent]]<br />
|-<br />
| 5 || [[#MapSharedMem]]<br />
|-<br />
| 6 || [[#GetStatus]]<br />
|-<br />
| 7 || [[#SetAruid]]<br />
|-<br />
| 8 || [[#SetAruidByPID]]<br />
|-<br />
| 9 || [[#DumpGraphicsMemoryInfo]]<br />
|-<br />
| 10 || [3.0.0+] [[#InitializeDevtools]]<br />
|-<br />
| 11 || [3.0.0+] [[#Ioctl2]]<br />
|-<br />
| 12 || [3.0.0+] [[#Ioctl3]]<br />
|-<br />
| 13 || [3.0.0+] [[#FinishInitialize]]<br />
|}<br />
<br />
== Open ==<br />
Takes a type-0x5 input buffer for the device-path. Returns the output 32bit '''fd''' and the u32 '''error_code'''.<br />
<br />
== Ioctl ==<br />
Takes a 32bit '''fd''', an u32 '''ioctl_cmd''', a type-0x21 input buffer, and a type-0x22 output buffer. Returns an output u32 ('''error_code''').<br />
<br />
The addr/size for send/recv buffers are only set when the associated direction bit is set in the ioctl cmd (addr/size = 0 otherwise).<br />
<br />
== Close ==<br />
Takes a 32bit '''fd'''. Returns an output u32 ('''error_code''').<br />
<br />
== Initialize ==<br />
Takes two copy-handles ('''current_process''' and '''transfer_memory''') and an input u32 ('''transfer_memory_size'''). Returns an output u32 ('''error_code''').<br />
<br />
Webkit applet creates the transfer-memory with perm = 0 and size 0x300000.<br />
<br />
== QueryEvent ==<br />
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''').<br />
<br />
QueryEvent is only supported on (and implemented differently on):<br />
* /dev/nvhost-gpu<br />
** 1: SmException_BptIntReport<br />
** 2: SmException_BptPauseReport<br />
** 3: ErrorNotifierEvent<br />
* /dev/nvhost-ctrl: Used to get events for SyncPts.<br />
** If bit31-28 is 1, then lower 16-bits contain event_slot, bit27-16 contain syncpt_number. <br />
** If bit31-28 is 0, then lower 4-bits contain event_slot, bit31-4 contains syncpt_number.<br />
* /dev/nvhost-ctrl-gpu<br />
** 1: Returns error_event_handle.<br />
** 2: Returns unknown event.<br />
* /dev/nvhost-dbg-gpu<br />
** Ignores event_id.<br />
<br />
== MapSharedMem ==<br />
Takes a copy-handle ('''transfer_memory''') and two input u32s ('''fd''' and '''nvmap_handle'''). Returns an output u32 ('''error_code''').<br />
<br />
== GetStatus ==<br />
Takes no input. Returns 0x10-bytes and an output u32 ('''error_code''').<br />
<br />
== SetAruid ==<br />
Takes an input u64 which must [[IPC_Marshalling|match]] the user-process PID ([[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]]). Returns an output u32 ('''error_code''').<br />
<br />
== SetAruidByPID ==<br />
Takes a PID-descriptor and an u64 which must [[IPC_Marshalling|match]] the user-process PID ([[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]]). Returns an output u32 ('''error_code''').<br />
<br />
== DumpGraphicsMemoryInfo ==<br />
No input or output. Does nothing.<br />
<br />
== InitializeDevtools ==<br />
Takes a copy-handle and an input u32. Returns an output u32 ('''error_code''').<br />
<br />
== Ioctl2 ==<br />
Takes a type-0x21 buffer, a type-0x22 buffer, a type-0x21 buffer, and two input u32s. Returns an output u32 ('''error_code''').<br />
<br />
== Ioctl3 ==<br />
Takes a type-0x21 buffer, a type-0x22 buffer, another type-0x22 buffer, and two input u32s. Returns an output u32 (error_code). <br />
Cmdhdr_word1 is 0x100B instead of 0xC0B.<br />
<br />
== FinishInitialize ==<br />
Takes an input u64. No output.<br />
<br />
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).<br />
<br />
Official user-processes starting with 3.0.0 now use this at the end of nvdrv service init with value 0x1.<br />
<br />
= Ioctls =<br />
The ioctl number is generated with the following primitive (see Linux kernel):<br />
<br />
#define _IOC(inout, group, num, len) \<br />
(inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num))<br />
<br />
The following table contains known ioctls.<br />
<br />
== /dev/nvhost-ctrl ==<br />
{| class="wikitable" border="1"<br />
! Value || Direction || Size || Description<br />
|-<br />
| 0xC0080014 || Inout || 8 || [[#NVHOST_IOCTL_CTRL_SYNCPT_READ]]<br />
|-<br />
| 0x40040015 || In || 4 || [[#NVHOST_IOCTL_CTRL_SYNCPT_INCR]]<br />
|-<br />
| 0xC00C0016 || Inout || 12 || [[#NVHOST_IOCTL_CTRL_SYNCPT_WAIT]]<br />
|-<br />
| 0x40080017 || In || 8 || [[#NVHOST_IOCTL_CTRL_MODULE_MUTEX]]<br />
|-<br />
| 0xC0180018 || Inout || 24 || [[#NVHOST_IOCTL_CTRL_MODULE_REGRDWR]]<br />
|-<br />
| 0xC0100019 || Inout || 16 || [[#NVHOST_IOCTL_CTRL_SYNCPT_WAITEX]]<br />
|-<br />
| 0xC008001A || Inout || 8 || [[#NVHOST_IOCTL_CTRL_SYNCPT_READ_MAX]]<br />
|-<br />
| 0xC183001B || Inout || 387 || [[#NVHOST_IOCTL_CTRL_GET_CONFIG]]<br />
|-<br />
| 0xC004001C || Inout || 4 || [[#NVHOST_IOCTL_CTRL_EVENT_SIGNAL]]<br />
|-<br />
| 0xC010001D || Inout || 16 || [[#NVHOST_IOCTL_CTRL_EVENT_WAIT]]<br />
|-<br />
| 0xC010001E || Inout || 16 || [[#NVHOST_IOCTL_CTRL_EVENT_WAIT_ASYNC]]<br />
|-<br />
| 0xC004001F || Inout || 4 || [[#NVHOST_IOCTL_CTRL_EVENT_REGISTER]]<br />
|-<br />
| 0xC0040020 || Inout || 4 || [[#NVHOST_IOCTL_CTRL_EVENT_UNREGISTER]]<br />
|-<br />
| 0x40080021 || In || 8 || [[#NVHOST_IOCTL_CTRL_EVENT_KILL]]<br />
|-<br />
| 0xC0040022 || Inout || 4 || [[#NVHOST_IOCTL_CTRL_GET_MAX_EVENT_FIFO_CHANNEL]]<br />
|}<br />
<br />
=== NVHOST_IOCTL_CTRL_SYNCPT_READ ===<br />
Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 id;<br />
__out u32 value;<br />
};<br />
<br />
=== NVHOST_IOCTL_CTRL_SYNCPT_INCR ===<br />
Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 id;<br />
};<br />
<br />
=== NVHOST_IOCTL_CTRL_SYNCPT_WAIT ===<br />
Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 id;<br />
__in u32 thresh;<br />
__in s32 timeout;<br />
};<br />
<br />
=== NVHOST_IOCTL_CTRL_MODULE_MUTEX ===<br />
Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 id;<br />
__in u32 lock; // (0==unlock; 1==lock)<br />
};<br />
<br />
=== NVHOST_IOCTL_CTRL_MODULE_REGRDWR ===<br />
Identical to Linux driver. Uses 32-bit version and doesn't work.<br />
<br />
struct {<br />
__in u32 id;<br />
__in u32 num_offsets;<br />
__in u32 block_size;<br />
__in u32 offsets;<br />
__in u32 values;<br />
__in u32 write;<br />
};<br />
<br />
=== NVHOST_IOCTL_CTRL_SYNCPT_WAITEX ===<br />
Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 id;<br />
__in u32 thresh;<br />
__in s32 timeout;<br />
__out u32 value;<br />
};<br />
<br />
=== NVHOST_IOCTL_CTRL_SYNCPT_READ_MAX ===<br />
Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 id;<br />
__out u32 value;<br />
};<br />
<br />
=== NVHOST_IOCTL_CTRL_GET_CONFIG ===<br />
Returns configured settings. Not available in production mode.<br />
<br />
struct {<br />
__in char domain_str[0x41]; // "nv"<br />
__in char param_str[0x41];<br />
__out char config_str[0x101];<br />
};<br />
<br />
=== NVHOST_IOCTL_CTRL_EVENT_SIGNAL ===<br />
Signals an user event. Exclusive to the Switch.<br />
<br />
struct {<br />
__in u32 user_event_id; // ranges from 0x00 to 0x3F<br />
};<br />
<br />
=== NVHOST_IOCTL_CTRL_EVENT_WAIT ===<br />
Waits on an event. If waiting fails, returns error code 0x05 (Timeout) and sets '''value''' to (('''syncpt_id''' << 0x10) | 0x10000000).<br />
<br />
Depending on '''threshold''', an '''user_event_id''' may be returned for using with other event ioctls.<br />
<br />
struct {<br />
__in u32 syncpt_id;<br />
__in u32 threshold;<br />
__in s32 timeout;<br />
__inout u32 value; // in=user_event_id (ignored); out=syncpt_value or user_event_id<br />
};<br />
<br />
=== NVHOST_IOCTL_CTRL_EVENT_WAIT_ASYNC ===<br />
Waits on an event (async version). If waiting fails, returns error code 0x0B (BadValue).<br />
<br />
Depending on '''threshold''', an '''user_event_id''' may be returned for using with other event ioctls.<br />
<br />
struct {<br />
__in u32 syncpt_id;<br />
__in u32 threshold;<br />
__in u32 timeout;<br />
__inout u32 value; // in=user_event_id (ignored); out=syncpt_value or user_event_id<br />
};<br />
<br />
=== NVHOST_IOCTL_CTRL_EVENT_REGISTER ===<br />
Registers an user event. Exclusive to the Switch. <br />
<br />
struct {<br />
__in u32 user_event_id; // ranges from 0x00 to 0x3F<br />
};<br />
<br />
=== NVHOST_IOCTL_CTRL_EVENT_UNREGISTER ===<br />
Unregisters an user event. Exclusive to the Switch. <br />
<br />
struct {<br />
__in u32 user_event_id; // ranges from 0x00 to 0x3F<br />
};<br />
<br />
=== NVHOST_IOCTL_CTRL_EVENT_KILL ===<br />
Kills user events. Exclusive to the Switch. <br />
<br />
struct {<br />
__in u64 user_events; // 64-bit bitfield where each bit represents one event<br />
};<br />
<br />
=== NVHOST_IOCTL_CTRL_GET_MAX_EVENT_FIFO_CHANNEL ===<br />
If event FIFO is enabled, returns the maximum channel number. Exclusive to the Switch.<br />
<br />
struct {<br />
__out u32 max_channel; // 0x00 (FIFO disabled) or 0x60 (FIFO enabled)<br />
};<br />
<br />
== /dev/nvmap ==<br />
{| class="wikitable" border="1"<br />
! Value || Direction || Size || Description<br />
|-<br />
| 0xC0080101 || Inout || 8 || [[#NVMAP_IOC_CREATE]]<br />
|-<br />
| 0x00000102 || - || 0 || [[#NVMAP_IOC_CLAIM]]<br />
|-<br />
| 0xC0080103 || Inout || 8 || [[#NVMAP_IOC_FROM_ID]]<br />
|-<br />
| 0xC0200104 || Inout || 32 || [[#NVMAP_IOC_ALLOC]]<br />
|-<br />
| 0xC0180105 || Inout || 24 || [[#NVMAP_IOC_FREE]]<br />
|-<br />
| 0xC0280106 || Inout || 40 || [[#NVMAP_IOC_MMAP]]<br />
|-<br />
| 0xC0280107 || Inout || 40 || [[#NVMAP_IOC_WRITE]]<br />
|-<br />
| 0xC0280108 || Inout || 40 || [[#NVMAP_IOC_READ]]<br />
|-<br />
| 0xC00C0109 || Inout || 12 || [[#NVMAP_IOC_PARAM]]<br />
|-<br />
| 0xC010010A || Inout || 16 || [[#NVMAP_IOC_PIN_MULT]]<br />
|-<br />
| 0xC010010B || Inout || 16 || [[#NVMAP_IOC_UNPIN_MULT]]<br />
|-<br />
| 0xC008010C || Inout || 8 || [[#NVMAP_IOC_CACHE]]<br />
|-<br />
| 0xC004010D || Inout || 4 || [[#NVMAP_IOC_GET_IVC_ID]]<br />
|-<br />
| 0xC008010E || Inout || 8 || [[#NVMAP_IOC_GET_ID]]<br />
|-<br />
| 0xC004010F || Inout || 4 || [[#NVMAP_IOC_FROM_IVC_ID]]<br />
|-<br />
| 0x40040110 || In || 4 || [[#NVMAP_IOC_SET_ALLOCATION_TAG_LABEL]]<br />
|-<br />
| 0x00000111 || - || 0 || [[#NVMAP_IOC_RESERVE]]<br />
|-<br />
| 0x40100112 || In || 16 || [[#NVMAP_IOC_EXPORT_FOR_ARUID]]<br />
|-<br />
| 0x40100113 || In || 16 || [[#NVMAP_IOC_IS_OWNED_BY_ARUID]]<br />
|-<br />
| 0x40100114 || In || 16 || [[#NVMAP_IOC_REMOVE_EXPORT_FOR_ARUID]]<br />
|}<br />
<br />
=== NVMAP_IOC_CREATE ===<br />
Creates an nvmap object. Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 size;<br />
__out u32 handle;<br />
};<br />
<br />
=== NVMAP_IOC_CLAIM ===<br />
Returns [[#Errors|NotSupported]].<br />
<br />
=== NVMAP_IOC_FROM_ID ===<br />
Get handle to an existing nvmap object. Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 id;<br />
__out u32 handle;<br />
};<br />
<br />
=== NVMAP_IOC_ALLOC ===<br />
Allocate memory for the nvmap object. Nintendo extended this one with 16 bytes, and changed it from in to inout.<br />
<br />
struct {<br />
__in u32 handle;<br />
__in u32 heapmask;<br />
__in u32 flags; // (0=read-only, 1=read-write)<br />
__in u32 align;<br />
__in u8 kind;<br />
u8 pad[7];<br />
__inout u64 addr;<br />
};<br />
<br />
=== NVMAP_IOC_FREE ===<br />
This one is completely custom. Partly because the Linux driver passed the handle as the ioctl "arg-ptr", and HIPC can't handle that voodoo.<br />
<br />
struct {<br />
__in u32 handle;<br />
u32 pad;<br />
__out u64 address;<br />
__out u32 size;<br />
__out u32 flags; // 1=NOT_FREED_YET<br />
};<br />
<br />
=== NVMAP_IOC_MMAP ===<br />
Returns [[#Errors|NotSupported]].<br />
<br />
=== NVMAP_IOC_WRITE ===<br />
Returns [[#Errors|NotSupported]].<br />
<br />
=== NVMAP_IOC_READ ===<br />
Returns [[#Errors|NotSupported]].<br />
<br />
=== NVMAP_IOC_PARAM ===<br />
Returns info about a nvmap object. Identical to Linux driver, but extended with further params.<br />
<br />
struct {<br />
__in u32 handle;<br />
__in u32 param; // 1=SIZE, 2=ALIGNMENT, 3=BASE (returns error), 4=HEAP (always 0x40000000), 5=KIND, 6=COMPR (unused)<br />
__out u32 result;<br />
};<br />
<br />
=== NVMAP_IOC_PIN_MULT ===<br />
Returns [[#Errors|NotSupported]].<br />
<br />
=== NVMAP_IOC_UNPIN_MULT ===<br />
Returns [[#Errors|NotSupported]].<br />
<br />
=== NVMAP_IOC_CACHE ===<br />
Returns [[#Errors|NotSupported]].<br />
<br />
=== NVMAP_IOC_GET_IVC_ID ===<br />
Returns [[#Errors|NotSupported]].<br />
<br />
=== NVMAP_IOC_GET_ID ===<br />
Returns an id for a nvmap object. Identical to Linux driver.<br />
<br />
struct {<br />
__out u32 id; //~0 indicates error<br />
__in u32 handle;<br />
};<br />
<br />
=== NVMAP_IOC_FROM_IVC_ID ===<br />
Returns [[#Errors|NotSupported]].<br />
<br />
=== NVMAP_IOC_SET_ALLOCATION_TAG_LABEL ===<br />
Returns [[#Errors|NotSupported]].<br />
<br />
=== NVMAP_IOC_RESERVE ===<br />
Returns [[#Errors|NotSupported]].<br />
<br />
=== NVMAP_IOC_EXPORT_FOR_ARUID ===<br />
Binds a nvmap object to an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]].<br />
<br />
struct {<br />
__in u64 aruid;<br />
__in u32 handle;<br />
u8 pad[4];<br />
};<br />
<br />
=== NVMAP_IOC_IS_OWNED_BY_ARUID ===<br />
Checks if a nvmap object is bound to an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]].<br />
<br />
struct {<br />
__in u64 aruid;<br />
__in u32 handle;<br />
u8 pad[4];<br />
};<br />
<br />
=== NVMAP_IOC_REMOVE_EXPORT_FOR_ARUID ===<br />
Unbinds a nvmap object from an [[Applet_Manager_services#AppletResourceUserId|AppletResourceUserId]].<br />
<br />
struct {<br />
__in u64 aruid;<br />
__in u32 handle;<br />
u8 pad[4];<br />
};<br />
<br />
== /dev/nvdisp-ctrl ==<br />
{| class="wikitable" border="1"<br />
! Value || Direction || Size || Description<br />
|-<br />
| 0x80040212 || Out || 4 || NVDISP_CTRL_GET_NUM_OUTPUTS<br />
|-<br />
| 0xC0140213 || Inout || 20 || NVDISP_CTRL_GET_OUTPUT_PROPERTIES<br />
|-<br />
| 0xC1100214 || Inout || 272 || NVDISP_CTRL_GET_OUTPUT_EDID<br />
|-<br />
| 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)<br />
|-<br />
| ([1.0.0-3.0.0] 0xC0040217) || ([1.0.0-3.0.0] Inout) || ([1.0.0-3.0.0] 4) || ([1.0.0-3.0.0] NVDISP_CTRL_GET_EXT_HPD_OUT_EVENT)<br />
|-<br />
| 0xC0100218 || Inout || 16 || NVDISP_CTRL_GET_VBLANK_HEAD0_EVENT<br />
|-<br />
| 0xC0100219 || Inout || 16 || NVDISP_CTRL_GET_VBLANK_HEAD1_EVENT<br />
|-<br />
| 0xC0040220 || Inout || 4 || NVDISP_CTRL_GET_HPD_IRQ<br />
|}<br />
<br />
== /dev/nvdisp-disp0, /dev/nvdisp-disp1 ==<br />
{| class="wikitable" border="1"<br />
! Value || Direction || Size || Description<br />
|-<br />
| 0x40040201 || In || 4 || NVDISP_GET_WINDOW<br />
|-<br />
| 0x40040202 || In || 4 || NVDISP_PUT_WINDOW<br />
|-<br />
| 0xC4C80203 || In || 1224 || NVDISP_FLIP<br />
|-<br />
| 0x80380204 || Out || 56 || NVDISP_GET_MODE<br />
|-<br />
| 0x40380205 || Out || 56 || NVDISP_SET_MODE<br />
|-<br />
| 0x430C0206 || In || 780 || NVDISP_SET_LUT<br />
|-<br />
| 0x40010207 || In || 1 || NVDISP_ENABLE_DISABLE_CRC<br />
|-<br />
| 0x80040208 || Out || 4 || NVDISP_GET_CRC<br />
|-<br />
| 0x80040209 || Out || 4 || NVDISP_GET_HEAD_STATUS<br />
|-<br />
| 0xC038020A || Inout || 56 || NVDISP_VALIDATE_MODE<br />
|-<br />
| 0x4018020B || In || 24 || NVDISP_SET_CSC<br />
|-<br />
| 0xC004020C || Inout || 4 || NVDISP_GET_VBLANK_SYNCPT<br />
|-<br />
| 0x8040020D || Out || 64 || NVDISP_GET_UNDERFLOWS<br />
|-<br />
| 0xC99A020E || Inout || 2458 || NVDISP_SET_CMU<br />
|-<br />
| 0xC004020F || Inout || 4 || NVDISP_DPMS<br />
|-<br />
| 0x80600210 || Out || 96 || NVDISP_GET_AVI_INFOFRAME<br />
|-<br />
| 0x40600211 || In || 96 || NVDISP_SET_AVI_INFOFRAME<br />
|-<br />
| 0xEBFC0215 || Inout || 11260 || NVDISP_GET_MODE_DB<br />
|-<br />
| 0xC003021A || Inout || 3 || NVDISP_PANEL_GET_VENDOR_ID<br />
|-<br />
| 0x803C021B || Out || 60 || NVDISP_GET_MODE2<br />
|-<br />
| 0x403C021C || In || 60 || NVDISP_SET_MODE2<br />
|-<br />
| 0xC03C021D || Inout || 60 || NVDISP_VALIDATE_MODE2<br />
|-<br />
| 0xEF20021E || Inout || 12064 || NVDISP_GET_MODE_DB2<br />
|-<br />
| 0xC004021F || Inout || 4 || NVDISP_GET_WINMASK<br />
|}<br />
<br />
== /dev/nvcec-ctrl ==<br />
{| class="wikitable" border="1"<br />
! Value || Direction || Size || Description<br />
|-<br />
| 0x40010301 || In || 1 || NVCEC_CTRL_ENABLE<br />
|-<br />
| 0x804C0302 || Out || 76 || NVCEC_CTRL_GET_PADDR<br />
|-<br />
| 0x40040303 || In || 4 || NVCEC_CTRL_SET_LADDR<br />
|-<br />
| 0xC04C0304 || Inout || 76 || NVCEC_CTRL_WRITE<br />
|-<br />
| 0xC04C0305 || Inout || 76 || NVCEC_CTRL_READ<br />
|-<br />
| 0x804C0306 || Out || 76 || NVCEC_CTRL_GET_CONNECTION_STATUS<br />
|-<br />
| 0x804C0307 || Out || 76 || NVCEC_CTRL_GET_WRITE_STATUS<br />
|}<br />
<br />
== /dev/nvhdcp_up-ctrl ==<br />
{| class="wikitable" border="1"<br />
! Value || Direction || Size || Description<br />
|-<br />
| 0xC4880401 || Inout || 1160 || NVHDCP_READ_M<br />
|-<br />
| 0xC4880402 || Inout || 1160 || NVHDCP_READ_S<br />
|-<br />
| 0x40010403 || In || 1 || NVHDCP_ON_OFF<br />
|-<br />
| 0xC0080404 || Inout || 8 || NVHDCP_READ_EVENT<br />
|-<br />
| 0xC0010405 || Inout || 1 || NVHDCP_EVENTS_ON_OFF<br />
|}<br />
<br />
== /dev/nvdcutil-disp0, /dev/nvdcutil-disp1 ==<br />
{| class="wikitable" border="1"<br />
! Value || Direction || Size || Description<br />
|-<br />
| 0x40010501 || In || 1 || NVDCUTIL_SW_HOTPLUG_IN_OUT<br />
|-<br />
| 0x40010502 || In || 1 || NVDCUTIL_VIRTUAL_EDID_ON_OFF<br />
|-<br />
| 0x42040503 || In || 1056 || NVDCUTIL_VIRTUAL_EDID_SET_DATA<br />
|-<br />
| 0x803C0504 || Out || 60 || NVDCUTIL_GET_MODE<br />
|-<br />
| 0x40010505 || In || 1 || NVDCUTIL_TELEMETRY_TEST_ON_OFF<br />
|-<br />
| 0x400C0506 || In || 12 || NVDCUTIL_DSI_PACKET_SHORT_WRITE<br />
|-<br />
| 0x40F80507 || In || 248 || NVDCUTIL_DSI_PACKET_LONG_WRITE<br />
|-<br />
| 0xC0F40508 || Inout || 244 || NVDCUTIL_DSI_PACKET_READ<br />
|}<br />
<br />
== /dev/nvsched-ctrl ==<br />
This is a customized scheduler device.<br />
<br />
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.<br />
<br />
{| class="wikitable" border="1"<br />
! Value || Direction || Size || Description<br />
|-<br />
| 0x00000601 || - || 0 || [[#NVSCHED_CTRL_ENABLE]]<br />
|-<br />
| 0x00000602 || - || 0 || [[#NVSCHED_CTRL_DISABLE]]<br />
|-<br />
| 0x40180603 || In || 24 || [[#NVSCHED_CTRL_ADD_APPLICATION]]<br />
|-<br />
| 0x40180604 || In || 24 || [[#NVSCHED_CTRL_UPDATE_APPLICATION]]<br />
|-<br />
| 0x40080605 || In || 8 || [[#NVSCHED_CTRL_REMOVE_APPLICATION]]<br />
|-<br />
| 0x80080606 || Out || 8 || [[#NVSCHED_CTRL_GET_ID]]<br />
|-<br />
| 0x80080607 || Out || 8 || [[#NVSCHED_CTRL_ADD_RUNLIST]]<br />
|-<br />
| 0x40180608 || In || 24 || [[#NVSCHED_CTRL_UPDATE_RUNLIST]]<br />
|-<br />
| 0x40100609 || In || 16 || [[#NVSCHED_CTRL_LINK_RUNLIST]]<br />
|-<br />
| 0x4010060A || In || 16 || [[#NVSCHED_CTRL_UNLINK_RUNLIST]]<br />
|-<br />
| 0x4008060B || In || 8 || [[#NVSCHED_CTRL_REMOVE_RUNLIST]]<br />
|-<br />
| 0x8001060C || Out || 1 || [[#NVSCHED_CTRL_HAS_OVERRUN_EVENT]]<br />
|-<br />
| 0x8020060D</br>([1.0.0-3.0.0] 0x8010060D) || Out || 32</br>([1.0.0-3.0.0] 16) || [[#NVSCHED_CTRL_GET_NEXT_OVERRUN_EVENT]]<br />
|-<br />
| 0x400C060E || In || 12 || [[#NVSCHED_CTRL_PUT_CONDUCTOR_FLIP_FENCE]]<br />
|-<br />
| 0x4008060F || In || 8 || [[#NVSCHED_CTRL_DETACH_APPLICATION]]<br />
|-<br />
| 0x40100610 || In || 16 || NVSCHED_CTRL_LINK_RUNLIST_EX<br />
|-<br />
| 0x40100611 || In || 16 || NVSCHED_CTRL_UNLINK_RUNLIST_EX<br />
|-<br />
| 0x40010612 || In || 1 || NVSCHED_CTRL_OVERRUN_EVENTS_ON_OFF<br />
|}<br />
<br />
=== NVSCHED_CTRL_ENABLE ===<br />
Enables the scheduler.<br />
<br />
=== NVSCHED_CTRL_DISABLE ===<br />
Disables the scheduler.<br />
<br />
=== NVSCHED_CTRL_ADD_APPLICATION ===<br />
Adds a new application to the scheduler.<br />
<br />
struct {<br />
__in u64 application_id;<br />
__in u64 priority;<br />
__in u64 timeslice;<br />
};<br />
<br />
=== NVSCHED_CTRL_UPDATE_APPLICATION ===<br />
Updates the application parameters in the scheduler.<br />
<br />
struct {<br />
__in u64 application_id;<br />
__in u64 priority;<br />
__in u64 timeslice;<br />
};<br />
<br />
=== NVSCHED_CTRL_REMOVE_APPLICATION ===<br />
Removes the application from the scheduler.<br />
<br />
struct {<br />
__in u64 application_id;<br />
};<br />
<br />
=== NVSCHED_CTRL_GET_ID ===<br />
Returns the ID of the last scheduled object.<br />
<br />
struct {<br />
__out u64 id;<br />
};<br />
<br />
=== NVSCHED_CTRL_ADD_RUNLIST ===<br />
Creates a new runlist and returns it's ID.<br />
<br />
struct {<br />
__out u64 runlist_id;<br />
};<br />
<br />
=== NVSCHED_CTRL_UPDATE_RUNLIST ===<br />
Updates the runlist parameters in the scheduler.<br />
<br />
struct {<br />
__in u64 runlist_id;<br />
__in u64 priority;<br />
__in u64 timeslice;<br />
};<br />
<br />
=== NVSCHED_CTRL_LINK_RUNLIST ===<br />
Links a runlist to a given application in the scheduler.<br />
<br />
struct {<br />
__in u64 runlist_id;<br />
__in u64 application_id;<br />
};<br />
<br />
=== NVSCHED_CTRL_UNLINK_RUNLIST ===<br />
Unlinks a runlist from a given application in the scheduler.<br />
<br />
struct {<br />
__in u64 runlist_id;<br />
__in u64 application_id;<br />
};<br />
<br />
=== NVSCHED_CTRL_REMOVE_RUNLIST ===<br />
Removes the runlist from the scheduler.<br />
<br />
struct {<br />
__in u64 runlist_id;<br />
};<br />
<br />
=== NVSCHED_CTRL_HAS_OVERRUN_EVENT ===<br />
Returns a boolean to tell if the scheduler has an overrun event or not.<br />
<br />
struct {<br />
__out u8 has_overrun;<br />
};<br />
<br />
=== NVSCHED_CTRL_GET_NEXT_OVERRUN_EVENT ===<br />
Returns the overrun event's data from the scheduler.<br />
<br />
struct {<br />
__out u64 runlist_id;<br />
__out u64 debt;<br />
__out u64 unk0; // 3.0.0+ only<br />
__out u64 unk1; // 3.0.0+ only<br />
};<br />
<br />
=== NVSCHED_CTRL_PUT_CONDUCTOR_FLIP_FENCE ===<br />
Installs a fence swap event?<br />
<br />
struct {<br />
__in u32 fence_id;<br />
__in u32 fence_value;<br />
__in u32 swap_interval;<br />
};<br />
<br />
=== NVSCHED_CTRL_DETACH_APPLICATION ===<br />
Places the given application in detached state.<br />
<br />
struct {<br />
__in u64 application_id;<br />
};<br />
<br />
== /dev/nverpt-ctrl ==<br />
Added in firmware version 3.0.0.<br />
<br />
{| class="wikitable" border="1"<br />
! Value || Direction || Size || Description<br />
|-<br />
| 0xC1280701 || Inout || 296 || [[#NVERPT_TELEMETRY_SUBMIT_DATA]]<br />
|-<br />
| 0xCF580702 || Inout || 3928 || [[#NVERPT_TELEMETRY_SUBMIT_DISPLAY_DATA]]<br />
|}<br />
<br />
=== NVERPT_TELEMETRY_SUBMIT_DATA ===<br />
Sends test data for creating a new [[Error_Report_services|Error Report]].<br />
<br />
struct {<br />
__in u64 TestU64;<br />
__in u32 TestU32;<br />
__in u8 padding0[4];<br />
__in s64 TestI64;<br />
__in s32 TestI32;<br />
__in u8 TestString[32];<br />
__in u8 TestU8Array[8];<br />
__in u32 TestU8Array_size;<br />
__in u32 TestU32Array[8];<br />
__in u32 TestU32Array_size;<br />
__in u64 TestU64Array[8];<br />
__in u32 TestU64Array_size;<br />
__in s32 TestI32Array[8];<br />
__in u32 TestI32Array_size;<br />
__in s64 TestI64Array[8];<br />
__in u32 TestI64Array_size;<br />
__in u16 TestU16;<br />
__in u8 TestU8;<br />
__in s16 TestI16;<br />
__in s8 TestI8;<br />
__in u8 padding1[5];<br />
};<br />
<br />
=== NVERPT_TELEMETRY_SUBMIT_DISPLAY_DATA ===<br />
Sends display data for creating a new [[Error_Report_services|Error Report]].<br />
<br />
struct {<br />
__in u32 CodecType;<br />
__in u32 DecodeBuffers;<br />
__in u32 FrameWidth;<br />
__in u32 FrameHeight;<br />
__in u8 ColorPrimaries;<br />
__in u8 TransferCharacteristics;<br />
__in u8 MatrixCoefficients;<br />
__in u8 padding;<br />
__in u32 DisplayWidth;<br />
__in u32 DisplayHeight;<br />
__in u32 DARWidth;<br />
__in u32 DARHeight;<br />
__in u32 ColorFormat;<br />
__in u32 ColorSpace[8];<br />
__in u32 ColorSpace_size;<br />
__in u32 SurfaceLayout[8];<br />
__in u32 SurfaceLayout_size;<br />
__in u8 ErrorString[64]; // must be "Error detected = 0x1000000"<br />
__in u32 VideoDecState;<br />
__in u8 VideoLog[3712];<br />
__in u32 VideoLog_size;<br />
};<br />
<br />
== /dev/nvhost-as-gpu ==<br />
Each fd opened to this device creates an address space. An address space is then later bound with a channel.<br />
<br />
Once a nvgpu channel has been bound to an address space it cannot be unbound. There is no support for allowing an nvgpu channel to change from one address space to another (or from one to none).<br />
<br />
{| class="wikitable" border="1"<br />
! Value || Direction || Size || Description<br />
|-<br />
| 0x40044101 || In || 4 || [[#NVGPU_AS_IOCTL_BIND_CHANNEL]]<br />
|-<br />
| 0xC0184102 || Inout || 24 || [[#NVGPU_AS_IOCTL_ALLOC_SPACE]]<br />
|-<br />
| 0xC0104103 || Inout || 16 || [[#NVGPU_AS_IOCTL_FREE_SPACE]]<br />
|-<br />
| 0xC0184104 || Inout || 24 || [[#NVGPU_AS_IOCTL_MAP_BUFFER]]<br />
|-<br />
| 0xC0084105 || Inout || 8 || [[#NVGPU_AS_IOCTL_UNMAP_BUFFER]]<br />
|-<br />
| 0xC0284106 || Inout || 40 || [[#NVGPU_AS_IOCTL_MODIFY]]<br />
|-<br />
| 0x40104107 || In || 16 || [[#NVGPU_AS_IOCTL_INITIALIZE]]<br />
|-<br />
| 0xC0404108 || Inout || 64 || [[#NVGPU_AS_IOCTL_GET_VA_REGIONS]]<br />
|-<br />
| 0x40284109 || In || 40 || [[#NVGPU_AS_IOCTL_INITIALIZE_EX]]<br />
|-<br />
| 0xC038410A || Inout || 56 || [[#NVGPU_AS_IOCTL_MAP_BUFFER_EX]]<br />
|-<br />
| 0xC0??4114 || Inout || Variable || [[#NVGPU_AS_IOCTL_REMAP]]<br />
|}<br />
<br />
=== NVGPU_AS_IOCTL_BIND_CHANNEL ===<br />
Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 fd;<br />
};<br />
<br />
=== NVGPU_AS_IOCTL_ALLOC_SPACE ===<br />
Reserves pages in the device address space.<br />
<br />
struct {<br />
__in u32 pages;<br />
__in u32 page_size;<br />
__in u32 flags;<br />
u32 pad;<br />
union {<br />
__out u64 offset;<br />
__in u64 align;<br />
};<br />
};<br />
<br />
=== NVGPU_AS_IOCTL_FREE_SPACE ===<br />
Frees pages from the device address space.<br />
<br />
struct {<br />
__in u64 offset;<br />
__in u32 pages;<br />
__in u32 page_size;<br />
};<br />
<br />
=== NVGPU_AS_IOCTL_MAP_BUFFER ===<br />
Maps a memory region in the device address space. Identical to Linux driver pretty much.<br />
<br />
On success, the mapped memory region is locked by having [[SVC#MemoryState]] bit34 set.<br />
<br />
struct {<br />
__in u32 flags; // bit0: fixed_offset, bit2: cacheable<br />
u32 pad;<br />
__in u32 nvmap_handle;<br />
__inout u32 page_size; // 0 means don't care<br />
union {<br />
__out u64 offset;<br />
__in u64 align;<br />
};<br />
};<br />
<br />
=== NVGPU_AS_IOCTL_MODIFY ===<br />
Modifies a memory region in the device address space.<br />
<br />
Unaligned size will cause a [[#Panic]].<br />
<br />
On success, the mapped memory region is locked by having [[SVC#MemoryState]] bit34 set.<br />
<br />
struct {<br />
__in u32 flags; // bit0: fixed_offset, bit2: cacheable<br />
__in u32 kind; // -1 is default<br />
__in u32 nvmap_handle;<br />
__inout u32 page_size; // 0 means don't care<br />
__in u64 buffer_offset;<br />
__in u64 mapping_size;<br />
__inout u64 offset;<br />
};<br />
<br />
=== NVGPU_AS_IOCTL_UNMAP_BUFFER ===<br />
Unmaps a memory region from the device address space.<br />
<br />
struct {<br />
__in u64 offset;<br />
};<br />
<br />
=== NVGPU_AS_IOCTL_INITIALIZE ===<br />
Nintendo's custom implementation of NVGPU_GPU_IOCTL_ALLOC_AS (unavailable).<br />
<br />
struct {<br />
__in u32 big_page_size; // depends on GPU's available_big_page_sizes; 0=default<br />
__in s32 as_fd; // ignored; passes 0<br />
__in u32 flags; // ignored; passes 0<br />
__in u32 reserved; // ignored; passes 0<br />
};<br />
<br />
=== NVGPU_AS_IOCTL_GET_VA_REGIONS ===<br />
Nintendo's custom implementation to get rid of pointer in struct.<br />
<br />
struct va_region {<br />
u64 offset;<br />
u32 page_size;<br />
u32 pad;<br />
u64 pages;<br />
};<br />
<br />
struct {<br />
u64 not_used; // (contained output user ptr on linux, ignored)<br />
__inout u32 bufsize; // forced to 2*sizeof(struct va_region)<br />
u32 pad;<br />
__out struct va_region regions[2];<br />
};<br />
<br />
=== NVGPU_AS_IOCTL_INITIALIZE_EX ===<br />
Nintendo's custom implementation of NVGPU_GPU_IOCTL_ALLOC_AS (unavailable) with extra params.<br />
<br />
struct {<br />
__in u32 big_page_size; // depends on GPU's available_big_page_sizes; 0=default<br />
__in s32 as_fd; // ignored; passes 0<br />
__in u32 flags; // passes 0<br />
__in u32 reserved; // ignored; passes 0<br />
__in u64 unk0;<br />
__in u64 unk1;<br />
__in u64 unk2;<br />
};<br />
<br />
=== NVGPU_AS_IOCTL_MAP_BUFFER_EX ===<br />
Maps a memory region in the device address space with extra params.<br />
<br />
struct {<br />
__in u32 flags; // bit0: fixed_offset, bit2: cacheable<br />
__in u32 kind; // -1 is default<br />
__in u32 nvmap_handle;<br />
__inout u32 page_size; // 0 means don't care<br />
__in u64 buffer_offset;<br />
__in u64 mapping_size;<br />
__inout u64 offset;<br />
__in u64 unk0;<br />
__in u32 unk1;<br />
u32 pad;<br />
};<br />
<br />
=== NVGPU_AS_IOCTL_REMAP ===<br />
Nintendo's custom implementation of address space remapping.<br />
<br />
struct remap_entry {<br />
__in u16 flags; // 0 or 4<br />
__in u16 kind; <br />
__in u32 nvmap_handle;<br />
__in u32 map_offset;<br />
__in u32 gpu_offset; // (alloc_space_offset >> 0x10)<br />
__in u32 pages; // alloc_space_pages<br />
};<br />
<br />
struct {<br />
__in struct remap_entry entries[];<br />
};<br />
<br />
== /dev/nvhost-dbg-gpu ==<br />
Returns [[#Errors|NotSupported]] on Open unless nn::settings::detail::GetDebugModeFlag is set.<br />
<br />
{| class="wikitable" border="1"<br />
! Value || Direction || Size || Description<br />
|-<br />
| 0x40084401 || In || 8 || NVGPU_DBG_GPU_IOCTL_BIND_CHANNEL<br />
|-<br />
| 0xC0??4402 || Inout || Variable || NVGPU_DBG_GPU_IOCTL_REG_OPS<br />
|-<br />
| 0x40084403 || In || 8 || NVGPU_DBG_GPU_IOCTL_EVENTS_CTRL<br />
|-<br />
| 0x40044404 || In || 4 || NVGPU_DBG_GPU_IOCTL_POWERGATE<br />
|-<br />
| 0x40044405 || In || 4 || NVGPU_DBG_GPU_IOCTL_SMPC_CTXSW_MODE<br />
|-<br />
| 0x40044406 || In || 4 || NVGPU_DBG_GPU_IOCTL_SUSPEND_RESUME_ALL_SMS<br />
|-<br />
| 0xC0184407 || Inout || 24 || NVGPU_DBG_GPU_IOCTL_PERFBUF_MAP<br />
|-<br />
| 0x40084408 || In || 8 || NVGPU_DBG_GPU_IOCTL_PERFBUF_UNMAP<br />
|-<br />
| 0x40084409 || In || 8 || NVGPU_DBG_GPU_IOCTL_PC_SAMPLING<br />
|-<br />
| 0x4008440A || In || 8 || NVGPU_DBG_GPU_IOCTL_TIMEOUT<br />
|-<br />
| 0x8008440B || Out || 8 || NVGPU_DBG_GPU_IOCTL_GET_TIMEOUT<br />
|-<br />
| 0x8004440C || Out || 4 || NVGPU_DBG_GPU_IOCTL_GET_GR_CONTEXT_SIZE<br />
|-<br />
| 0x0000440D || None || 0 || [[#NVGPU_DBG_GPU_IOCTL_GET_GR_CONTEXT]]<br />
|-<br />
| 0xC018440F || Inout || 24 || NVGPU_DBG_GPU_IOCTL_GET_GPU_VA_RANGE_NUM_PDES<br />
|-<br />
| 0xC0104410 || Inout || 16 || [[#NVGPU_DBG_GPU_IOCTL_GET_GPU_VA_RANGE_PDES]]<br />
|-<br />
| 0xC0184411 || Inout || 24 || NVGPU_DBG_GPU_IOCTL_GET_GPU_VA_RANGE_NUM_PTES<br />
|-<br />
| 0xC0104412 || Inout || 16 || [[#NVGPU_DBG_GPU_IOCTL_GET_GPU_VA_RANGE_PTES]]<br />
|-<br />
| 0xC0684413 || Inout || 104 || NVGPU_DBG_GPU_IOCTL_GET_COMPTAG_INFO<br />
|-<br />
| 0xC0184414 || Inout || 24 || [[#NVGPU_DBG_GPU_IOCTL_READ_COMPTAGS]]<br />
|-<br />
| 0xC0184415 || Inout || 24 || [[#NVGPU_DBG_GPU_IOCTL_WRITE_COMPTAGS]]<br />
|-<br />
| 0xC0104416 || Inout || 16 || NVGPU_DBG_GPU_IOCTL_RESERVE_COMPTAGS<br />
|-<br />
| 0xC0104417 || Inout || 16 || NVGPU_DBG_GPU_IOCTL_FREE_RESERVED_COMPTAGS<br />
|-<br />
| 0xC0104418 || Inout || 16 || NVGPU_DBG_GPU_IOCTL_RESERVE_PA<br />
|-<br />
| 0xC0104419 || Inout || 16 || NVGPU_DBG_GPU_IOCTL_FREE_RESERVED_PA<br />
|-<br />
| 0xC018441A || Inout || 24 || NVGPU_DBG_GPU_IOCTL_LAZY_ALLOC_RESERVED_PA<br />
|}<br />
<br />
=== NVGPU_DBG_GPU_IOCTL_GET_GR_CONTEXT ===<br />
Uses [[#Ioctl3|Ioctl3]].<br />
<br />
=== NVGPU_DBG_GPU_IOCTL_GET_GPU_VA_RANGE_PDES ===<br />
Uses [[#Ioctl3|Ioctl3]].<br />
<br />
=== NVGPU_DBG_GPU_IOCTL_GET_GPU_VA_RANGE_PTES ===<br />
Uses [[#Ioctl3|Ioctl3]].<br />
<br />
=== NVGPU_DBG_GPU_IOCTL_READ_COMPTAGS ===<br />
Uses [[#Ioctl3|Ioctl3]].<br />
<br />
=== NVGPU_DBG_GPU_IOCTL_WRITE_COMPTAGS ===<br />
Uses [[#Ioctl2|Ioctl2]].<br />
<br />
== /dev/nvhost-prof-gpu ==<br />
Returns [[#Errors|NotSupported]] on Open unless nn::settings::detail::GetDebugModeFlag is set.<br />
<br />
This device is identical to [[#/dev/nvhost-dbg-gpu|/dev/nvhost-dbg-gpu]].<br />
<br />
== /dev/nvhost-ctrl-gpu ==<br />
This device is for global (context independent) operations on the gpu. <br />
<br />
{| class="wikitable" border="1"<br />
! Value || Direction || Size || Description<br />
|-<br />
| 0x80044701 || Out || 4 || [[#NVGPU_GPU_IOCTL_ZCULL_GET_CTX_SIZE]]<br />
|-<br />
| 0x80284702 || Out || 40 || [[#NVGPU_GPU_IOCTL_ZCULL_GET_INFO]]<br />
|-<br />
| 0x402C4703 || In || 44 || [[#NVGPU_GPU_IOCTL_ZBC_SET_TABLE]]<br />
|-<br />
| 0xC0344704 || Inout || 52 || [[#NVGPU_GPU_IOCTL_ZBC_QUERY_TABLE]]<br />
|-<br />
| 0xC0B04705 || Inout || 176 || [[#NVGPU_GPU_IOCTL_GET_CHARACTERISTICS]]<br />
|-<br />
| 0xC0184706 || Inout || 24 || [[#NVGPU_GPU_IOCTL_GET_TPC_MASKS]]<br />
|-<br />
| 0x40084707 || In || 8 || [[#NVGPU_GPU_IOCTL_FLUSH_L2]]<br />
|-<br />
| 0x4008470D || In || 8 || [[#NVGPU_GPU_IOCTL_INVAL_ICACHE]]<br />
|-<br />
| 0x4008470E || In || 8 || [[#NVGPU_GPU_IOCTL_SET_MMU_DEBUG_MODE]]<br />
|-<br />
| 0x4010470F || In || 16 || [[#NVGPU_GPU_IOCTL_SET_SM_DEBUG_MODE]]<br />
|-<br />
| 0xC0304710</br>([1.0.0-6.1.0] 0xC0084710) || Inout || 48</br>([1.0.0-6.1.0] 8) || [[#NVGPU_GPU_IOCTL_WAIT_FOR_PAUSE]]<br />
|-<br />
| 0x80084711 || Out || 8 || [[#NVGPU_GPU_IOCTL_GET_TPC_EXCEPTION_EN_STATUS]]<br />
|-<br />
| 0x80084712 || Out || 8 || [[#NVGPU_GPU_IOCTL_NUM_VSMS]]<br />
|-<br />
| 0xC0044713 || Inout || 4 || [[#NVGPU_GPU_IOCTL_VSMS_MAPPING]]<br />
|-<br />
| 0x80084714 || Out || 8 || [[#NVGPU_GPU_IOCTL_ZBC_GET_ACTIVE_SLOT_MASK]]<br />
|-<br />
| 0x80044715 || Out || 4 || [[#NVGPU_GPU_IOCTL_PMU_GET_GPU_LOAD]]<br />
|-<br />
| 0x40084716 || In || 8 || [[#NVGPU_GPU_IOCTL_SET_CG_CONTROLS]]<br />
|-<br />
| 0xC0084717 || Inout || 8 || [[#NVGPU_GPU_IOCTL_GET_CG_CONTROLS]]<br />
|-<br />
| 0x40084718 || In || 8 || [[#NVGPU_GPU_IOCTL_SET_PG_CONTROLS]]<br />
|-<br />
| 0xC0084719 || Inout || 8 || [[#NVGPU_GPU_IOCTL_GET_PG_CONTROLS]]<br />
|-<br />
| 0x8018471A || Out || 24 || [[#NVGPU_GPU_IOCTL_PMU_GET_ELPG_RESIDENCY_GATING]]<br />
|-<br />
| 0xC008471B || Inout || 8 || [[#NVGPU_GPU_IOCTL_GET_ERROR_CHANNEL_USER_DATA]]<br />
|-<br />
| 0xC010471C || Inout || 16 || [[#NVGPU_GPU_IOCTL_GET_GPU_TIME]]<br />
|-<br />
| 0xC108471D || Inout || 264 || [[#NVGPU_GPU_IOCTL_GET_CPU_TIME_CORRELATION_INFO]]<br />
|}<br />
<br />
=== NVGPU_GPU_IOCTL_ZCULL_GET_CTX_SIZE ===<br />
Returns the GPU's ZCULL context size. Identical to Linux driver.<br />
<br />
struct {<br />
__out u32 size;<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_ZCULL_GET_INFO ===<br />
Returns GPU's ZCULL information. Identical to Linux driver.<br />
<br />
struct {<br />
__out u32 width_align_pixels;<br />
__out u32 height_align_pixels;<br />
__out u32 pixel_squares_by_aliquots;<br />
__out u32 aliquot_total;<br />
__out u32 region_byte_multiplier;<br />
__out u32 region_header_size;<br />
__out u32 subregion_header_size;<br />
__out u32 subregion_width_align_pixels;<br />
__out u32 subregion_height_align_pixels;<br />
__out u32 subregion_count;<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_ZBC_SET_TABLE ===<br />
Sets the active ZBC table. Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 color_ds[4];<br />
__in u32 color_l2[4];<br />
__in u32 depth;<br />
__in u32 format;<br />
__in u32 type; // 1=color, 2=depth<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_ZBC_QUERY_TABLE ===<br />
Queries the active ZBC table. Identical to Linux driver.<br />
<br />
struct {<br />
__out u32 color_ds[4];<br />
__out u32 color_l2[4];<br />
__out u32 depth;<br />
__out u32 ref_cnt;<br />
__out u32 format;<br />
__out u32 type;<br />
__inout u32 index_size;<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_GET_CHARACTERISTICS ===<br />
Returns the GPU characteristics. Modified to return inline data instead of using a pointer.<br />
<br />
[3.0.0+] Uses either [[#Ioctl|Ioctl]] or [[#Ioctl3|Ioctl3]].<br />
<br />
struct gpu_characteristics {<br />
u32 arch; // 0x120 (NVGPU_GPU_ARCH_GM200)<br />
u32 impl; // 0xB (NVGPU_GPU_IMPL_GM20B) or 0xE (NVGPU_GPU_IMPL_GM20B_B)<br />
u32 rev; // 0xA1 (Revision A1)<br />
u32 num_gpc; // 0x1<br />
u64 l2_cache_size; // 0x40000<br />
u64 on_board_video_memory_size; // 0x0 (not used)<br />
u32 num_tpc_per_gpc; // 0x2<br />
u32 bus_type; // 0x20 (NVGPU_GPU_BUS_TYPE_AXI)<br />
u32 big_page_size; // 0x20000<br />
u32 compression_page_size; // 0x20000<br />
u32 pde_coverage_bit_count; // 0x1B<br />
u32 available_big_page_sizes; // 0x30000<br />
u32 gpc_mask; // 0x1<br />
u32 sm_arch_sm_version; // 0x503 (Maxwell Generation 5.0.3)<br />
u32 sm_arch_spa_version; // 0x503 (Maxwell Generation 5.0.3)<br />
u32 sm_arch_warp_count; // 0x80<br />
u32 gpu_va_bit_count; // 0x28<br />
u32 reserved; // NULL<br />
u64 flags; // 0x55 (HAS_SYNCPOINTS | SUPPORT_SPARSE_ALLOCS | SUPPORT_CYCLE_STATS | SUPPORT_CYCLE_STATS_SNAPSHOT)<br />
u32 twod_class; // 0x902D (FERMI_TWOD_A)<br />
u32 threed_class; // 0xB197 (MAXWELL_B)<br />
u32 compute_class; // 0xB1C0 (MAXWELL_COMPUTE_B)<br />
u32 gpfifo_class; // 0xB06F (MAXWELL_CHANNEL_GPFIFO_A)<br />
u32 inline_to_memory_class; // 0xA140 (KEPLER_INLINE_TO_MEMORY_B)<br />
u32 dma_copy_class; // 0xB0B5 (MAXWELL_DMA_COPY_A)<br />
u32 max_fbps_count; // 0x1<br />
u32 fbp_en_mask; // 0x0 (disabled)<br />
u32 max_ltc_per_fbp; // 0x2<br />
u32 max_lts_per_ltc; // 0x1<br />
u32 max_tex_per_tpc; // 0x0 (not supported)<br />
u32 max_gpc_count; // 0x1<br />
u32 rop_l2_en_mask_0; // 0x21D70 (fuse_status_opt_rop_l2_fbp_r)<br />
u32 rop_l2_en_mask_1; // 0x0<br />
u64 chipname; // 0x6230326D67 ("gm20b")<br />
u64 gr_compbit_store_base_hw; // 0x0 (not supported)<br />
};<br />
<br />
struct {<br />
__inout u64 gpu_characteristics_buf_size; // must not be NULL, but gets overwritten with 0xA0=max_size<br />
__in u64 gpu_characteristics_buf_addr; // ignored, but must not be NULL<br />
__out struct gpu_characteristics gc;<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_GET_TPC_MASKS ===<br />
Returns the TPC mask value for each GPC. Modified to return inline data instead of using a pointer.<br />
<br />
[3.0.0+] Uses either [[#Ioctl|Ioctl]] or [[#Ioctl3|Ioctl3]].<br />
<br />
struct {<br />
__in u32 mask_buf_size; // ignored, but must not be NULL<br />
__in u32 reserved[3];<br />
__out u64 mask_buf; // receives one 32-bit TPC mask per GPC (GPC 0 and GPC 1)<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_FLUSH_L2 ===<br />
Flushes the GPU L2 cache.<br />
<br />
struct {<br />
__in u32 flush; // l2_flush | l2_invalidate << 1 | fb_flush << 2<br />
__in u32 reserved;<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_INVAL_ICACHE ===<br />
Invalidates the GPU instruction cache. Identical to Linux driver.<br />
<br />
struct {<br />
__in s32 channel_fd;<br />
__in u32 reserved;<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_SET_MMU_DEBUG_MODE ===<br />
Sets the GPU MMU debug mode. Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 state;<br />
__in u32 reserved;<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_SET_SM_DEBUG_MODE ===<br />
Sets the GPU SM debug mode. Identical to Linux driver.<br />
<br />
struct {<br />
__in s32 channel_fd;<br />
__in u32 enable;<br />
__in u64 sms;<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_WAIT_FOR_PAUSE ===<br />
Waits until all valid warps on the GPU SM are paused and returns their current state.<br />
<br />
struct {<br />
__in u64 pwarpstate;<br />
};<br />
<br />
[6.1.0+] This command was modified to return inline data instead of using a pointer.<br />
<br />
struct {<br />
__out u64 sm0_valid_warps;<br />
__out u64 sm0_trapped_warps;<br />
__out u64 sm0_paused_warps;<br />
__out u64 sm1_valid_warps;<br />
__out u64 sm1_trapped_warps;<br />
__out u64 sm1_paused_warps;<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_GET_TPC_EXCEPTION_EN_STATUS ===<br />
Returns a mask value describing all active TPC exceptions. Identical to Linux driver.<br />
<br />
struct {<br />
__out u64 tpc_exception_en_sm_mask;<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_NUM_VSMS ===<br />
Returns the number of GPU SM units present. Identical to Linux driver.<br />
<br />
struct {<br />
__out u32 num_vsms;<br />
__out u32 reserved;<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_VSMS_MAPPING ===<br />
Returns mapping information on each GPU SM unit. Modified to return inline data instead of using a pointer.<br />
<br />
struct {<br />
__out u8 sm0_gpc_index;<br />
__out u8 sm0_tpc_index;<br />
__out u8 sm1_gpc_index;<br />
__out u8 sm1_tpc_index;<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_ZBC_GET_ACTIVE_SLOT_MASK ===<br />
Returns the mask value for a ZBC slot.<br />
<br />
struct {<br />
__out u32 slot; // always 0x07<br />
__out u32 mask;<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_PMU_GET_GPU_LOAD ===<br />
Returns the GPU load value from the PMU.<br />
<br />
struct {<br />
__out u32 pmu_gpu_load;<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_SET_CG_CONTROLS ===<br />
Sets the clock gate control value.<br />
<br />
struct {<br />
__in u32 cg_mask;<br />
__in u32 cg_value;<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_GET_CG_CONTROLS ===<br />
Returns the clock gate control value.<br />
<br />
struct {<br />
__in u32 cg_mask;<br />
__out u32 cg_value;<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_SET_PG_CONTROLS ===<br />
Sets the power gate control value.<br />
<br />
struct {<br />
__in u32 pg_mask;<br />
__in u32 pg_value;<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_GET_PG_CONTROLS ===<br />
Returns the power gate control value.<br />
<br />
struct {<br />
__in u32 pg_mask;<br />
__out u32 pg_value;<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_PMU_GET_ELPG_RESIDENCY_GATING ===<br />
Returns the GPU PMU ELPG residency gating values.<br />
<br />
struct {<br />
__out u64 pg_ingating_time_us;<br />
__out u64 pg_ungating_time_us;<br />
__out u64 pg_gating_cnt;<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_GET_ERROR_CHANNEL_USER_DATA ===<br />
Returns user specific data from the error channel, if one exists.<br />
<br />
struct {<br />
__out u64 data;<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_GET_GPU_TIME ===<br />
Returns the timestamp from the GPU's nanosecond timer (PTIMER). Identical to Linux driver.<br />
<br />
struct {<br />
__out u64 gpu_timestamp; // raw GPU counter (PTIMER) value<br />
__out u64 reserved;<br />
};<br />
<br />
=== NVGPU_GPU_IOCTL_GET_CPU_TIME_CORRELATION_INFO ===<br />
Returns CPU/GPU timestamp pairs for correlation analysis. Identical to Linux driver.<br />
<br />
struct time_correlation_sample {<br />
u64 cpu_timestamp; // from CPU's CNTPCT_EL0 register<br />
u64 gpu_timestamp; // from GPU's PTIMER registers<br />
};<br />
<br />
struct {<br />
__out struct time_correlation_sample samples[16]; // timestamp pairs<br />
__in u32 count; // number of pairs to read<br />
__in u32 source_id; // cpu clock source id (must be 1)<br />
};<br />
<br />
== Channels ==<br />
Channels are a concept for NVIDIA hardware blocks that share a common interface.<br />
<br />
{| class="wikitable" border="1"<br />
! Path || Name<br />
|-<br />
| /dev/nvhost-gpu || GPU<br />
|-<br />
| /dev/nvhost-msenc || Video Encoder<br />
|-<br />
| /dev/nvhost-nvdec || Video Decoder<br />
|-<br />
| /dev/nvhost-nvjpg || JPEG Decoder<br />
|-<br />
| /dev/nvhost-vic || Video Image Compositor<br />
|-<br />
| /dev/nvhost-display || Display<br />
|}<br />
<br />
== Channel Ioctls ==<br />
{| class="wikitable" border="1"<br />
! Value || Size || Description<br />
|-<br />
| 0xC0??0001 || Variable || NVHOST_IOCTL_CHANNEL_SUBMIT<br />
|-<br />
| 0xC0080002 || 8 || [[#NVHOST_IOCTL_CHANNEL_GET_SYNCPOINT]]<br />
|-<br />
| 0xC0080003 || 8 || [[#NVHOST_IOCTL_CHANNEL_GET_WAITBASE]]<br />
|-<br />
| 0xC0080004 || 8 || [[#NVHOST_IOCTL_CHANNEL_GET_MODMUTEX]]<br />
|-<br />
| 0x40040007 || 4 || [[#NVHOST_IOCTL_CHANNEL_SET_SUBMIT_TIMEOUT]]<br />
|-<br />
| 0x40080008 || 8 || [[#NVHOST_IOCTL_CHANNEL_SET_CLK_RATE]]<br />
|-<br />
| 0xC0??0009 || Variable || [[#NVHOST_IOCTL_CHANNEL_MAP_CMD_BUFFER]]<br />
|-<br />
| 0xC0??000A || Variable || [[#NVHOST_IOCTL_CHANNEL_UNMAP_CMD_BUFFER]]<br />
|-<br />
| 0x00000013 || 0 || [[#NVHOST_IOCTL_CHANNEL_SET_TIMEOUT_EX]]<br />
|-<br />
| 0xC0080023</br>([1.0.0-7.0.1] 0xC0080014) || 8 || [[#NVHOST_IOCTL_CHANNEL_GET_CLK_RATE]]<br />
|-<br />
| 0xC0??0024 || Variable || NVHOST_IOCTL_CHANNEL_SUBMIT_EX<br />
|-<br />
| 0xC0??0025 || Variable || [[#NVHOST_IOCTL_CHANNEL_MAP_CMD_BUFFER_EX]]<br />
|-<br />
| 0xC0??0026 || Variable || [[#NVHOST_IOCTL_CHANNEL_UNMAP_CMD_BUFFER_EX]]<br />
|- style="border-top: double"<br />
| 0x40044801 || 4 || [[#NVGPU_IOCTL_CHANNEL_SET_NVMAP_FD]]<br />
|-<br />
| 0x40044803 || 4 || [[#NVGPU_IOCTL_CHANNEL_SET_TIMEOUT]]<br />
|-<br />
| 0x40084805 || 8 || [[#NVGPU_IOCTL_CHANNEL_ALLOC_GPFIFO]]<br />
|-<br />
| 0x40184806 || 24 || [[#NVGPU_IOCTL_CHANNEL_WAIT]]<br />
|-<br />
| 0xC0044807 || 4 || [[#NVGPU_IOCTL_CHANNEL_CYCLE_STATS]]<br />
|-<br />
| 0xC0??4808 || Variable || [[#NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO]]<br />
|-<br />
| 0xC0104809 || 16 || [[#NVGPU_IOCTL_CHANNEL_ALLOC_OBJ_CTX]]<br />
|-<br />
| 0x4008480A || 8 || [[#NVHOST_IOCTL_CHANNEL_FREE_OBJ_CTX]]<br />
|-<br />
| 0xC010480B || 16 || [[#NVGPU_IOCTL_CHANNEL_ZCULL_BIND]]<br />
|-<br />
| 0xC018480C || 24 || [[#NVGPU_IOCTL_CHANNEL_SET_ERROR_NOTIFIER]]<br />
|-<br />
| 0x4004480D || 4 || [[#NVGPU_IOCTL_CHANNEL_SET_PRIORITY]]<br />
|-<br />
| 0x0000480E || 0 || [[#NVGPU_IOCTL_CHANNEL_ENABLE]]<br />
|-<br />
| 0x0000480F || 0 || [[#NVGPU_IOCTL_CHANNEL_DISABLE]]<br />
|-<br />
| 0x00004810 || 0 || [[#NVGPU_IOCTL_CHANNEL_PREEMPT]]<br />
|-<br />
| 0x00004811 || 0 || [[#NVGPU_IOCTL_CHANNEL_FORCE_RESET]]<br />
|-<br />
| 0x40084812 || 8 || [[#NVGPU_IOCTL_CHANNEL_EVENT_ID_CONTROL]]<br />
|-<br />
| 0xC0104813 || 16 || [[#NVGPU_IOCTL_CHANNEL_CYCLE_STATS_SNAPSHOT]]<br />
|-<br />
| 0x80804816 || 128 || [[#NVGPU_IOCTL_CHANNEL_GET_ERROR_INFO]]<br />
|-<br />
| 0xC0104817 || 16 || [[#NVGPU_IOCTL_CHANNEL_GET_ERROR_NOTIFICATION]]<br />
|-<br />
| 0x40204818 || 32 || [[#NVGPU_IOCTL_CHANNEL_ALLOC_GPFIFO_EX]]<br />
|-<br />
| 0xC0??4819 || Variable || [[#NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO_RETRY]]<br />
|-<br />
| 0xC020481A || 32 || [[#NVGPU_IOCTL_CHANNEL_ALLOC_GPFIFO_EX2]]<br />
|-<br />
| 0xC018481B || 24 || [[#NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO_EX]]<br />
|-<br />
| 0xC018481C || 24 || [[#NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO_RETRY_EX]]<br />
|-<br />
| 0xC004481D || 4 || [[#NVGPU_IOCTL_CHANNEL_SET_TIMESLICE]]<br />
|- style="border-top: double"<br />
| 0x40084714 || 8 || [[#NVGPU_IOCTL_CHANNEL_SET_USER_DATA]]<br />
|-<br />
| 0x80084715 || 8 || [[#NVGPU_IOCTL_CHANNEL_GET_USER_DATA]]<br />
|}<br />
<br />
=== NVHOST_IOCTL_CHANNEL_GET_SYNCPOINT ===<br />
Returns the current syncpoint value for a given module. Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 module_id;<br />
__out u32 syncpt_value;<br />
};<br />
<br />
=== NVHOST_IOCTL_CHANNEL_GET_WAITBASE ===<br />
Returns the current waitbase value for a given module. Always returns 0.<br />
<br />
struct {<br />
__in u32 module_id;<br />
__out u32 waitbase_value;<br />
};<br />
<br />
=== NVHOST_IOCTL_CHANNEL_GET_MODMUTEX ===<br />
Stubbed. Does a debug print and returns 0.<br />
<br />
=== NVHOST_IOCTL_CHANNEL_SET_SUBMIT_TIMEOUT ===<br />
Sets the submit timeout value for the channel. Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 timeout;<br />
};<br />
<br />
=== NVHOST_IOCTL_CHANNEL_SET_CLK_RATE ===<br />
Sets the clock rate value for a given module. Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 clk_rate;<br />
__in u32 module_id;<br />
};<br />
<br />
=== NVHOST_IOCTL_CHANNEL_MAP_CMD_BUFFER ===<br />
Uses '''nvmap_pin''' internally to pin a given number of nvmap handles to an appropriate device physical address.<br />
<br />
struct handle {<br />
u32 handle_id_in; // nvmap handle to map<br />
u32 phys_addr_out; // returned device physical address mapped to the handle<br />
};<br />
<br />
struct {<br />
__in u32 num_handles; // number of nvmap handles to map<br />
__in u32 reserved; // ignored<br />
__in u8 is_compr; // memory to map is compressed<br />
__in u8 padding[3]; // ignored<br />
__inout struct handle handles[]; // depends on num_handles<br />
};<br />
<br />
=== NVHOST_IOCTL_CHANNEL_UNMAP_CMD_BUFFER ===<br />
Uses '''nvmap_unpin''' internally to unpin a given number of nvmap handles from their device physical address.<br />
<br />
struct handle {<br />
u32 handle_id_in; // nvmap handle to unmap<br />
u32 reserved; // ignored<br />
};<br />
<br />
struct {<br />
__in u32 num_handles; // number of nvmap handles to unmap<br />
__in u32 reserved; // ignored<br />
__in u8 is_compr; // memory to unmap is compressed<br />
__in u8 padding[3]; // ignored<br />
__inout struct handle handles[]; // depends on num_handles<br />
};<br />
<br />
=== NVHOST_IOCTL_CHANNEL_SET_TIMEOUT_EX ===<br />
Sets the global timeout value for the channel. Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 timeout;<br />
__in u32 flags;<br />
};<br />
<br />
=== NVHOST_IOCTL_CHANNEL_GET_CLK_RATE ===<br />
Returns the clock rate value for a given module. Identical to Linux driver.<br />
<br />
struct {<br />
__out u32 clk_rate;<br />
__in u32 module_id;<br />
};<br />
<br />
=== NVHOST_IOCTL_CHANNEL_MAP_CMD_BUFFER_EX ===<br />
Same as [[#NVHOST_IOCTL_CHANNEL_MAP_CMD_BUFFER|NVHOST_IOCTL_CHANNEL_MAP_CMD_BUFFER]], but calls '''nvmap_unpin''' internally in case of error.<br />
<br />
=== NVHOST_IOCTL_CHANNEL_UNMAP_CMD_BUFFER_EX ===<br />
Same as [[#NVHOST_IOCTL_CHANNEL_UNMAP_CMD_BUFFER|NVHOST_IOCTL_CHANNEL_UNMAP_CMD_BUFFER]].<br />
<br />
=== NVGPU_IOCTL_CHANNEL_SET_NVMAP_FD ===<br />
Binds a nvmap object to this channel. Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 nvmap_fd;<br />
};<br />
<br />
=== NVGPU_IOCTL_CHANNEL_SET_TIMEOUT ===<br />
Sets the timeout value for the GPU channel. Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 timeout;<br />
};<br />
<br />
=== NVGPU_IOCTL_CHANNEL_ALLOC_GPFIFO ===<br />
Allocates gpfifo entries. Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 num_entries;<br />
__in u32 flags;<br />
};<br />
<br />
=== NVGPU_IOCTL_CHANNEL_WAIT ===<br />
Waits on channel. Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 type; // wait type (0=notifier, 1=semaphore)<br />
__in u32 timeout; // wait timeout value<br />
__in u32 dmabuf_fd; // nvmap handle<br />
__in u32 offset; // nvmap memory offset<br />
__in u32 payload; // payload data (semaphore only)<br />
__in u32 padding; // ignored<br />
};<br />
<br />
=== NVGPU_IOCTL_CHANNEL_CYCLE_STATS ===<br />
Maps memory for the cycle stats buffer. Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 dmabuf_fd; // nvmap handle<br />
};<br />
<br />
=== NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO ===<br />
Submits a gpfifo object. Modified to take inline entry objects instead of a pointer.<br />
<br />
struct fence {<br />
u32 syncpt_id;<br />
u32 syncpt_value;<br />
};<br />
<br />
struct gpfifo_entry {<br />
u64 entry; // gpu_iova | (unk_2bits << 40) | (size << 42) | (unk_flag << 63)<br />
};<br />
<br />
struct {<br />
__in u64 gpfifo; // (ignored) pointer to gpfifo fence structs<br />
__in u32 num_entries; // number of fence objects being submitted<br />
__in u32 flags;<br />
__inout struct fence fence_out; // returned new fence object for others to wait on<br />
__in struct gpfifo_entry entries[]; // depends on num_entries<br />
};<br />
<br />
=== NVGPU_IOCTL_CHANNEL_ALLOC_OBJ_CTX ===<br />
Allocates a graphics context object. Modified to ignore object's ID.<br />
<br />
You can only have one object context allocated at a time. You must have bound an address space before using this.<br />
<br />
struct {<br />
__in u32 class_num; // 0x902D=2d, 0xB197=3d, 0xB1C0=compute, 0xA140=kepler, 0xB0B5=DMA, 0xB06F=channel_gpfifo<br />
__in u32 flags; // bit0: LOCKBOOST_ZERO<br />
__out u64 obj_id; // (ignored) used for FREE_OBJ_CTX ioctl, which is not supported<br />
};<br />
<br />
=== NVHOST_IOCTL_CHANNEL_FREE_OBJ_CTX ===<br />
Frees a graphics context object. Not supported.<br />
<br />
struct {<br />
__in u64 obj_id; // ignored<br />
};<br />
<br />
=== NVGPU_IOCTL_CHANNEL_ZCULL_BIND ===<br />
Binds a ZCULL context to the channel. Identical to Linux driver.<br />
<br />
struct {<br />
__in u64 gpu_va;<br />
__in u32 mode; // 0=global, 1=no_ctxsw, 2=separate_buffer, 3=part_of_regular_buf<br />
__in u32 reserved;<br />
};<br />
<br />
=== NVGPU_IOCTL_CHANNEL_SET_ERROR_NOTIFIER ===<br />
Initializes the error notifier for this channel. Unlike for the Linux kernel, the Switch driver cannot write to an arbitrary userspace buffer. Thus new ioctls have been introduced to fetch the error information rather than using a shared memory buffer.<br />
<br />
struct {<br />
__in u64 offset; // ignored<br />
__in u64 size; // ignored<br />
__in u32 mem; // must be non-zero to initialize, zero to de-initialize<br />
__in u32 reserved; // ignored<br />
};<br />
<br />
=== NVGPU_IOCTL_CHANNEL_SET_PRIORITY ===<br />
Changes channel's priority. Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 priority; // 0x32 is low, 0x64 is medium and 0x96 is high<br />
};<br />
<br />
=== NVGPU_IOCTL_CHANNEL_ENABLE ===<br />
Enables the current channel. Identical to Linux driver.<br />
<br />
=== NVGPU_IOCTL_CHANNEL_DISABLE ===<br />
Disables the current channel. Identical to Linux driver.<br />
<br />
=== NVGPU_IOCTL_CHANNEL_PREEMPT ===<br />
Clears the FIFO pipe for this channel. Identical to Linux driver.<br />
<br />
=== NVGPU_IOCTL_CHANNEL_FORCE_RESET ===<br />
Forces the channel to reset. Identical to Linux driver.<br />
<br />
=== NVGPU_IOCTL_CHANNEL_EVENT_ID_CONTROL ===<br />
Controls event notifications.<br />
<br />
struct {<br />
__in u32 cmd; // 0=disable, 1=enable, 2=clear<br />
__in u32 id; // same id's as for [[#QueryEvent]]<br />
};<br />
<br />
=== NVGPU_IOCTL_CHANNEL_CYCLE_STATS_SNAPSHOT ===<br />
Controls the cycle stats snapshot buffer. Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 cmd; // command to handle (0=flush, 1=attach, 2=detach)<br />
__in u32 dmabuf_fd; // nvmap handle<br />
__inout u32 extra; // extra payload data/result<br />
__in u32 padding; // ignored<br />
};<br />
<br />
=== NVGPU_IOCTL_CHANNEL_GET_ERROR_INFO ===<br />
Returns information on the current error notification caught by the error notifier. Exclusive to the Switch.<br />
<br />
struct {<br />
__out u32 error_info[32]; // first word is an error code (0=no_error, 1=gr_error, 2=gr_error, 3=invalid, 4=invalid)<br />
};<br />
<br />
=== NVGPU_IOCTL_CHANNEL_GET_ERROR_NOTIFICATION ===<br />
Returns the current error notification caught by the error notifier. Exclusive to the Switch.<br />
<br />
struct {<br />
__out u64 timestamp; // fetched straight from armGetSystemTick<br />
__out u32 info32; // error code<br />
__out u16 info16; // additional error info<br />
__out u16 status; // always 0xFFFF<br />
};<br />
<br />
=== NVGPU_IOCTL_CHANNEL_ALLOC_GPFIFO_EX ===<br />
Allocates gpfifo entries with additional parameters. Exclusive to the Switch.<br />
<br />
struct fence {<br />
u32 syncpt_id;<br />
u32 syncpt_value;<br />
};<br />
<br />
struct {<br />
__in u32 num_entries;<br />
__in u32 num_jobs;<br />
__in u32 flags;<br />
__out struct fence fence_out; // returned new fence object for others to wait on<br />
__in u32 reserved[3]; // ignored<br />
};<br />
<br />
=== NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO_RETRY ===<br />
Same as [[#NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO|NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO]].<br />
<br />
=== NVGPU_IOCTL_CHANNEL_ALLOC_GPFIFO_EX2 ===<br />
Same as [[#NVGPU_IOCTL_CHANNEL_ALLOC_GPFIFO_EX|NVGPU_IOCTL_CHANNEL_ALLOC_GPFIFO_EX]].<br />
<br />
=== NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO_EX ===<br />
Same as [[#NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO|NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO]], but uses [[#Ioctl2|Ioctl2]].<br />
<br />
=== NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO_RETRY_EX ===<br />
Same as [[#NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO_RETRY|NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO_RETRY]], but uses [[#Ioctl2|Ioctl2]].<br />
<br />
=== NVGPU_IOCTL_CHANNEL_SET_TIMESLICE ===<br />
Changes channel's timeslice. Identical to Linux driver.<br />
<br />
struct {<br />
__in u32 timeslice;<br />
};<br />
<br />
=== NVGPU_IOCTL_CHANNEL_SET_USER_DATA ===<br />
Sets user specific data.<br />
<br />
struct {<br />
__in u64 data;<br />
};<br />
<br />
=== NVGPU_IOCTL_CHANNEL_GET_USER_DATA ===<br />
Returns user specific data.<br />
<br />
struct {<br />
__out u64 data;<br />
};<br />
<br />
= nvmemp =<br />
NVIDIA memory profiler (this service is not available on retail units). <br />
/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 application attempts to use nvmemp.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || Open<br />
|-<br />
| 1 || GetAruid<br />
|}<br />
<br />
= nvdrvdbg =<br />
This is "nns::nvdrv::INvDrvDebugFSServices".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#OpenDebugFS]]<br />
|-<br />
| 1 || [[#CloseDebugFS]]<br />
|-<br />
| 2 || [[#GetDebugFSKeys]]<br />
|-<br />
| 3 || GetDebugFSValue<br />
|-<br />
| 4 || SetDebugFSValue<br />
|}<br />
<br />
== OpenDebugFS ==<br />
Takes a process handle. Returns a u32 '''fd'''.<br />
<br />
== CloseDebugFS ==<br />
Takes a u32 '''fd''' and closes it.<br />
<br />
== GetDebugFSKeys ==<br />
Takes a u32 '''fd''' and reads debug contents into a type-6 buffer.<br />
<br />
= nvgem:c =<br />
This is "nv::gemcontrol::INvGemControl".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || Initialize<br />
|-<br />
| 1 || GetGemEvent<br />
|-<br />
| 2 || <br />
|-<br />
| 3 || RegisterUnregisterAppIdLocked<br />
|-<br />
| 4 ||<br />
|-<br />
| [1.0.0-4.1.0] 5 || GetAruid<br />
|-<br />
| 6 || HandleDeferredErrors<br />
|-<br />
| 7 || [3.0.0+]<br />
|}<br />
<br />
= nvgem:cd =<br />
This is "nv::gemcoredump::INvGemCoreDump".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || Initialize<br />
|-<br />
| 1 || GetAruid<br />
|-<br />
| [1.0.0-8.1.0] 2 || ReadNextCdBlock<br />
|-<br />
| 3 || [8.0.0+]<br />
|-<br />
| 4 || [8.0.0+]<br />
|}<br />
<br />
= Errors =<br />
Most nvidia driver commands return an error code apart from the normal return code.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || Success<br />
|-<br />
| 1 || NotImplemented<br />
|-<br />
| 2 || NotSupported<br />
|-<br />
| 3 || NotInitialized<br />
|-<br />
| 4 || BadParameter<br />
|-<br />
| 5 || Timeout<br />
|-<br />
| 6 || InsufficientMemory<br />
|-<br />
| 7 || ReadOnlyAttribute<br />
|-<br />
| 8 || InvalidState<br />
|-<br />
| 9 || InvalidAddress<br />
|-<br />
| 0xA || InvalidSize<br />
|-<br />
| 0xB || BadValue<br />
|-<br />
| 0xD || AlreadyAllocated<br />
|-<br />
| 0xE || Busy<br />
|-<br />
| 0xF || ResourceError<br />
|-<br />
| 0x10 || CountMismatch<br />
|-<br />
| 0x1000 || SharedMemoryTooSmall<br />
|-<br />
| 0x30003 || FileOperationFailed<br />
|-<br />
| 0x30004 || DirOperationFailed<br />
|-<br />
| 0x3000F || IoctlFailed <br />
|-<br />
| 0x30010 || AccessDenied<br />
|-<br />
| 0x30013 || FileNotFound<br />
|-<br />
| 0xA000E || ModuleNotPresent<br />
|}<br />
<br />
= Panic =<br />
In some cases, a panic may occur. NV forces a crash by doing:<br />
(void *)0 = 0xCAFE;<br />
End result is that the system hangs with a white-screen.<br />
<br />
== Gpfifo Panic ==<br />
When the gpfifo data in the gpu_va buffers specified by the submitted gpfifo entries is invalid(?), eventually the user-process will be force-terminated after using the submit-gpfifo ioctl. It's unknown how exactly this is done.<br />
<br />
[[Category:Services]]</div>
Thog
https://switchbrew.org/w/index.php?title=PSC_services&diff=8059
PSC services
2019-10-03T20:43:02Z
<p>Thog: Document a bit more of time 9.0.0</p>
<hr />
<div>PSC (Power State Control) provides services related to power state changes in the system.<br />
<br />
= Concept =<br />
psc:m allows a process to register a module that depends on power management in some way. A client calls GetPmModule to receive an IPmModule (Power Managed Module), and then calls IPmModule->Initialize(module_id, module_dependency_list) where module_id is the ModuleId enum member for the client, and the dependency list is an array of module IDs for the modules that this depends on. Initialize() returns an event handle that the client can wait on to be notified of a power state change.<br />
<br />
psc:c allows a module to the power state controller for the system (in practice, AM is the only client to the controller). IPmControl->DispatchRequest() is used notify all IPmModules of a state change.<br />
<br />
For example, FS registers itself as an IPmModule with dependencies on pinmux, gpio, pcv, tma, and initializes the SD card once those dependencies have registered.. <br />
<br />
It then does (basically) the following pseudocode (actual code located at .text + 0xB2DB0 in 6.0.0 FS):<br />
<br />
while (true) {<br />
Fs_IPmModule->WaitSignaled();<br />
<br />
Fs_IPmModule->GetRequest(&state);<br />
switch (state) {<br />
case WakingUp:<br />
/* hardware devices are woken up here */<br />
case GoingToSleep:<br />
/* hardware devices are put to sleep here */<br />
case ShuttingDown:<br />
/* hardware devices are turned off here */<br />
}<br />
<br />
Fs_IPmModule->Acknowledge(state);<br />
}<br />
<br />
= psc:c =<br />
This is "nn::psc::sf::IPmControl".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || Initialize<br />
|-<br />
| 1 || DispatchRequest<br />
|-<br />
| 2 || GetResult<br />
|-<br />
| 3 || GetState<br />
|-<br />
| 4 || Cancel<br />
|-<br />
| 5 || [1.0.0-6.2.0] PrintModuleInformation<br />
|-<br />
| 6 || GetModuleInformation<br />
|-<br />
| 10 || [9.0.0+]<br />
|-<br />
| 11 || [9.0.0+]<br />
|}<br />
<br />
= psc:m =<br />
This is "nn::psc::sf::IPmService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetPmModule || Returns an [[#IPmModule]].<br />
|}<br />
<br />
== IPmModule ==<br />
This is "nn::psc::sf::IPmModule".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || Initialize<br />
|-<br />
| 1 || GetRequest<br />
|-<br />
| 2 || Acknowledge<br />
|-<br />
| 3 || Finalize<br />
|-<br />
| 4 || [5.1.0+] AcknowledgeEx<br />
|}<br />
<br />
= psc:l =<br />
This was added with [9.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 ||<br />
|-<br />
| 1 ||<br />
|-<br />
| 2 ||<br />
|-<br />
| 3 ||<br />
|-<br />
| 4 ||<br />
|}<br />
<br />
= srepo:u, srepo:a =<br />
These are "nn::srepo::detail::ipc::ISrepoService".<br />
<br />
These were added with [5.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 10100 ||<br />
|-<br />
| 10101 || [6.0.0+]<br />
|-<br />
| 10200 || [6.0.0+]<br />
|-<br />
| 10201 || [6.0.0+]<br />
|-<br />
| 11000 || [6.0.0+]<br />
|-<br />
| 11001 || [6.0.0+]<br />
|-<br />
| 11002 || [6.0.0+]<br />
|-<br />
| 11003 || [6.0.0+]<br />
|-<br />
| 11004 || [6.0.0+]<br />
|-<br />
| 11100 || [6.0.0+]<br />
|-<br />
| 11200 || [6.0.0+]<br />
|-<br />
| 11300 || [6.0.0+]<br />
|-<br />
| 11400 || [6.0.0+]<br />
|-<br />
| 11500 || [6.0.0+]<br />
|-<br />
| 11600 || [6.0.0+]<br />
|-<br />
| 11601 || [6.0.0+]<br />
|-<br />
| 11602 || [6.0.0+]<br />
|-<br />
| 11700 || [6.0.0+]<br />
|-<br />
| 11800 || [6.0.0+]<br />
|-<br />
| 11801 || [6.0.0+]<br />
|-<br />
| 11810 || [8.0.0+]<br />
|-<br />
| 11811 || [8.0.0+]<br />
|-<br />
| 12000 || [8.0.0+]<br />
|-<br />
| 12001 || [8.0.0+]<br />
|-<br />
| 13000 || [8.0.0+]<br />
|-<br />
| 13001 || [8.0.0+]<br />
|-<br />
| 20100 ||<br />
|-<br />
| 20200 ||<br />
|-<br />
| 20300 || [6.0.0+]<br />
|-<br />
| 20400 || [6.0.0+]<br />
|-<br />
| 20401 || [6.0.0+]<br />
|-<br />
| 20402 || [7.0.0+]<br />
|-<br />
| 20500 || [8.0.0+]<br />
|}<br />
<br />
== Cmd13000 ==<br />
Takes a type-0x5 input buffer, no output.<br />
<br />
[9.0.0+] No input, returns a total of 0xC-bytes of output, an [[#IUnknown0]], and a handle.<br />
<br />
== IUnknown0 ==<br />
Added with [9.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || <br />
|}<br />
<br />
Cmd0: no input, returns a total of 8-bytes of output.<br />
<br />
= ovln:rcv =<br />
This is "nn::ovln::IReceiverService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || OpenReceiver<br />
|}<br />
<br />
== IReceiver ==<br />
This is "nn::ovln::IReceiver".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || AddSource<br />
|-<br />
| 1 || RemoveSource<br />
|-<br />
| 2 || GetReceiveEventHandle<br />
|-<br />
| 3 || Receive<br />
|-<br />
| 4 || ReceiveWithTick<br />
|}<br />
<br />
= ovln:snd =<br />
This is "nn::ovln::ISenderService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || OpenSender<br />
|}<br />
<br />
== ISender ==<br />
This is "nn::ovln::ISender".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || Send<br />
|-<br />
| 1 || GetUnreceivedMessageCount<br />
|}<br />
<br />
= time:m =<br />
This is "nn::timesrv::detail::service::ITimeServiceManager".<br />
<br />
This was added with [9.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#GetUserStaticService]]<br />
|-<br />
| 5 || [[#GetAdminStaticService]]<br />
|-<br />
| 6 || [[#GetRepairStaticService]]<br />
|-<br />
| 9 || [[#GetManufactureStaticService]]<br />
|-<br />
| 10 || [[#SetupStandardSteadyClock]]<br />
|-<br />
| 11 || [[#SetupStandardLocalSystemClock]]<br />
|-<br />
| 12 || [[#SetupStandardNetworkSystemClock]]<br />
|-<br />
| 13 || [[#SetupStandardUserSystemClock]]<br />
|-<br />
| 14 || [[#SetupTimeZoneManager]]<br />
|-<br />
| 15 || [[#SetupEphemeralNetworkSystemClock]]<br />
|-<br />
| 50 ||<br />
|-<br />
| 51 ||<br />
|-<br />
| 52 ||<br />
|-<br />
| 60 || GetStandardUserSystemClockAutomaticCorrectionEvent<br />
|-<br />
| 100 || [[#SetStandardSteadyClockRtcOffset]]<br />
|-<br />
| 200 || GetAlarmRegistrationEvent<br />
|-<br />
| 201 || [[#UpdateSteadyAlarms]]<br />
|-<br />
| 202 ||<br />
|}<br />
<br />
== GetUserStaticService ==<br />
Returns an [[#IStaticService]].<br />
<br />
This is used for the wrapped instance of "time:u" in glue.<br />
<br />
== GetAdminStaticService ==<br />
Returns an [[#IStaticService]].<br />
<br />
This is used for the wrapped instance of "time:a" in glue.<br />
<br />
== GetRepairStaticService ==<br />
Returns an [[#IStaticService]].<br />
<br />
This is used for the wrapped instance of "time:r" in glue.<br />
<br />
== GetManufactureStaticService ==<br />
Returns an [[#IStaticService]].<br />
<br />
This seems unused.<br />
<br />
== SetupStandardSteadyClock ==<br />
Takes an input rtc_clock_source UUID, an input rtc_offset s64, an input internal_offset s64, an input test_offset s64 and a is_rtc_reset_detected bool. No output.<br />
<br />
== SetupStandardLocalSystemClock ==<br />
Takes an input [[#SystemClockContext]] and an input [[#PosixTime]]. No output.<br />
<br />
== SetupStandardNetworkSystemClock ==<br />
Takes an input [[#SystemClockContext]] and an input sufficient_accuracy_minutes u64. No output.<br />
<br />
== SetupStandardUserSystemClock ==<br />
Takes an input automatic_correction bool and an input [[#SteadyClockTimePoint]]. No output.<br />
<br />
== SetupTimeZoneManager ==<br />
Takes an input [[#LocationName]], an input [[#SteadyClockTimePoint]], an input total_location_name_count u32, an input [[#TimeZoneRuleVersion]] and a type-0x21 input buffer containing a TimeZoneBinary. No output.<br />
<br />
== SetupEphemeralNetworkSystemClock ==<br />
No input, no output.<br />
<br />
== SetStandardSteadyClockRtcOffset ==<br />
An input rtc_offset s64, no output.<br />
<br />
== UpdateSteadyAlarms ==<br />
No input, no output.<br />
<br />
= time:al =<br />
This is "nn::timesrv::detail::service::IAlarmService".<br />
<br />
This was added with [9.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 ||<br />
|-<br />
| 1 ||<br />
|}<br />
<br />
Cmd0/cmd1: no input, returns an [[#ISteadyClockAlarm]].<br />
<br />
== ISteadyClockAlarm ==<br />
This is "nn::timesrv::detail::service::ISteadyClockAlarm".<br />
<br />
This was added with [9.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || GetWakeUpEvent<br />
|-<br />
| 1 || Enable<br />
|-<br />
| 2 || Disable<br />
|-<br />
| 3 || IsEnabled<br />
|-<br />
| 10 ||<br />
|-<br />
| 11 ||<br />
|}<br />
<br />
=== Cmd10 ===<br />
Opens a session for [[#psc:l|psc:l]] and returns it's interface.<br />
<br />
=== Cmd11 ===<br />
Close the session opened by [[#Cmd10]] when the alarm is disabled.<br />
<br />
= time:p =<br />
This is "nn::timesrv::detail::service::IPowerStateRequestHandler".<br />
<br />
This was added with [9.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 ||<br />
|-<br />
| 1 ||<br />
|}<br />
<br />
= time:su, time:s =<br />
These are "nn::timesrv::detail::service::IStaticService".<br />
<br />
These were added with [9.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetStandardUserSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 1 || GetStandardNetworkSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 2 || GetStandardSteadyClock || Returns an [[#ISteadyClock]].<br />
|-<br />
| 3 || GetTimeZoneService || Returns an [[#ITimeZoneService]].<br />
|-<br />
| 4 || GetStandardLocalSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 5 || [4.0.0+] GetEphemeralNetworkSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 20 || [6.0.0+] GetSharedMemoryNativeHandle || <br />
|-<br />
| 30 || [6.0.0-8.1.0] GetStandardNetworkClockOperationEventReadableHandle || <br />
|-<br />
| 31 || [6.0.0-8.1.0] GetEphemeralNetworkClockOperationEventReadableHandle || <br />
|-<br />
| 50 || [4.0.0+] SetStandardSteadyClockInternalOffset || <br />
|-<br />
| 51 || [9.0.0+] GetStandardSteadyClockRtcValue || <br />
|-<br />
| 100 || IsStandardUserSystemClockAutomaticCorrectionEnabled || <br />
|-<br />
| 101 || SetStandardUserSystemClockAutomaticCorrectionEnabled || <br />
|-<br />
| 102 || [5.0.0+] GetStandardUserSystemClockInitialYear || <br />
|-<br />
| 200 || [3.0.0+] IsStandardNetworkSystemClockAccuracySufficient || <br />
|-<br />
| 201 || [6.0.0+] GetStandardUserSystemClockAutomaticCorrectionUpdatedTime || <br />
|-<br />
| 300 || [4.0.0+] CalculateMonotonicSystemClockBaseTimePoint || <br />
|-<br />
| 400 || [4.0.0+] GetClockSnapshot || <br />
|-<br />
| 401 || [4.0.0+] GetClockSnapshotFromSystemClockContext || <br />
|-<br />
| 500 || [4.0.0+] CalculateStandardUserSystemClockDifferenceByUser || <br />
|-<br />
| 501 || [4.0.0+] CalculateSpanBetween || <br />
|}<br />
<br />
== ISteadyClock ==<br />
This is "nn::timesrv::detail::service::ISteadyClock".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetCurrentTimePoint || No input, returns an output [[#SteadyClockTimePoint]].<br />
|-<br />
| 2 || GetTestOffset || No input, returns an output [[#TimeSpanType]].<br />
|-<br />
| 3 || SetTestOffset || Takes an input [[#TimeSpanType]], no output.<br />
|-<br />
| 100 || [2.0.0+] GetRtcValue || No input, returns an output s64.<br />
|-<br />
| 101 || [2.0.0+] IsRtcResetDetected || No input, returns an output u8 bool.<br />
|-<br />
| 102 || [2.0.0+] GetSetupResultValue || No input, returns an output u32.<br />
|-<br />
| 200 || [3.0.0+] GetInternalOffset || No input, returns an output [[#TimeSpanType]].<br />
|-<br />
| 201 || [3.0.0-3.0.2] SetInternalOffset || Takes an input [[#TimeSpanType]], no output.<br />
|}<br />
<br />
=== SteadyClockTimePoint ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x8|| A u64 representing a point in time.<br />
|-<br />
| 0x8 || 0x10 || An ID representing the clock source.<br />
|}<br />
<br />
This is a 0x18-byte struct.<br />
<br />
=== TimeSpanType ===<br />
This is an u64.<br />
<br />
== ISystemClock ==<br />
This is "nn::timesrv::detail::service::ISystemClock".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetCurrentTime || Returns an output [[#PosixTime]].<br />
|-<br />
| 1 || SetCurrentTime || Takes an input [[#PosixTime]].<br />
|-<br />
| 2 || GetSystemClockContext || Returns an output [[#SystemClockContext]].<br />
|-<br />
| 3 || SetSystemClockContext || Takes an input [[#SystemClockContext]].<br />
|-<br />
| 4 || [9.0.0+] GetOperationEventReadableHandle ||<br />
|}<br />
<br />
=== PosixTime ===<br />
This is an s64 for UTC POSIX time.<br />
<br />
=== SystemClockContext ===<br />
This is an 0x20-byte struct.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x8|| a [[#PosixTime]] representing the system clock epoch.<br />
|-<br />
| 0x8 || 0x18 || a [[#SteadyClockTimePoint]]<br />
|}<br />
<br />
== ITimeZoneService ==<br />
This is "nn::timesrv::detail::service::ITimeZoneService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetDeviceLocationName || No input, returns an output [[#LocationName]].<br />
|-<br />
| 1 || SetDeviceLocationName || Takes an input [[#LocationName]], no output.<br />
|-<br />
| 2 || GetTotalLocationNameCount || No input, returns an output s32.<br />
|-<br />
| 3 || LoadLocationNameList || <br />
|-<br />
| 4 || LoadTimeZoneRule || Takes an input [[#LocationName]] and a type-0x16 output buffer for [[#TimeZoneRule]], no output.<br />
|-<br />
| 5 || [2.0.0+] GetTimeZoneRuleVersion || No input, returns an output [[#TimeZoneRuleVersion]].<br />
|-<br />
| 6 || [5.0.0+] GetDeviceLocationNameAndUpdatedTime || <br />
|-<br />
| 7 || [9.0.0+] SetDeviceLocationNameWithTimeZoneRule || <br />
|-<br />
| 8 || [9.0.0+] ParseTimeZoneBinary || <br />
|-<br />
| 20 || [9.0.0+] GetDeviceLocationNameOperationEventReadableHandle || <br />
|-<br />
| 100 || ToCalendarTime || Takes an input [[#PosixTime]] and a type-0x15 input buffer for [[#TimeZoneRule]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].<br />
|-<br />
| 101 || ToCalendarTimeWithMyRule || Takes an input [[#PosixTime]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].<br />
|-<br />
| 201 || ToPosixTime || Takes an input [[#CalendarTime]], a type-0x15 input buffer for [[#TimeZoneRule]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.<br />
|-<br />
| 202 || ToPosixTimeWithMyRule || Takes an input [[#CalendarTime]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.<br />
|}<br />
<br />
=== LoadLocationNameList ===<br />
Takes an input s32 LocationName_index and a type-0x6 output buffer for [[#LocationName]], returns an output s32 for total output entries.<br />
<br />
=== LocationName ===<br />
This contains a TimeZone location string with a max size of 0x24 bytes.<br />
<br />
=== TimeZoneRule ===<br />
This is an 0x4000-byte struct. Official sw uses fixed-size 0x4000 for the buffer size with the above commands.<br />
<br />
This is loaded from the [[Title_list|TimeZoneBinary]] title with the specified LocationName under the zoneinfo/ directory, the content is then converted into this TimeZoneRule structure.<br />
<br />
The files contained under zoneinfo/ directory are Tzif2 files without Tzif1 header and data at the begining of them (see [https://tools.ietf.org/html/rfc8536 RFC8536] for more information).<br />
<br />
The conversion of a Tzif2 file to a TimeZoneRule structure is based on [https://github.com/eggert/tz/blob/master/localtime.c tz database code] with some custom modifications (Leap seconds aren't handled, no usage of "posixrules" and Tzif1 support stripped out).<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x4 || timecnt<br />
|-<br />
| 0x4 || 0x4 || typecnt<br />
|-<br />
| 0x8 || 0x4 || charcnt<br />
|-<br />
| 0xC || 0x1 || goback<br />
|-<br />
| 0xD || 0x1 || goahead<br />
|-<br />
| 0xE || 0x2 || Padding<br />
|-<br />
| 0x10 || 0x8 * 1000 || ats<br />
|-<br />
| 0x1f50 || 0x1 * 1000 || types<br />
|-<br />
| 0x2338 || 0x10 * 128 || ttis (time type information), struct ttinfo[1000]<br />
|-<br />
| 0x2b38 || 0x1 * 512 || chars<br />
|-<br />
| 0x2d38 || 0x4 || defaulttype<br />
|-<br />
| 0x2d3c || 0x12c4 || Reserved / Unused<br />
|}<br />
<br />
=== ttinfo ===<br />
This is an 0x10-byte struct.<br />
Represent a Time Type Information used in [[#TimeZoneRule]].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x4 || tt_gmtoff<br />
|-<br />
| 0x4 || 0x1 || tt_isdst<br />
|-<br />
| 0x5 || 0x3 || Padding<br />
|-<br />
| 0x8 || 0x4 || tt_abbrind<br />
|-<br />
| 0xC || 0x1 || tt_ttisstd<br />
|-<br />
| 0xD || 0x1 || tt_ttisgmt<br />
|-<br />
| 0xE || 0x2 || Padding<br />
|}<br />
<br />
=== TimeZoneRuleVersion ===<br />
This is an u128.<br />
<br />
=== CalendarTime ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x2 || Year<br />
|-<br />
| 0x2 || 0x1 || Month<br />
|-<br />
| 0x3 || 0x1 || Day<br />
|-<br />
| 0x4 || 0x1 || Hour<br />
|-<br />
| 0x5 || 0x1 || Minute<br />
|-<br />
| 0x6 || 0x1 || Second<br />
|-<br />
| 0x7 || 0x1 || Padding / unknown?<br />
|}<br />
<br />
This is an 0x8-byte struct.<br />
<br />
=== CalendarAdditionalInfo ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x4 || 0-based day-of-week.<br />
|-<br />
| 0x4 || 0x4 || 0-based day-of-year.<br />
|-<br />
| 0x8 || 0x8 || Timezone name string.<br />
|-<br />
| 0x10 || 0x4 || 0 = no DST, 1 = DST.<br />
|-<br />
| 0x14 || 0x4 || s32 seconds relative to UTC for this timezone.<br />
|}<br />
<br />
This is an 0x18-byte struct. This stores timezone info.<br />
<br />
= ins:r =<br />
This is "nn::ins::IReceiverManager".<br />
<br />
This was added with [9.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 ||<br />
|-<br />
| 1 ||<br />
|}<br />
<br />
== Cmd0 ==<br />
Takes an input u32 '''InsID'''. Returns an u64.<br />
<br />
== Cmd1 ==<br />
Takes an input u32 '''InsID''' and an input u64 (unused, official software passes struct pointer). Returns an output Event handle with autoclear disabled.<br />
<br />
= ins:s =<br />
This is "nn::ins::ISenderManager".<br />
<br />
This was added with [9.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 ||<br />
|}<br />
<br />
== Cmd0 ==<br />
Takes an input u32 '''InsID''' and an input u64 (unused, official software passes struct pointer). Returns an output Event handle with autoclear disabled.<br />
<br />
= PSC Module IDs =<br />
{| class="wikitable" border="1"<br />
|-<br />
! ID || Module<br />
|-<br />
| 0x03 ||<br />
|-<br />
| 0x04 || [[USB services|USB]]<br />
|-<br />
| 0x05 ||<br />
|-<br />
| 0x07 || [[PCV services|Pcv]]<br />
|-<br />
| 0x08 || [[PCV services|Pcv:Imm]]<br />
|-<br />
| 0x09 || [[Bus services|Gpio]]<br />
|-<br />
| 0x0A || [[Bus services|Pinmux]]<br />
|-<br />
| 0x0B || [[Bus services|Uart]]<br />
|-<br />
| 0x0C || [[Bus services|I2c]]<br />
|-<br />
| 0x0D || [[Bus services|I2c:Pcv]]<br />
|-<br />
| 0x0E || [[Bus services|Sasbus]]<br />
|-<br />
| 0x0F || [[Bus services|Pwm]]<br />
|-<br />
| 0x10 ||<br />
|-<br />
| 0x13 || [[PCIe services|PCIe]]<br />
|-<br />
| 0x14 || [[Backlight services|Backlight]]<br />
|-<br />
| 0x15 || [[Nvnflinger services|Nvnflinger]]<br />
|-<br />
| 0x18 || [[HID services|nn::psc::PmModuleId_Hid]]<br />
|-<br />
| 0x1B ||<br />
|-<br />
| 0x1C || [[Audio services|Audio]]<br />
|-<br />
| 0x1E ||<br />
|-<br />
| 0x1F || [[Bluetooth Driver services|Bluetooth]]<br />
|-<br />
| 0x20 || [[PCV services|Bpc]]<br />
|-<br />
| 0x21 || [[PTM services|Ptm]]<br />
|-<br />
| 0x23 || [[NFC services|nn::psc::PmModuleId_Nfc]]<br />
|- <br />
| 0x24 || [[PPC services|Ppc]]<br />
|-<br />
| 0x25 ||<br />
|-<br />
| 0x26 || [[Network Interface services|Nifm]]<br />
|-<br />
| 0x28 || [[NPNS services|Npns]]<br />
|-<br />
| 0x29 || [[Log services|nn::psc::PmModuleId_Lm]]<br />
|-<br />
| 0x2A || [[BCAT services|Bcat]]<br />
|-<br />
| 0x2B || [[PCV services|Time]]<br />
|-<br />
| 0x2C || [[Parental Control services|Pctl]]<br />
|-<br />
| 0x2D || [[Error Report services|Erpt]]<br />
|-<br />
| 0x2E || [[Error Upload services|Eupld]]<br />
|-<br />
| 0x2F || [[Friend services|Friend]]<br />
|-<br />
| 0x30 || [[Glue services|Glue]]<br />
|-<br />
| 0x31 || [[Account services|Account]]<br />
|-<br />
| 0x32 || [[Bus services|SasBus]]<br />
|-<br />
| 0x65 || [[NV services|NV]]<br />
|}<br />
<br />
= Power Management States =<br />
{| class="wikitable" border="1"<br />
|-<br />
! ID || Name || Description<br />
|-<br />
| Awake || 0 || Everything is awake.<br />
|-<br />
| ReadyAwaken || 1 || Preparing to transition to awake.<br />
|-<br />
| ReadySleep || 2 || Preparing to transition to sleep.<br />
|-<br />
| ReadySleepCritical || 3 || Critical services are ready to sleep.<br />
|-<br />
| ReadyAwakenCritical || 4 || Critical services are ready to wake up.<br />
|-<br />
| ReadyShutdown || 5 || Preparing to transition to shutdown.<br />
|}<br />
<br />
[[Category:Services]]</div>
Thog
https://switchbrew.org/w/index.php?title=PCV_services&diff=7907
PCV services
2019-09-16T17:58:24Z
<p>Thog: </p>
<hr />
<div>= bpc =<br />
This is "nn::bpc::IBoardPowerControlManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || ShutdownSystem<br />
|-<br />
| 1 || RebootSystem<br />
|-<br />
| 2 || GetWakeupReason<br />
|-<br />
| 3 || GetShutdownReason<br />
|-<br />
| 4 || GetAcOk<br />
|-<br />
| 5 || GetBoardPowerControlEvent<br />
|-<br />
| 6 || [2.0.0+] GetSleepButtonState<br />
|-<br />
| 7 || [2.0.0+] GetPowerEvent<br />
|-<br />
| 8 || [2.0.0+] CreateWakeupTimer<br />
|-<br />
| 9 || [2.0.0+] CancelWakeupTimer<br />
|-<br />
| 10 || [2.0.0+] [[#EnableWakeupTimerOnDevice]]<br />
|-<br />
| 11 || [3.0.0+] CreateWakeupTimerEx<br />
|-<br />
| 12 || [3.0.0+] GetLastEnabledWakeupTimerType<br />
|-<br />
| 13 || [3.0.0+] CleanAllWakeupTimers<br />
|-<br />
| 14 || [6.0.0+]<br />
|}<br />
<br />
== EnableWakeupTimerOnDevice ==<br />
No input, returns a total of 0x10-bytes of output. [3.0.0+] Now returns a total of 0xC-bytes of output.<br />
<br />
= bpc:r =<br />
This is "nn::bpc::IRtcManager".<br />
<br />
This service no longer exists in [9.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || GetRtcTime<br />
|-<br />
| 1 || SetRtcTime<br />
|-<br />
| 2 || GetRtcResetDetected<br />
|-<br />
| 3 || [2.0.0+] ClearRtcResetDetected<br />
|-<br />
| 4 || [3.0.0+] SetUpRtcResetOnShutdown<br />
|}<br />
<br />
GetRtcTime / SetRtcTime directly accesses the max77620_rtc0 device.<br />
<br />
= pcv =<br />
This is "nn::pcv::detail::IPcvService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| [1.0.0-7.0.1] 0 || SetPowerEnabled<br />
|-<br />
| [1.0.0-7.0.1] 1 || SetClockEnabled<br />
|-<br />
| [1.0.0-7.0.1] 2 || SetClockRate<br />
|-<br />
| [1.0.0-7.0.1] 3 || GetClockRate<br />
|-<br />
| [1.0.0-7.0.1] 4 || GetState<br />
|-<br />
| [1.0.0-7.0.1] 5 || GetPossibleClockRates<br />
|-<br />
| [1.0.0-7.0.1] 6 || SetMinVClockRate<br />
|-<br />
| [1.0.0-7.0.1] 7 || SetReset<br />
|-<br />
| [1.0.0-7.0.1] 8 || SetVoltageEnabled<br />
|-<br />
| [1.0.0-7.0.1] 9 || GetVoltageEnabled<br />
|-<br />
| [1.0.0-7.0.1] 10 || GetVoltageRange<br />
|-<br />
| [1.0.0-7.0.1] 11 || SetVoltageValue<br />
|-<br />
| [1.0.0-7.0.1] 12 || GetVoltageValue<br />
|-<br />
| [1.0.0-7.0.1] 13 || GetTemperatureThresholds<br />
|-<br />
| [1.0.0-7.0.1] 14 || SetTemperature<br />
|-<br />
| [1.0.0-5.1.0] 15 || Initialize<br />
|-<br />
| [1.0.0-5.1.0] 16 || IsInitialized<br />
|-<br />
| [1.0.0-5.1.0] 17 || Finalize<br />
|-<br />
| [3.0.0-7.0.1] 18 || PowerOn<br />
|-<br />
| [3.0.0-7.0.1] 19 || PowerOff<br />
|-<br />
| [3.0.0-7.0.1] 20 || ChangeVoltage<br />
|-<br />
| [3.0.0-7.0.1] 21 || GetPowerClockInfoEvent<br />
|-<br />
| [3.0.0-7.0.1] 22 || GetOscillatorClock<br />
|-<br />
| [3.0.0-7.0.1] 23 || GetDvfsTable<br />
|-<br />
| [3.0.0-7.0.1] 24 || GetModuleStateTable<br />
|-<br />
| [3.0.0-7.0.1] 25 || GetPowerDomainStateTable<br />
|-<br />
| 26 || [3.0.0+] GetFuseInfo<br />
|-<br />
| 27 || [5.0.0+] GetDramId<br />
|-<br />
| [6.0.0-7.0.1] 28 || [[#IsPoweredOn]]<br />
|-<br />
| [6.0.0-7.0.1] 29 || [[#GetVoltage]]<br />
|}<br />
<br />
[7.0.0+] The type-0xA output buffers were replaced with type-0x22 output buffers, for the following: GetDvfsTable, GetModuleStateTable, and GetPowerDomainStateTable.<br />
<br />
== IsPoweredOn ==<br />
Takes an u32 '''PowerControlTarget''' and returns a bool indicating the status of the requested [[#Voltage|voltage block]].<br />
<br />
== GetVoltage ==<br />
Takes an u32 '''PowerControlTarget''' and returns an u32 voltage value for the requested [[#Voltage|voltage block]].<br />
<br />
== Modules ==<br />
These are "nn::pcv::Module_X" where X is the power, clock and reset block name.<br />
<br />
[8.0.0+] Every module name is now mapped to an ID.<br />
<br />
=== Power Switch / Clocking / Reset ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Name || ID || Block || Rail || Notes<br />
|-<br />
| 0 || 0x40000001 || CpuBus || vdd_cpu ||<br />
|-<br />
| 1 || 0x40000002 || GPU || vdd_gpu ||<br />
|-<br />
| 2 || 0x40000003 || I2S1 || vdd_soc ||<br />
|-<br />
| 3 || 0x40000004 || I2S2 || vdd_soc ||<br />
|-<br />
| 4 || 0x40000005 || I2S3 || vdd_soc ||<br />
|-<br />
| 5 || 0x40000006 || PWM || vdd_soc ||<br />
|-<br />
| 6 || 0x02000001 || I2C1 || vdd_soc ||<br />
|-<br />
| 7 || 0x02000002 || I2C2 || vdd_soc ||<br />
|-<br />
| 8 || 0x02000003 || I2C3 || vdd_soc ||<br />
|-<br />
| 9 || 0x02000004 || I2C4 || vdd_soc ||<br />
|-<br />
| 10 || 0x02000005 || I2C5 || vdd_soc ||<br />
|-<br />
| 11 || 0x02000006 || I2C6 || vdd_soc ||<br />
|-<br />
| 12 || 0x07000000 || SPI1 || vdd_soc ||<br />
|-<br />
| 13 || 0x07000001 || SPI2 || vdd_soc ||<br />
|-<br />
| 14 || 0x07000002 || SPI3 || vdd_soc ||<br />
|-<br />
| 15 || 0x07000003 || SPI4 || vdd_soc ||<br />
|-<br />
| 16 || 0x40000011 || DISP1 || vdd_soc ||<br />
|-<br />
| 17 || 0x40000012 || DISP2 || vdd_soc ||<br />
|-<br />
| 18 || 0x40000013 || ISP || - || Not an actual block. Used for debug.<br />
|-<br />
| 19 || 0x40000014 || VI || - || Not an actual block. Used for debug.<br />
|-<br />
| 20 || 0x40000015 || SDMMC1 || vdd_soc ||<br />
|-<br />
| 21 || 0x40000016 || SDMMC2 || vdd_soc ||<br />
|-<br />
| 22 || 0x40000017 || SDMMC3 || vdd_soc ||<br />
|-<br />
| 23 || 0x40000018 || SDMMC4 || vdd_soc ||<br />
|-<br />
| 24 || 0x40000019 || OWR || - || Not an actual block. Used for debug.<br />
|-<br />
| 25 || 0x4000001A || CSITE || vdd_soc ||<br />
|-<br />
| 26 || 0x4000001B || TSEC || vdd_soc ||<br />
|-<br />
| 27 || 0x4000001C || MSELECT || vdd_soc ||<br />
|-<br />
| 28 || 0x4000001D || HDA2CODEC_2X || vdd_soc ||<br />
|-<br />
| 29 || 0x4000001E || ACTMON || vdd_soc ||<br />
|-<br />
| 30 || 0x4000001F || I2C_SLOW || vdd_soc ||<br />
|-<br />
| 31 || 0x40000020 || SOR1 || vdd_soc ||<br />
|-<br />
| 32 || 0x40000021 || SATA || - || Not an actual block. Used for debug.<br />
|-<br />
| 33 || 0x40000022 || HDA || vdd_soc ||<br />
|-<br />
| 34 || 0x40000023 || XUSB_CORE_HOST || vdd_soc ||<br />
|-<br />
| 35 || 0x40000024 || XUSB_FALCON || vdd_soc ||<br />
|-<br />
| 36 || 0x40000025 || XUSB_FS || vdd_soc ||<br />
|-<br />
| 37 || 0x40000026 || XUSB_CORE_DEV || vdd_soc ||<br />
|-<br />
| 38 || 0x40000027 || XUSB_SS_HOSTDEV || vdd_soc ||<br />
|-<br />
| 39 || 0x03000001 || UARTA || vdd_soc ||<br />
|-<br />
| 40 || 0x35000405 || UARTB || vdd_soc ||<br />
|-<br />
| 41 || 0x3500040F || UARTC || vdd_soc ||<br />
|-<br />
| 42 || 0x37000001 || UARTD || vdd_soc ||<br />
|-<br />
| 43 || 0x4000002C || HOST1X || vdd_soc ||<br />
|-<br />
| 44 || 0x4000002D || ENTROPY || vdd_soc ||<br />
|-<br />
| 45 || 0x4000002E || SOC_THERM || vdd_soc ||<br />
|-<br />
| 46 || 0x4000002F || VIC || vdd_soc ||<br />
|-<br />
| 47 || 0x40000030 || NVENC || vdd_soc ||<br />
|-<br />
| 48 || 0x40000031 || NVJPG || vdd_soc ||<br />
|-<br />
| 49 || 0x40000032 || NVDEC || vdd_soc ||<br />
|-<br />
| 50 || 0x40000033 || QSPI || vdd_soc ||<br />
|-<br />
| 51 || 0x40000034 || VI_I2C || - || Not an actual block. Used for debug.<br />
|-<br />
| 52 || 0x40000035 || TSECB || vdd_soc ||<br />
|-<br />
| 53 || 0x40000036 || APE || vdd_soc ||<br />
|-<br />
| 54 || 0x40000037 || ACLK || vdd_soc ||<br />
|-<br />
| 55 || 0x40000038 || UARTAPE || vdd_soc ||<br />
|-<br />
| 56 || 0x40000039 || EMC || vdd_soc ||<br />
|-<br />
| 57 || 0x4000003A || PLLE0 || vdd_soc ||<br />
|-<br />
| 58 || 0x4000003B || PLLE0 || vdd_soc ||<br />
|-<br />
| 59 || 0x4000003C || DSI || vdd_soc ||<br />
|-<br />
| 60 || 0x4000003D || MAUD || vdd_soc ||<br />
|-<br />
| 61 || 0x4000003E || DPAUX1 || vdd_soc ||<br />
|-<br />
| 62 || 0x4000003F || MIPI_CAL || vdd_soc ||<br />
|-<br />
| 63 || 0x40000040 || UART_FST_MIPI_CAL || vdd_soc ||<br />
|-<br />
| 64 || 0x40000041 || OSC || vdd_soc ||<br />
|-<br />
| 65 || 0x40000042 || SCLK || vdd_soc ||<br />
|-<br />
| 66 || 0x40000043 || SOR_SAFE || vdd_soc ||<br />
|-<br />
| 67 || 0x40000044 || XUSB_SS || vdd_soc ||<br />
|-<br />
| 68 || 0x40000045 || XUSB_HOST || vdd_soc ||<br />
|-<br />
| 69 || 0x40000046 || XUSB_DEV || vdd_soc ||<br />
|-<br />
| 70 || 0x40000047 || EXTPERIPH1 || vdd_soc ||<br />
|-<br />
| 71 || 0x40000048 || AHUB || vdd_soc ||<br />
|-<br />
| 72 || 0x40000049 || HDA2HDMICODEC || vdd_soc ||<br />
|-<br />
| 73 || 0x4000004A || PLLP5 || vdd_soc ||<br />
|-<br />
| 74 || 0x4000004B || USBD || vdd_soc ||<br />
|-<br />
| 75 || 0x4000004C || USB2 || vdd_soc ||<br />
|-<br />
| 76 || 0x4000004D || PCIE || vdd_soc ||<br />
|-<br />
| 77 || 0x4000004E || AFI || vdd_soc ||<br />
|-<br />
| 78 || 0x4000004F || PCIEXCLK || vdd_soc ||<br />
|-<br />
| 79 || 0x40000050 || PEX_USB_UPHY || vdd_soc ||<br />
|-<br />
| 80 || 0x40000051 || XUSB_PADCTL || vdd_soc ||<br />
|-<br />
| 81 || 0x40000052 || APBDMA || vdd_soc ||<br />
|-<br />
| 82 || 0x40000053 || USB2_TRK || vdd_soc ||<br />
|-<br />
| 83 || 0x40000054 || PLLE0 || vdd_soc ||<br />
|-<br />
| 84 || 0x40000055 || PLLE0 || vdd_soc ||<br />
|-<br />
| 85 || 0x40000056 || CEC || vdd_soc ||<br />
|-<br />
| [6.0.0+] 86 || 0x40000057 || EXTPERIPH2 || vdd_soc ||<br />
|}<br />
<br />
=== Voltage ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Name || Block || Notes<br />
|-<br />
| 0 || max77620_sd0 || <br />
|-<br />
| 1 || max77620_sd1 || <br />
|-<br />
| 2 || max77620_sd2 || <br />
|-<br />
| 3 || max77620_sd3 || <br />
|-<br />
| 4 || max77620_ldo0 || 1.2v<br />
|-<br />
| 5 || max77620_ldo1 || <br />
|-<br />
| 6 || max77620_ldo2 || SDcard power, 1.8v - 3.3v<br />
|-<br />
| 7 || max77620_ldo3 || GC ASIC 3.1v<br />
|-<br />
| 8 || max77620_ldo4 || RTC power, 0.85v<br />
|-<br />
| 9 || max77620_ldo5 || GC ASIC 1.8v<br />
|-<br />
| 10 || max77620_ldo6 || AVDD touchscreen, 2.9v<br />
|-<br />
| 11 || max77620_ldo7 || <br />
|-<br />
| 12 || max77620_ldo8 || DisplayPort, 1.05v<br />
|-<br />
| 13 || max77621_cpu || <br />
|-<br />
| 14 || max77621_gpu || <br />
|-<br />
| [6.0.0+] 15 || max77812_cpu || <br />
|-<br />
| [6.0.0+] 16 || max77812_gpu || <br />
|-<br />
| [6.0.0+] 17 || max77812_dram || <br />
|}<br />
<br />
Note: max77620 GPIOs are only used internally by the driver during init, and not exposed via an API.<br />
<br />
= pcv:arb =<br />
This is "nn::pcv::IArbitrationManager".<br />
<br />
This service no longer exists in [8.0.0+]. <br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || ReleaseControl<br />
|}<br />
<br />
= pcv:imm =<br />
This is "nn::pcv::IImmediateManager".<br />
<br />
This service no longer exists in [8.0.0+]. <br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || SetClockRate<br />
|}<br />
<br />
= clkrst, clkrst:i =<br />
These are "nn::clkrst::IClkrstManager" and "nn::clkrst::IImmediateManager".<br />
<br />
These were added with [8.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#OpenSession]]<br />
|-<br />
| 1 || GetTemperatureThresholds<br />
|-<br />
| 2 || SetTemperature<br />
|-<br />
| 3 || GetPossibleClockRates<br />
|-<br />
| 4 || GetClockInfoEvent<br />
|-<br />
| 5 || GetClockModuleNumLimit<br />
|}<br />
<br />
== OpenSession ==<br />
Takes an u32 '''ModuleID''', an u32 '''ModuleUnk''' and returns an [[#IClkrstSession]].<br />
<br />
== GetClockModuleNumLimit ==<br />
Returns 0x1A.<br />
<br />
== IClkrstSession ==<br />
This is "nn::clkrst::IClkrstSession".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || SetClockEnabled<br />
|-<br />
| 1 || SetClockDisabled<br />
|-<br />
| 2 || SetResetAsserted<br />
|-<br />
| 3 || SetResetDeasserted<br />
|-<br />
| 4 || SetPowerEnabled<br />
|-<br />
| 5 || SetPowerDisabled<br />
|-<br />
| 6 || GetState<br />
|-<br />
| 7 || SetClockRate<br />
|-<br />
| 8 || GetClockRate<br />
|-<br />
| 9 || SetMinVClockRate<br />
|-<br />
| 10 || GetPossibleClockRates<br />
|-<br />
| 11 || GetDvfsTable<br />
|}<br />
<br />
= clkrst:a =<br />
This is "nn::clkrst::IArbitrationManager".<br />
<br />
This was added with [8.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#ReleaseControl]]<br />
|}<br />
<br />
== ReleaseControl ==<br />
Takes an u32 '''ModuleID'''. No output.<br />
<br />
= rgltr =<br />
This is "nn::regulator::IRegulatorManager".<br />
<br />
This was added with [8.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#OpenSession]]<br />
|-<br />
| 1 || GetPowerDomainStateTable<br />
|-<br />
| 2 || GetPowerInfoEvent<br />
|-<br />
| 3 || GetPowerModuleNumLimit<br />
|}<br />
<br />
== OpenSession ==<br />
Takes an u32 '''ModuleID''' and returns an [[#IRegulatorSession]].<br />
<br />
== GetPowerModuleNumLimit ==<br />
Returns 0x3.<br />
<br />
== IRegulatorSession ==<br />
This is "nn::regulator::IRegulatorSession".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#SetVoltageEnabled]]<br />
|-<br />
| 1 ||<br />
|-<br />
| 2 || [[#GetVoltageEnabled]]<br />
|-<br />
| 3 || GetVoltageRange<br />
|-<br />
| 4 || GetVoltageValue<br />
|-<br />
| 5 || [[#SetVoltageValue]]<br />
|-<br />
| 6 || ChangeVoltage<br />
|}<br />
<br />
=== SetVoltageEnabled ===<br />
Takes a bool. Enables/disables the LDO this session was opened for.<br />
<br />
=== GetVoltageEnabled ===<br />
Returns a bool. True if voltage is enabled, false if not.<br />
<br />
=== SetVoltageValue ===<br />
Takes in a voltage in microvolts and sets the LDO to this voltage.<br />
<br />
= rtc =<br />
This was added with [8.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || GetRtcTime<br />
|-<br />
| 1 || SetRtcTime<br />
|-<br />
| 2 || SetRtcClientUnknownBool<br />
|-<br />
| 3 || GetRtcResetDetected<br />
|-<br />
| 4 || ClearRtcResetDetected<br />
|}<br />
<br />
Commands 0, 1, 3, 4 call the same internal functions as bpc:r, except they take an extra u32 [[Bus_services#Known_Devices_2|device code]], where bpc:r hardcodes 0x3B000001 (max77620_rtc0).<br />
<br />
Command 2 takes a u8 bool and a u32 device code; it opens an i2c session to the device code, and sets *(i2c_session_client_object + 0x38) = bool.<br />
<br />
= time:u, time:a, time:s =<br />
This is "nn::timesrv::detail::service::IStaticService".<br />
<br />
[9.0.0+] These services were moved to [[Glue_services|Glue]] and [[PSC_services|PSC]].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetStandardUserSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 1 || GetStandardNetworkSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 2 || GetStandardSteadyClock || Returns an [[#ISteadyClock]].<br />
|-<br />
| 3 || GetTimeZoneService || Returns an [[#ITimeZoneService]].<br />
|-<br />
| 4 || GetStandardLocalSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 5 || [4.0.0+] GetEphemeralNetworkSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 20 || [6.0.0+] GetSharedMemoryNativeHandle || <br />
|-<br />
| 30 || [6.0.0+] GetStandardNetworkClockOperationEventReadableHandle || <br />
|-<br />
| 31 || [6.0.0+] GetEphemeralNetworkClockOperationEventReadableHandle || <br />
|-<br />
| 50 || [4.0.0+] SetStandardSteadyClockInternalOffset || <br />
|-<br />
| 100 || IsStandardUserSystemClockAutomaticCorrectionEnabled || <br />
|-<br />
| 101 || SetStandardUserSystemClockAutomaticCorrectionEnabled || <br />
|-<br />
| 102 || [5.0.0+] GetStandardUserSystemClockInitialYear || <br />
|-<br />
| 200 || [3.0.0+] IsStandardNetworkSystemClockAccuracySufficient || <br />
|-<br />
| 201 || [6.0.0+] GetStandardUserSystemClockAutomaticCorrectionUpdatedTime || <br />
|-<br />
| 300 || [4.0.0+] CalculateMonotonicSystemClockBaseTimePoint || <br />
|-<br />
| 400 || [4.0.0+] GetClockSnapshot || <br />
|-<br />
| 401 || [4.0.0+] GetClockSnapshotFromSystemClockContext || <br />
|-<br />
| 500 || [4.0.0+] CalculateStandardUserSystemClockDifferenceByUser || <br />
|-<br />
| 501 || [4.0.0+] CalculateSpanBetween || <br />
|}<br />
<br />
== ISteadyClock ==<br />
This is "nn::timesrv::detail::service::ISteadyClock".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetCurrentTimePoint || No input, returns an output [[#SteadyClockTimePoint]].<br />
|-<br />
| 2 || GetTestOffset || No input, returns an output [[#TimeSpanType]].<br />
|-<br />
| 3 || SetTestOffset || Takes an input [[#TimeSpanType]], no output.<br />
|-<br />
| 100 || [2.0.0+] GetRtcValue || No input, returns an output s64.<br />
|-<br />
| 101 || [2.0.0+] IsRtcResetDetected || No input, returns an output u8 bool.<br />
|-<br />
| 102 || [2.0.0+] GetSetupResultValue || No input, returns an output u32.<br />
|-<br />
| 200 || [3.0.0+] GetInternalOffset || No input, returns an output [[#TimeSpanType]].<br />
|-<br />
| 201 || [3.0.0-3.0.2] SetInternalOffset || Takes an input [[#TimeSpanType]], no output.<br />
|}<br />
<br />
=== SteadyClockTimePoint ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x8|| A u64 representing a point in time.<br />
|-<br />
| 0x8 || 0x10 || An ID representing the clock source.<br />
|}<br />
<br />
This is a 0x18-byte struct.<br />
<br />
=== TimeSpanType ===<br />
This is an u64.<br />
<br />
== ISystemClock ==<br />
This is "nn::timesrv::detail::service::ISystemClock".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetCurrentTime || Returns an output [[#PosixTime]].<br />
|-<br />
| 1 || SetCurrentTime || Takes an input [[#PosixTime]].<br />
|-<br />
| 2 || GetSystemClockContext || Returns an output [[#SystemClockContext]].<br />
|-<br />
| 3 || SetSystemClockContext || Takes an input [[#SystemClockContext]].<br />
|-<br />
| 4 || [9.0.0+] GetOperationEventReadableHandle ||<br />
|}<br />
<br />
=== PosixTime ===<br />
This is an s64 for UTC POSIX time.<br />
<br />
=== SystemClockContext ===<br />
This is an 0x20-byte struct.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x8|| a [[#PosixTime]] representing the system clock epoch.<br />
|-<br />
| 0x8 || 0x18 || a [[#SteadyClockTimePoint]]<br />
|}<br />
<br />
== ITimeZoneService ==<br />
This is "nn::timesrv::detail::service::ITimeZoneService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetDeviceLocationName || No input, returns an output [[#LocationName]].<br />
|-<br />
| 1 || SetDeviceLocationName || Takes an input [[#LocationName]], no output.<br />
|-<br />
| 2 || GetTotalLocationNameCount || No input, returns an output s32.<br />
|-<br />
| 3 || LoadLocationNameList || <br />
|-<br />
| 4 || LoadTimeZoneRule || Takes an input [[#LocationName]] and a type-0x16 output buffer for [[#TimeZoneRule]], no output.<br />
|-<br />
| 5 || [2.0.0+] GetTimeZoneRuleVersion || No input, returns an output [[#TimeZoneRuleVersion]].<br />
|-<br />
| 6 || [5.0.0+] GetDeviceLocationNameAndUpdatedTime || <br />
|-<br />
| 100 || ToCalendarTime || Takes an input [[#PosixTime]] and a type-0x15 input buffer for [[#TimeZoneRule]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].<br />
|-<br />
| 101 || ToCalendarTimeWithMyRule || Takes an input [[#PosixTime]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].<br />
|-<br />
| 201 || ToPosixTime || Takes an input [[#CalendarTime]], a type-0x15 input buffer for [[#TimeZoneRule]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.<br />
|-<br />
| 202 || ToPosixTimeWithMyRule || Takes an input [[#CalendarTime]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.<br />
|}<br />
<br />
=== LoadLocationNameList ===<br />
Takes an input s32 LocationName_index and a type-0x6 output buffer for [[#LocationName]], returns an output s32 for total output entries.<br />
<br />
=== LocationName ===<br />
This contains a TimeZone location string with a max size of 0x24 bytes.<br />
<br />
=== TimeZoneRule ===<br />
This is an 0x4000-byte struct. Official sw uses fixed-size 0x4000 for the buffer size with the above commands.<br />
<br />
This is loaded from the [[Title_list|TimeZoneBinary]] title with the specified LocationName under the zoneinfo/ directory, the content is then converted into this TimeZoneRule structure.<br />
<br />
The files contained under zoneinfo/ directory are Tzif2 files without Tzif1 header and data at the begining of them (see [https://tools.ietf.org/html/rfc8536 RFC8536] for more information).<br />
<br />
The conversion of a Tzif2 file to a TimeZoneRule structure is based on [https://github.com/eggert/tz/blob/master/localtime.c tz database code] with some custom modifications (Leap seconds aren't handled, no usage of "posixrules" and Tzif1 support stripped out).<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x4 || timecnt<br />
|-<br />
| 0x4 || 0x4 || typecnt<br />
|-<br />
| 0x8 || 0x4 || charcnt<br />
|-<br />
| 0xC || 0x1 || goback<br />
|-<br />
| 0xD || 0x1 || goahead<br />
|-<br />
| 0xE || 0x2 || Padding<br />
|-<br />
| 0x10 || 0x8 * 1000 || ats<br />
|-<br />
| 0x1f50 || 0x1 * 1000 || types<br />
|-<br />
| 0x2338 || 0x10 * 128 || ttis (time type information), struct ttinfo[1000]<br />
|-<br />
| 0x2b38 || 0x1 * 512 || chars<br />
|-<br />
| 0x2d38 || 0x4 || defaulttype<br />
|-<br />
| 0x2d3c || 0x12c4 || Reserved / Unused<br />
|}<br />
<br />
=== ttinfo ===<br />
This is an 0x10-byte struct.<br />
Represent a Time Type Information used in [[#TimeZoneRule]].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x4 || tt_gmtoff<br />
|-<br />
| 0x4 || 0x1 || tt_isdst<br />
|-<br />
| 0x5 || 0x3 || Padding<br />
|-<br />
| 0x8 || 0x4 || tt_abbrind<br />
|-<br />
| 0xC || 0x1 || tt_ttisstd<br />
|-<br />
| 0xD || 0x1 || tt_ttisgmt<br />
|-<br />
| 0xE || 0x2 || Padding<br />
|}<br />
<br />
=== TimeZoneRuleVersion ===<br />
This is an u128.<br />
<br />
=== CalendarTime ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x2 || Year<br />
|-<br />
| 0x2 || 0x1 || Month<br />
|-<br />
| 0x3 || 0x1 || Day<br />
|-<br />
| 0x4 || 0x1 || Hour<br />
|-<br />
| 0x5 || 0x1 || Minute<br />
|-<br />
| 0x6 || 0x1 || Second<br />
|-<br />
| 0x7 || 0x1 || Padding / unknown?<br />
|}<br />
<br />
This is an 0x8-byte struct.<br />
<br />
=== CalendarAdditionalInfo ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x4 || 0-based day-of-week.<br />
|-<br />
| 0x4 || 0x4 || 0-based day-of-year.<br />
|-<br />
| 0x8 || 0x8 || Timezone name string.<br />
|-<br />
| 0x10 || 0x4 || 0 = no DST, 1 = DST.<br />
|-<br />
| 0x14 || 0x4 || s32 seconds relative to UTC for this timezone.<br />
|}<br />
<br />
This is an 0x18-byte struct. This stores timezone info.<br />
<br />
[[Category:Services]]</div>
Thog
https://switchbrew.org/w/index.php?title=Glue_services&diff=7859
Glue services
2019-09-12T17:45:29Z
<p>Thog: </p>
<hr />
<div>= arp:r =<br />
This is "nn::arp::detail::IReader".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetApplicationLaunchProperty || Takes an input u64 ProcessId, returns an [[#ApplicationLaunchProperty]]<br />
|-<br />
| 1 || GetApplicationLaunchPropertyWithApplicationId || Takes an input u64 TitleId, returns an [[#ApplicationLaunchProperty]]<br />
|-<br />
| 2 || GetApplicationControlProperty || Takes an input u64 ProcessId, returns a type-0x16 buffer filled with the contents of [[NACP_Format|control.nacp]]<br />
|-<br />
| 3 || GetApplicationControlPropertyWithApplicationId || Takes an input u64 TitleId, returns a type-0x16 buffer filled with the contents of [[NACP_Format|control.nacp]]<br />
|-<br />
| 9998 || [9.0.0+] ||<br />
|-<br />
| 9999 || [9.0.0+] ||<br />
|}<br />
<br />
= arp:w =<br />
This is "nn::arp::detail::IWriter".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || AcquireRegistrar || Returns an [[#IRegistrar]]<br />
|-<br />
| 1 || DeleteProperties || Takes an input u64 unknown<br />
|}<br />
<br />
== IRegistrar ==<br />
This is "nn::arp::detail::IRegistrar".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || Issue || Takes an input u64 unknown<br />
|-<br />
| 1 || SetApplicationLaunchProperty || Takes an input [[#ApplicationLaunchProperty]]<br />
|-<br />
| 2 || SetApplicationControlProperty || Takes an input type-0x15 buffer filled with the contents of [[NACP_Format|control.nacp]]<br />
|}<br />
<br />
= bgtc:t =<br />
This is "nn::bgtc::ITaskService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 1 || NotifyTaskStarting<br />
|-<br />
| 2 || NotifyTaskFinished<br />
|-<br />
| 3 || GetTriggerEvent<br />
|-<br />
| 4 || IsInHalfAwake<br />
|-<br />
| 5 || NotifyClientName<br />
|-<br />
| 6 || [3.0.0+] IsInFullAwake<br />
|-<br />
| 11 || ScheduleTask<br />
|-<br />
| 12 || GetScheduledTaskInterval<br />
|-<br />
| 13 || UnscheduleTask<br />
|-<br />
| 14 || GetScheduleEvent<br />
|-<br />
| 15 || SchedulePeriodicTask<br />
|-<br />
| 16 || [9.0.0+]<br />
|-<br />
| 101 || [3.0.0+] GetOperationMode<br />
|-<br />
| 102 || [3.0.0+] WillDisconnectNetworkWhenEnteringSleep<br />
|-<br />
| 103 || [3.0.0+] WillStayHalfAwakeInsteadSleep<br />
|}<br />
<br />
= bgtc:sc =<br />
This is "nn::bgtc::IStateControlService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 1 || GetState<br />
|-<br />
| 2 || GetStateChangedEvent<br />
|-<br />
| 3 || NotifyEnteringHalfAwake<br />
|-<br />
| 4 || NotifyLeavingHalfAwake<br />
|-<br />
| 5 || [3.0.0+] SetIsUsingSleepUnsupportedDevices<br />
|}<br />
<br />
= time:a, time:r, time:u =<br />
These are "nn::timesrv::detail::service::IStaticService".<br />
<br />
These were added with [9.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetStandardUserSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 1 || GetStandardNetworkSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 2 || GetStandardSteadyClock || Returns an [[#ISteadyClock]].<br />
|-<br />
| 3 || GetTimeZoneService || Returns an [[#ITimeZoneService]].<br />
|-<br />
| 4 || GetStandardLocalSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 5 || [4.0.0+] GetEphemeralNetworkSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 20 || [6.0.0+] GetSharedMemoryNativeHandle || <br />
|-<br />
| 30 || [6.0.0-8.1.0] GetStandardNetworkClockOperationEventReadableHandle || <br />
|-<br />
| 31 || [6.0.0-8.1.0] GetEphemeralNetworkClockOperationEventReadableHandle || <br />
|-<br />
| 50 || [4.0.0+] SetStandardSteadyClockInternalOffset || <br />
|-<br />
| 51 || [9.0.0+] GetStandardSteadyClockRtcValue || <br />
|-<br />
| 100 || IsStandardUserSystemClockAutomaticCorrectionEnabled || <br />
|-<br />
| 101 || SetStandardUserSystemClockAutomaticCorrectionEnabled || <br />
|-<br />
| 102 || [5.0.0+] GetStandardUserSystemClockInitialYear || <br />
|-<br />
| 200 || [3.0.0+] IsStandardNetworkSystemClockAccuracySufficient || <br />
|-<br />
| 201 || [6.0.0+] GetStandardUserSystemClockAutomaticCorrectionUpdatedTime || <br />
|-<br />
| 300 || [4.0.0+] CalculateMonotonicSystemClockBaseTimePoint || <br />
|-<br />
| 400 || [4.0.0+] GetClockSnapshot || <br />
|-<br />
| 401 || [4.0.0+] GetClockSnapshotFromSystemClockContext || <br />
|-<br />
| 500 || [4.0.0+] CalculateStandardUserSystemClockDifferenceByUser || <br />
|-<br />
| 501 || [4.0.0+] CalculateSpanBetween || <br />
|}<br />
<br />
== ISteadyClock ==<br />
This is "nn::timesrv::detail::service::ISteadyClock".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetCurrentTimePoint || No input, returns an output [[#SteadyClockTimePoint]].<br />
|-<br />
| 2 || GetTestOffset || No input, returns an output [[#TimeSpanType]].<br />
|-<br />
| 3 || SetTestOffset || Takes an input [[#TimeSpanType]], no output.<br />
|-<br />
| 100 || [2.0.0+] GetRtcValue || No input, returns an output s64.<br />
|-<br />
| 101 || [2.0.0+] IsRtcResetDetected || No input, returns an output u8 bool.<br />
|-<br />
| 102 || [2.0.0+] GetSetupResultValue || No input, returns an output u32.<br />
|-<br />
| 200 || [3.0.0+] GetInternalOffset || No input, returns an output [[#TimeSpanType]].<br />
|-<br />
| 201 || [3.0.0-3.0.2] SetInternalOffset || Takes an input [[#TimeSpanType]], no output.<br />
|}<br />
<br />
=== SteadyClockTimePoint ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x8|| A u64 representing a point in time.<br />
|-<br />
| 0x8 || 0x10 || An ID representing the clock source.<br />
|}<br />
<br />
This is a 0x18-byte struct.<br />
<br />
=== TimeSpanType ===<br />
This is an u64.<br />
<br />
== ISystemClock ==<br />
This is "nn::timesrv::detail::service::ISystemClock".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetCurrentTime || Returns an output [[#PosixTime]].<br />
|-<br />
| 1 || SetCurrentTime || Takes an input [[#PosixTime]].<br />
|-<br />
| 2 || GetSystemClockContext || Returns an output [[#SystemClockContext]].<br />
|-<br />
| 3 || SetSystemClockContext || Takes an input [[#SystemClockContext]].<br />
|-<br />
| 4 || [9.0.0+] GetOperationEventReadableHandle ||<br />
|}<br />
<br />
=== PosixTime ===<br />
This is an s64 for UTC POSIX time.<br />
<br />
=== SystemClockContext ===<br />
This is an 0x20-byte struct.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x8|| a [[#PosixTime]] representing the system clock epoch.<br />
|-<br />
| 0x8 || 0x18 || a [[#SteadyClockTimePoint]]<br />
|}<br />
<br />
== ITimeZoneService ==<br />
This is "nn::timesrv::detail::service::ITimeZoneService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetDeviceLocationName || No input, returns an output [[#LocationName]].<br />
|-<br />
| 1 || SetDeviceLocationName || Takes an input [[#LocationName]], no output.<br />
|-<br />
| 2 || GetTotalLocationNameCount || No input, returns an output s32.<br />
|-<br />
| 3 || LoadLocationNameList || <br />
|-<br />
| 4 || LoadTimeZoneRule || Takes an input [[#LocationName]] and a type-0x16 output buffer for [[#TimeZoneRule]], no output.<br />
|-<br />
| 5 || [2.0.0+] GetTimeZoneRuleVersion || No input, returns an output [[#TimeZoneRuleVersion]].<br />
|-<br />
| 6 || [5.0.0+] GetDeviceLocationNameAndUpdatedTime || <br />
|-<br />
| 7 || [9.0.0+] SetDeviceLocationNameWithTimeZoneRule || <br />
|-<br />
| 8 || [9.0.0+] ParseTimeZoneBinary || Stubbed, return 0x7BC74. <br />
|-<br />
| 20 || [9.0.0+] GetDeviceLocationNameOperationEventReadableHandle || <br />
|-<br />
| 100 || ToCalendarTime || Takes an input [[#PosixTime]] and a type-0x15 input buffer for [[#TimeZoneRule]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].<br />
|-<br />
| 101 || ToCalendarTimeWithMyRule || Takes an input [[#PosixTime]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].<br />
|-<br />
| 201 || ToPosixTime || Takes an input [[#CalendarTime]], a type-0x15 input buffer for [[#TimeZoneRule]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.<br />
|-<br />
| 202 || ToPosixTimeWithMyRule || Takes an input [[#CalendarTime]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.<br />
|}<br />
<br />
=== LoadLocationNameList ===<br />
Takes an input s32 LocationName_index and a type-0x6 output buffer for [[#LocationName]], returns an output s32 for total output entries.<br />
<br />
=== LocationName ===<br />
This contains a TimeZone location string with a max size of 0x24 bytes.<br />
<br />
=== TimeZoneRule ===<br />
This is an 0x4000-byte struct. Official sw uses fixed-size 0x4000 for the buffer size with the above commands.<br />
<br />
This is loaded from the [[Title_list|TimeZoneBinary]] title with the specified LocationName under the zoneinfo/ directory, the content is then converted into this TimeZoneRule structure.<br />
<br />
The files contained under zoneinfo/ directory are Tzif2 files without Tzif1 header and data at the begining of them (see [https://tools.ietf.org/html/rfc8536 RFC8536] for more information).<br />
<br />
The conversion of a Tzif2 file to a TimeZoneRule structure is based on [https://github.com/eggert/tz/blob/master/localtime.c tz database code] with some custom modifications (Leap seconds aren't handled, no usage of "posixrules" and Tzif1 support stripped out).<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x4 || timecnt<br />
|-<br />
| 0x4 || 0x4 || typecnt<br />
|-<br />
| 0x8 || 0x4 || charcnt<br />
|-<br />
| 0xC || 0x1 || goback<br />
|-<br />
| 0xD || 0x1 || goahead<br />
|-<br />
| 0xE || 0x2 || Padding<br />
|-<br />
| 0x10 || 0x8 * 1000 || ats<br />
|-<br />
| 0x1f50 || 0x1 * 1000 || types<br />
|-<br />
| 0x2338 || 0x10 * 128 || ttis (time type information), struct ttinfo[1000]<br />
|-<br />
| 0x2b38 || 0x1 * 512 || chars<br />
|-<br />
| 0x2d38 || 0x4 || defaulttype<br />
|-<br />
| 0x2d3c || 0x12c4 || Reserved / Unused<br />
|}<br />
<br />
=== ttinfo ===<br />
This is an 0x10-byte struct.<br />
Represent a Time Type Information used in [[#TimeZoneRule]].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x4 || tt_gmtoff<br />
|-<br />
| 0x4 || 0x1 || tt_isdst<br />
|-<br />
| 0x5 || 0x3 || Padding<br />
|-<br />
| 0x8 || 0x4 || tt_abbrind<br />
|-<br />
| 0xC || 0x1 || tt_ttisstd<br />
|-<br />
| 0xD || 0x1 || tt_ttisgmt<br />
|-<br />
| 0xE || 0x2 || Padding<br />
|}<br />
<br />
=== TimeZoneRuleVersion ===<br />
This is an u128.<br />
<br />
=== CalendarTime ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x2 || Year<br />
|-<br />
| 0x2 || 0x1 || Month<br />
|-<br />
| 0x3 || 0x1 || Day<br />
|-<br />
| 0x4 || 0x1 || Hour<br />
|-<br />
| 0x5 || 0x1 || Minute<br />
|-<br />
| 0x6 || 0x1 || Second<br />
|-<br />
| 0x7 || 0x1 || Padding / unknown?<br />
|}<br />
<br />
This is an 0x8-byte struct.<br />
<br />
=== CalendarAdditionalInfo ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x4 || 0-based day-of-week.<br />
|-<br />
| 0x4 || 0x4 || 0-based day-of-year.<br />
|-<br />
| 0x8 || 0x8 || Timezone name string.<br />
|-<br />
| 0x10 || 0x4 || 0 = no DST, 1 = DST.<br />
|-<br />
| 0x14 || 0x4 || s32 seconds relative to UTC for this timezone.<br />
|}<br />
<br />
This is an 0x18-byte struct. This stores timezone info.<br />
<br />
= notif:a =<br />
This is "nn::notification::server::INotificationServicesForApplication".<br />
<br />
This was added with [9.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 500 || RegisterAlarmSetting<br />
|-<br />
| 510 || UpdateAlarmSetting<br />
|-<br />
| 520 || ListAlarmSettings<br />
|-<br />
| 530 || LoadApplicationParameter<br />
|-<br />
| 540 || DeleteAlarmSetting<br />
|-<br />
| 1000 || Initialize<br />
|}<br />
<br />
= notif:s =<br />
This is "nn::notification::server::INotificationServicesForSystem".<br />
<br />
This was added with [9.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 500 || RegisterAlarmSetting<br />
|-<br />
| 510 || UpdateAlarmSetting<br />
|-<br />
| 520 || ListAlarmSettings<br />
|-<br />
| 530 || LoadApplicationParameter<br />
|-<br />
| 540 || DeleteAlarmSetting<br />
|-<br />
| 1000 || Initialize<br />
|-<br />
| 1010 ||<br />
|-<br />
| 1020 ||<br />
|-<br />
| 1030 ||<br />
|-<br />
| 1040 ||<br />
|-<br />
| 1500 ||<br />
|-<br />
| 1510 ||<br />
|-<br />
| 2000 ||<br />
|-<br />
| 2001 ||<br />
|-<br />
| 2010 ||<br />
|-<br />
| 2020 ||<br />
|-<br />
| 8000 ||<br />
|-<br />
| 8010 ||<br />
|-<br />
| 9000 ||<br />
|}<br />
<br />
== Cmd1040 ==<br />
No input, returns an output [[#IUnknown0]].<br />
<br />
== IUnknown0 ==<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || <br />
|}<br />
<br />
This was added with [9.0.0+].<br />
<br />
Cmd0: no input, returns an output handle.<br />
<br />
= ApplicationLaunchProperty =<br />
Total size is 0x10-bytes.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset<br />
! Size<br />
! Description<br />
|-<br />
| 0x00<br />
| 0x08<br />
| Title ID<br />
|-<br />
| 0x08<br />
| 0x04<br />
| Version<br />
|-<br />
| 0x0C<br />
| 0x01<br />
| Base Game [[Filesystem_services#StorageId|Storage Id]]<br />
|-<br />
| 0x0D<br />
| 0x01<br />
| Update [[Filesystem_services#StorageId|Storage Id]]<br />
|-<br />
| 0x0E<br />
| 0x02<br />
| Padding<br />
|}<br />
<br />
[[Category:Services]]</div>
Thog
https://switchbrew.org/w/index.php?title=Error_codes&diff=7212
Error codes
2019-07-14T16:21:10Z
<p>Thog: </p>
<hr />
<div>= Structure =<br />
These have been redesigned from the 3DS so that they fit within a Aarch64 MOV instruction immediate most of the time (without requiring the additional MOVK).<br />
<br />
{| class=wikitable<br />
! Bits || Field<br />
|-<br />
| 8-0 || Module<br />
|-<br />
| 21-9 || Description<br />
|}<br />
<br />
When a fatal-error is received the error code is outputted using the following formatter:<br />
%04d-%04d<br />
<br />
.. where the first code is <code>2000 + Module</code>, and the other being <code>Description</code>. Bits >=22 from the error-code are unused when displaying fatal-errors, since the Description ends with bit21.<br />
<br />
= Modules =<br />
{| class=wikitable<br />
! Value || Name<br />
|-<br />
| 1 || Kernel<br />
|-<br />
| 2 || FS<br />
|-<br />
| 3 || OS (Memory, Thread, Mutex, NVIDIA)<br />
|-<br />
| 4 || HTCS<br />
|-<br />
| 5 || NCM<br />
|-<br />
| 6 || DD<br />
|-<br />
| 7 || Debug Monitor<br />
|-<br />
| 8 || LR<br />
|-<br />
| 9 || Loader<br />
|-<br />
| 10 || CMIF (IPC command interface)<br />
|-<br />
| 11 || HIPC (IPC)<br />
|-<br />
| 15 || PM<br />
|-<br />
| 16 || NS<br />
|-<br />
| 17 || Sockets<br />
|-<br />
| 18 || HTC<br />
|-<br />
| 19 || TSC<br />
|-<br />
| 20 || NCM Content<br />
|-<br />
| 21 || SM<br />
|-<br />
| 22 || RO userland<br />
|-<br />
| 24 || SDMMC<br />
|-<br />
| 25 || OVLN<br />
|-<br />
| 26 || SPL<br />
|-<br />
| 30 || Bus<br />
|-<br />
| 100 || ETHC<br />
|-<br />
| 101 || I2C<br />
|-<br />
| 102 || GPIO<br />
|-<br />
| 103 || UART<br />
|-<br />
| 105 || Settings<br />
|-<br />
| 107 || WLAN<br />
|-<br />
| 108 || XCD<br />
|-<br />
| 110 || NIFM<br />
|-<br />
| 111 || Hwopus<br />
|-<br />
| 113 || Bluetooth<br />
|-<br />
| 114 || VI<br />
|-<br />
| 115 || NFP<br />
|-<br />
| 116 || Time<br />
|-<br />
| 117 || FGM<br />
|-<br />
| 118 || OE<br />
|-<br />
| 120 || PCIe<br />
|-<br />
| 121 || Friends<br />
|-<br />
| 122 || BCAT<br />
|-<br />
| 123 || SSL<br />
|-<br />
| 124 || Account<br />
|-<br />
| 125 || News<br />
|-<br />
| 126 || Mii<br />
|-<br />
| 127 || NFC<br />
|-<br />
| 128 || AM<br />
|-<br />
| 129 || Play Report<br />
|-<br />
| 130 || AHID<br />
|-<br />
| 132 || Home Menu (Qlaunch)<br />
|-<br />
| 133 || PCV<br />
|-<br />
| 134 || OMM<br />
|-<br />
| 135 || BPC<br />
|-<br />
| 136 || PSM<br />
|-<br />
| 137 || NIM<br />
|-<br />
| 138 || PSC<br />
|-<br />
| 139 || TC<br />
|-<br />
| 140 || USB<br />
|-<br />
| 141 || NSD<br />
|-<br />
| 142 || PCTL<br />
|-<br />
| 143 || BTM<br />
|-<br />
| 144 || LA (Library Applet)<br />
|-<br />
| 145 || ETicket<br />
|-<br />
| 146 || NGC (Bad Words)<br />
|-<br />
| 147 || Error Report<br />
|-<br />
| 148 || APM<br />
|-<br />
| 149 || CEC<br />
|-<br />
| 150 || Profiler<br />
|-<br />
| 151 || Error Upload<br />
|-<br />
| 153 || Audio<br />
|-<br />
| 154 || NPNS<br />
|-<br />
| 155 || NPNS HTTP Stream<br />
|-<br />
| 157 || ARP<br />
|-<br />
| 158 || Updater<br />
|-<br />
| 159 || SWKBD<br />
|-<br />
| 161 || NFC Mifare<br />
|-<br />
| 162 || Userland assert<br />
|-<br />
| 163 || Fatal<br />
|-<br />
| 164 || NIM Shop<br />
|-<br />
| 165 || SPSM<br />
|-<br />
| 167 || BGTC<br />
|-<br />
| 168 || Userland crash<br />
|-<br />
| 178 || PDM<br />
|-<br />
| 179 || OLSC<br />
|-<br />
| 180 || SREPO<br />
|-<br />
| 181 || Dauth<br />
|-<br />
| 191 || RTC<br />
|-<br />
| 192 || Regulator<br />
|-<br />
| 197 || Clkrst<br />
|-<br />
| 202 || HID<br />
|-<br />
| 203 || LDN<br />
|-<br />
| 205 || Irsensor<br />
|-<br />
| 206 || Capture<br />
|-<br />
| 208 || Manu<br />
|-<br />
| 209 || ATK<br />
|-<br />
| 210 || Web<br />
|-<br />
| 211 ||<br />
|-<br />
| 212 || GRC<br />
|-<br />
| 216 || Migration<br />
|-<br />
| 217 || Migration Idc Server<br />
|-<br />
| 345 || libnx<br />
|-<br />
| 346 || [[Homebrew ABI]]<br />
|-<br />
| 347 || Homebrew Loader<br />
|-<br />
| 348 || libnx Nvidia errors<br />
|-<br />
|}<br />
<br />
= Error codes =<br />
{| class=wikitable<br />
! Value || Module || Description || Notes<br />
|-<br />
| 0x0E01 || 1 || 7 || Session count exceeded<br />
|-<br />
| 0x1C01 || 1 || 14 || Invalid kernel capability descriptor<br />
|-<br />
| 0x4201 || 1 || 33 || Not Implemented<br />
|-<br />
| 0x7601 || 1 || 59 || Thread terminated/termination requested<br />
|-<br />
| 0x8C01 || 1 || 70 || No more debug events<br />
|-<br />
| 0xCA01 || 1 || 101 || Invalid size<br />
|-<br />
| 0xCC01 || 1 || 102 || Invalid address<br />
|-<br />
| 0xCE01 || 1 || 103 || Resource exhaustion<br />
|-<br />
| 0xD001 || 1 || 104 || Memory exhaustion<br />
|-<br />
| 0xD201 || 1 || 105 || Handle-table exhaustion<br />
|-<br />
| 0xD401 || 1 || 106 || Invalid memory state / invalid memory permissions.<br />
|-<br />
| 0xD801 || 1 || 108 || Invalid memory permissions.<br />
|-<br />
| 0xDC01 || 1 || 110 || Invalid memory range<br />
|-<br />
| 0xE001 || 1 || 112 || Invalid thread priority.<br />
|-<br />
| 0xE201 || 1 || 113 || Invalid processor id.<br />
|-<br />
| 0xE401 || 1 || 114 || Invalid handle.<br />
|-<br />
| 0xE601 || 1 || 115 || Invalid pointer/Syscall copy from user failed.<br />
|-<br />
| 0xE801 || 1 || 116 || Invalid combination<br />
|-<br />
| 0xEA01 || 1 || 117 || Time out. Also when you give 0 handles to svcWaitSynchronizationN.<br />
|-<br />
| 0xEC01 || 1 || 118 || Operation canceled<br />
|-<br />
| 0xEE01 || 1 || 119 || Out of range<br />
|-<br />
| 0xF001 || 1 || 120 || Invalid enum<br />
|-<br />
| 0xF201 || 1 || 121 || No such entry<br />
|-<br />
| 0xF401 || 1 || 122 || Irq/DeviceAddressSpace/{...} already registered<br />
|-<br />
| 0xF601 || 1 || 123 || Port remote dead<br />
|-<br />
| 0xF801 || 1 || 124 || [Usermode] Unhandled interrupt/exception<br />
|-<br />
| 0xFA01 || 1 || 125 || Process already started/Wrong memory permission?<br />
|-<br />
| 0xFC01 || 1 || 126 || Reserved value<br />
|-<br />
| 0xFE01 || 1 || 127 || Invalid hardware breakpoint<br />
|-<br />
| 0x10001 || 1 || 128 || [Usermode] Fatal exception<br />
|-<br />
| 0x10201 || 1 || 129 || Last thread didn't belong to your process<br />
|-<br />
| 0x10601 || 1 || 131 || Port closed<br />
|-<br />
| 0x10801 || 1 || 132 || Resource limit exceeded<br />
|-<br />
| 0x20801 || 1 || 260 || Command buffer too small<br />
|-<br />
| 0x40A01 || 1 || 517 || Invalid process ID.<br />
|-<br />
| 0x40C01 || 1 || 518 || Invalid thread ID.<br />
|-<br />
| 0x40E01 || 1 || 519 || Invalid thread ID (used in svcGetDebugThreadParam).<br />
|-<br />
| 0x41001 || 1 || 520 || Process not being debugged<br />
|-<br />
| 0x202 || 2 || 1 || Path does not exist.<br />
|-<br />
| 0x402 || 2 || 2 || Path already exists.<br />
|-<br />
| 0xE02 || 2 || 7 || Resource already in use (file already opened, savedata filesystem already mounted).<br />
|-<br />
| 0x4602 || 2 || 35 || Not enough free space for BIS Calibration partition.<br />
|-<br />
| 0x4802 || 2 || 36 || Not enough free space for BIS Safe partition.<br />
|-<br />
| 0x4A02 || 2 || 37 || Not enough free space for BIS User partition.<br />
|-<br />
| 0x4C02 || 2 || 38 || Not enough free space for BIS System partition.<br />
|-<br />
| 0x4E02 || 2 || 39 || Not enough free space on SD card.<br />
|-<br />
| 0x6402 || 2 || 50 || NCA is older than version 3, or NCA SDK version is older than 0.11.0.0<br />
|-<br />
| 0x7802 || 2 || 60 || Specified mount name already exists.<br />
|-<br />
| 0x7D202 || 2 || 1001 || Process does not have RomFs <br />
|-<br />
| 0x7D402 || 2 || 1002 || Title-id not found / savedata not found.<br />
|-<br />
| 0xFA202 || 2 || 2001 || SD card not inserted<br />
|-<br />
| 0x13B002 || 2 || 2520 || Gamecard not inserted<br />
|-<br />
| 0x13DA02 || 2 || 2541 || Version check failed when mounting gamecard sysupdate partition?<br />
|-<br />
| 0x171402 || 2 || 2954 || Invalid gamecard handle.<br />
|-<br />
| 0x177202 || 2 || 3001 || Unimplemented behavior<br />
|-<br />
| 0x177602 || 2 || 3003 || File/Directory already exists.<br />
|-<br />
| 0x190202 || 2 || 3201 || Memory allocation failure related to FAT filesystem code<br />
|-<br />
| 0x190602 || 2 || 3203 || Memory allocation failure related to FAT filesystem code<br />
|-<br />
| 0x190802 || 2 || 3204 || Memory allocation failure related to FAT filesystem code<br />
|-<br />
| 0x190A02 || 2 || 3205 || Memory allocation failure related to FAT filesystem code<br />
|-<br />
| 0x190C02 || 2 || 3206 || Memory allocation failure related to FAT filesystem code<br />
|-<br />
| 0x191002 || 2 || 3208 || Memory allocation failure related to FAT filesystem code<br />
|-<br />
| 0x195802 || 2 || 3244 || Allocation failure related to SD cards<br />
|-<br />
| 0x196002 || 2 || 3248 || Out of memory<br />
|-<br />
| 0x196202 || 2 || 3249 || Out of memory<br />
|-<br />
| 0x1A3E02 || 2 || 3359 || Out of memory<br />
|-<br />
| 0x1A4002 || 2 || 3360 || Out of memory<br />
|-<br />
| 0x1A4A02 || 2 || 3365 || Out of memory<br />
|-<br />
| 0x21BC02 || 2 || 4318 || Invalid save data filesystem magic (valid magic is SAVE in ASCII)<br />
|-<br />
| 0x234202 || 2 || 4513 || Error reading ACID section in NPDM<br />
|-<br />
| 0x234402 || 2 || 4514 || Invalid NPDM ACID section size<br />
|-<br />
| 0x234602 || 2 || 4515 || Last byte of the ACID modulus is zero<br />
|-<br />
| 0x234802 || 2 || 4516 || Invalid ACID fixed key signature<br />
|-<br />
| 0x234A02 || 2 || 4517 || Invalid NCA magic<br />
|-<br />
| 0x234C02 || 2 || 4518 || Invalid NCA header fixed key signature<br />
|-<br />
| 0x234E02 || 2 || 4519 || Invalid NCA header ACID signature<br />
|-<br />
| 0x235002 || 2 || 4520 || Invalid NCA header section hash<br />
|-<br />
| 0x235202 || 2 || 4521 || Invalid NCA Key index<br />
|-<br />
| 0x235602 || 2 || 4523 || Invalid encryption type<br />
|-<br />
| 0x235802 || 2 || 4524 || Redirection BKTR table size is negative<br />
|-<br />
| 0x235A02 || 2 || 4525 || Encryption BKTR table size is negative<br />
|-<br />
| 0x235C02 || 2 || 4526 || Redirection BKTR table end offset is past the Encryption BKTR table start offset<br />
|-<br />
| 0x235E02 || 2 || 4527 || NCA-path used with the wrong titleID.<br />
|-<br />
| 0x236002 || 2 || 4528 || NCA header value is out of range<br />
|-<br />
| 0x236202 || 2 || 4529 || NCA FS header value is out of range<br />
|-<br />
| 0x236802 || 2 || 4532 || PartitionFS hash block size is not a power of 2<br />
|-<br />
| 0x236A02 || 2 || 4533 || PartitionFS hash "always_2" field is not 2<br />
|-<br />
| 0x236C02 || 2 || 4534 || PartitionFS hash table is too small for main data<br />
|-<br />
| 0x236E02 || 2 || 4535 || Invalid PartitionFS block hash<br />
|-<br />
| 0x244402 || 2 || 4642 || Invalid Partition file hashed region bounds<br />
|-<br />
| 0x244602 || 2 || 4643 || Invalid Partition FS hash<br />
|-<br />
| 0x244802 || 2 || 4644 || Invalid PFS0 magic<br />
|-<br />
| 0x244A02 || 2 || 4645 || Invalid HFS0 magic<br />
|-<br />
| 0x244C02 || 2 || 4646 || Invalid name offset for Partition FS file entry<br />
|-<br />
| 0x244E02 || 2 || 4647 || Calculated Partition FS header size changed between 2 consecutive reads<br />
|-<br />
| 0x249802 || 2 || 4684 || Invalid FAT file number.<br />
|-<br />
| 0x249C02 || 2 || 4686 || Invalid FAT format for BIS User partition.<br />
|-<br />
| 0x249E02 || 2 || 4687 || Invalid FAT format for BIS System partition.<br />
|-<br />
| 0x24A002 || 2 || 4688 || Invalid FAT format for BIS Safe partition.<br />
|-<br />
| 0x24A202 || 2 || 4689 || Invalid FAT format for BIS Calibration partition.<br />
|-<br />
| 0x250E02 || 2 || 4743 || [[NAX0|Corrupted]] NAX0 header.<br />
|-<br />
| 0x251002 || 2 || 4744 || Invalid [[NAX0]] magicnum.<br />
|-<br />
| 0x280202 || 2 || 5121 || Invalid FAT size<br />
|-<br />
| 0x280402 || 2 || 5122 || Invalid FAT BPB (BIOS Parameter Block)<br />
|-<br />
| 0x280602 || 2 || 5123 || Invalid FAT parameter<br />
|-<br />
| 0x280802 || 2 || 5124 || Invalid FAT sector<br />
|-<br />
| 0x280A02 || 2 || 5125 || Invalid FAT sector<br />
|-<br />
| 0x280C02 || 2 || 5126 || Invalid FAT sector<br />
|-<br />
| 0x280E02 || 2 || 5127 || Invalid FAT sector<br />
|-<br />
| 0x296A02 || 2 || 5301 || Mountpoint not found<br />
|-<br />
| 0x2EE202 || 2 || 6001 || Invalid input<br />
|-<br />
| 0x2EE602 || 2 || 6003 || Path too long<br />
|-<br />
| 0x2EE802 || 2 || 6004 || Invalid character.<br />
|-<br />
| 0x2EEA02 || 2 || 6005 || Invalid directory path.<br />
|-<br />
| 0x2EEC02 || 2 || 6006 || Unable to retrieve directory from path<br />
|-<br />
| 0x2F5A02 || 2 || 6061 || Offset outside storage<br />
|-<br />
| 0x313802 || 2 || 6300 || Operation not supported<br />
|-<br />
| 0x313C02 || 2 || 6302 || Attempted to resize a nn::fs::SubStorage or BufferedStorage that is marked as non-resizable<br />
|-<br />
| 0x313E02 || 2 || 6303 || Attempted to resize a nn::fs::SubStorage or BufferedStorage when the SubStorage ends before the base storage<br />
|-<br />
| 0x314002 || 2 || 6304 || Attempted to call nn::fs::MemoryStorage::SetSize<br />
|-<br />
| 0x314202 || 2 || 6305 || Invalid Operation ID in nn::fs::MemoryStorage::OperateRange<br />
|-<br />
| 0x314402 || 2 || 6306 || Invalid Operation ID in nn::fs::FileStorage::OperateRange<br />
|-<br />
| 0x314C02 || 2 || 6310 || Attempted to call nn::fssystem::AesCtrCounterExtendedStorage::Write<br />
|-<br />
| 0x314E02 || 2 || 6311 || Attempted to call nn::fssystem::AesCtrCounterExtendedStorage::SetSize<br />
|-<br />
| 0x315002 || 2 || 6312 || Invalid Operation ID in nn::fssystem::AesCtrCounterExtendedStorage::OperateRange<br />
|-<br />
| 0x315802 || 2 || 6316 || Attempted to call nn::fssystem::save::HierarchicalIntegrityVerificationStorage::SetSize<br />
|-<br />
| 0x315A02 || 2 || 6317 || Attempted to call nn::fssystem::save::HierarchicalIntegrityVerificationStorage::OperateRange<br />
|-<br />
| 0x315C02 || 2 || 6318 || Attempted to call nn::fssystem::save::IntegrityVerificationStorage::SetSize<br />
|-<br />
| 0x315E02 || 2 || 6319 || Attempted to invalidate the cache of a RomFs IVFC storage in nn::fssystem::save::IntegrityVerificationStorage::OperateRange<br />
|-<br />
| 0x316002 || 2 || 6320 || Invalid Operation ID in nn::fssystem::save::IntegrityVerificationStorage::OperateRange <br />
|-<br />
| 0x316202 || 2 || 6321 || Attempted to call nn::fssystem::save::BlockCacheBufferedStorage::SetSize<br />
|-<br />
| 0x316402 || 2 || 6322 || Attempted to invalidate the cache of something other than a savedata IVFC storage in nn::fssystem::save::BlockCacheBufferedStorage::OperateRange<br />
|-<br />
| 0x316602 || 2 || 6323 || Invalid Operation ID in nn::fssystem::save::BlockCacheBufferedStorage::OperateRange<br />
|-<br />
| 0x316802 || 2 || 6324 || Attempted to call nn::fssystem::IndirectStorage::Write<br />
|-<br />
| 0x316A02 || 2 || 6325 || Attempted to call nn::fssystem::IndirectStorage::SetSize<br />
|-<br />
| 0x316C02 || 2 || 6326 || Invalid Operation ID in nn::fssystem::IndirectStorage::OperateRange<br />
|-<br />
| 0x317202 || 2 || 6329 || Attempted to call nn::fssystem::HierarchicalSha256Storage::SetSize<br />
|-<br />
| 0x317402 || 2 || 6330 || Attempted to call nn::fssystem::ReadOnlyBlockCacheStorage::Write<br />
|-<br />
| 0x317602 || 2 || 6331 || Attempted to call nn::fssystem::ReadOnlyBlockCacheStorage::SetSize<br />
|-<br />
| 0x317802 || 2 || 6332 || Attempted to call nn::fssystem::IntegrityRomFsStorage::SetSize<br />
|-<br />
| 0x317A02 || 2 || 6333 || Attempted to call nn::fssystem::save::DuplexStorage::SetSize<br />
|-<br />
| 0x317C02 || 2 || 6334 || Invalid Operation ID in nn::fssystem::save::DuplexStorage::OperateRange<br />
|-<br />
| 0x317E02 || 2 || 6335 || Attempted to call nn::fssystem::save::HierarchicalDuplexStorage::SetSize<br />
|-<br />
| 0x318002 || 2 || 6336 || Attempted to call nn::fssystem::save::RemapStorage::GetSize<br />
|-<br />
| 0x318202 || 2 || 6337 || Attempted to call nn::fssystem::save::RemapStorage::SetSize<br />
|-<br />
| 0x318402 || 2 || 6338 || Invalid Operation ID in nn::fssystem::save::RemapStorage::OperateRange<br />
|-<br />
| 0x318602 || 2 || 6339 || Attempted to call nn::fssystem::save::IntegritySaveDataStorage::SetSize<br />
|-<br />
| 0x318802 || 2 || 6340 || Invalid Operation ID in nn::fssystem::save::IntegritySaveDataStorage::OperateRange<br />
|-<br />
| 0x318A02 || 2 || 6341 || Attempted to call nn::fssystem::save::JournalIntegritySaveDataStorage::SetSize<br />
|-<br />
| 0x318C02 || 2 || 6342 || Invalid Operation ID in nn::fssystem::save::JournalIntegritySaveDataStorage::OperateRange<br />
|-<br />
| 0x318E02 || 2 || 6343 || Attempted to call nn::fssystem::save::JournalStorage::GetSize<br />
|-<br />
| 0x319002 || 2 || 6344 || Attempted to call nn::fssystem::save::JournalStorage::SetSize<br />
|-<br />
| 0x319202 || 2 || 6345 || Invalid Operation ID in nn::fssystem::save::JournalStorage::OperateRange<br />
|-<br />
| 0x319602 || 2 || 6347 || Attempted to call nn::fssystem::dbm::AllocationTableStorage::SetSize<br />
|-<br />
| 0x31A602 || 2 || 6355 || Invalid Operation ID in nn::fat::FatFile::DoOperateRange<br />
|-<br />
| 0x31A802 || 2 || 6356 || Invalid Operation ID in nn::fssystem::StorageFile::DoOperateRange<br />
|-<br />
| 0x31AE02 || 2 || 6359 || Invalid Query ID in nn::fssystem::ConcatenationFileSystem::DoQueryEntry<br />
|-<br />
| 0x31B002 || 2 || 6360 || Invalid Operation ID in nn::fssystem::ConcatenationFile::DoOperateRange<br />
|-<br />
| 0x31B402 || 2 || 6362 || Invalid Operation ID in nn::fs::detail::FileServiceObjectAdapter::DoOperateRange<br />
|-<br />
| 0x31B602 || 2 || 6363 || Invalid Operation ID in nn::fssystem::AesXtsFile::DoOperateRange<br />
|-<br />
| 0x31B802 || 2 || 6364 || Attempted to modify a nn::fs::RomFsFileSystem<br />
|-<br />
| 0x31BA02 || 2 || 6365 || Attempted to call nn::fs::RomFsFileSystem::DoCommitProvisionally<br />
|-<br />
| 0x31BC02 || 2 || 6366 || Attempted to query the space in a nn::fs::RomFsFileSystem<br />
|-<br />
| 0x31BE02 || 2 || 6367 || Attempted to modify a nn::fssystem::RomFsFile<br />
|-<br />
| 0x31C002 || 2 || 6368 || Invalid Operation ID in nn::fssystem::RomFsFile::DoOperateRange<br />
|-<br />
| 0x31C202 || 2 || 6369 || Attempted to modify a nn::fs::ReadOnlyFileSystemTemplate<br />
|-<br />
| 0x31C402 || 2 || 6370 || Attempted to call nn::fs::ReadOnlyFileSystemTemplate::DoCommitProvisionally<br />
|-<br />
| 0x31C602 || 2 || 6371 || Attempted to query the space in a nn::fs::ReadOnlyFileSystemTemplate<br />
|-<br />
| 0x31C802 || 2 || 6372 || Attempted to modify a nn::fs::ReadOnlyFileSystemFile<br />
|-<br />
| 0x31CA02 || 2 || 6373 || Invalid Operation ID in nn::fs::ReadOnlyFileSystemFile::DoOperateRange<br />
|-<br />
| 0x31CC02 || 2 || 6374 || Attempted to modify a nn::fssystem::PartitionFileSystemCore<br />
|-<br />
| 0x31CE02 || 2 || 6375 || Attempted to call nn::fssystem::PartitionFileSystemCore::DoCommitProvisionally<br />
|-<br />
| 0x31D002 || 2 || 6376 || Attempted to call nn::fssystem::PartitionFileSystemCore::PartitionFile::DoSetSize<br />
|-<br />
| 0x31D202 || 2 || 6377 || Invalid Operation ID in nn::fssystem::PartitionFileSystemCore::PartitionFile::DoOperateRange<br />
|-<br />
| 0x31DC02 || 2 || 6382 || Attempted to call nn::fssystem::ApplicationTemporaryFileSystem::DoCommitProvisionally<br />
|-<br />
| 0x31DE02 || 2 || 6383 || Attempted to call nn::fssystem::SaveDataFileSystem::DoCommitProvisionally<br />
|-<br />
| 0x31E002 || 2 || 6384 || Attempted to call nn::fssystem::DirectorySaveDataFileSystem::DoCommitProvisionally<br />
|-<br />
| 0x320002 || 2 || 6400 || Permission denied<br />
|-<br />
| 0x326602 || 2 || 6451 || Missing titlekey(?) required to mount content<br />
|-<br />
| 0x326E02 || 2 || 6455 || File not closed<br />
|-<br />
| 0x327002 || 2 || 6456 || Directory not closed<br />
|-<br />
| 0x327202 || 2 || 6457 || Writable file not closed when committing<br />
|-<br />
| 0x327402 || 2 || 6458 || FS allocators already registered<br />
|-<br />
| 0x327602 || 2 || 6459 || FS allocators already used<br />
|-<br />
| 0x327A02 || 2 || 6461 || FS allocator alignment violation<br />
|-<br />
| 0x339402 || 2 || 6602 || File not found.<br />
|-<br />
| 0x339602 || 2 || 6603 || Directory not found.<br />
|-<br />
| 0x35F202 || 2 || 6905 || Mount name not found in table.<br />
|-<br />
| 0x3DBC02 || 2 || 7902 || RomFs table: Entry not found in dictionary<br />
|-<br />
| 0x3DBE02 || 2 || 7903 || RomFs table: File not found<br />
|-<br />
| 0x3DC002 || 2 || 7904 || RomFs table: Directory not found<br />
|-<br />
| 0x3DC402 || 2 || 7906 || RomFs table: Entry already exists when trying to add a new entry<br />
|-<br />
| 0x3DC602 || 2 || 7907 || RomFs table: Insufficient space to add new entry<br />
|-<br />
| 0x3DC802 || 2 || 7908 || RomFs table: Unable to add new directory<br />
|-<br />
| 0x3DCA02 || 2 || 7909 || RomFs table: Unable to add new file<br />
|-<br />
| 0x3DCC02 || 2 || 7910 || RomFs directory has no more child directories/files when iterating<br />
|-<br />
| 0x3DD402 || 2 || 7914 || RomFs table: Path is file, not directory<br />
|-<br />
| 0x803 || 3 || 4 || OS busy<br />
|-<br />
| 0xE03 || 3 || 7 || Invalid parameter<br />
|-<br />
| 0x1003 || 3 || 8 || Out of memory<br />
|-<br />
| 0x1203 || 3 || 9 || Out of resources<br />
|-<br />
| 0x3EA03 || 3 || 501 || Invalid handle<br />
|-<br />
| 0x3EE03 || 3 || 503 || Invalid memory mirror<br />
|-<br />
| 0x7FE03 || 3 || 1023 || TLS slot is not allocated<br />
|-<br />
| 0xA05 || 5 || 5 || [[Content_Manager_services|NcaID]] not found. Returned when attempting to mount titles which exist that aren't *8XX titles, the same way *8XX titles are mounted.<br />
|-<br />
| 0xE05 || 5 || 7 || TitleId not found<br />
|-<br />
| 0x1805 || 5 || 12 || Invalid StorageId<br />
|-<br />
| 0xDC05 || 5 || 110 || Gamecard not inserted<br />
|-<br />
| 0x17C05 || 5 || 190 || Gamecard not initialized<br />
|-<br />
| 0x1F405 || 5 || 250 || Sdcard not inserted<br />
|-<br />
| 0x20805 || 5 || 260 || Storage not mounted<br />
|-<br />
| 0x806 || 6 || 4 || Converted from error 0xD401<br />
|-<br />
| 0x1006 || 6 || 8 || Converted from error 0xE401<br />
|-<br />
| 0x408 || 8 || 2 || Program location entry not found<br />
|-<br />
| 0x608 || 8 || 3 || Invalid context for control location<br />
|-<br />
| 0x808 || 8 || 4 || Storage not found<br />
|-<br />
| 0xA08 || 8 || 5 || Access denied<br />
|-<br />
| 0xC08 || 8 || 6 || Offline manual HTML location entry not found<br />
|-<br />
| 0xE08 || 8 || 7 || Title is not registered<br />
|-<br />
| 0x1008 || 8 || 8 || Control location entry for host not found<br />
|-<br />
| 0x1208 || 8 || 9 || Legal info HTML location entry not found<br />
|-<br />
| 0x1408 || 8 || 10 || Program location for debug entry not found<br />
|-<br />
| 0x209 || 9 || 1 || Args too long.<br />
|-<br />
| 0x409 || 9 || 2 || Maximum processes loaded.<br />
|-<br />
| 0x609 || 9 || 3 || NPDM too big.<br />
|-<br />
| 0x19009 || 9 || 200 || Invalid access control sizes in NPDM.<br />
|-<br />
| 0x809 || 9 || 4 || Invalid NPDM.<br />
|-<br />
| 0xA09 || 9 || 5 || Invalid files.<br />
|-<br />
| 0xE09 || 9 || 7 || Already registered.<br />
|-<br />
| 0x1009 || 9 || 8 || Title not found.<br />
|-<br />
| 0x1209 || 9 || 9 || Title-id in ACI0 doesn't match range in ACID.<br />
|-<br />
| 0x6609 || 9 || 51 || Invalid memory state/permission<br />
|-<br />
| 0x6A09 || 9 || 53 || Invalid NRR<br />
|-<br />
| 0xA209 || 9 || 81 || Unaligned NRR address<br />
|-<br />
| 0xA409 || 9 || 82 || Bad NRR size<br />
|-<br />
| 0xAA09 || 9 || 85 || Bad NRR address<br />
|-<br />
| 0xAE09 || 9 || 87 || Bad initialization<br />
|-<br />
| 0xC809 || 9 || 100 || Unknown ACI0 descriptor<br />
|-<br />
| 0xCE09 || 9 || 103 || ACID/ACI0 don't match for descriptor "KernelFlags"<br />
|-<br />
| 0xD009 || 9 || 104 || ACID/ACI0 don't match for descriptor "SyscallMask"<br />
|-<br />
| 0xD409 || 9 || 106 || ACID/ACI0 don't match for descriptor "MapIoOrNormalRange"<br />
|-<br />
| 0xD609 || 9 || 107 || ACID/ACI0 don't match for descriptor "MapNormalPage"<br />
|-<br />
| 0xDE09 || 9 || 111 || ACID/ACI0 don't match for descriptor "InterruptPair"<br />
|-<br />
| 0xE209 || 9 || 113 || ACID/ACI0 don't match for descriptor "ApplicationType"<br />
|-<br />
| 0xE409 || 9 || 114 || ACID/ACI0 don't match for descriptor "KernelReleaseVersion"<br />
|-<br />
| 0xE609 || 9 || 115 || ACID/ACI0 don't match for descriptor "HandleTableSize"<br />
|-<br />
| 0xE809 || 9 || 116 || ACID/ACI0 don't match for descriptor "DebugFlags"<br />
|-<br />
| 0x1940A || 10 || 202 || Invalid CMIF header size.<br />
|-<br />
| 0x1A60A || 10 || 211 || Invalid CMIF input header.<br />
|-<br />
| 0x1A80A || 10 || 212 || Invalid CMIF output header.<br />
|-<br />
| 0x1BA0A || 10 || 221 || Invalid method dispatch ID.<br />
|-<br />
| 0x1D60A || 10 || 235 || Invalid in object count.<br />
|-<br />
| 0x1D80A || 10 || 236 || Invalid out object count.<br />
|-<br />
| 0x25A0A || 10 || 301 || Out of domain entries.<br />
|-<br />
| 0x20B || 11 || 1 || Unsupported operation<br />
|-<br />
| 0xCC0B || 11 || 102 || Out of server session memory<br />
|-<br />
| 0x11A0B || 11 || 141 || Went past maximum during marshalling.<br />
|-<br />
| 0x1900B || 11 || 200 || Session doesn't support domains.<br />
|-<br />
| 0x25A0B || 11 || 301 || Remote process is dead.<br />
|-<br />
| 0x3260B || 11 || 403 || Unknown request type<br />
|-<br />
| 0x3D60B || 11 || 491 || IPC Query 1 failed.<br />
|-<br />
| 0x20F || 15 || 1 || Pid not found<br />
|-<br />
| 0x60F || 15 || 3 || Process has no pending events<br />
|-<br />
| 0xA0F || 15 || 5 || Application already running<br />
|-<br />
| 0x410 || 16 || 2 || Title-id not found<br />
|-<br />
| 0xF010 || 16 || 120 || Gamecard sysupdate not required<br />
|-<br />
| 0x1F610 || 16 || 251 || Unexpected StorageId<br />
|-<br />
| 0x215 || 21 || 1 || Out of processes<br />
|-<br />
| 0x415 || 21 || 2 || Not initialized.<br />
|-<br />
| 0x615 || 21 || 3 || Max sessions<br />
|-<br />
| 0x815 || 21 || 4 || Service already registered<br />
|-<br />
| 0xA15 || 21 || 5 || Out of services<br />
|-<br />
| 0xC15 || 21 || 6 || Invalid name (all zeroes)<br />
|-<br />
| 0xE15 || 21 || 7 || Service not registered<br />
|-<br />
| 0x1015 || 21 || 8 || Permission denied<br />
|-<br />
| 0x1215 || 21 || 9 || Service Access Control too big.<br />
|-<br />
| 0x416 || 22 || 2 || Address space is full<br />
|-<br />
| 0x616 || 22 || 3 || NRO already loaded<br />
|-<br />
| 0x816 || 22 || 4 || Invalid NRO header values<br />
|-<br />
| 0xC16 || 22 || 6 || Bad NRR magic<br />
|-<br />
| 0x1016 || 22 || 8 || Reached max NRR count<br />
|-<br />
| 0x1216 || 22 || 9 || Unable to verify NRO hash or NRR signature<br />
|-<br />
| 0x80216 || 22 || 1025 || Address not page-aligned<br />
|-<br />
| 0x80416 || 22 || 1026 || Incorrect NRO size<br />
|-<br />
| 0x80816 || 22 || 1028 || NRO not loaded<br />
|-<br />
| 0x80A16 || 22 || 1029 || NRR not loaded<br />
|-<br />
| 0x80C16 || 22 || 1030 || Already initialized<br />
|-<br />
| 0x80E16 || 22 || 1031 || Not initialized<br />
|-<br />
| 0x21A || 26 || 1 || SMC is not implemented<br />
|-<br />
| 0x41A || 26 || 2 || SMC argument is invalid<br />
|-<br />
| 0x61A || 26 || 3 || SMC is currently in progress/secmon is busy<br />
|-<br />
| 0x81A || 26 || 4 || Secmon not currently performing async operation<br />
|-<br />
| 0xA1A || 26 || 5 || Invalid SMC async callback key<br />
|-<br />
| 0xC1A || 26 || 6 || SMC is blacklisted during current boot<br />
|-<br />
| 0xC81A || 26 || 100 || Invalid (buffer) size<br />
|-<br />
| 0xCA1A || 26 || 101 || Unknown SMC error<br />
|-<br />
| 0xCA1A || 26 || 101 || Decryption failure<br />
|-<br />
| 0xD01A || 26 || 104 || No AES keyslots available<br />
|-<br />
| 0xD21A || 26 || 105 || Invalid AES keyslot<br />
|-<br />
| 0xD41A || 26 || 106 || BootReason already set<br />
|-<br />
| 0xD61A || 26 || 107 || BootReason not set<br />
|-<br />
| 0xD81A || 26 || 108 || Invalid argument<br />
|-<br />
| 0x19269 || 105 || 201 || Null settings name<br />
|-<br />
| 0x19469 || 105 || 202 || Null settings key<br />
|-<br />
| 0x19669 || 105 || 203 || Null settings value<br />
|-<br />
| 0x19A69 || 105 || 205 || Null settings value buffer<br />
|-<br />
| 0x1A069 || 105 || 208 || Null setting value size buffer<br />
|-<br />
| 0x1A269 || 105 || 209 || Null debug mode flag buffer<br />
|-<br />
| 0x1BA69 || 105 || 221 || Setting group name has zero length<br />
|-<br />
| 0x1BC69 || 105 || 222 || Empty settings item key<br />
|-<br />
| 0x1E269 || 105 || 241 || Setting group name is too long (64 character limit?)<br />
|-<br />
| 0x1E469 || 105 || 242 || Setting name is too long (64 character limit?)<br />
|-<br />
| 0x20A69 || 105 || 261 || Setting group name ends with '.' or contains invalid characters (allowed: [a-z0-9_\-.])<br />
|-<br />
| 0x20C69 || 105 || 262 || Setting name ends with '.' or contains invalid characters (allowed: [a-z0-9_\-.])<br />
|-<br />
| 0x4DA69 || 105 || 621 || Null language code buffer<br />
|-<br />
| 0x4EE69 || 105 || 631 || Null network settings buffer<br />
|-<br />
| 0x4F069 || 105 || 632 || Null network settings output count buffer<br />
|-<br />
| 0x50269 || 105 || 641 || Null backlight settings buffer<br />
|-<br />
| 0x51669 || 105 || 651 || Null Bluetooth device setting buffer<br />
|-<br />
| 0x51869 || 105 || 652 || Null Bluetooth device setting output count buffer<br />
|-<br />
| 0x51A69 || 105 || 653 || Null Bluetooth enable flag buffer<br />
|-<br />
| 0x51C69 || 105 || 654 || Null Bluetooth AFH enable flag buffer<br />
|-<br />
| 0x51E69 || 105 || 655 || Null Bluetooth boost enable flag buffer<br />
|-<br />
| 0x52069 || 105 || 656 || Null BLE pairing settings buffer<br />
|-<br />
| 0x52269 || 105 || 657 || Null BLE pairing settings entry count buffer<br />
|-<br />
| 0x52A69 || 105 || 661 || Null external steady clock source ID buffer<br />
|-<br />
| 0x52C69 || 105 || 662 || Null user system clock context buffer<br />
|-<br />
| 0x52E69 || 105 || 663 || Null network system clock context buffer<br />
|-<br />
| 0x53069 || 105 || 664 || Null user system clock automatic correction enabled flag buffer<br />
|-<br />
| 0x53269 || 105 || 665 || Null shutdown RTC value buffer<br />
|-<br />
| 0x53469 || 105 || 666 || Null external steady clock internal offset buffer<br />
|-<br />
| 0x53E69 || 105 || 671 || Null account settings buffer<br />
|-<br />
| 0x55269 || 105 || 681 || Null audio volume buffer<br />
|-<br />
| 0x55669 || 105 || 683 || Null ForceMuteOnHeadphoneRemoved buffer<br />
|-<br />
| 0x55869 || 105 || 684 || Null headphone volume warning count buffer<br />
|-<br />
| 0x55E69 || 105 || 687 || Invalid audio output mode<br />
|-<br />
| 0x56069 || 105 || 688 || Null headphone volume update flag buffer<br />
|-<br />
| 0x56669 || 105 || 691 || Null console information upload flag buffer<br />
|-<br />
| 0x57A69 || 105 || 701 || Null automatic application download flag buffer<br />
|-<br />
| 0x57C69 || 105 || 702 || Null notification settings buffer<br />
|-<br />
| 0x57E69 || 105 || 703 || Null account notification settings entry count buffer<br />
|-<br />
| 0x58069 || 105 || 704 || Null account notification settings buffer<br />
|-<br />
| 0x58E69 || 105 || 711 || Null vibration master volume buffer<br />
|-<br />
| 0x59069 || 105 || 712 || Null NX controller settings buffer<br />
|-<br />
| 0x59269 || 105 || 713 || Null NX controller settings entry count buffer<br />
|-<br />
| 0x59469 || 105 || 714 || Null USB full key enable flag buffer<br />
|-<br />
| 0x5A269 || 105 || 721 || Null TV settings buffer<br />
|-<br />
| 0x5A469 || 105 || 722 || Null EDID buffer<br />
|-<br />
| 0x5B669 || 105 || 731 || Null data deletion settings buffer<br />
|-<br />
| 0x5CA69 || 105 || 741 || Null initial system applet program ID buffer<br />
|-<br />
| 0x5CC69 || 105 || 742 || Null overlay disp program ID buffer<br />
|-<br />
| 0x5CE69 || 105 || 743 || Null IsInRepairProcess buffer<br />
|-<br />
| 0x5D069 || 105 || 744 || Null RequiresRunRepairTimeReviser buffer<br />
|-<br />
| 0x5DE69 || 105 || 751 || Null device timezone location name buffer<br />
|-<br />
| 0x5F269 || 105 || 761 || Null primary album storage buffer<br />
|-<br />
| 0x60669 || 105 || 771 || Null USB 3.0 enable flag buffer<br />
|-<br />
| 0x60869 || 105 || 772 || Null USB Type-C power source circuit version buffer<br />
|-<br />
| 0x61A69 || 105 || 781 || Null battery lot buffer<br />
|-<br />
| 0x62E69 || 105 || 791 || Null serial number buffer<br />
|-<br />
| 0x64269 || 105 || 801 || Null lock screen flag buffer<br />
|-<br />
| 0x64669 || 105 || 803 || Null color set ID buffer<br />
|-<br />
| 0x64869 || 105 || 804 || Null quest flag buffer<br />
|-<br />
| 0x64A69 || 105 || 805 || Null wireless certification file size buffer<br />
|-<br />
| 0x64C69 || 105 || 806 || Null wireless certification file buffer<br />
|-<br />
| 0x64E69 || 105 || 807 || Null initial launch settings buffer<br />
|-<br />
| 0x65069 || 105 || 808 || Null device nickname buffer<br />
|-<br />
| 0x65269 || 105 || 809 || Null battery percentage flag buffer<br />
|-<br />
| 0x65469 || 105 || 810 || Null applet launch flags buffer<br />
|-<br />
| 0x7E869 || 105 || 1012 || Null wireless LAN enable flag buffer<br />
|-<br />
| 0x7FA69 || 105 || 1021 || Null product model buffer<br />
|-<br />
| 0x80E69 || 105 || 1031 || Null NFC enable flag buffer<br />
|-<br />
| 0x82269 || 105 || 1041 || Null ECI device certificate buffer<br />
|-<br />
| 0x82469 || 105 || 1042 || Null E-Ticket device certificate buffer<br />
|-<br />
| 0x83669 || 105 || 1051 || Null sleep settings buffer<br />
|-<br />
| 0x84A69 || 105 || 1061 || Null EULA version buffer<br />
|-<br />
| 0x84C69 || 105 || 1062 || Null EULA version entry count buffer<br />
|-<br />
| 0x85E69 || 105 || 1071 || Null LDN channel buffer<br />
|-<br />
| 0x87269 || 105 || 1081 || Null SSL key buffer<br />
|-<br />
| 0x87469 || 105 || 1082 || Null SSL certificate buffer<br />
|-<br />
| 0x88669 || 105 || 1091 || Null telemetry flags buffer<br />
|-<br />
| 0x89A69 || 105 || 1101 || Null Gamecard key buffer<br />
|-<br />
| 0x89C69 || 105 || 1102 || Null Gamecard certificate buffer<br />
|-<br />
| 0x8AE69 || 105 || 1111 || Null PTM battery lot buffer<br />
|-<br />
| 0x8B069 || 105 || 1112 || Null PTM fuel gauge parameter buffer<br />
|-<br />
| 0x8C269 || 105 || 1121 || Null ECI device key buffer<br />
|-<br />
| 0x8C469 || 105 || 1122 || Null E-Ticket device key buffer<br />
|-<br />
| 0x8D669 || 105 || 1131 || Null speaker parameter buffer<br />
|-<br />
| 0x8EA69 || 105 || 1141 || Null firmware version buffer<br />
|-<br />
| 0x8EC69 || 105 || 1142 || Null firmware version digest buffer<br />
|-<br />
| 0x8EE69 || 105 || 1143 || Null rebootless system update version buffer<br />
|-<br />
| 0x8FE69 || 105 || 1151 || Null Mii author ID buffer<br />
|-<br />
| 0x91269 || 105 || 1161 || Null fatal flags buffer<br />
|-<br />
| 0x92669 || 105 || 1171 || Null auto update enable flag buffer<br />
|-<br />
| 0x93A69 || 105 || 1181 || Null external RTC reset flag buffer<br />
|-<br />
| 0x94E69 || 105 || 1191 || Null push notification activity mode buffer<br />
|-<br />
| 0x96269 || 105 || 1201 || Null service discovery control setting buffer<br />
|-<br />
| 0x97669 || 105 || 1211 || Null error report share permission buffer<br />
|-<br />
| 0x98A69 || 105 || 1221 || Null LCD vendor ID buffer<br />
|-<br />
| 0x99E69 || 105 || 1231 || Null console SixAxis sensor acceleration bias buffer<br />
|-<br />
| 0x9A069 || 105 || 1232 || Null console SixAxis sensor angular velocity bias buffer<br />
|-<br />
| 0x9A269 || 105 || 1233 || Null console SixAxis sensor acceleration gain buffer<br />
|-<br />
| 0x9A469 || 105 || 1234 || Null console SixAxis sensor angular velocity gain buffer<br />
|-<br />
| 0x9A669 || 105 || 1235 || Null console SixAxis sensor angular velocity time bias buffer<br />
|-<br />
| 0x9A869 || 105 || 1236 || Null console SixAxis sensor angular acceleration buffer <br />
|-<br />
| 0x9B269 || 105 || 1241 || Null keyboard layout buffer<br />
|-<br />
| 0x9BA69 || 105 || 1245 || Invalid keyboard layout<br />
|-<br />
| 0x9C669 || 105 || 1251 || Null web inspector flag buffer<br />
|-<br />
| 0x9C869 || 105 || 1252 || Null allowed SSL hosts buffer<br />
|-<br />
| 0x9CA69 || 105 || 1253 || Null allowed SSL hosts entry count buffer<br />
|-<br />
| 0x9CC69 || 105 || 1254 || Null host FS mount point buffer<br />
|-<br />
| 0x9EE69 || 105 || 1271 || Null Amiibo key buffer<br />
|-<br />
| 0x9F069 || 105 || 1272 || Null Amiibo ECQV certificate buffer<br />
|-<br />
| 0x9F269 || 105 || 1273 || Null Amiibo ECDSA certificate buffer<br />
|-<br />
| 0x9F469 || 105 || 1274 || Null Amiibo ECQV BLS key buffer<br />
|-<br />
| 0x9F669 || 105 || 1275 || Null Amiibo ECQV BLS certificate buffer<br />
|-<br />
| 0x9F869 || 105 || 1276 || Null Amiibo ECQV BLS root certificate buffer<br />
|-<br />
| 0x272 || 114 || 1 || Generic error<br />
|-<br />
| 0xC72 || 114 || 6 || Unsupported operation<br />
|-<br />
| 0x74 || 116 || 0 || Time service not initialized<br />
|-<br />
| 0x274 || 116 || 1 || Permission denied<br />
|-<br />
| 0xCC74 || 116 || 102 || Time not set / Clock Source Id mismatch<br />
|-<br />
| 0x19074 || 116 || 200 || Invalid time comparison<br />
|-<br />
| 0x19274 || 116 || 201 || Signed overflow/underflow<br />
|-<br />
| 0x64274 || 116 || 801 || Memory allocation failure<br />
|-<br />
| 0x70A74 || 116 || 901 || Null pointer<br />
|-<br />
| 0x70C74 || 116 || 902 || Value out of valid range<br />
|-<br />
| 0x70E74 || 116 || 903 || TimeZoneRule conversion failed<br />
|-<br />
| 0x7BA74 || 116 || 989 || TimeZone location name not found<br />
|-<br />
| 0x7BC74 || 116 || 990 || Unimplemented functionality<br />
|-<br />
| 0x27A || 122 || 1 || Invalid argument<br />
|-<br />
| 0x47A || 122 || 2 || Object not found<br />
|-<br />
| 0x67A || 122 || 3 || Object locked/in used<br />
|-<br />
| 0x87A || 122 || 4 || Target already mounted<br />
|-<br />
| 0xA7A || 122 || 5 || Target not mounted<br />
|-<br />
| 0xC7A || 122 || 6 || Object already opened<br />
|-<br />
| 0xE7A || 122 || 7 || Object not opened<br />
|-<br />
| 0xA07A || 122 || 80 || Passphrase not found<br />
|-<br />
| 0xA27A || 122 || 81 || Data verification failed<br />
|-<br />
| 0xB47A || 122 || 90 || Invalid API call<br />
|-<br />
| 0xC47A || 122 || 98 || Invalid operation<br />
|-<br />
| 0x287C || 124 || 20 || Argument is NULL<br />
|-<br />
| 0x2C7C || 124 || 22 || Argument is invalid<br />
|-<br />
| 0x3C7C || 124 || 30 || Bad input buffer size<br />
|-<br />
| 0x407C || 124 || 32 || Invalid input buffer<br />
|-<br />
| 0x27E || 126 || 1 || Invalid argument<br />
|-<br />
| 0x87E || 126 || 4 || Entry not found<br />
|-<br />
| 0xCE7E || 126 || 67 || Invalid database signature value (should be "NFDB")<br />
|-<br />
| 0xD27E || 126 || 69 || Invalid database entry count<br />
|-<br />
| 0x1987E || 126 || 204 || Development/debug-only behavior<br />
|-<br />
| 0x480 || 128 || 2 || IStorage not available.<br />
|-<br />
| 0x4680 || 128 || 35 || Error while launching applet.<br />
|-<br />
| 0x4A80 || 128 || 37 || Title-ID not found. Caused by code 0x410 when applet launch fails<br />
|-<br />
| 0x3E880 || 128 || 500 || Invalid input<br />
|-<br />
| 0x3EC80 || 128 || 502 || IStorage has already been opened by another accessor<br />
|-<br />
| 0x3EE80 || 128 || 503 || IStorage Read/Write out-of-bounds<br />
|-<br />
| 0x3FE80 || 128 || 511 || IStorage opened as wrong type (data opened as transfermem, transfermem opened as data)<br />
|-<br />
| 0x40080 || 128 || 512 || Unbalanced fatal section leave (returned when executing LeaveFatalSection without a preceding EnterFatalSection call)<br />
|-<br />
| 0x4B080 || 128 || 600 || Failed to allocate memory for IStorage<br />
|-<br />
| 0x59080 || 128 || 712 || Thread stack pool exhausted (out of memory)<br />
|-<br />
| 0x7A880 || 128 || 980 || <code>am.debug!dev_function</code> setting needs to be set<br />
|-<br />
| 0xA83 || 131 || 5 || Unrecognized applet ID<br />
|-<br />
| 0x485 || 133 || 2 || Invalid DVFS table ID<br />
|-<br />
| 0x885 || 133 || 4 || Invalid parameter<br />
|-<br />
| 0x3CF089 || 137 || 7800 || Unknown/invalid libcurl error.<br />
|-<br />
| 0x3E8289-0x3F4089 || 137 || 8001-8096 || libcurl error 1-96. Some of the libcurl errors in the error-table map to the above unknown-libcurl-error however.<br />
|-<br />
| 0x68A || 138 || 3 || Not initialized.<br />
|-<br />
| 0x668C || 140 || 51 || USB data-transfer in progress<br />
|-<br />
| 0xD48C || 140 || 106 || Invalid descriptor<br />
|-<br />
| 0x1928C || 140 || 201 || USB device not bound / interface already enabled<br />
|-<br />
| 0x290 || 144 || 1 || Exited Abnormally ([[Applet_Manager_services#LibraryAppletExitReason|ExitReason]] == Abormal)<br />
|-<br />
| 0x690 || 144 || 3 || Canceled ([[Applet_Manager_services#LibraryAppletExitReason|ExitReason]] == Canceled)<br />
|-<br />
| 0x890 || 144 || 4 || Rejected<br />
|-<br />
| 0xA90 || 144 || 5 || Exited Unexpectedly ([[Applet_Manager_services#LibraryAppletExitReason|ExitReason]] == Unexpected)<br />
|-<br />
| 0x299 || 153 || 1 || Invalid audio device<br />
|-<br />
| 0x499 || 153 || 2 || Operation couldn't complete successfully<br />
|-<br />
| 0x699 || 153 || 3 || Invalid sample rate<br />
|-<br />
| 0x899 || 153 || 4 || Buffer size too small<br />
|-<br />
| 0x1099 || 153 || 8 || Too many buffers are still unreleased<br />
|-<br />
| 0x1499 || 153 || 10 || Invalid channel count<br />
|-<br />
| 0x40299 || 153 || 513 || Invalid/Unsupported operation<br />
|-<br />
| 0xC0099 || 153 || 1536 || Invalid handle<br />
|-<br />
| 0xC0899 || 153 || 1540 || Audio output was already started<br />
|-<br />
| 0x3C9D || 157 || 30 || Address is NULL<br />
|-<br />
| 0x3E9D || 157 || 31 || PID is NULL<br />
|-<br />
| 0x549D || 157 || 42 || Already bound<br />
|-<br />
| 0xCC9D || 157 || 102 || Invalid PID<br />
|-<br />
| 0xAA3 || 163 || 5 || System is booting up repair process without VOL+ held down.<br />
|-<br />
| 0xCA3 || 163 || 6 || System is booting up repair process that requires RepairTimeReviser but does not have special cartridge inserted.<br />
|-<br />
| 0xC8B2 || 178 || 100 || Invalid user ID<br />
|-<br />
| 0xCAB2 || 178 || 101 || User does not exist<br />
|-<br />
| 0x12CB2 || 178 || 150 || Service unavailable<br />
|-<br />
| 0x190B2 || 178 || 200 || File storage failure<br />
|-<br />
| 0x58ACA || 202 || 709 || Npad ID is out of range.<br />
|-<br />
| 0xF0CD || 205 || 120 || IR image data not available/ready.<br />
|-<br />
| 0x1A8CD || 205 || 212 || IR camera handle pointer is null.<br />
|-<br />
| 0x198CD || 205 || 204 || IR camera invalid handle value.<br />
|-<br />
| 0x35B || 347 || 1 || Failed to init SM.<br />
|-<br />
| 0x55B || 347 || 2 || Failed to init FS.<br />
|-<br />
| 0x75B || 347 || 3 || Failed to open NRO file. May also happen when SD card isn't inserted / SD mounting failed earlier.<br />
|-<br />
| 0x95B || 347 || 4 || Failed to read NRO header.<br />
|-<br />
| 0xB5B || 347 || 5 || Invalid NRO magic.<br />
|-<br />
| 0xD5B || 347 || 6 || Invalid NRO segments.<br />
|-<br />
| 0xF5B || 347 || 7 || Failed to read NRO.<br />
|-<br />
| 0x135B || 347 || 9 || Failed to allocate heap.<br />
|-<br />
| 0x255B || 347 || 18 || Failed to map code-binary memory.<br />
|-<br />
| 0x275B || 347 || 19 || Failed to map code memory (.text).<br />
|-<br />
| 0x295B || 347 || 20 || Failed to map code memory (.rodata).<br />
|-<br />
| 0x2B5B || 347 || 21 || Failed to map code memory (.data+.bss).<br />
|-<br />
| 0x315B || 347 || 24 || Failed to unmap code memory (.text).<br />
|-<br />
| 0x335B || 347 || 25 || Failed to unmap code memory (.rodata).<br />
|-<br />
| 0x355B || 347 || 26 || Failed to unmap code memory (.data+.bss).<br />
|}<br />
<br />
== FS Error Codes ==<br />
The following are the error codes recognized by nn::fs::detail::LogErrorMessage found in some [[Factory Setup|factory]] titles:<br />
<br />
{| class=wikitable<br />
! Value || Description || Message<br />
|-<br />
| 0x7802 || 60 || nn::fs::ResultMountNameAlreadyExists: Error: Specified mount name already exists.<br />
|-<br />
| 0xD401 || 106 || nn::svc::ResultInvalidCurrentMemory: Error: Passed buffer is not usable for fs library. See a manual of fs library for more information.<br />
|-<br />
| 0x7D202 || 1001 || nn::fs::ResultPartitionNotFound: Error: Specified partition is not found.<br />
|-<br />
| 0x7D402 || 1002 || nn::fs::ResultTargetNotFound: Error: Specified target is not found.<br />
|-<br />
| 0xFA002 - 0x138602 || 2000 - 2499 || nn::fs::ResultSdCardAccessFailed: Error: Failed to access SD card.<br />
|-<br />
| 0x136802 - 0x176E02 || 2500 - 2999 || nn::fs::ResultGameCardAccessFailed: Error: Failed to access game card.<br />
|-<br />
| 0x177202 || 3001 || nn::fs::ResultNotImplemented: Error: Specified operation is not implemented.<br />
|-<br />
| 0x177A02 || 3005 || nn::fs::ResultOutOfRange: Error: Specified value is out of range.<br />
|-<br />
| 0x190002 - 0x1B5602 || 3200 - 3499 || nn::fs::ResultAllocationMemoryFailed: Error: Failed to allocate memory.<br />
|-<br />
| 0x1B5802 - 0x1F3E02 || 3500 - 3999 || nn::fs::ResultMmcAccessFailed: Error: Failed to access MMC.<br />
|-<br />
| 0x1F4202 - 0x219602 || 4001 - 4299 || nn::fs::ResultRomCorrupted: Error: ROM is corrupted.<br />
|-<br />
| 0x219A02 - 0x232602 || 4301 - 4499 || nn::fs::ResultSaveDataCorrupted: Error: Save data is corrupted.<br />
|-<br />
| 0x232A02 - 0x23EE02 || 4501 - 4599 || nn::fs::ResultNcaCorrupted: Error: NCA is corrupted.<br />
|-<br />
| 0x23F202 - 0x243E02 || 4601 - 4639 || nn::fs::ResultIntegrityVerificationStorageCorrupted: Error: Integrity verification failed.<br />
|-<br />
| 0x244202 - 0x246602 || 4641 - 4659 || nn::fs::ResultPartitionFileSystemCorrupted: Error: Partition FS is corrupted.<br />
|-<br />
| 0x246A02 - 0x248E02 || 4661 - 4679 || nn::fs::ResultBuiltInStorageCorrupted: Error: Built-in-storage is corrupted.<br />
|-<br />
| 0x249202 - 0x24B602 || 4681 - 4699 || nn::fs::ResultFatFileSystemCorrupted: Error: FAT FS is corrupted.<br />
|-<br />
| 0x24BA02 - 0x24DE02 || 4701 - 4719 || nn::fs::ResultHostFileSystemCorrupted: Error: HOST FS is corrupted.<br />
|-<br />
| 0x1F4002 - 0x270E02 || 4000, 4300, 4500, 4600, 4640, 4660, 4680, 4700, 4720-4999 || nn::fs::ResultDataCorrupted: Error: Data is corrupted.<br />
|-<br />
| 0x271002 - 0x2EDE02 || 5000-5999 || nn::fs::ResultUnexpected: Error: Unexpected failure occurred.<br />
|-<br />
| 0x2EE002 - 0x32C602 || 6000-6499 || nn::fs::ResultPreconditionViolation: Error: Precondition violation.<br />
|-<br />
| 0x2EE202 - 0x306E02 || 6001-6199 || nn::fs::ResultInvalidArgument: Error: Invalid argument was specified.<br />
|-<br />
| 0x2EE402 - 0x2F1A02 || 6002-6029 || nn::fs::ResultInvalidPath: Error: Invalid path was specified.<br />
|-<br />
| 0x2EE602 || 6003 || nn::fs::ResultTooLongPath: Error: Too long path was specified.<br />
|-<br />
| 0x2EE802 || 6004 || nn::fs::ResultInvalidCharacter: Error: Invalid path character was specified.<br />
|-<br />
| 0x2EEA02 || 6005 || nn::fs::ResultInvalidPathFormat: Error: Invalid path format was specified.<br />
|-<br />
| 0x2F5A02 || 6061 || nn::fs::ResultInvalidOffset: Error: Invalid offset was specified.<br />
|-<br />
| 0x2F5C02 || 6062 || nn::fs::ResultInvalidSize: Error: Invalid size was specified.<br />
|-<br />
| 0x2F5E02 || 6063 || nn::fs::ResultNullptrArgument: Error: Null pointer argument was specified.<br />
|-<br />
| 0x2F6202 || 6065 || nn::fs::ResultInvalidMountName: Error: Invalid mount name was specified.<br />
|-<br />
| 0x2F6402 || 6066 || nn::fs::ResultExtensionSizeTooLarge: Error: Extension size exceeds max value set in nmeta file.<br />
|-<br />
| 0x2F6602 || 6067 || nn::fs::ResultExtensionSizeInvalid: Error: Extension size is not a multiple of nn::fs::SaveDataExtensionUnitSize.<br />
|-<br />
| 0x307202 || 6201 || nn::fs::ResultFileExtensionWithoutOpenModeAllowAppend: Error: OpenMode_AllowAppend is required for implicit extension of file size by WriteFile().<br />
|-<br />
| 0x307002 - 0x313602 || 6200, 6202 - 6299 || nn::fs::ResultInvalidOperationForOpenMode: Error: Invalid operation for the open mode.<br />
|-<br />
| 0x313802 - 0x31FE02 || 6300-6399 || nn::fs::ResultUnsupportedOperation: Error: Unsupported operation.<br />
|-<br />
| 0x320002 - 0x326202 || 6400-6449 || nn::fs::ResultPermissionDenied: Error: Permission denied.<br />
|-<br />
| 0x327202 || 6457 || nn::fs::ResultWriteModeFileNotClosed: Error: Close files opened in write mode before committing.<br />
|-<br />
| 0x328202 || 6465 || nn::fs::ResultUserNotExist: Error: Specified user doesn't exist.<br />
|-<br />
| 0x346402 || 6706 || nn::fs::ResultMappingTableFull: Error: Enough journal space is not left.<br />
|-<br />
| 0x346A02 || 6709 || nn::fs::ResultOpenCountLimit: Error: The open count of files and directories reached the limitation.<br />
|-<br />
| 0x353602 || 6811 || nn::fs::ResultMapFull: Error: Save data extension count reached the limitation.<br />
|-<br />
| 0x35F202 || 6905 || nn::fs::ResultNotMounted: Error: Specified mount name is not found.<br />
|}<br />
<br />
= Fatal Errors =<br />
{| class=wikitable<br />
! Error || Description<br />
|-<br />
| 2162-0002<br />
| Can be triggered by running [[SVC|svcBreak]]. The svcBreak params have no effect on the value of the thrown error-code.<br />
|-<br />
| 2168-0000<br />
| Userland ARM undefined instruction exception<br />
|-<br />
| 2168-0001<br />
| Userland ARM prefetch-abort due to PC set to non-executable region<br />
|-<br />
| 2168-0002<br />
| Userland ARM data abort. Also caused by abnormal process termination via [[SVC|svcExitProcess]]. Note: directly jumping to nnMain()-retaddr from non-main-thread has the same result.<br />
|-<br />
| 2168-0003<br />
| Userland PC address not aligned to 4 bytes<br />
|-<br />
| 2168-0008<br />
| Can occur when attempting to call an svc outside the whitelist<br />
|}<br />
<br />
= Support Errors =<br />
This section is for Support Errors displayed by the error-applet, separate from the normal Result errors.<br />
<br />
== Support Modules ==<br />
{| class=wikitable<br />
! Value || Name<br />
|-<br />
| 800 || [[Internet_Browser|General web-applet]]<br />
|-<br />
| 809 || [[Internet_Browser|WifiWebAuthApplet]]<br />
|-<br />
| 810 || [[Internet_Browser|Whitelisted-applet]]<br />
|-<br />
| 811 || [[Internet_Browser|ShopN]]<br />
|}<br />
<br />
8XX is for/includes system applets.<br />
<br />
== Errors ==<br />
{| class=wikitable<br />
! Error || Module || Description || Notes<br />
|-<br />
| <br />
| {web-applets listed above}<br />
| 2750<br />
| MP4 parsing failed.<br />
|}<br />
<br />
Normal error-codes displayed by the system also use the same format as fatal-errors.</div>
Thog
https://switchbrew.org/w/index.php?title=Thread_Local_Region&diff=6976
Thread Local Region
2019-06-06T14:16:36Z
<p>Thog: </p>
<hr />
<div>This is the 0x200-byte TLS (thread local storage). It's base address is loaded via ARM threadid register tpidrro_el0. TLS for multiple threads are stored in the same page, with the first TLS normally located at page+0x200, because the first TLS spot is reserved for usermode exception handling.<br />
<br />
= Structure =<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset<br />
! Size<br />
! Description<br />
|-<br />
| 0x0<br />
| 0x100<br />
| [[IPC_Marshalling|IPC]] command buffer.<br />
|-<br />
| [8.0.0+] 0x100<br />
| 0x4<br />
| Preemption State<br />
|-<br />
| 0x104<br />
| 0xF4<br />
| Unknown.<br />
|-<br />
| 0x1F8<br />
| 0x8<br />
| Pointer to [[Thread_Local_Storage#Thread_context|thread context]].<br />
|}<br />
<br />
= Userland context =<br />
== Boot paramter ==<br />
This is "nn::os::detail::g_OsBootParamter".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset<br />
! Size<br />
! Description<br />
|-<br />
| 0x00<br />
| 0x04<br />
| Main thread handle.<br />
|-<br />
| 0x04<br />
| 0x04<br />
| Always 0.<br />
|-<br />
| 0x08<br />
| 0x30<br />
| Empty.<br />
|}<br />
<br />
== Resource manager storage ==<br />
This is "nn::os::detail::g_OsResourceManagerStorage".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset<br />
! Size<br />
! Description<br />
|-<br />
| 0x00<br />
| 0x04<br />
| Always 0.<br />
|-<br />
| 0x04<br />
| 0x10<br />
| Process PRNG.<br />
|-<br />
| 0x14<br />
| 0x04<br />
| Padding.<br />
|-<br />
| 0x18<br />
| 0x08<br />
| Always set to 0.<br />
|-<br />
| 0x20<br />
| 0x08<br />
| [[SVC#svcGetInfo|AddressSpaceStart]] right shifted by 0x0C.<br />
|-<br />
| 0x28<br />
| 0x08<br />
| AddressSpaceEnd ([[SVC#svcGetInfo|AddressSpaceStart]] + [[SVC#svcGetInfo|AddressSpaceSize]]) right shifted by 0x0C and aligned to AddressSpaceAlign.<br />
|-<br />
| 0x30<br />
| 0x08<br />
| AddressSpaceAlign right shifted by 0x0C.<br />
|-<br />
| 0x38<br />
| 0x08<br />
| Always 0.<br />
|-<br />
| 0x40<br />
| 0x08<br />
| Always set to 0.<br />
|-<br />
| 0x48<br />
| 0x08<br />
| [[SVC#svcGetInfo|MapRegionBased]] right shifted by 0x0C.<br />
|-<br />
| 0x50<br />
| 0x08<br />
| MapRegionEnd ([[SVC#svcGetInfo|MapRegionBased]] + [[SVC#svcGetInfo|MapRegionSize]]) right shifted by 0x0C and aligned to MapRegionAlign.<br />
|-<br />
| 0x58<br />
| 0x08<br />
| MapRegionAlign right shifted by 0x0C.<br />
|-<br />
| 0x60<br />
| 0x08<br />
| Always 0.<br />
|-<br />
| 0x68<br />
| 0x08<br />
| Always 0.<br />
|-<br />
| 0x70<br />
| 0x1D0<br />
| Main [[Thread_Local_Storage#Thread_context|thread context]].<br />
|-<br />
| 0x240<br />
| 0x08<br />
| Pointer to main [[Thread_Local_Storage#Thread_context|thread context]].<br />
|-<br />
| 0x248<br />
| 0x08<br />
| Unknown.<br />
|-<br />
| 0x250<br />
| 0x08<br />
| Unknown.<br />
|-<br />
| 0x258<br />
| 0x130<br />
| Always empty?<br />
|-<br />
| 0x388<br />
| 0x08<br />
| Pointer to [[Thread_Local_Storage#Resource_manager_storage|resource manager storage]] + 0x388.<br />
|-<br />
| 0x390<br />
| 0x08<br />
| Pointer to [[Thread_Local_Storage#Resource_manager_storage|resource manager storage]] + 0x388.<br />
|-<br />
| 0x398<br />
| 0x08<br />
| Always 0.<br />
|-<br />
| 0x3A0<br />
| 0x08<br />
| Always 0.<br />
|}<br />
<br />
== Thread context ==<br />
This structure is used for describing each thread's context. In the main thread's case, this structure comes from the [[Thread_Local_Storage#Resource_manager_storage|resource manager storage]].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset<br />
! Size<br />
! Description<br />
|-<br />
| 0x00<br />
| 0x08<br />
| Pointer to [[Thread_Local_Storage#Thread_context|thread context]] + 0x1C8.<br />
|-<br />
| 0x08<br />
| 0x08<br />
| Pointer to [[Thread_Local_Storage#Thread_context|thread context]]<br />
|-<br />
| 0x10<br />
| 0x08<br />
| Pointer to [[Thread_Local_Storage#Thread_context|thread context]] + 0x10.<br />
|-<br />
| 0x18<br />
| 0x08<br />
| Pointer to [[Thread_Local_Storage#Thread_context|thread context]] + 0x10.<br />
|-<br />
| 0x20<br />
| 0x20<br />
| Empty.<br />
|-<br />
| 0x40<br />
| 0x04<br />
| Thread status.<br />
|-<br />
| 0x44<br />
| 0x04<br />
| Thread priority minus 0x1C.<br />
|-<br />
| 0x48<br />
| 0x08<br />
| Thread stack base address.<br />
|-<br />
| 0x50<br />
| 0x08<br />
| Thread stack base address mirror.<br />
|-<br />
| 0x58<br />
| 0x08<br />
| Thread stack size.<br />
|-<br />
| 0x60<br />
| 0x08<br />
| Thread stub pointer.<br />
|-<br />
| 0x68<br />
| 0x08<br />
| Thread ID.<br />
|-<br />
| 0x70<br />
| 0x08<br />
| Always 0?<br />
|-<br />
| 0x78<br />
| 0x08<br />
| Always 0?<br />
|-<br />
| 0x80<br />
| 0x08<br />
| Always 0?<br />
|-<br />
| 0x88<br />
| 0x100<br />
| TLS slots.<br />
|-<br />
| 0x188<br />
| 0x20<br />
| Thread name.<br />
|-<br />
| 0x1A8<br />
| 0x08<br />
| Thread name address.<br />
|-<br />
| 0x1B0<br />
| 0x04<br />
| Critical Section.<br />
|-<br />
| 0x1B4<br />
| 0x04<br />
| Conditional Variable.<br />
|-<br />
| 0x1B8<br />
| 0x04<br />
| Thread handle.<br />
|-<br />
| 0x1BC<br />
| 0x04<br />
| Always 0.<br />
|-<br />
| 0x1C0<br />
| 0x08<br />
| Thread global mutex.<br />
|-<br />
| 0x1C8<br />
| 0x08<br />
| Unknown.<br />
|}</div>
Thog
https://switchbrew.org/w/index.php?title=Error_codes&diff=6972
Error codes
2019-06-03T22:03:24Z
<p>Thog: </p>
<hr />
<div>= Structure =<br />
These have been redesigned from the 3DS so that they fit within a Aarch64 MOV instruction immediate most of the time (without requiring the additional MOVK).<br />
<br />
{| class=wikitable<br />
! Bits || Field<br />
|-<br />
| 8-0 || Module<br />
|-<br />
| 21-9 || Description<br />
|}<br />
<br />
When a fatal-error is received the error code is outputted using the following formatter:<br />
%04d-%04d<br />
<br />
.. where the first code is <code>2000 + Module</code>, and the other being <code>Description</code>. Bits >=22 from the error-code are unused when displaying fatal-errors, since the Description ends with bit21.<br />
<br />
= Modules =<br />
{| class=wikitable<br />
! Value || Name<br />
|-<br />
| 1 || Kernel<br />
|-<br />
| 2 || FS<br />
|-<br />
| 3 || OS (Memory, Thread, Mutex, NVIDIA)<br />
|-<br />
| 4 || HTCS<br />
|-<br />
| 5 || NCM<br />
|-<br />
| 6 || DD<br />
|-<br />
| 7 || Debug Monitor<br />
|-<br />
| 8 || LR<br />
|-<br />
| 9 || Loader<br />
|-<br />
| 10 || CMIF (IPC command interface)<br />
|-<br />
| 11 || HIPC (IPC)<br />
|-<br />
| 15 || PM<br />
|-<br />
| 16 || NS<br />
|-<br />
| 17 || Sockets<br />
|-<br />
| 18 || HTC<br />
|-<br />
| 20 || NCM Content<br />
|-<br />
| 21 || SM<br />
|-<br />
| 22 || RO userland<br />
|-<br />
| 24 || SDMMC<br />
|-<br />
| 25 || OVLN<br />
|-<br />
| 26 || SPL<br />
|-<br />
| 30 || Bus<br />
|-<br />
| 100 || ETHC<br />
|-<br />
| 101 || I2C<br />
|-<br />
| 102 || GPIO<br />
|-<br />
| 103 || UART<br />
|-<br />
| 105 || Settings<br />
|-<br />
| 107 || WLAN<br />
|-<br />
| 108 || XCD<br />
|-<br />
| 110 || NIFM<br />
|-<br />
| 111 || Hwopus<br />
|-<br />
| 113 || Bluetooth<br />
|-<br />
| 114 || VI<br />
|-<br />
| 115 || NFP<br />
|-<br />
| 116 || Time<br />
|-<br />
| 117 || FGM<br />
|-<br />
| 118 || OE<br />
|-<br />
| 120 || PCIe<br />
|-<br />
| 121 || Friends<br />
|-<br />
| 122 || BCAT<br />
|-<br />
| 123 || SSL<br />
|-<br />
| 124 || Account<br />
|-<br />
| 125 || News<br />
|-<br />
| 126 || Mii<br />
|-<br />
| 127 || NFC<br />
|-<br />
| 128 || AM<br />
|-<br />
| 129 || Play Report<br />
|-<br />
| 130 || AHID<br />
|-<br />
| 132 || Home Menu (Qlaunch)<br />
|-<br />
| 133 || PCV<br />
|-<br />
| 134 || OMM<br />
|-<br />
| 135 || BPC<br />
|-<br />
| 136 || PSM<br />
|-<br />
| 137 || NIM<br />
|-<br />
| 138 || PSC<br />
|-<br />
| 139 || TC<br />
|-<br />
| 140 || USB<br />
|-<br />
| 141 || NSD<br />
|-<br />
| 142 || PCTL<br />
|-<br />
| 143 || BTM<br />
|-<br />
| 144 || EC (Shop)<br />
|-<br />
| 145 || ETicket<br />
|-<br />
| 146 || NGC (Bad Words)<br />
|-<br />
| 147 || Error Report<br />
|-<br />
| 148 || APM<br />
|-<br />
| 149 || CEC<br />
|-<br />
| 150 || Profiler<br />
|-<br />
| 151 || Error Upload<br />
|-<br />
| 153 || Audio<br />
|-<br />
| 154 || NPNS<br />
|-<br />
| 155 || NPNS HTTP Stream<br />
|-<br />
| 157 || ARP<br />
|-<br />
| 158 || Updater<br />
|-<br />
| 159 || SWKBD<br />
|-<br />
| 161 || NFC Mifare<br />
|-<br />
| 162 || Userland assert<br />
|-<br />
| 163 || Fatal<br />
|-<br />
| 164 || NIM Shop<br />
|-<br />
| 165 || SPSM<br />
|-<br />
| 167 || BGTC<br />
|-<br />
| 168 || Userland crash<br />
|-<br />
| 178 || PDM<br />
|-<br />
| 179 || OLSC<br />
|-<br />
| 180 || SREPO<br />
|-<br />
| 181 || Dauth<br />
|-<br />
| 191 || RTC<br />
|-<br />
| 192 || Regulator<br />
|-<br />
| 197 || Clkrst<br />
|-<br />
| 202 || HID<br />
|-<br />
| 203 || LDN<br />
|-<br />
| 205 || Irsensor<br />
|-<br />
| 206 || Capture<br />
|-<br />
| 208 || Manu<br />
|-<br />
| 209 || ATK<br />
|-<br />
| 210 || Web<br />
|-<br />
| 211 ||<br />
|-<br />
| 212 || GRC<br />
|-<br />
| 216 || Migration<br />
|-<br />
| 217 || Migration Idc Server<br />
|-<br />
| 345 || libnx<br />
|-<br />
| 346 || [[Homebrew ABI]]<br />
|-<br />
| 347 || Homebrew Loader<br />
|-<br />
| 348 || libnx Nvidia errors<br />
|-<br />
|}<br />
<br />
= Error codes =<br />
{| class=wikitable<br />
! Value || Module || Description || Notes<br />
|-<br />
| 0x0E01 || 1 || 7 || Session count exceeded<br />
|-<br />
| 0x1C01 || 1 || 14 || Invalid kernel capability descriptor<br />
|-<br />
| 0x4201 || 1 || 33 || Not Implemented<br />
|-<br />
| 0x7601 || 1 || 59 || Thread terminated/termination requested<br />
|-<br />
| 0x8C01 || 1 || 70 || No more debug events<br />
|-<br />
| 0xCA01 || 1 || 101 || Invalid size<br />
|-<br />
| 0xCC01 || 1 || 102 || Invalid address<br />
|-<br />
| 0xCE01 || 1 || 103 || Resource exhaustion<br />
|-<br />
| 0xD001 || 1 || 104 || Memory exhaustion<br />
|-<br />
| 0xD201 || 1 || 105 || Handle-table exhaustion<br />
|-<br />
| 0xD401 || 1 || 106 || Invalid memory state / invalid memory permissions.<br />
|-<br />
| 0xD801 || 1 || 108 || Invalid memory permissions.<br />
|-<br />
| 0xDC01 || 1 || 110 || Invalid memory range<br />
|-<br />
| 0xE001 || 1 || 112 || Invalid thread priority.<br />
|-<br />
| 0xE201 || 1 || 113 || Invalid processor id.<br />
|-<br />
| 0xE401 || 1 || 114 || Invalid handle.<br />
|-<br />
| 0xE601 || 1 || 115 || Invalid pointer/Syscall copy from user failed.<br />
|-<br />
| 0xE801 || 1 || 116 || Invalid combination<br />
|-<br />
| 0xEA01 || 1 || 117 || Time out. Also when you give 0 handles to svcWaitSynchronizationN.<br />
|-<br />
| 0xEC01 || 1 || 118 || Operation canceled<br />
|-<br />
| 0xEE01 || 1 || 119 || Out of range<br />
|-<br />
| 0xF001 || 1 || 120 || Invalid enum<br />
|-<br />
| 0xF201 || 1 || 121 || No such entry<br />
|-<br />
| 0xF401 || 1 || 122 || Irq/DeviceAddressSpace/{...} already registered<br />
|-<br />
| 0xF601 || 1 || 123 || Port remote dead<br />
|-<br />
| 0xF801 || 1 || 124 || [Usermode] Unhandled interrupt/exception<br />
|-<br />
| 0xFA01 || 1 || 125 || Process already started/Wrong memory permission?<br />
|-<br />
| 0xFC01 || 1 || 126 || Reserved value<br />
|-<br />
| 0xFE01 || 1 || 127 || Invalid hardware breakpoint<br />
|-<br />
| 0x10001 || 1 || 128 || [Usermode] Fatal exception<br />
|-<br />
| 0x10201 || 1 || 129 || Last thread didn't belong to your process<br />
|-<br />
| 0x10601 || 1 || 131 || Port closed<br />
|-<br />
| 0x10801 || 1 || 132 || Resource limit exceeded<br />
|-<br />
| 0x20801 || 1 || 260 || Command buffer too small<br />
|-<br />
| 0x40A01 || 1 || 517 || Invalid process ID.<br />
|-<br />
| 0x40C01 || 1 || 518 || Invalid thread ID.<br />
|-<br />
| 0x40E01 || 1 || 519 || Invalid thread ID (used in svcGetDebugThreadParam).<br />
|-<br />
| 0x41001 || 1 || 520 || Process not being debugged<br />
|-<br />
| 0x202 || 2 || 1 || Path does not exist.<br />
|-<br />
| 0x402 || 2 || 2 || Path already exists.<br />
|-<br />
| 0xE02 || 2 || 7 || Resource already in use (file already opened, savedata filesystem already mounted).<br />
|-<br />
| 0x4602 || 2 || 35 || Not enough free space for BIS Calibration partition.<br />
|-<br />
| 0x4802 || 2 || 36 || Not enough free space for BIS Safe partition.<br />
|-<br />
| 0x4A02 || 2 || 37 || Not enough free space for BIS User partition.<br />
|-<br />
| 0x4C02 || 2 || 38 || Not enough free space for BIS System partition.<br />
|-<br />
| 0x4E02 || 2 || 39 || Not enough free space on SD card.<br />
|-<br />
| 0x6402 || 2 || 50 || NCA is older than version 3, or NCA SDK version is older than 0.11.0.0<br />
|-<br />
| 0x7802 || 2 || 60 || The specified [[NCA]]-type doesn't exist for this title.<br />
|-<br />
| 0x7D202 || 2 || 1001 || Process does not have RomFs <br />
|-<br />
| 0x7D402 || 2 || 1002 || Title-id not found / savedata not found.<br />
|-<br />
| 0xFA202 || 2 || 2001 || SD card not inserted<br />
|-<br />
| 0x13B002 || 2 || 2520 || Gamecard not inserted<br />
|-<br />
| 0x13DA02 || 2 || 2541 || Version check failed when mounting gamecard sysupdate partition?<br />
|-<br />
| 0x171402 || 2 || 2954 || Invalid gamecard handle.<br />
|-<br />
| 0x177202 || 2 || 3001 || Unimplemented behavior<br />
|-<br />
| 0x177602 || 2 || 3003 || File/Directory already exists.<br />
|-<br />
| 0x190202 || 2 || 3201 || Memory allocation failure related to FAT filesystem code<br />
|-<br />
| 0x190602 || 2 || 3203 || Memory allocation failure related to FAT filesystem code<br />
|-<br />
| 0x190802 || 2 || 3204 || Memory allocation failure related to FAT filesystem code<br />
|-<br />
| 0x190A02 || 2 || 3205 || Memory allocation failure related to FAT filesystem code<br />
|-<br />
| 0x190C02 || 2 || 3206 || Memory allocation failure related to FAT filesystem code<br />
|-<br />
| 0x191002 || 2 || 3208 || Memory allocation failure related to FAT filesystem code<br />
|-<br />
| 0x195802 || 2 || 3244 || Allocation failure related to SD cards<br />
|-<br />
| 0x196002 || 2 || 3248 || Out of memory<br />
|-<br />
| 0x196202 || 2 || 3249 || Out of memory<br />
|-<br />
| 0x1A3E02 || 2 || 3359 || Out of memory<br />
|-<br />
| 0x1A4002 || 2 || 3360 || Out of memory<br />
|-<br />
| 0x1A4A02 || 2 || 3365 || Out of memory<br />
|-<br />
| 0x21BC02 || 2 || 4318 || Invalid save data filesystem magic (valid magic is SAVE in ASCII)<br />
|-<br />
| 0x234202 || 2 || 4513 || Error reading ACID section in NPDM<br />
|-<br />
| 0x234402 || 2 || 4514 || Invalid NPDM ACID section size<br />
|-<br />
| 0x234602 || 2 || 4515 || Last byte of the ACID modulus is zero<br />
|-<br />
| 0x234802 || 2 || 4516 || Invalid ACID fixed key signature<br />
|-<br />
| 0x234A02 || 2 || 4517 || Invalid NCA magic<br />
|-<br />
| 0x234C02 || 2 || 4518 || Invalid NCA header fixed key signature<br />
|-<br />
| 0x234E02 || 2 || 4519 || Invalid NCA header ACID signature<br />
|-<br />
| 0x235002 || 2 || 4520 || Invalid NCA header section hash<br />
|-<br />
| 0x235202 || 2 || 4521 || Invalid NCA Key index<br />
|-<br />
| 0x235602 || 2 || 4523 || Invalid encryption type<br />
|-<br />
| 0x235802 || 2 || 4524 || Redirection BKTR table size is negative<br />
|-<br />
| 0x235A02 || 2 || 4525 || Encryption BKTR table size is negative<br />
|-<br />
| 0x235C02 || 2 || 4526 || Redirection BKTR table end offset is past the Encryption BKTR table start offset<br />
|-<br />
| 0x235E02 || 2 || 4527 || NCA-path used with the wrong titleID.<br />
|-<br />
| 0x236002 || 2 || 4528 || NCA header value is out of range<br />
|-<br />
| 0x236202 || 2 || 4529 || NCA FS header value is out of range<br />
|-<br />
| 0x236802 || 2 || 4532 || PartitionFS hash block size is not a power of 2<br />
|-<br />
| 0x236A02 || 2 || 4533 || PartitionFS hash "always_2" field is not 2<br />
|-<br />
| 0x236C02 || 2 || 4534 || PartitionFS hash table is too small for main data<br />
|-<br />
| 0x236E02 || 2 || 4535 || Invalid PartitionFS block hash<br />
|-<br />
| 0x244402 || 2 || 4642 || Invalid Partition file hashed region bounds<br />
|-<br />
| 0x244602 || 2 || 4643 || Invalid Partition FS hash<br />
|-<br />
| 0x244802 || 2 || 4644 || Invalid PFS0 magic<br />
|-<br />
| 0x244A02 || 2 || 4645 || Invalid HFS0 magic<br />
|-<br />
| 0x244C02 || 2 || 4646 || Invalid name offset for Partition FS file entry<br />
|-<br />
| 0x244E02 || 2 || 4647 || Calculated Partition FS header size changed between 2 consecutive reads<br />
|-<br />
| 0x249802 || 2 || 4684 || Invalid FAT file number.<br />
|-<br />
| 0x249C02 || 2 || 4686 || Invalid FAT format for BIS User partition.<br />
|-<br />
| 0x249E02 || 2 || 4687 || Invalid FAT format for BIS System partition.<br />
|-<br />
| 0x24A002 || 2 || 4688 || Invalid FAT format for BIS Safe partition.<br />
|-<br />
| 0x24A202 || 2 || 4689 || Invalid FAT format for BIS Calibration partition.<br />
|-<br />
| 0x250E02 || 2 || 4743 || [[NAX0|Corrupted]] NAX0 header.<br />
|-<br />
| 0x251002 || 2 || 4744 || Invalid [[NAX0]] magicnum.<br />
|-<br />
| 0x280202 || 2 || 5121 || Invalid FAT size<br />
|-<br />
| 0x280402 || 2 || 5122 || Invalid FAT BPB (BIOS Parameter Block)<br />
|-<br />
| 0x280602 || 2 || 5123 || Invalid FAT parameter<br />
|-<br />
| 0x280802 || 2 || 5124 || Invalid FAT sector<br />
|-<br />
| 0x280A02 || 2 || 5125 || Invalid FAT sector<br />
|-<br />
| 0x280C02 || 2 || 5126 || Invalid FAT sector<br />
|-<br />
| 0x280E02 || 2 || 5127 || Invalid FAT sector<br />
|-<br />
| 0x296A02 || 2 || 5301 || Mountpoint not found<br />
|-<br />
| 0x2EE202 || 2 || 6001 || Invalid input<br />
|-<br />
| 0x2EE602 || 2 || 6003 || Path too long<br />
|-<br />
| 0x2EE802 || 2 || 6004 || Invalid character.<br />
|-<br />
| 0x2EEA02 || 2 || 6005 || Invalid directory path.<br />
|-<br />
| 0x2EEC02 || 2 || 6006 || Unable to retrieve directory from path<br />
|-<br />
| 0x2F5A02 || 2 || 6061 || Offset outside storage<br />
|-<br />
| 0x313802 || 2 || 6300 || Operation not supported<br />
|-<br />
| 0x31AE02 || 2 || 6359 || Operation not supported in nn::fssystem::ConcatenationFileSystem<br />
|-<br />
| 0x31B002 || 2 || 6360 || Operation not supported in nn::fssystem::ConcatenationFile<br />
|-<br />
| 0x320002 || 2 || 6400 || Permission denied<br />
|-<br />
| 0x326602 || 2 || 6451 || Missing titlekey(?) required to mount content<br />
|-<br />
| 0x326E02 || 2 || 6455 || File not closed<br />
|-<br />
| 0x327002 || 2 || 6456 || Directory not closed<br />
|-<br />
| 0x327402 || 2 || 6458 || FS allocators already registered<br />
|-<br />
| 0x327602 || 2 || 6459 || FS allocators already used<br />
|-<br />
| 0x327A02 || 2 || 6461 || FS allocator alignment violation<br />
|-<br />
| 0x339402 || 2 || 6602 || File not found.<br />
|-<br />
| 0x339602 || 2 || 6603 || Directory not found.<br />
|-<br />
| 0x3DBC02 || 2 || 7902 || RomFs table: Entry not found in dictionary<br />
|-<br />
| 0x3DBE02 || 2 || 7903 || RomFs table: File not found<br />
|-<br />
| 0x3DC002 || 2 || 7904 || RomFs table: Directory not found<br />
|-<br />
| 0x3DC402 || 2 || 7906 || RomFs table: Entry already exists when trying to add a new entry<br />
|-<br />
| 0x3DC602 || 2 || 7907 || RomFs table: Insufficient space to add new entry<br />
|-<br />
| 0x3DC802 || 2 || 7908 || RomFs table: Unable to add new directory<br />
|-<br />
| 0x3DCA02 || 2 || 7909 || RomFs table: Unable to add new file<br />
|-<br />
| 0x3DCC02 || 2 || 7910 || RomFs directory has no more child directories/files when iterating<br />
|-<br />
| 0x3DD402 || 2 || 7914 || RomFs table: Path is file, not directory<br />
|-<br />
| 0x803 || 3 || 4 || OS busy<br />
|-<br />
| 0xE03 || 3 || 7 || Invalid parameter<br />
|-<br />
| 0x1003 || 3 || 8 || Out of memory<br />
|-<br />
| 0x1203 || 3 || 9 || Out of resources<br />
|-<br />
| 0x3EA03 || 3 || 501 || Invalid handle<br />
|-<br />
| 0x3EE03 || 3 || 503 || Invalid memory mirror<br />
|-<br />
| 0x7FE03 || 3 || 1023 || TLS slot is not allocated<br />
|-<br />
| 0xA05 || 5 || 5 || [[Content_Manager_services|NcaID]] not found. Returned when attempting to mount titles which exist that aren't *8XX titles, the same way *8XX titles are mounted.<br />
|-<br />
| 0xE05 || 5 || 7 || TitleId not found<br />
|-<br />
| 0x1805 || 5 || 12 || Invalid StorageId<br />
|-<br />
| 0xDC05 || 5 || 110 || Gamecard not inserted<br />
|-<br />
| 0x17C05 || 5 || 190 || Gamecard not initialized<br />
|-<br />
| 0x1F405 || 5 || 250 || Sdcard not inserted<br />
|-<br />
| 0x20805 || 5 || 260 || Storage not mounted<br />
|-<br />
| 0x806 || 6 || 4 || Converted from error 0xD401<br />
|-<br />
| 0x1006 || 6 || 8 || Converted from error 0xE401<br />
|-<br />
| 0x408 || 8 || 2 || Program location entry not found<br />
|-<br />
| 0x608 || 8 || 3 || Invalid context for control location<br />
|-<br />
| 0x808 || 8 || 4 || Storage not found<br />
|-<br />
| 0xA08 || 8 || 5 || Access denied<br />
|-<br />
| 0xC08 || 8 || 6 || Offline manual HTML location entry not found<br />
|-<br />
| 0xE08 || 8 || 7 || Title is not registered<br />
|-<br />
| 0x1008 || 8 || 8 || Control location entry for host not found<br />
|-<br />
| 0x1208 || 8 || 9 || Legal info HTML location entry not found<br />
|-<br />
| 0x1408 || 8 || 10 || Program location for debug entry not found<br />
|-<br />
| 0x209 || 9 || 1 || Args too long.<br />
|-<br />
| 0x409 || 9 || 2 || Maximum processes loaded.<br />
|-<br />
| 0x609 || 9 || 3 || NPDM too big.<br />
|-<br />
| 0x19009 || 9 || 200 || Invalid access control sizes in NPDM.<br />
|-<br />
| 0x809 || 9 || 4 || Invalid NPDM.<br />
|-<br />
| 0xA09 || 9 || 5 || Invalid files.<br />
|-<br />
| 0xE09 || 9 || 7 || Already registered.<br />
|-<br />
| 0x1009 || 9 || 8 || Title not found.<br />
|-<br />
| 0x1209 || 9 || 9 || Title-id in ACI0 doesn't match range in ACID.<br />
|-<br />
| 0x6609 || 9 || 51 || Invalid memory state/permission<br />
|-<br />
| 0x6A09 || 9 || 53 || Invalid NRR<br />
|-<br />
| 0xA209 || 9 || 81 || Unaligned NRR address<br />
|-<br />
| 0xA409 || 9 || 82 || Bad NRR size<br />
|-<br />
| 0xAA09 || 9 || 85 || Bad NRR address<br />
|-<br />
| 0xAE09 || 9 || 87 || Bad initialization<br />
|-<br />
| 0xC809 || 9 || 100 || Unknown ACI0 descriptor<br />
|-<br />
| 0xCE09 || 9 || 103 || ACID/ACI0 don't match for descriptor "KernelFlags"<br />
|-<br />
| 0xD009 || 9 || 104 || ACID/ACI0 don't match for descriptor "SyscallMask"<br />
|-<br />
| 0xD409 || 9 || 106 || ACID/ACI0 don't match for descriptor "MapIoOrNormalRange"<br />
|-<br />
| 0xD609 || 9 || 107 || ACID/ACI0 don't match for descriptor "MapNormalPage"<br />
|-<br />
| 0xDE09 || 9 || 111 || ACID/ACI0 don't match for descriptor "InterruptPair"<br />
|-<br />
| 0xE209 || 9 || 113 || ACID/ACI0 don't match for descriptor "ApplicationType"<br />
|-<br />
| 0xE409 || 9 || 114 || ACID/ACI0 don't match for descriptor "KernelReleaseVersion"<br />
|-<br />
| 0xE609 || 9 || 115 || ACID/ACI0 don't match for descriptor "HandleTableSize"<br />
|-<br />
| 0xE809 || 9 || 116 || ACID/ACI0 don't match for descriptor "DebugFlags"<br />
|-<br />
| 0x1940A || 10 || 202 || Invalid CMIF header size.<br />
|-<br />
| 0x1A60A || 10 || 211 || Invalid CMIF input header.<br />
|-<br />
| 0x1A80A || 10 || 212 || Invalid CMIF output header.<br />
|-<br />
| 0x1BA0A || 10 || 221 || Invalid method dispatch ID.<br />
|-<br />
| 0x1D60A || 10 || 235 || Invalid in object count.<br />
|-<br />
| 0x1D80A || 10 || 236 || Invalid out object count.<br />
|-<br />
| 0x25A0A || 10 || 301 || Out of domain entries.<br />
|-<br />
| 0x20B || 11 || 1 || Unsupported operation<br />
|-<br />
| 0xCC0B || 11 || 102 || Out of server session memory<br />
|-<br />
| 0x11A0B || 11 || 141 || Went past maximum during marshalling.<br />
|-<br />
| 0x1900B || 11 || 200 || Session doesn't support domains.<br />
|-<br />
| 0x25A0B || 11 || 301 || Remote process is dead.<br />
|-<br />
| 0x3260B || 11 || 403 || Unknown request type<br />
|-<br />
| 0x3D60B || 11 || 491 || IPC Query 1 failed.<br />
|-<br />
| 0x20F || 15 || 1 || Pid not found<br />
|-<br />
| 0x60F || 15 || 3 || Process has no pending events<br />
|-<br />
| 0xA0F || 15 || 5 || Application already running<br />
|-<br />
| 0x410 || 16 || 2 || Title-id not found<br />
|-<br />
| 0xF010 || 16 || 120 || Gamecard sysupdate not required<br />
|-<br />
| 0x1F610 || 16 || 251 || Unexpected StorageId<br />
|-<br />
| 0x215 || 21 || 1 || Out of processes<br />
|-<br />
| 0x415 || 21 || 2 || Not initialized.<br />
|-<br />
| 0x615 || 21 || 3 || Max sessions<br />
|-<br />
| 0x815 || 21 || 4 || Service already registered<br />
|-<br />
| 0xA15 || 21 || 5 || Out of services<br />
|-<br />
| 0xC15 || 21 || 6 || Invalid name (all zeroes)<br />
|-<br />
| 0xE15 || 21 || 7 || Service not registered<br />
|-<br />
| 0x1015 || 21 || 8 || Permission denied<br />
|-<br />
| 0x1215 || 21 || 9 || Service Access Control too big.<br />
|-<br />
| 0x416 || 22 || 2 || Address space is full<br />
|-<br />
| 0x616 || 22 || 3 || NRO already loaded<br />
|-<br />
| 0x816 || 22 || 4 || Invalid NRO header values<br />
|-<br />
| 0xC16 || 22 || 6 || Bad NRR magic<br />
|-<br />
| 0x1016 || 22 || 8 || Reached max NRR count<br />
|-<br />
| 0x1216 || 22 || 9 || Unable to verify NRO hash or NRR signature<br />
|-<br />
| 0x80216 || 22 || 1025 || Address not page-aligned<br />
|-<br />
| 0x80416 || 22 || 1026 || Incorrect NRO size<br />
|-<br />
| 0x80816 || 22 || 1028 || NRO not loaded<br />
|-<br />
| 0x80A16 || 22 || 1029 || NRR not loaded<br />
|-<br />
| 0x80C16 || 22 || 1030 || Already initialized<br />
|-<br />
| 0x80E16 || 22 || 1031 || Not initialized<br />
|-<br />
| 0x21A || 26 || 1 || SMC is not implemented<br />
|-<br />
| 0x41A || 26 || 2 || SMC argument is invalid<br />
|-<br />
| 0x61A || 26 || 3 || SMC is currently in progress/secmon is busy<br />
|-<br />
| 0x81A || 26 || 4 || Secmon not currently performing async operation<br />
|-<br />
| 0xA1A || 26 || 5 || Invalid SMC async callback key<br />
|-<br />
| 0xC1A || 26 || 6 || SMC is blacklisted during current boot<br />
|-<br />
| 0xC81A || 26 || 100 || Invalid (buffer) size<br />
|-<br />
| 0xCA1A || 26 || 101 || Unknown SMC error<br />
|-<br />
| 0xCA1A || 26 || 101 || Decryption failure<br />
|-<br />
| 0xD01A || 26 || 104 || No AES keyslots available<br />
|-<br />
| 0xD21A || 26 || 105 || Invalid AES keyslot<br />
|-<br />
| 0xD41A || 26 || 106 || BootReason already set<br />
|-<br />
| 0xD61A || 26 || 107 || BootReason not set<br />
|-<br />
| 0xD81A || 26 || 108 || Invalid argument<br />
|-<br />
| 0x19269 || 105 || 201 || Null settings name<br />
|-<br />
| 0x19469 || 105 || 202 || Null settings key<br />
|-<br />
| 0x19669 || 105 || 203 || Null settings value<br />
|-<br />
| 0x19A69 || 105 || 205 || Null settings value buffer<br />
|-<br />
| 0x1A069 || 105 || 208 || Null setting value size buffer<br />
|-<br />
| 0x1A269 || 105 || 209 || Null debug mode flag buffer<br />
|-<br />
| 0x1BA69 || 105 || 221 || Setting group name has zero length<br />
|-<br />
| 0x1BC69 || 105 || 222 || Empty settings item key<br />
|-<br />
| 0x1E269 || 105 || 241 || Setting group name is too long (64 character limit?)<br />
|-<br />
| 0x1E469 || 105 || 242 || Setting name is too long (64 character limit?)<br />
|-<br />
| 0x20A69 || 105 || 261 || Setting group name ends with '.' or contains invalid characters (allowed: [a-z0-9_\-.])<br />
|-<br />
| 0x20C69 || 105 || 262 || Setting name ends with '.' or contains invalid characters (allowed: [a-z0-9_\-.])<br />
|-<br />
| 0x4DA69 || 105 || 621 || Null language code buffer<br />
|-<br />
| 0x4EE69 || 105 || 631 || Null network settings buffer<br />
|-<br />
| 0x4F069 || 105 || 632 || Null network settings output count buffer<br />
|-<br />
| 0x50269 || 105 || 641 || Null backlight settings buffer<br />
|-<br />
| 0x51669 || 105 || 651 || Null Bluetooth device setting buffer<br />
|-<br />
| 0x51869 || 105 || 652 || Null Bluetooth device setting output count buffer<br />
|-<br />
| 0x51A69 || 105 || 653 || Null Bluetooth enable flag buffer<br />
|-<br />
| 0x51C69 || 105 || 654 || Null Bluetooth AFH enable flag buffer<br />
|-<br />
| 0x51E69 || 105 || 655 || Null Bluetooth boost enable flag buffer<br />
|-<br />
| 0x52069 || 105 || 656 || Null BLE pairing settings buffer<br />
|-<br />
| 0x52269 || 105 || 657 || Null BLE pairing settings entry count buffer<br />
|-<br />
| 0x52A69 || 105 || 661 || Null external steady clock source ID buffer<br />
|-<br />
| 0x52C69 || 105 || 662 || Null user system clock context buffer<br />
|-<br />
| 0x52E69 || 105 || 663 || Null network system clock context buffer<br />
|-<br />
| 0x53069 || 105 || 664 || Null user system clock automatic correction enabled flag buffer<br />
|-<br />
| 0x53269 || 105 || 665 || Null shutdown RTC value buffer<br />
|-<br />
| 0x53469 || 105 || 666 || Null external steady clock internal offset buffer<br />
|-<br />
| 0x53E69 || 105 || 671 || Null account settings buffer<br />
|-<br />
| 0x55269 || 105 || 681 || Null audio volume buffer<br />
|-<br />
| 0x55669 || 105 || 683 || Null ForceMuteOnHeadphoneRemoved buffer<br />
|-<br />
| 0x55869 || 105 || 684 || Null headphone volume warning count buffer<br />
|-<br />
| 0x55E69 || 105 || 687 || Invalid audio output mode<br />
|-<br />
| 0x56069 || 105 || 688 || Null headphone volume update flag buffer<br />
|-<br />
| 0x56669 || 105 || 691 || Null console information upload flag buffer<br />
|-<br />
| 0x57A69 || 105 || 701 || Null automatic application download flag buffer<br />
|-<br />
| 0x57C69 || 105 || 702 || Null notification settings buffer<br />
|-<br />
| 0x57E69 || 105 || 703 || Null account notification settings entry count buffer<br />
|-<br />
| 0x58069 || 105 || 704 || Null account notification settings buffer<br />
|-<br />
| 0x58E69 || 105 || 711 || Null vibration master volume buffer<br />
|-<br />
| 0x59069 || 105 || 712 || Null NX controller settings buffer<br />
|-<br />
| 0x59269 || 105 || 713 || Null NX controller settings entry count buffer<br />
|-<br />
| 0x59469 || 105 || 714 || Null USB full key enable flag buffer<br />
|-<br />
| 0x5A269 || 105 || 721 || Null TV settings buffer<br />
|-<br />
| 0x5A469 || 105 || 722 || Null EDID buffer<br />
|-<br />
| 0x5B669 || 105 || 731 || Null data deletion settings buffer<br />
|-<br />
| 0x5CA69 || 105 || 741 || Null initial system applet program ID buffer<br />
|-<br />
| 0x5CC69 || 105 || 742 || Null overlay disp program ID buffer<br />
|-<br />
| 0x5CE69 || 105 || 743 || Null IsInRepairProcess buffer<br />
|-<br />
| 0x5D069 || 105 || 744 || Null RequiresRunRepairTimeReviser buffer<br />
|-<br />
| 0x5DE69 || 105 || 751 || Null device timezone location name buffer<br />
|-<br />
| 0x5F269 || 105 || 761 || Null primary album storage buffer<br />
|-<br />
| 0x60669 || 105 || 771 || Null USB 3.0 enable flag buffer<br />
|-<br />
| 0x60869 || 105 || 772 || Null USB Type-C power source circuit version buffer<br />
|-<br />
| 0x61A69 || 105 || 781 || Null battery lot buffer<br />
|-<br />
| 0x62E69 || 105 || 791 || Null serial number buffer<br />
|-<br />
| 0x64269 || 105 || 801 || Null lock screen flag buffer<br />
|-<br />
| 0x64669 || 105 || 803 || Null color set ID buffer<br />
|-<br />
| 0x64869 || 105 || 804 || Null quest flag buffer<br />
|-<br />
| 0x64A69 || 105 || 805 || Null wireless certification file size buffer<br />
|-<br />
| 0x64C69 || 105 || 806 || Null wireless certification file buffer<br />
|-<br />
| 0x64E69 || 105 || 807 || Null initial launch settings buffer<br />
|-<br />
| 0x65069 || 105 || 808 || Null device nickname buffer<br />
|-<br />
| 0x65269 || 105 || 809 || Null battery percentage flag buffer<br />
|-<br />
| 0x65469 || 105 || 810 || Null applet launch flags buffer<br />
|-<br />
| 0x7E869 || 105 || 1012 || Null wireless LAN enable flag buffer<br />
|-<br />
| 0x7FA69 || 105 || 1021 || Null product model buffer<br />
|-<br />
| 0x80E69 || 105 || 1031 || Null NFC enable flag buffer<br />
|-<br />
| 0x82269 || 105 || 1041 || Null ECI device certificate buffer<br />
|-<br />
| 0x82469 || 105 || 1042 || Null E-Ticket device certificate buffer<br />
|-<br />
| 0x83669 || 105 || 1051 || Null sleep settings buffer<br />
|-<br />
| 0x84A69 || 105 || 1061 || Null EULA version buffer<br />
|-<br />
| 0x84C69 || 105 || 1062 || Null EULA version entry count buffer<br />
|-<br />
| 0x85E69 || 105 || 1071 || Null LDN channel buffer<br />
|-<br />
| 0x87269 || 105 || 1081 || Null SSL key buffer<br />
|-<br />
| 0x87469 || 105 || 1082 || Null SSL certificate buffer<br />
|-<br />
| 0x88669 || 105 || 1091 || Null telemetry flags buffer<br />
|-<br />
| 0x89A69 || 105 || 1101 || Null Gamecard key buffer<br />
|-<br />
| 0x89C69 || 105 || 1102 || Null Gamecard certificate buffer<br />
|-<br />
| 0x8AE69 || 105 || 1111 || Null PTM battery lot buffer<br />
|-<br />
| 0x8B069 || 105 || 1112 || Null PTM fuel gauge parameter buffer<br />
|-<br />
| 0x8C269 || 105 || 1121 || Null ECI device key buffer<br />
|-<br />
| 0x8C469 || 105 || 1122 || Null E-Ticket device key buffer<br />
|-<br />
| 0x8D669 || 105 || 1131 || Null speaker parameter buffer<br />
|-<br />
| 0x8EA69 || 105 || 1141 || Null firmware version buffer<br />
|-<br />
| 0x8EC69 || 105 || 1142 || Null firmware version digest buffer<br />
|-<br />
| 0x8EE69 || 105 || 1143 || Null rebootless system update version buffer<br />
|-<br />
| 0x8FE69 || 105 || 1151 || Null Mii author ID buffer<br />
|-<br />
| 0x91269 || 105 || 1161 || Null fatal flags buffer<br />
|-<br />
| 0x92669 || 105 || 1171 || Null auto update enable flag buffer<br />
|-<br />
| 0x93A69 || 105 || 1181 || Null external RTC reset flag buffer<br />
|-<br />
| 0x94E69 || 105 || 1191 || Null push notification activity mode buffer<br />
|-<br />
| 0x96269 || 105 || 1201 || Null service discovery control setting buffer<br />
|-<br />
| 0x97669 || 105 || 1211 || Null error report share permission buffer<br />
|-<br />
| 0x98A69 || 105 || 1221 || Null LCD vendor ID buffer<br />
|-<br />
| 0x99E69 || 105 || 1231 || Null console SixAxis sensor acceleration bias buffer<br />
|-<br />
| 0x9A069 || 105 || 1232 || Null console SixAxis sensor angular velocity bias buffer<br />
|-<br />
| 0x9A269 || 105 || 1233 || Null console SixAxis sensor acceleration gain buffer<br />
|-<br />
| 0x9A469 || 105 || 1234 || Null console SixAxis sensor angular velocity gain buffer<br />
|-<br />
| 0x9A669 || 105 || 1235 || Null console SixAxis sensor angular velocity time bias buffer<br />
|-<br />
| 0x9A869 || 105 || 1236 || Null console SixAxis sensor angular acceleration buffer <br />
|-<br />
| 0x9B269 || 105 || 1241 || Null keyboard layout buffer<br />
|-<br />
| 0x9BA69 || 105 || 1245 || Invalid keyboard layout<br />
|-<br />
| 0x9C669 || 105 || 1251 || Null web inspector flag buffer<br />
|-<br />
| 0x9C869 || 105 || 1252 || Null allowed SSL hosts buffer<br />
|-<br />
| 0x9CA69 || 105 || 1253 || Null allowed SSL hosts entry count buffer<br />
|-<br />
| 0x9CC69 || 105 || 1254 || Null host FS mount point buffer<br />
|-<br />
| 0x9EE69 || 105 || 1271 || Null Amiibo key buffer<br />
|-<br />
| 0x9F069 || 105 || 1272 || Null Amiibo ECQV certificate buffer<br />
|-<br />
| 0x9F269 || 105 || 1273 || Null Amiibo ECDSA certificate buffer<br />
|-<br />
| 0x9F469 || 105 || 1274 || Null Amiibo ECQV BLS key buffer<br />
|-<br />
| 0x9F669 || 105 || 1275 || Null Amiibo ECQV BLS certificate buffer<br />
|-<br />
| 0x9F869 || 105 || 1276 || Null Amiibo ECQV BLS root certificate buffer<br />
|-<br />
| 0x272 || 114 || 1 || Generic error<br />
|-<br />
| 0xC72 || 114 || 6 || Unsupported operation<br />
|-<br />
| 0x74 || 116 || 0 || Time service not initialized<br />
|-<br />
| 0xCC74 || 116 || 102 || Time not set<br />
|-<br />
| 0x19074 || 116 || 200 || Invalid time comparison<br />
|-<br />
| 0x19274 || 116 || 201 || Signed overflow/underflow<br />
|-<br />
| 0x64274 || 116 || 801 || Memory allocation failure<br />
|-<br />
| 0x70A74 || 116 || 901 || Null pointer<br />
|-<br />
| 0x70C74 || 116 || 902 || Value out of valid range<br />
|-<br />
| 0x70E74 || 116 || 903 || TimeZoneRule conversion failed<br />
|-<br />
| 0x7BA74 || 116 || 989 || TimeZone location name not found<br />
|-<br />
| 0x7BC74 || 116 || 990 || Unimplemented functionality<br />
|-<br />
| 0x27A || 122 || 1 || Invalid argument<br />
|-<br />
| 0x47A || 122 || 2 || Object not found<br />
|-<br />
| 0x67A || 122 || 3 || Object locked/in used<br />
|-<br />
| 0x87A || 122 || 4 || Target already mounted<br />
|-<br />
| 0xA7A || 122 || 5 || Target not mounted<br />
|-<br />
| 0xC7A || 122 || 6 || Object already opened<br />
|-<br />
| 0xE7A || 122 || 7 || Object not opened<br />
|-<br />
| 0xA07A || 122 || 80 || Passphrase not found<br />
|-<br />
| 0xA27A || 122 || 81 || Data verification failed<br />
|-<br />
| 0xB47A || 122 || 90 || Invalid API call<br />
|-<br />
| 0xC47A || 122 || 98 || Invalid operation<br />
|-<br />
| 0x287C || 124 || 20 || Argument is NULL<br />
|-<br />
| 0x2C7C || 124 || 22 || Argument is invalid<br />
|-<br />
| 0x3C7C || 124 || 30 || Bad input buffer size<br />
|-<br />
| 0x407C || 124 || 32 || Invalid input buffer<br />
|-<br />
| 0x27E || 126 || 1 || Invalid argument<br />
|-<br />
| 0x87E || 126 || 4 || Entry not found<br />
|-<br />
| 0xCE7E || 126 || 67 || Invalid database signature value (should be "NFDB")<br />
|-<br />
| 0xD27E || 126 || 69 || Invalid database entry count<br />
|-<br />
| 0x1987E || 126 || 204 || Development/debug-only behavior<br />
|-<br />
| 0x480 || 128 || 2 || IStorage not available.<br />
|-<br />
| 0x4680 || 128 || 35 || Error while launching applet.<br />
|-<br />
| 0x4A80 || 128 || 37 || Title-ID not found. Caused by code 0x410 when applet launch fails<br />
|-<br />
| 0x3E880 || 128 || 500 || Invalid IStorage size (negative?)<br />
|-<br />
| 0x3EC80 || 128 || 502 || IStorage has already been opened by another accessor<br />
|-<br />
| 0x3EE80 || 128 || 503 || IStorage Read/Write out-of-bounds<br />
|-<br />
| 0x3FE80 || 128 || 511 || IStorage opened as wrong type (data opened as transfermem, transfermem opened as data)<br />
|-<br />
| 0x40080 || 128 || 512 || Unbalanced fatal section leave (returned when executing LeaveFatalSection without a preceding EnterFatalSection call)<br />
|-<br />
| 0x4B080 || 128 || 600 || Failed to allocate memory for IStorage<br />
|-<br />
| 0x59080 || 128 || 712 || Thread stack pool exhausted (out of memory)<br />
|-<br />
| 0x7A880 || 128 || 980 || <code>am.debug!dev_function</code> setting needs to be set<br />
|-<br />
| 0xA83 || 131 || 5 || Unrecognized applet ID<br />
|-<br />
| 0x485 || 133 || 2 || Invalid DVFS table ID<br />
|-<br />
| 0x885 || 133 || 4 || Invalid parameter<br />
|-<br />
| 0x3CF089 || 137 || 7800 || Unknown/invalid libcurl error.<br />
|-<br />
| 0x3E8289-0x3F4089 || 137 || 8001-8096 || libcurl error 1-96. Some of the libcurl errors in the error-table map to the above unknown-libcurl-error however.<br />
|-<br />
| 0x68A || 138 || 3 || Not initialized.<br />
|-<br />
| 0x668C || 140 || 51 || USB data-transfer in progress<br />
|-<br />
| 0xD48C || 140 || 106 || Invalid descriptor<br />
|-<br />
| 0x1928C || 140 || 201 || USB device not bound / interface already enabled<br />
|-<br />
| 0x299 || 153 || 1 || Invalid audio device<br />
|-<br />
| 0x499 || 153 || 2 || Operation couldn't complete successfully<br />
|-<br />
| 0x699 || 153 || 3 || Invalid sample rate<br />
|-<br />
| 0x899 || 153 || 4 || Buffer size too small<br />
|-<br />
| 0x1099 || 153 || 8 || Too many buffers are still unreleased<br />
|-<br />
| 0x1499 || 153 || 10 || Invalid channel count<br />
|-<br />
| 0x40299 || 153 || 513 || Invalid/Unsupported operation<br />
|-<br />
| 0xC0099 || 153 || 1536 || Invalid handle<br />
|-<br />
| 0xC0899 || 153 || 1540 || Audio output was already started<br />
|-<br />
| 0x3C9D || 157 || 30 || Address is NULL<br />
|-<br />
| 0x3E9D || 157 || 31 || PID is NULL<br />
|-<br />
| 0x549D || 157 || 42 || Already bound<br />
|-<br />
| 0xCC9D || 157 || 102 || Invalid PID<br />
|-<br />
| 0xAA3 || 163 || 5 || System is booting up repair process without VOL+ held down.<br />
|-<br />
| 0xCA3 || 163 || 6 || System is booting up repair process that requires RepairTimeReviser but does not have special cartridge inserted.<br />
|-<br />
| 0xC8B2 || 178 || 100 || Invalid user ID<br />
|-<br />
| 0xCAB2 || 178 || 101 || User does not exist<br />
|-<br />
| 0x12CB2 || 178 || 150 || Service unavailable<br />
|-<br />
| 0x190B2 || 178 || 200 || File storage failure<br />
|-<br />
| 0x58ACA || 202 || 709 || Npad ID is out of range.<br />
|-<br />
| 0xF0CD || 205 || 120 || IR image data not available/ready.<br />
|-<br />
| 0x1A8CD || 205 || 212 || IR camera handle pointer is null.<br />
|-<br />
| 0x198CD || 205 || 204 || IR camera invalid handle value.<br />
|-<br />
| 0x35B || 347 || 1 || Failed to init SM.<br />
|-<br />
| 0x55B || 347 || 2 || Failed to init FS.<br />
|-<br />
| 0x75B || 347 || 3 || Failed to open NRO file. May also happen when SD card isn't inserted / SD mounting failed earlier.<br />
|-<br />
| 0x95B || 347 || 4 || Failed to read NRO header.<br />
|-<br />
| 0xB5B || 347 || 5 || Invalid NRO magic.<br />
|-<br />
| 0xD5B || 347 || 6 || Invalid NRO segments.<br />
|-<br />
| 0xF5B || 347 || 7 || Failed to read NRO.<br />
|-<br />
| 0x135B || 347 || 9 || Failed to allocate heap.<br />
|-<br />
| 0x255B || 347 || 18 || Failed to map code-binary memory.<br />
|-<br />
| 0x275B || 347 || 19 || Failed to map code memory (.text).<br />
|-<br />
| 0x295B || 347 || 20 || Failed to map code memory (.rodata).<br />
|-<br />
| 0x2B5B || 347 || 21 || Failed to map code memory (.data+.bss).<br />
|-<br />
| 0x315B || 347 || 24 || Failed to unmap code memory (.text).<br />
|-<br />
| 0x335B || 347 || 25 || Failed to unmap code memory (.rodata).<br />
|-<br />
| 0x355B || 347 || 26 || Failed to unmap code memory (.data+.bss).<br />
|}<br />
<br />
== FS Error Codes ==<br />
The following are the error codes recognized by nn::fs::detail::LogErrorMessage found in some [[Factory Setup|factory]] titles:<br />
<br />
{| class=wikitable<br />
! Value || Description || Message<br />
|-<br />
| 0x7802 || 60 || Error: Specified mount name already exists.<br />
|-<br />
| 0xD401 || 106 || Error: Passed buffer is not usable for fs library.<br />
|-<br />
| 0x7D202 || 1001 || Error: Specified partition is not found.<br />
|-<br />
| 0x7D402 || 1002 || Error: Specified target is not found.<br />
|-<br />
| 0xFA002 - 0x138602 || 2000 - 2499 || Error: Failed to access SD card.<br />
|-<br />
| 0x136802 - 0x176E02 || 2500 - 2999 || Error: Failed to access game card.<br />
|-<br />
| 0x177202 || 3001 || Error: Specified operation is not implemented.<br />
|-<br />
| 0x177A02 || 3005 || Error: Specified value is out of range.<br />
|-<br />
| 0x1B5802 - 0x1F3E02 || 3500 - 3999 || Error: Failed to access MMC.<br />
|-<br />
| 0x1F4202 - 0x219602 || 4001 - 4299 || Error: ROM is corrupted.<br />
|-<br />
| 0x219A02 - 0x232602 || 4301 - 4499 || Error: Save data is corrupted.<br />
|-<br />
| 0x232A02 - 0x23EE02 || 4501 - 4599 || Error: NCA is corrupted.<br />
|-<br />
| 0x23F202 - 0x243E02 || 4601 - 4639 || Error: Integrity verification failed.<br />
|-<br />
| 0x244202 - 0x246602 || 4641 - 4659 || Error: Partition FS is corrupted.<br />
|-<br />
| 0x246A02 - 0x248E02 || 4661 - 4679 || Error: Built-in-storage is corrupted.<br />
|-<br />
| 0x249202 - 0x24B602 || 4681 - 4699 || Error: FAT FS is corrupted.<br />
|-<br />
| 0x24BA02 - 0x24DE02 || 4701 - 4719 || Error: HOST FS is corrupted.<br />
|-<br />
| 0x1F4002 - 0x270E02 || 4000, 4300, 4500, 4600, 4640, 4660, 4680, 4700, 4720-4999 || Error: Data is corrupted.<br />
|-<br />
| 0x271002 - 0x2EDE02 || 5000-5999 || Error: Unexpected failure occurred.<br />
|-<br />
| 0x2EE402 - 0x2F1A02 || 6002-6029 || Error: Invalid path was specified.<br />
|-<br />
| 0x2F5A02 || 6061 || Error: Invalid offset was specified.<br />
|-<br />
| 0x2F5C02 || 6062 || Error: Invalid size was specified.<br />
|-<br />
| 0x2F5E02 || 6063 || Error: Null pointer argument was specified.<br />
|-<br />
| 0x2EE002 || 6000 || Error: Precondition violation.<br />
|-<br />
| 0x2EE202 - 0x306E02 || 6001-6199 || Error: Invalid argument was specified.<br />
|-<br />
| 0x307202 || 6201 || Error: OpenMode_AllowAppend is required for implicit extension of file size by WriteFile().<br />
|-<br />
| 0x307002 - 0x313602 || 6200, 6202 - 6299 || Error: Invalid operation for the open mode.<br />
|-<br />
| 0x313802 - 0x31FE02 || 6300-6399 || Error: Unsupported operation.<br />
|-<br />
| 0x320002 - 0x32C602 || 6400-6499 || Error: Permission denied.<br />
|-<br />
| 0x346402 || 6706 || Error: Enough journal space is not left.<br />
|-<br />
| 0x346A02 || 6709 || Error: The open count of files and directories reached the limitation.<br />
|}<br />
<br />
= Fatal Errors =<br />
{| class=wikitable<br />
! Error || Description<br />
|-<br />
| 2162-0002<br />
| Can be triggered by running [[SVC|svcBreak]]. The svcBreak params have no effect on the value of the thrown error-code.<br />
|-<br />
| 2168-0000<br />
| Userland ARM undefined instruction exception<br />
|-<br />
| 2168-0001<br />
| Userland ARM prefetch-abort due to PC set to non-executable region<br />
|-<br />
| 2168-0002<br />
| Userland ARM data abort. Also caused by abnormal process termination via [[SVC|svcExitProcess]]. Note: directly jumping to nnMain()-retaddr from non-main-thread has the same result.<br />
|-<br />
| 2168-0003<br />
| Userland PC address not aligned to 4 bytes<br />
|-<br />
| 2168-0008<br />
| Can occur when attempting to call an svc outside the whitelist<br />
|}<br />
<br />
= Support Errors =<br />
This section is for Support Errors displayed by the error-applet, separate from the normal Result errors.<br />
<br />
== Support Modules ==<br />
{| class=wikitable<br />
! Value || Name<br />
|-<br />
| 800 || [[Internet_Browser|General web-applet]]<br />
|-<br />
| 809 || [[Internet_Browser|WifiWebAuthApplet]]<br />
|-<br />
| 810 || [[Internet_Browser|Whitelisted-applet]]<br />
|-<br />
| 811 || [[Internet_Browser|ShopN]]<br />
|}<br />
<br />
8XX is for/includes system applets.<br />
<br />
== Errors ==<br />
{| class=wikitable<br />
! Error || Module || Description || Notes<br />
|-<br />
| <br />
| {web-applets listed above}<br />
| 2750<br />
| MP4 parsing failed.<br />
|}<br />
<br />
Normal error-codes displayed by the system also use the same format as fatal-errors.</div>
Thog
https://switchbrew.org/w/index.php?title=PCV_services&diff=6915
PCV services
2019-05-17T19:32:04Z
<p>Thog: PosixTime is signed</p>
<hr />
<div>= bpc =<br />
This is "nn::bpc::IBoardPowerControlManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || ShutdownSystem<br />
|-<br />
| 1 || RebootSystem<br />
|-<br />
| 2 || GetWakeupReason<br />
|-<br />
| 3 || GetShutdownReason<br />
|-<br />
| 4 || GetAcOk<br />
|-<br />
| 5 || GetBoardPowerControlEvent<br />
|-<br />
| 6 || [2.0.0+] GetSleepButtonState<br />
|-<br />
| 7 || [2.0.0+] GetPowerEvent<br />
|-<br />
| 8 || [2.0.0+] CreateWakeupTimer<br />
|-<br />
| 9 || [2.0.0+] CancelWakeupTimer<br />
|-<br />
| 10 || [2.0.0+] EnableWakeupTimerOnDevice<br />
|-<br />
| 11 || [3.0.0+] CreateWakeupTimerEx<br />
|-<br />
| 12 || [3.0.0+] GetLastEnabledWakeupTimerType<br />
|-<br />
| 13 || [3.0.0+] CleanAllWakeupTimers<br />
|-<br />
| 14 || [6.0.0+]<br />
|}<br />
<br />
Cmd10: No input, returns a total of 0x10-bytes of output. [3.0.0+] Now returns a total of 0xC-bytes of output.<br />
<br />
= bpc:r =<br />
This is "nn::bpc::IRtcManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || GetRtcTime<br />
|-<br />
| 1 || SetRtcTime<br />
|-<br />
| 2 || GetRtcResetDetected<br />
|-<br />
| 3 || [2.0.0+] ClearRtcResetDetected<br />
|-<br />
| 4 || [3.0.0+] SetUpRtcResetOnShutdown<br />
|}<br />
<br />
GetExternalRtcValue / SetExternalRtcValue directly accesses the max77620_rtc0 device.<br />
<br />
= pcv =<br />
This is "nn::pcv::detail::IPcvService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| [1.0.0-7.0.1] 0 || SetPowerEnabled<br />
|-<br />
| [1.0.0-7.0.1] 1 || SetClockEnabled<br />
|-<br />
| [1.0.0-7.0.1] 2 || SetClockRate<br />
|-<br />
| [1.0.0-7.0.1] 3 || GetClockRate<br />
|-<br />
| [1.0.0-7.0.1] 4 || GetState<br />
|-<br />
| [1.0.0-7.0.1] 5 || GetPossibleClockRates<br />
|-<br />
| [1.0.0-7.0.1] 6 || SetMinVClockRate<br />
|-<br />
| [1.0.0-7.0.1] 7 || SetReset<br />
|-<br />
| [1.0.0-7.0.1] 8 || SetVoltageEnabled<br />
|-<br />
| [1.0.0-7.0.1] 9 || GetVoltageEnabled<br />
|-<br />
| [1.0.0-7.0.1] 10 || GetVoltageRange<br />
|-<br />
| [1.0.0-7.0.1] 11 || SetVoltageValue<br />
|-<br />
| [1.0.0-7.0.1] 12 || GetVoltageValue<br />
|-<br />
| [1.0.0-7.0.1] 13 || GetTemperatureThresholds<br />
|-<br />
| [1.0.0-7.0.1] 14 || SetTemperature<br />
|-<br />
| [1.0.0-5.1.0] 15 || Initialize<br />
|-<br />
| [1.0.0-5.1.0] 16 || IsInitialized<br />
|-<br />
| [1.0.0-5.1.0] 17 || Finalize<br />
|-<br />
| [3.0.0-7.0.1] 18 || PowerOn<br />
|-<br />
| [3.0.0-7.0.1] 19 || PowerOff<br />
|-<br />
| [3.0.0-7.0.1] 20 || ChangeVoltage<br />
|-<br />
| [3.0.0-7.0.1] 21 || GetPowerClockInfoEvent<br />
|-<br />
| [3.0.0-7.0.1] 22 || GetOscillatorClock<br />
|-<br />
| [3.0.0-7.0.1] 23 || GetDvfsTable<br />
|-<br />
| [3.0.0-7.0.1] 24 || GetModuleStateTable<br />
|-<br />
| [3.0.0-7.0.1] 25 || GetPowerDomainStateTable<br />
|-<br />
| 26 || [3.0.0+] GetFuseInfo<br />
|-<br />
| 27 || [5.0.0+] GetDramId<br />
|-<br />
| [6.0.0-7.0.1] 28 ||<br />
|-<br />
| [6.0.0-7.0.1] 29 ||<br />
|}<br />
<br />
[7.0.0+] The type-0xA output buffers were replaced with type-0x22 output buffers, for the following: GetDvfsTable, GetModuleStateTable, and GetPowerDomainStateTable.<br />
<br />
== Modules ==<br />
These are "nn::pcv::Module_X" where X is the power, clock and reset block name.<br />
<br />
[8.0.0+] Every module name is now mapped to an ID.<br />
<br />
=== Power Switch / Clocking / Reset ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Name || ID || Block || Rail || Notes<br />
|-<br />
| 0 || 0x40000001 || CpuBus || vdd_cpu ||<br />
|-<br />
| 1 || 0x40000002 || GPU || vdd_gpu ||<br />
|-<br />
| 2 || 0x40000003 || I2S1 || vdd_soc ||<br />
|-<br />
| 3 || 0x40000004 || I2S2 || vdd_soc ||<br />
|-<br />
| 4 || 0x40000005 || I2S3 || vdd_soc ||<br />
|-<br />
| 5 || 0x40000006 || PWM || vdd_soc ||<br />
|-<br />
| 6 || 0x02000001 || I2C1 || vdd_soc ||<br />
|-<br />
| 7 || 0x02000002 || I2C2 || vdd_soc ||<br />
|-<br />
| 8 || 0x02000003 || I2C3 || vdd_soc ||<br />
|-<br />
| 9 || 0x02000004 || I2C4 || vdd_soc ||<br />
|-<br />
| 10 || 0x02000005 || I2C5 || vdd_soc ||<br />
|-<br />
| 11 || 0x02000006 || I2C6 || vdd_soc ||<br />
|-<br />
| 12 || 0x07000000 || SPI1 || vdd_soc ||<br />
|-<br />
| 13 || 0x07000001 || SPI2 || vdd_soc ||<br />
|-<br />
| 14 || 0x07000002 || SPI3 || vdd_soc ||<br />
|-<br />
| 15 || 0x07000003 || SPI4 || vdd_soc ||<br />
|-<br />
| 16 || 0x40000011 || DISP1 || vdd_soc ||<br />
|-<br />
| 17 || 0x40000012 || DISP2 || vdd_soc ||<br />
|-<br />
| 18 || 0x40000013 || ISP || - || Not an actual block. Used for debug.<br />
|-<br />
| 19 || 0x40000014 || VI || - || Not an actual block. Used for debug.<br />
|-<br />
| 20 || 0x40000015 || SDMMC1 || vdd_soc ||<br />
|-<br />
| 21 || 0x40000016 || SDMMC2 || vdd_soc ||<br />
|-<br />
| 22 || 0x40000017 || SDMMC3 || vdd_soc ||<br />
|-<br />
| 23 || 0x40000018 || SDMMC4 || vdd_soc ||<br />
|-<br />
| 24 || 0x40000019 || OWR || - || Not an actual block. Used for debug.<br />
|-<br />
| 25 || 0x4000001A || CSITE || vdd_soc ||<br />
|-<br />
| 26 || 0x4000001B || TSEC || vdd_soc ||<br />
|-<br />
| 27 || 0x4000001C || MSELECT || vdd_soc ||<br />
|-<br />
| 28 || 0x4000001D || HDA2CODEC_2X || vdd_soc ||<br />
|-<br />
| 29 || 0x4000001E || ACTMON || vdd_soc ||<br />
|-<br />
| 30 || 0x4000001F || I2C_SLOW || vdd_soc ||<br />
|-<br />
| 31 || 0x40000020 || SOR1 || vdd_soc ||<br />
|-<br />
| 32 || 0x40000021 || SATA || - || Not an actual block. Used for debug.<br />
|-<br />
| 33 || 0x40000022 || HDA || vdd_soc ||<br />
|-<br />
| 34 || 0x40000023 || XUSB_CORE_HOST || vdd_soc ||<br />
|-<br />
| 35 || 0x40000024 || XUSB_FALCON || vdd_soc ||<br />
|-<br />
| 36 || 0x40000025 || XUSB_FS || vdd_soc ||<br />
|-<br />
| 37 || 0x40000026 || XUSB_CORE_DEV || vdd_soc ||<br />
|-<br />
| 38 || 0x40000027 || XUSB_SS_HOSTDEV || vdd_soc ||<br />
|-<br />
| 39 || 0x03000001 || UARTA || vdd_soc ||<br />
|-<br />
| 40 || 0x35000405 || UARTB || vdd_soc ||<br />
|-<br />
| 41 || 0x3500040F || UARTC || vdd_soc ||<br />
|-<br />
| 42 || 0x37000001 || UARTD || vdd_soc ||<br />
|-<br />
| 43 || 0x4000002C || HOST1X || vdd_soc ||<br />
|-<br />
| 44 || 0x4000002D || ENTROPY || vdd_soc ||<br />
|-<br />
| 45 || 0x4000002E || SOC_THERM || vdd_soc ||<br />
|-<br />
| 46 || 0x4000002F || VIC || vdd_soc ||<br />
|-<br />
| 47 || 0x40000030 || NVENC || vdd_soc ||<br />
|-<br />
| 48 || 0x40000031 || NVJPG || vdd_soc ||<br />
|-<br />
| 49 || 0x40000032 || NVDEC || vdd_soc ||<br />
|-<br />
| 50 || 0x40000033 || QSPI || vdd_soc ||<br />
|-<br />
| 51 || 0x40000034 || VI_I2C || - || Not an actual block. Used for debug.<br />
|-<br />
| 52 || 0x40000035 || TSECB || vdd_soc ||<br />
|-<br />
| 53 || 0x40000036 || APE || vdd_soc ||<br />
|-<br />
| 54 || 0x40000037 || ACLK || vdd_soc ||<br />
|-<br />
| 55 || 0x40000038 || UARTAPE || vdd_soc ||<br />
|-<br />
| 56 || 0x40000039 || EMC || vdd_soc ||<br />
|-<br />
| 57 || 0x4000003A || PLLE0 || vdd_soc ||<br />
|-<br />
| 58 || 0x4000003B || PLLE0 || vdd_soc ||<br />
|-<br />
| 59 || 0x4000003C || DSI || vdd_soc ||<br />
|-<br />
| 60 || 0x4000003D || MAUD || vdd_soc ||<br />
|-<br />
| 61 || 0x4000003E || DPAUX1 || vdd_soc ||<br />
|-<br />
| 62 || 0x4000003F || MIPI_CAL || vdd_soc ||<br />
|-<br />
| 63 || 0x40000040 || UART_FST_MIPI_CAL || vdd_soc ||<br />
|-<br />
| 64 || 0x40000041 || OSC || vdd_soc ||<br />
|-<br />
| 65 || 0x40000042 || SCLK || vdd_soc ||<br />
|-<br />
| 66 || 0x40000043 || SOR_SAFE || vdd_soc ||<br />
|-<br />
| 67 || 0x40000044 || XUSB_SS || vdd_soc ||<br />
|-<br />
| 68 || 0x40000045 || XUSB_HOST || vdd_soc ||<br />
|-<br />
| 69 || 0x40000046 || XUSB_DEV || vdd_soc ||<br />
|-<br />
| 70 || 0x40000047 || EXTPERIPH1 || vdd_soc ||<br />
|-<br />
| 71 || 0x40000048 || AHUB || vdd_soc ||<br />
|-<br />
| 72 || 0x40000049 || HDA2HDMICODEC || vdd_soc ||<br />
|-<br />
| 73 || 0x4000004A || PLLP5 || vdd_soc ||<br />
|-<br />
| 74 || 0x4000004B || USBD || vdd_soc ||<br />
|-<br />
| 75 || 0x4000004C || USB2 || vdd_soc ||<br />
|-<br />
| 76 || 0x4000004D || PCIE || vdd_soc ||<br />
|-<br />
| 77 || 0x4000004E || AFI || vdd_soc ||<br />
|-<br />
| 78 || 0x4000004F || PCIEXCLK || vdd_soc ||<br />
|-<br />
| 79 || 0x40000050 || PEX_USB_UPHY || vdd_soc ||<br />
|-<br />
| 80 || 0x40000051 || XUSB_PADCTL || vdd_soc ||<br />
|-<br />
| 81 || 0x40000052 || APBDMA || vdd_soc ||<br />
|-<br />
| 82 || 0x40000053 || USB2_TRK || vdd_soc ||<br />
|-<br />
| 83 || 0x40000054 || PLLE0 || vdd_soc ||<br />
|-<br />
| 84 || 0x40000055 || PLLE0 || vdd_soc ||<br />
|-<br />
| 85 || 0x40000056 || CEC || vdd_soc ||<br />
|-<br />
| [6.0.0+] 86 || 0x40000057 || EXTPERIPH2 || vdd_soc ||<br />
|}<br />
<br />
=== Voltage ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Name || Block || Notes<br />
|-<br />
| 0 || max77620_sd0 || <br />
|-<br />
| 1 || max77620_sd1 || <br />
|-<br />
| 2 || max77620_sd2 || <br />
|-<br />
| 3 || max77620_sd3 || <br />
|-<br />
| 4 || max77620_ldo0 || 1.2v<br />
|-<br />
| 5 || max77620_ldo1 || <br />
|-<br />
| 6 || max77620_ldo2 || SDcard power, 1.8v - 3.3v<br />
|-<br />
| 7 || max77620_ldo3 || GC ASIC 3.1v<br />
|-<br />
| 8 || max77620_ldo4 || RTC power, 0.85v<br />
|-<br />
| 9 || max77620_ldo5 || GC ASIC 1.8v<br />
|-<br />
| 10 || max77620_ldo6 || AVDD touchscreen, 2.9v<br />
|-<br />
| 11 || max77620_ldo7 || <br />
|-<br />
| 12 || max77620_ldo8 || DisplayPort, 1.05v<br />
|-<br />
| 13 || max77621_cpu || <br />
|-<br />
| 14 || max77621_gpu || <br />
|-<br />
| [6.0.0+] 15 || max77812_cpu || <br />
|-<br />
| [6.0.0+] 16 || max77812_gpu || <br />
|-<br />
| [6.0.0+] 17 || max77812_dram || <br />
|}<br />
<br />
Note: max77620 GPIOs are only used internally by the driver during init, and not exposed via an API.<br />
<br />
= pcv:arb =<br />
This is "nn::pcv::IArbitrationManager".<br />
<br />
This service no longer exists in [8.0.0+]. <br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || ReleaseControl<br />
|}<br />
<br />
= pcv:imm =<br />
This is "nn::pcv::IImmediateManager".<br />
<br />
This service no longer exists in [8.0.0+]. <br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || SetClockRate<br />
|}<br />
<br />
= clkrst, clkrst:i =<br />
These are "nn::clkrst::IClkrstManager" and "nn::clkrst::IImmediateManager".<br />
<br />
These were added with [8.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#OpenSession]]<br />
|-<br />
| 1 || GetTemperatureThresholds<br />
|-<br />
| 2 || SetTemperature<br />
|-<br />
| 3 || GetPossibleClockRates<br />
|-<br />
| 4 || GetClockInfoEvent<br />
|-<br />
| 5 || GetClockModuleNumLimit<br />
|}<br />
<br />
== OpenSession ==<br />
Takes an u32 '''ModuleID''', an u32 '''ModuleUnk''' and returns an [[#IClkrstSession]].<br />
<br />
== GetClockModuleNumLimit ==<br />
Returns 0x1A.<br />
<br />
== IClkrstSession ==<br />
This is "nn::clkrst::IClkrstSession".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || SetClockEnabled<br />
|-<br />
| 1 || SetClockDisabled<br />
|-<br />
| 2 || SetResetAsserted<br />
|-<br />
| 3 || SetResetDeasserted<br />
|-<br />
| 4 || SetPowerEnabled<br />
|-<br />
| 5 || SetPowerDisabled<br />
|-<br />
| 6 || GetState<br />
|-<br />
| 7 || SetClockRate<br />
|-<br />
| 8 || GetClockRate<br />
|-<br />
| 9 || SetMinVClockRate<br />
|-<br />
| 10 || GetPossibleClockRates<br />
|-<br />
| 11 || GetDvfsTable<br />
|}<br />
<br />
= clkrst:a =<br />
This is "nn::clkrst::IArbitrationManager".<br />
<br />
This was added with [8.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#ReleaseControl]]<br />
|}<br />
<br />
== ReleaseControl ==<br />
Takes an u32 '''ModuleID'''. No output.<br />
<br />
= rgltr =<br />
This is "nn::regulator::IRegulatorManager".<br />
<br />
This was added with [8.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#OpenSession]]<br />
|-<br />
| 1 || GetPowerDomainStateTable<br />
|-<br />
| 2 || GetPowerInfoEvent<br />
|-<br />
| 3 || GetPowerModuleNumLimit<br />
|}<br />
<br />
== OpenSession ==<br />
Takes an u32 '''ModuleID''' and returns an [[#IRegulatorSession]].<br />
<br />
== GetPowerModuleNumLimit ==<br />
Returns 0x3.<br />
<br />
== IRegulatorSession ==<br />
This is "nn::regulator::IRegulatorSession".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#SetVoltageEnabled]]<br />
|-<br />
| 1 ||<br />
|-<br />
| 2 || [[#GetVoltageEnabled]]<br />
|-<br />
| 3 || GetVoltageRange<br />
|-<br />
| 4 || GetVoltageValue<br />
|-<br />
| 5 || [[#SetVoltageValue]]<br />
|-<br />
| 6 || ChangeVoltage<br />
|}<br />
<br />
=== SetVoltageEnabled ===<br />
Takes a bool. Enables/disables the LDO this session was opened for.<br />
<br />
=== GetVoltageEnabled ===<br />
Returns a bool. True if voltage is enabled, false if not.<br />
<br />
=== SetVoltageValue ===<br />
Takes in a voltage in microvolts and sets the LDO to this voltage.<br />
<br />
= rtc =<br />
This was added with [8.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || GetRtcTime<br />
|-<br />
| 1 || SetRtcTime<br />
|-<br />
| 2 || SetRtcClientUnknownBool<br />
|-<br />
| 3 || GetRtcResetDetected<br />
|-<br />
| 4 || ClearRtcResetDetected<br />
|}<br />
<br />
Commands 0, 1, 3, 4 call the same internal functions as bpc:r, except they take an extra u32 [[Bus_services#Known_Devices_2|device code]], where bpc:r hardcodes 0x3B000001 (max77620_rtc0).<br />
<br />
Command 2 takes a u8 bool and a u32 device code; it opens an i2c session to the device code, and sets *(i2c_session_client_object + 0x38) = bool.<br />
<br />
= time:u, time:a, time:s =<br />
This is "nn::timesrv::detail::service::IStaticService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetStandardUserSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 1 || GetStandardNetworkSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 2 || GetStandardSteadyClock || Returns an [[#ISteadyClock]].<br />
|-<br />
| 3 || GetTimeZoneService || Returns an [[#ITimeZoneService]].<br />
|-<br />
| 4 || GetStandardLocalSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 5 || [4.0.0+] GetEphemeralNetworkSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 20 || [6.0.0+] GetSharedMemoryNativeHandle || <br />
|-<br />
| 30 || [6.0.0+] GetStandardNetworkClockOperationEventReadableHandle || <br />
|-<br />
| 31 || [6.0.0+] GetEphemeralNetworkClockOperationEventReadableHandle || <br />
|-<br />
| 50 || [4.0.0+] SetStandardSteadyClockInternalOffset || <br />
|-<br />
| 100 || IsStandardUserSystemClockAutomaticCorrectionEnabled || <br />
|-<br />
| 101 || SetStandardUserSystemClockAutomaticCorrectionEnabled || <br />
|-<br />
| 102 || [5.0.0+] GetStandardUserSystemClockInitialYear || <br />
|-<br />
| 200 || [3.0.0+] IsStandardNetworkSystemClockAccuracySufficient || <br />
|-<br />
| 201 || [6.0.0+] GetStandardUserSystemClockAutomaticCorrectionUpdatedTime || <br />
|-<br />
| 300 || [4.0.0+] CalculateMonotonicSystemClockBaseTimePoint || <br />
|-<br />
| 400 || [4.0.0+] GetClockSnapshot || <br />
|-<br />
| 401 || [4.0.0+] GetClockSnapshotFromSystemClockContext || <br />
|-<br />
| 500 || [4.0.0+] CalculateStandardUserSystemClockDifferenceByUser || <br />
|-<br />
| 501 || [4.0.0+] CalculateSpanBetween || <br />
|}<br />
<br />
== ISteadyClock ==<br />
This is "nn::timesrv::detail::service::ISteadyClock".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetCurrentTimePoint || No input, returns an output [[#SteadyClockTimePoint]].<br />
|-<br />
| 2 || GetTestOffset || No input, returns an output [[#TimeSpanType]].<br />
|-<br />
| 3 || SetTestOffset || Takes an input [[#TimeSpanType]], no output.<br />
|-<br />
| 100 || [2.0.0+] GetRtcValue || No input, returns an output s64.<br />
|-<br />
| 101 || [2.0.0+] IsRtcResetDetected || No input, returns an output u8 bool.<br />
|-<br />
| 102 || [2.0.0+] GetSetupResultValue || No input, returns an output u32.<br />
|-<br />
| 200 || [3.0.0+] GetInternalOffset || No input, returns an output [[#TimeSpanType]].<br />
|-<br />
| 201 || [3.0.0-3.0.2] SetInternalOffset || Takes an input [[#TimeSpanType]], no output.<br />
|}<br />
<br />
=== SteadyClockTimePoint ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x8|| A u64 representing a point in time.<br />
|-<br />
| 0x8 || 0x10 || An ID representing the clock source.<br />
|}<br />
<br />
This is a 0x18-byte struct.<br />
<br />
=== TimeSpanType ===<br />
This is an u64.<br />
<br />
== ISystemClock ==<br />
This is "nn::timesrv::detail::service::ISystemClock".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetCurrentTime || Returns an output [[#PosixTime]].<br />
|-<br />
| 1 || SetCurrentTime || Takes an input [[#PosixTime]].<br />
|-<br />
| 2 || GetSystemClockContext || Returns an output [[#SystemClockContext]].<br />
|-<br />
| 3 || SetSystemClockContext || Takes an input [[#SystemClockContext]].<br />
|}<br />
<br />
=== PosixTime ===<br />
This is an s64 for UTC POSIX time.<br />
<br />
=== SystemClockContext ===<br />
This is an 0x20-byte struct.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x8|| a [[#PosixTime]] representing the system clock epoch.<br />
|-<br />
| 0x8 || 0x18 || a [[#SteadyClockTimePoint]]<br />
|}<br />
<br />
== ITimeZoneService ==<br />
This is "nn::timesrv::detail::service::ITimeZoneService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetDeviceLocationName || No input, returns an output [[#LocationName]].<br />
|-<br />
| 1 || SetDeviceLocationName || Takes an input [[#LocationName]], no output.<br />
|-<br />
| 2 || GetTotalLocationNameCount || No input, returns an output s32.<br />
|-<br />
| 3 || LoadLocationNameList || <br />
|-<br />
| 4 || LoadTimeZoneRule || Takes an input [[#LocationName]] and a type-0x16 output buffer for [[#TimeZoneRule]], no output.<br />
|-<br />
| 5 || [2.0.0+] GetTimeZoneRuleVersion || No input, returns an output [[#TimeZoneRuleVersion]].<br />
|-<br />
| 6 || [5.0.0+] GetDeviceLocationNameAndUpdatedTime || <br />
|-<br />
| 100 || ToCalendarTime || Takes an input [[#PosixTime]] and a type-0x15 input buffer for [[#TimeZoneRule]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].<br />
|-<br />
| 101 || ToCalendarTimeWithMyRule || Takes an input [[#PosixTime]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].<br />
|-<br />
| 201 || ToPosixTime || Takes an input [[#CalendarTime]], a type-0x15 input buffer for [[#TimeZoneRule]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.<br />
|-<br />
| 202 || ToPosixTimeWithMyRule || Takes an input [[#CalendarTime]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.<br />
|}<br />
<br />
=== LoadLocationNameList ===<br />
Takes an input s32 LocationName_index and a type-0x6 output buffer for [[#LocationName]], returns an output s32 for total output entries.<br />
<br />
=== LocationName ===<br />
This contains a TimeZone location string with a max size of 0x24 bytes.<br />
<br />
=== TimeZoneRule ===<br />
This is an 0x4000-byte struct. Official sw uses fixed-size 0x4000 for the buffer size with the above commands.<br />
<br />
This is loaded from the [[Title_list|TimeZoneBinary]] title with the specified LocationName under the zoneinfo/ directory, the content is then converted into this TimeZoneRule structure.<br />
<br />
The files contained under zoneinfo/ directory are Tzif2 files without Tzif1 header and data at the begining of them (see [https://tools.ietf.org/html/rfc8536 RFC8536] for more information).<br />
<br />
The conversion of a Tzif2 file to a TimeZoneRule structure is based on [https://github.com/eggert/tz/blob/master/localtime.c tz database code] with some custom modifications (Leap seconds aren't handled, no usage of "posixrules" and Tzif1 support stripped out).<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x4 || timecnt<br />
|-<br />
| 0x4 || 0x4 || typecnt<br />
|-<br />
| 0x8 || 0x4 || charcnt<br />
|-<br />
| 0xC || 0x1 || goback<br />
|-<br />
| 0xD || 0x1 || goahead<br />
|-<br />
| 0xE || 0x2 || Padding<br />
|-<br />
| 0x10 || 0x8 * 1000 || ats<br />
|-<br />
| 0x1f50 || 0x1 * 1000 || types<br />
|-<br />
| 0x2338 || 0x10 * 128 || ttis (time type information), struct ttinfo[1000]<br />
|-<br />
| 0x2b38 || 0x1 * 512 || chars<br />
|-<br />
| 0x2d38 || 0x4 || defaulttype<br />
|-<br />
| 0x2d3c || 0x12c4 || Reserved / Unused<br />
|}<br />
<br />
=== ttinfo ===<br />
This is an 0x10-byte struct.<br />
Represent a Time Type Information used in [[#TimeZoneRule]].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x4 || tt_gmtoff<br />
|-<br />
| 0x4 || 0x1 || tt_isdst<br />
|-<br />
| 0x5 || 0x3 || Padding<br />
|-<br />
| 0x8 || 0x4 || tt_abbrind<br />
|-<br />
| 0xC || 0x1 || tt_ttisstd<br />
|-<br />
| 0xD || 0x1 || tt_ttisgmt<br />
|-<br />
| 0xE || 0x2 || Padding<br />
|}<br />
<br />
=== TimeZoneRuleVersion ===<br />
This is an u128.<br />
<br />
=== CalendarTime ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x2 || Year<br />
|-<br />
| 0x2 || 0x1 || Month<br />
|-<br />
| 0x3 || 0x1 || Day<br />
|-<br />
| 0x4 || 0x1 || Hour<br />
|-<br />
| 0x5 || 0x1 || Minute<br />
|-<br />
| 0x6 || 0x1 || Second<br />
|-<br />
| 0x7 || 0x1 || Padding / unknown?<br />
|}<br />
<br />
This is an 0x8-byte struct.<br />
<br />
=== CalendarAdditionalInfo ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x4 || 0-based day-of-week.<br />
|-<br />
| 0x4 || 0x4 || 0-based day-of-year.<br />
|-<br />
| 0x8 || 0x8 || Timezone name string.<br />
|-<br />
| 0x10 || 0x4 || 0 = no DST, 1 = DST.<br />
|-<br />
| 0x14 || 0x4 || s32 seconds relative to UTC for this timezone.<br />
|}<br />
<br />
This is an 0x18-byte struct. This stores timezone info.<br />
<br />
[[Category:Services]]</div>
Thog
https://switchbrew.org/w/index.php?title=PCV_services&diff=6776
PCV services
2019-05-03T11:34:18Z
<p>Thog: Document TimeZoneRule</p>
<hr />
<div>= bpc =<br />
This is "nn::bpc::IBoardPowerControlManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || ShutdownSystem<br />
|-<br />
| 1 || RebootSystem<br />
|-<br />
| 2 || GetWakeupReason<br />
|-<br />
| 3 || GetShutdownReason<br />
|-<br />
| 4 || GetAcOk<br />
|-<br />
| 5 || GetBoardPowerControlEvent<br />
|-<br />
| 6 || [2.0.0+] GetSleepButtonState<br />
|-<br />
| 7 || [2.0.0+] GetPowerEvent<br />
|-<br />
| 8 || [2.0.0+]<br />
|-<br />
| 9 || [2.0.0+]<br />
|-<br />
| 10 || [2.0.0+]<br />
|-<br />
| 11 || [3.0.0+]<br />
|-<br />
| 12 || [3.0.0+]<br />
|-<br />
| 13 || [3.0.0+]<br />
|-<br />
| 14 || [6.0.0+]<br />
|}<br />
<br />
= bpc:r =<br />
This is "nn::bpc::IRtcManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || GetExternalRtcValue<br />
|-<br />
| 1 || SetExternalRtcValue<br />
|-<br />
| 2 || ReadExternalRtcResetFlag<br />
|-<br />
| 3 || [2.0.0+] ClearExternalRtcResetFlag<br />
|-<br />
| 4 || [3.0.0+]<br />
|}<br />
<br />
GetExternalRtcValue / SetExternalRtcValue directly accesses the max77620_rtc0 device.<br />
<br />
= pcv =<br />
This is "nn::pcv::detail::IPcvService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| [1.0.0-7.0.1] 0 || SetPowerEnabled<br />
|-<br />
| [1.0.0-7.0.1] 1 || SetClockEnabled<br />
|-<br />
| [1.0.0-7.0.1] 2 || SetClockRate<br />
|-<br />
| [1.0.0-7.0.1] 3 || GetClockRate<br />
|-<br />
| [1.0.0-7.0.1] 4 || GetState<br />
|-<br />
| [1.0.0-7.0.1] 5 || GetPossibleClockRates<br />
|-<br />
| [1.0.0-7.0.1] 6 || SetMinVClockRate<br />
|-<br />
| [1.0.0-7.0.1] 7 || SetReset<br />
|-<br />
| [1.0.0-7.0.1] 8 || SetVoltageEnabled<br />
|-<br />
| [1.0.0-7.0.1] 9 || GetVoltageEnabled<br />
|-<br />
| [1.0.0-7.0.1] 10 || GetVoltageRange<br />
|-<br />
| [1.0.0-7.0.1] 11 || SetVoltageValue<br />
|-<br />
| [1.0.0-7.0.1] 12 || GetVoltageValue<br />
|-<br />
| [1.0.0-7.0.1] 13 || GetTemperatureThresholds<br />
|-<br />
| [1.0.0-7.0.1] 14 || SetTemperature<br />
|-<br />
| [1.0.0-5.1.0] 15 || Initialize<br />
|-<br />
| [1.0.0-5.1.0] 16 || IsInitialized<br />
|-<br />
| [1.0.0-5.1.0] 17 || Finalize<br />
|-<br />
| [3.0.0-7.0.1] 18 || PowerOn<br />
|-<br />
| [3.0.0-7.0.1] 19 || PowerOff<br />
|-<br />
| [3.0.0-7.0.1] 20 || ChangeVoltage<br />
|-<br />
| [3.0.0-7.0.1] 21 || GetPowerClockInfoEvent<br />
|-<br />
| [3.0.0-7.0.1] 22 || GetOscillatorClock<br />
|-<br />
| [3.0.0-7.0.1] 23 || GetDvfsTable<br />
|-<br />
| [3.0.0-7.0.1] 24 || GetModuleStateTable<br />
|-<br />
| [3.0.0-7.0.1] 25 || GetPowerDomainStateTable<br />
|-<br />
| 26 || [3.0.0+] GetFuseInfo<br />
|-<br />
| 27 || [5.0.0+] GetDramId<br />
|-<br />
| [6.0.0-7.0.1] 28 ||<br />
|-<br />
| [6.0.0-7.0.1] 29 ||<br />
|}<br />
<br />
[7.0.0+] The type-0xA output buffers were replaced with type-0x22 output buffers, for the following: GetDvfsTable, GetModuleStateTable, and GetPowerDomainStateTable.<br />
<br />
== Modules ==<br />
These are "nn::pcv::Module_X" where X is the power, clock and reset block name.<br />
<br />
[8.0.0+] Every module name is now mapped to an ID.<br />
<br />
=== Power Switch / Clocking / Reset ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Name || ID || Block || Rail || Notes<br />
|-<br />
| 0 || 0x40000001 || CpuBus || vdd_cpu ||<br />
|-<br />
| 1 || 0x40000002 || GPU || vdd_gpu ||<br />
|-<br />
| 2 || 0x40000003 || I2S1 || vdd_soc ||<br />
|-<br />
| 3 || 0x40000004 || I2S2 || vdd_soc ||<br />
|-<br />
| 4 || 0x40000005 || I2S3 || vdd_soc ||<br />
|-<br />
| 5 || 0x40000006 || PWM || vdd_soc ||<br />
|-<br />
| 6 || 0x02000001 || I2C1 || vdd_soc ||<br />
|-<br />
| 7 || 0x02000002 || I2C2 || vdd_soc ||<br />
|-<br />
| 8 || 0x02000003 || I2C3 || vdd_soc ||<br />
|-<br />
| 9 || 0x02000004 || I2C4 || vdd_soc ||<br />
|-<br />
| 10 || 0x02000005 || I2C5 || vdd_soc ||<br />
|-<br />
| 11 || 0x02000006 || I2C6 || vdd_soc ||<br />
|-<br />
| 12 || 0x07000000 || SPI1 || vdd_soc ||<br />
|-<br />
| 13 || 0x07000001 || SPI2 || vdd_soc ||<br />
|-<br />
| 14 || 0x07000002 || SPI3 || vdd_soc ||<br />
|-<br />
| 15 || 0x07000003 || SPI4 || vdd_soc ||<br />
|-<br />
| 16 || 0x40000011 || DISP1 || vdd_soc ||<br />
|-<br />
| 17 || 0x40000012 || DISP2 || vdd_soc ||<br />
|-<br />
| 18 || 0x40000013 || ISP || - || Not an actual block. Used for debug.<br />
|-<br />
| 19 || 0x40000014 || VI || - || Not an actual block. Used for debug.<br />
|-<br />
| 20 || 0x40000015 || SDMMC1 || vdd_soc ||<br />
|-<br />
| 21 || 0x40000016 || SDMMC2 || vdd_soc ||<br />
|-<br />
| 22 || 0x40000017 || SDMMC3 || vdd_soc ||<br />
|-<br />
| 23 || 0x40000018 || SDMMC4 || vdd_soc ||<br />
|-<br />
| 24 || 0x40000019 || OWR || - || Not an actual block. Used for debug.<br />
|-<br />
| 25 || 0x4000001A || CSITE || vdd_soc ||<br />
|-<br />
| 26 || 0x4000001B || TSEC || vdd_soc ||<br />
|-<br />
| 27 || 0x4000001C || MSELECT || vdd_soc ||<br />
|-<br />
| 28 || 0x4000001D || HDA2CODEC_2X || vdd_soc ||<br />
|-<br />
| 29 || 0x4000001E || ACTMON || vdd_soc ||<br />
|-<br />
| 30 || 0x4000001F || I2C_SLOW || vdd_soc ||<br />
|-<br />
| 31 || 0x40000020 || SOR1 || vdd_soc ||<br />
|-<br />
| 32 || 0x40000021 || SATA || - || Not an actual block. Used for debug.<br />
|-<br />
| 33 || 0x40000022 || HDA || vdd_soc ||<br />
|-<br />
| 34 || 0x40000023 || XUSB_CORE_HOST || vdd_soc ||<br />
|-<br />
| 35 || 0x40000024 || XUSB_FALCON || vdd_soc ||<br />
|-<br />
| 36 || 0x40000025 || XUSB_FS || vdd_soc ||<br />
|-<br />
| 37 || 0x40000026 || XUSB_CORE_DEV || vdd_soc ||<br />
|-<br />
| 38 || 0x40000027 || XUSB_SS_HOSTDEV || vdd_soc ||<br />
|-<br />
| 39 || 0x03000001 || UARTA || vdd_soc ||<br />
|-<br />
| 40 || 0x35000405 || UARTB || vdd_soc ||<br />
|-<br />
| 41 || 0x3500040F || UARTC || vdd_soc ||<br />
|-<br />
| 42 || 0x37000001 || UARTD || vdd_soc ||<br />
|-<br />
| 43 || 0x4000002C || HOST1X || vdd_soc ||<br />
|-<br />
| 44 || 0x4000002D || ENTROPY || vdd_soc ||<br />
|-<br />
| 45 || 0x4000002E || SOC_THERM || vdd_soc ||<br />
|-<br />
| 46 || 0x4000002F || VIC || vdd_soc ||<br />
|-<br />
| 47 || 0x40000030 || NVENC || vdd_soc ||<br />
|-<br />
| 48 || 0x40000031 || NVJPG || vdd_soc ||<br />
|-<br />
| 49 || 0x40000032 || NVDEC || vdd_soc ||<br />
|-<br />
| 50 || 0x40000033 || QSPI || vdd_soc ||<br />
|-<br />
| 51 || 0x40000034 || VI_I2C || - || Not an actual block. Used for debug.<br />
|-<br />
| 52 || 0x40000035 || TSECB || vdd_soc ||<br />
|-<br />
| 53 || 0x40000036 || APE || vdd_soc ||<br />
|-<br />
| 54 || 0x40000037 || ACLK || vdd_soc ||<br />
|-<br />
| 55 || 0x40000038 || UARTAPE || vdd_soc ||<br />
|-<br />
| 56 || 0x40000039 || EMC || vdd_soc ||<br />
|-<br />
| 57 || 0x4000003A || PLLE0 || vdd_soc ||<br />
|-<br />
| 58 || 0x4000003B || PLLE0 || vdd_soc ||<br />
|-<br />
| 59 || 0x4000003C || DSI || vdd_soc ||<br />
|-<br />
| 60 || 0x4000003D || MAUD || vdd_soc ||<br />
|-<br />
| 61 || 0x4000003E || DPAUX1 || vdd_soc ||<br />
|-<br />
| 62 || 0x4000003F || MIPI_CAL || vdd_soc ||<br />
|-<br />
| 63 || 0x40000040 || UART_FST_MIPI_CAL || vdd_soc ||<br />
|-<br />
| 64 || 0x40000041 || OSC || vdd_soc ||<br />
|-<br />
| 65 || 0x40000042 || SCLK || vdd_soc ||<br />
|-<br />
| 66 || 0x40000043 || SOR_SAFE || vdd_soc ||<br />
|-<br />
| 67 || 0x40000044 || XUSB_SS || vdd_soc ||<br />
|-<br />
| 68 || 0x40000045 || XUSB_HOST || vdd_soc ||<br />
|-<br />
| 69 || 0x40000046 || XUSB_DEV || vdd_soc ||<br />
|-<br />
| 70 || 0x40000047 || EXTPERIPH1 || vdd_soc ||<br />
|-<br />
| 71 || 0x40000048 || AHUB || vdd_soc ||<br />
|-<br />
| 72 || 0x40000049 || HDA2HDMICODEC || vdd_soc ||<br />
|-<br />
| 73 || 0x4000004A || PLLP5 || vdd_soc ||<br />
|-<br />
| 74 || 0x4000004B || USBD || vdd_soc ||<br />
|-<br />
| 75 || 0x4000004C || USB2 || vdd_soc ||<br />
|-<br />
| 76 || 0x4000004D || PCIE || vdd_soc ||<br />
|-<br />
| 77 || 0x4000004E || AFI || vdd_soc ||<br />
|-<br />
| 78 || 0x4000004F || PCIEXCLK || vdd_soc ||<br />
|-<br />
| 79 || 0x40000050 || PEX_USB_UPHY || vdd_soc ||<br />
|-<br />
| 80 || 0x40000051 || XUSB_PADCTL || vdd_soc ||<br />
|-<br />
| 81 || 0x40000052 || APBDMA || vdd_soc ||<br />
|-<br />
| 82 || 0x40000053 || USB2_TRK || vdd_soc ||<br />
|-<br />
| 83 || 0x40000054 || PLLE0 || vdd_soc ||<br />
|-<br />
| 84 || 0x40000055 || PLLE0 || vdd_soc ||<br />
|-<br />
| 85 || 0x40000056 || CEC || vdd_soc ||<br />
|-<br />
| [6.0.0+] 86 || 0x40000057 || EXTPERIPH2 || vdd_soc ||<br />
|}<br />
<br />
=== Voltage ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Name || Block || Notes<br />
|-<br />
| 0 || max77620_sd0 || <br />
|-<br />
| 1 || max77620_sd1 || <br />
|-<br />
| 2 || max77620_sd2 || <br />
|-<br />
| 3 || max77620_sd3 || <br />
|-<br />
| 4 || max77620_ldo0 || 1.2v<br />
|-<br />
| 5 || max77620_ldo1 || <br />
|-<br />
| 6 || max77620_ldo2 || SDcard power, 1.8v - 3.3v<br />
|-<br />
| 7 || max77620_ldo3 || GC ASIC 3.1v<br />
|-<br />
| 8 || max77620_ldo4 || RTC power, 0.85v<br />
|-<br />
| 9 || max77620_ldo5 || GC ASIC 1.8v<br />
|-<br />
| 10 || max77620_ldo6 || AVDD touchscreen, 2.9v<br />
|-<br />
| 11 || max77620_ldo7 || <br />
|-<br />
| 12 || max77620_ldo8 || DisplayPort, 1.05v<br />
|-<br />
| 13 || max77621_cpu || <br />
|-<br />
| 14 || max77621_gpu || <br />
|-<br />
| [6.0.0+] 15 || max77812_cpu || <br />
|-<br />
| [6.0.0+] 16 || max77812_gpu || <br />
|-<br />
| [6.0.0+] 17 || max77812_dram || <br />
|}<br />
<br />
Note: max77620 GPIOs are only used internally by the driver during init, and not exposed via an API.<br />
<br />
= pcv:arb =<br />
This is "nn::pcv::IArbitrationManager".<br />
<br />
This service no longer exists in [8.0.0+]. <br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || ReleaseControl<br />
|}<br />
<br />
= pcv:imm =<br />
This is "nn::pcv::IImmediateManager".<br />
<br />
This service no longer exists in [8.0.0+]. <br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || SetClockRate<br />
|}<br />
<br />
= clkrst, clkrst:i =<br />
These are "nn::clkrst::IClkrstManager" and "nn::clkrst::IImmediateManager".<br />
<br />
These were added with [8.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#OpenSession]]<br />
|-<br />
| 1 || GetTemperatureThresholds<br />
|-<br />
| 2 || SetTemperature<br />
|-<br />
| 3 || GetPossibleClockRates<br />
|-<br />
| 4 || GetClockInfoEvent<br />
|-<br />
| 5 || GetClockModuleNumLimit<br />
|}<br />
<br />
== OpenSession ==<br />
Takes an u32 '''ModuleID''', an u32 '''ModuleUnk''' and returns an [[#IClkrstSession]].<br />
<br />
== GetClockModuleNumLimit ==<br />
Returns 0x1A.<br />
<br />
== IClkrstSession ==<br />
This is "nn::clkrst::IClkrstSession".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || SetClockEnabled<br />
|-<br />
| 1 || SetClockDisabled<br />
|-<br />
| 2 || SetResetAsserted<br />
|-<br />
| 3 || SetResetDeasserted<br />
|-<br />
| 4 || SetPowerEnabled<br />
|-<br />
| 5 || SetPowerDisabled<br />
|-<br />
| 6 || GetState<br />
|-<br />
| 7 || SetClockRate<br />
|-<br />
| 8 || GetClockRate<br />
|-<br />
| 9 || SetMinVClockRate<br />
|-<br />
| 10 || GetPossibleClockRates<br />
|-<br />
| 11 || GetDvfsTable<br />
|}<br />
<br />
= clkrst:a =<br />
This is "nn::clkrst::IArbitrationManager".<br />
<br />
This was added with [8.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#ReleaseControl]]<br />
|}<br />
<br />
== ReleaseControl ==<br />
Takes an u32 '''ModuleID'''. No output.<br />
<br />
= rgltr =<br />
This is "nn::regulator::IRegulatorManager".<br />
<br />
This was added with [8.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#OpenSession]]<br />
|-<br />
| 1 || GetPowerDomainStateTable<br />
|-<br />
| 2 || GetPowerInfoEvent<br />
|-<br />
| 3 || GetPowerModuleNumLimit<br />
|}<br />
<br />
== OpenSession ==<br />
Takes an u32 '''ModuleID''' and returns an [[#IRegulatorSession]].<br />
<br />
== GetPowerModuleNumLimit ==<br />
Returns 0x3.<br />
<br />
== IRegulatorSession ==<br />
This is "nn::regulator::IRegulatorSession".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#SetVoltageEnabled]]<br />
|-<br />
| 1 ||<br />
|-<br />
| 2 || [[#GetVoltageEnabled]]<br />
|-<br />
| 3 || GetVoltageRange<br />
|-<br />
| 4 || GetVoltageValue<br />
|-<br />
| 5 || [[#SetVoltageValue]]<br />
|-<br />
| 6 || ChangeVoltage<br />
|}<br />
<br />
=== SetVoltageEnabled ===<br />
Takes a bool. Enables/disables the LDO this session was opened for.<br />
<br />
=== GetVoltageEnabled ===<br />
Returns a bool. True if voltage is enabled, false if not.<br />
<br />
=== SetVoltageValue ===<br />
Takes in a voltage in microvolts and sets the LDO to this voltage.<br />
<br />
= rtc =<br />
This was added with [8.0.0+].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 ||<br />
|-<br />
| 1 ||<br />
|-<br />
| 2 ||<br />
|-<br />
| 3 ||<br />
|-<br />
| 4 ||<br />
|}<br />
<br />
= time:u, time:a, time:s =<br />
This is "nn::timesrv::detail::service::IStaticService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetStandardUserSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 1 || GetStandardNetworkSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 2 || GetStandardSteadyClock || Returns an [[#ISteadyClock]].<br />
|-<br />
| 3 || GetTimeZoneService || Returns an [[#ITimeZoneService]].<br />
|-<br />
| 4 || GetStandardLocalSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 5 || [4.0.0+] GetEphemeralNetworkSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 20 || [6.0.0+] GetSharedMemoryNativeHandle || <br />
|-<br />
| 30 || [6.0.0+] GetStandardNetworkClockOperationEventReadableHandle || <br />
|-<br />
| 31 || [6.0.0+] GetEphemeralNetworkClockOperationEventReadableHandle || <br />
|-<br />
| 50 || [4.0.0+] SetStandardSteadyClockInternalOffset || <br />
|-<br />
| 100 || IsStandardUserSystemClockAutomaticCorrectionEnabled || <br />
|-<br />
| 101 || SetStandardUserSystemClockAutomaticCorrectionEnabled || <br />
|-<br />
| 102 || [5.0.0+] GetStandardUserSystemClockInitialYear || <br />
|-<br />
| 200 || [3.0.0+] IsStandardNetworkSystemClockAccuracySufficient || <br />
|-<br />
| 201 || [6.0.0+] GetStandardUserSystemClockAutomaticCorrectionUpdatedTime || <br />
|-<br />
| 300 || [4.0.0+] CalculateMonotonicSystemClockBaseTimePoint || <br />
|-<br />
| 400 || [4.0.0+] GetClockSnapshot || <br />
|-<br />
| 401 || [4.0.0+] GetClockSnapshotFromSystemClockContext || <br />
|-<br />
| 500 || [4.0.0+] CalculateStandardUserSystemClockDifferenceByUser || <br />
|-<br />
| 501 || [4.0.0+] CalculateSpanBetween || <br />
|}<br />
<br />
== ISteadyClock ==<br />
This is "nn::timesrv::detail::service::ISteadyClock".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetCurrentTimePoint || No input, returns an output [[#SteadyClockTimePoint]].<br />
|-<br />
| 2 || GetTestOffset || No input, returns an output [[#TimeSpanType]].<br />
|-<br />
| 3 || SetTestOffset || Takes an input [[#TimeSpanType]], no output.<br />
|-<br />
| 100 || [2.0.0+] GetRtcValue || No input, returns an output s64.<br />
|-<br />
| 101 || [2.0.0+] IsRtcResetDetected || No input, returns an output u8 bool.<br />
|-<br />
| 102 || [2.0.0+] GetSetupResultValue || No input, returns an output u32.<br />
|-<br />
| 200 || [3.0.0+] GetInternalOffset || No input, returns an output [[#TimeSpanType]].<br />
|-<br />
| 201 || [3.0.0-3.0.2] SetInternalOffset || Takes an input [[#TimeSpanType]], no output.<br />
|}<br />
<br />
=== SteadyClockTimePoint ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x8|| A u64 representing a point in time.<br />
|-<br />
| 0x8 || 0x10 || An ID representing the clock source.<br />
|}<br />
<br />
This is a 0x18-byte struct.<br />
<br />
=== TimeSpanType ===<br />
This is an u64.<br />
<br />
== ISystemClock ==<br />
This is "nn::timesrv::detail::service::ISystemClock".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetCurrentTime || Returns an output [[#PosixTime]].<br />
|-<br />
| 1 || SetCurrentTime || Takes an input [[#PosixTime]].<br />
|-<br />
| 2 || GetSystemClockContext || Returns an output [[#SystemClockContext]].<br />
|-<br />
| 3 || SetSystemClockContext || Takes an input [[#SystemClockContext]].<br />
|}<br />
<br />
=== PosixTime ===<br />
This is an u64 for UTC POSIX time.<br />
<br />
=== SystemClockContext ===<br />
This is an 0x20-byte struct.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x8|| a [[#PosixTime]] representing the system clock epoch.<br />
|-<br />
| 0x8 || 0x18 || a [[#SteadyClockTimePoint]]<br />
|}<br />
<br />
== ITimeZoneService ==<br />
This is "nn::timesrv::detail::service::ITimeZoneService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetDeviceLocationName || No input, returns an output [[#LocationName]].<br />
|-<br />
| 1 || SetDeviceLocationName || Takes an input [[#LocationName]], no output.<br />
|-<br />
| 2 || GetTotalLocationNameCount || No input, returns an output s32.<br />
|-<br />
| 3 || LoadLocationNameList || <br />
|-<br />
| 4 || LoadTimeZoneRule || Takes an input [[#LocationName]] and a type-0x16 output buffer for [[#TimeZoneRule]], no output.<br />
|-<br />
| 5 || [2.0.0+] GetTimeZoneRuleVersion || No input, returns an output [[#TimeZoneRuleVersion]].<br />
|-<br />
| 6 || [5.0.0+] GetDeviceLocationNameAndUpdatedTime || <br />
|-<br />
| 100 || ToCalendarTime || Takes an input [[#PosixTime]] and a type-0x15 input buffer for [[#TimeZoneRule]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].<br />
|-<br />
| 101 || ToCalendarTimeWithMyRule || Takes an input [[#PosixTime]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].<br />
|-<br />
| 201 || ToPosixTime || Takes an input [[#CalendarTime]], a type-0x15 input buffer for [[#TimeZoneRule]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.<br />
|-<br />
| 202 || ToPosixTimeWithMyRule || Takes an input [[#CalendarTime]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.<br />
|}<br />
<br />
=== LoadLocationNameList ===<br />
Takes an input s32 LocationName_index and a type-0x6 output buffer for [[#LocationName]], returns an output s32 for total output entries.<br />
<br />
=== LocationName ===<br />
This contains a TimeZone location string with a max size of 0x24 bytes.<br />
<br />
=== TimeZoneRule ===<br />
This is an 0x4000-byte struct. Official sw uses fixed-size 0x4000 for the buffer size with the above commands.<br />
<br />
This is loaded from the [[Title_list|TimeZoneBinary]] title with the specified LocationName under the zoneinfo/ directory, the content is then converted into this TimeZoneRule structure.<br />
<br />
The files contained under zoneinfo/ directory are Tzif2 files without Tzif1 header and data at the begining of them (see [https://tools.ietf.org/html/rfc8536 RFC8536] for more information).<br />
<br />
The conversion of a Tzif2 file to a TimeZoneRule structure is based on [https://github.com/eggert/tz/blob/master/localtime.c tz database code] with some custom modifications (Leap seconds aren't handled, no usage of "posixrules" and Tzif1 support stripped out).<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x4 || timecnt<br />
|-<br />
| 0x4 || 0x4 || typecnt<br />
|-<br />
| 0x8 || 0x4 || charcnt<br />
|-<br />
| 0xC || 0x1 || goback<br />
|-<br />
| 0xD || 0x1 || goahead<br />
|-<br />
| 0xE || 0x2 || Padding<br />
|-<br />
| 0x10 || 0x8 * 1000 || ats<br />
|-<br />
| 0x1f50 || 0x1 * 1000 || types<br />
|-<br />
| 0x2338 || 0x10 * 128 || ttis (time type information), struct ttinfo[1000]<br />
|-<br />
| 0x2b38 || 0x1 * 512 || chars<br />
|-<br />
| 0x2d38 || 0x4 || defaulttype<br />
|-<br />
| 0x2d3c || 0x12c4 || Reserved / Unused<br />
|}<br />
<br />
=== ttinfo ===<br />
This is an 0x10-byte struct.<br />
Represent a Time Type Information used in [[#TimeZoneRule]].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x4 || tt_gmtoff<br />
|-<br />
| 0x4 || 0x1 || tt_isdst<br />
|-<br />
| 0x5 || 0x3 || Padding<br />
|-<br />
| 0x8 || 0x4 || tt_abbrind<br />
|-<br />
| 0xC || 0x1 || tt_ttisstd<br />
|-<br />
| 0xD || 0x1 || tt_ttisgmt<br />
|-<br />
| 0xE || 0x2 || Padding<br />
|}<br />
<br />
=== TimeZoneRuleVersion ===<br />
This is an u128.<br />
<br />
=== CalendarTime ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x2 || Year<br />
|-<br />
| 0x2 || 0x1 || Month<br />
|-<br />
| 0x3 || 0x1 || Day<br />
|-<br />
| 0x4 || 0x1 || Hour<br />
|-<br />
| 0x5 || 0x1 || Minute<br />
|-<br />
| 0x6 || 0x1 || Second<br />
|-<br />
| 0x7 || 0x1 || Padding / unknown?<br />
|}<br />
<br />
This is an 0x8-byte struct.<br />
<br />
=== CalendarAdditionalInfo ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x4 || 0-based day-of-week.<br />
|-<br />
| 0x4 || 0x4 || 0-based day-of-year.<br />
|-<br />
| 0x8 || 0x8 || Timezone name string.<br />
|-<br />
| 0x10 || 0x4 || 0 = no DST, 1 = DST.<br />
|-<br />
| 0x14 || 0x4 || s32 seconds relative to UTC for this timezone.<br />
|}<br />
<br />
This is an 0x18-byte struct. This stores timezone info.<br />
<br />
[[Category:Services]]</div>
Thog
https://switchbrew.org/w/index.php?title=PSC_services&diff=6553
PSC services
2019-04-12T19:19:40Z
<p>Thog: Add PCV module ids</p>
<hr />
<div>PSC (Power State Control) provides services related to power state changes in the system.<br />
<br />
= Concept =<br />
<br />
psc:m allows a process to register a module that depends on power management in some way. A client calls GetPmModule to receive an IPmModule (Power Managed Module), and then calls IPmModule->Initialize(module_id, module_dependency_list) where module_id is the ModuleId enum member for the client, and the dependency list is an array of module IDs for the modules that this depends on. Initialize() returns an event handle that the client can wait on to be notified of a power state change.<br />
<br />
psc:c allows a module to the power state controller for the system (in practice, AM is the only client to the controller). IPmControl->DispatchRequest() is used notify all IPmModules of a state change.<br />
<br />
For example, FS registers itself as an IPmModule with dependencies on pinmux, gpio, pcv, tma, and initializes the SD card once those dependencies have registered.. <br />
<br />
It then does (basically) the following pseudocode (actual code located at .text + 0xB2DB0 in 6.0.0 FS):<br />
<br />
while (true) {<br />
Fs_IPmModule->WaitSignaled();<br />
<br />
Fs_IPmModule->GetRequest(&state);<br />
switch (state) {<br />
case WakingUp:<br />
/* hardware devices are woken up here */<br />
case GoingToSleep:<br />
/* hardware devices are put to sleep here */<br />
case ShuttingDown:<br />
/* hardware devices are turned off here */<br />
}<br />
<br />
Fs_IPmModule->Acknowledge(state);<br />
}<br />
<br />
= psc:c =<br />
This is "nn::psc::sf::IPmControl".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || Initialize<br />
|-<br />
| 1 || DispatchRequest<br />
|-<br />
| 2 || GetResult<br />
|-<br />
| 3 || GetState<br />
|-<br />
| 4 || Cancel<br />
|-<br />
| 5 || PrintModuleInformation<br />
|-<br />
| 6 || GetModuleInformation<br />
|}<br />
<br />
= psc:m =<br />
This is "nn::psc::sf::IPmService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetPmModule || Returns an [[#IPmModule]].<br />
|}<br />
<br />
== IPmModule ==<br />
This is "nn::psc::sf::IPmModule".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || Initialize<br />
|-<br />
| 1 || GetRequest<br />
|-<br />
| 2 || Acknowledge<br />
|-<br />
| 3 || Finalize<br />
|-<br />
| 4 || [5.1.0+] AcknowledgeEx<br />
|}<br />
<br />
= srepo:u, srepo:a =<br />
These are "nn::srepo::detail::ipc::ISrepoService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 10100 ||<br />
|-<br />
| 10101 || [6.0.0+]<br />
|-<br />
| 10200 || [6.0.0+]<br />
|-<br />
| 10201 || [6.0.0+]<br />
|-<br />
| 11000 || [6.0.0+]<br />
|-<br />
| 11001 || [6.0.0+]<br />
|-<br />
| 11002 || [6.0.0+]<br />
|-<br />
| 11003 || [6.0.0+]<br />
|-<br />
| 11004 || [6.0.0+]<br />
|-<br />
| 11100 || [6.0.0+]<br />
|-<br />
| 11200 || [6.0.0+]<br />
|-<br />
| 11300 || [6.0.0+]<br />
|-<br />
| 11400 || [6.0.0+]<br />
|-<br />
| 11500 || [6.0.0+]<br />
|-<br />
| 11600 || [6.0.0+]<br />
|-<br />
| 11601 || [6.0.0+]<br />
|-<br />
| 11602 || [6.0.0+]<br />
|-<br />
| 11700 || [6.0.0+]<br />
|-<br />
| 11800 || [6.0.0+]<br />
|-<br />
| 11801 || [6.0.0+]<br />
|-<br />
| 20100 ||<br />
|-<br />
| 20200 ||<br />
|-<br />
| 20300 || [6.0.0+]<br />
|-<br />
| 20400 || [6.0.0+]<br />
|-<br />
| 20401 || [6.0.0+]<br />
|-<br />
| 20402 || [7.0.0+]<br />
|}<br />
<br />
= PSC Module IDs =<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! ID || Module<br />
|-<br />
| 0x03 ||<br />
|-<br />
| 0x04 || [[USB services|USB]]<br />
|-<br />
| 0x05 ||<br />
|-<br />
| 0x07 || [[PCV services|Pcv]]<br />
|-<br />
| 0x08 || [[PCV services|Pcv:Imm]]<br />
|-<br />
| 0x09 || [[Bus services|Gpio]]<br />
|-<br />
| 0x0A || [[Bus services|Pinmux]]<br />
|-<br />
| 0x0B || [[Bus services|Uart]]<br />
|-<br />
| 0x0C || [[Bus services|I2c]]<br />
|-<br />
| 0x0D || [[Bus services|I2c:Pcv]]<br />
|-<br />
| 0x0F || [[Bus services|Pwn]]<br />
|-<br />
| 0x10 ||<br />
|-<br />
| 0x13 || [[PCIe services|PCIe]]<br />
|-<br />
| 0x14 || [[Backlight services|Backlight]]<br />
|-<br />
| 0x15 || [[Nvnflinger services|Nvnflinger]]<br />
|-<br />
| 0x18 ||<br />
|-<br />
| 0x1B ||<br />
|-<br />
| 0x1C || [[Audio services|Audio]]<br />
|-<br />
| 0x1E ||<br />
|-<br />
| 0x1F || [[Bluetooth Driver services|Bluetooth]]<br />
|-<br />
| 0x20 || [[PCV services|Bpc]]<br />
|-<br />
| 0x21 || [[PTM services|Ptm]]<br />
|-<br />
| 0x23 || [[NFC services|nn::psc::PmModuleId_Nfc]]<br />
|- <br />
| 0x24 || [[PPC services|Ppc]]<br />
|-<br />
| 0x25 ||<br />
|-<br />
| 0x26 || [[Network Interface services|Nifm]]<br />
|-<br />
| 0x28 || [[NPNS services|Npns]]<br />
|-<br />
| 0x29 || [[Log services|nn::psc::PmModuleId_Lm]]<br />
|-<br />
| 0x2A || [[BCAT services|Bcat]]<br />
|-<br />
| 0x2B || [[PCV services|Time]]<br />
|-<br />
| 0x2C || [[Parental Control services|Pctl]]<br />
|-<br />
| 0x2D || [[Error Report services|Erpt]]<br />
|-<br />
| 0x2E || [[Error Upload services|Eupld]]<br />
|-<br />
| 0x2F || [[Friend services|Friend]]<br />
|-<br />
| 0x30 || [[Glue services|Glue]]<br />
|-<br />
| 0x31 || [[Account services|Account]]<br />
|-<br />
| 0x32 || [[Bus services|SasBus]]<br />
|-<br />
| 0x65 || [[NV services|NV]]<br />
|}<br />
<br />
[[Category:Services]]<br />
<br />
= Power Management States =<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! ID || Name || Description<br />
|-<br />
| Awake || 0 || Everything is awake.<br />
|-<br />
| ReadyAwaken || 1 || Preparing to transition to awake.<br />
|-<br />
| ReadySleep || 2 || Preparing to transition to sleep.<br />
|-<br />
| ReadySleepCritical || 3 || Critical services are ready to sleep.<br />
|-<br />
| ReadyAwakenCritical || 4 || Critical services are ready to wake up.<br />
|-<br />
| ReadyShutdown || 5 || Preparing to transition to shutdown.<br />
|}</div>
Thog
https://switchbrew.org/w/index.php?title=PSC_services&diff=6551
PSC services
2019-04-12T19:02:07Z
<p>Thog: Add more PSC module ids</p>
<hr />
<div>PSC (Power State Control) provides services related to power state changes in the system.<br />
<br />
= Concept =<br />
<br />
psc:m allows a process to register a module that depends on power management in some way. A client calls GetPmModule to receive an IPmModule (Power Managed Module), and then calls IPmModule->Initialize(module_id, module_dependency_list) where module_id is the ModuleId enum member for the client, and the dependency list is an array of module IDs for the modules that this depends on. Initialize() returns an event handle that the client can wait on to be notified of a power state change.<br />
<br />
psc:c allows a module to the power state controller for the system (in practice, AM is the only client to the controller). IPmControl->DispatchRequest() is used notify all IPmModules of a state change.<br />
<br />
For example, FS registers itself as an IPmModule with dependencies on pinmux, gpio, pcv, tma, and initializes the SD card once those dependencies have registered.. <br />
<br />
It then does (basically) the following pseudocode (actual code located at .text + 0xB2DB0 in 6.0.0 FS):<br />
<br />
while (true) {<br />
Fs_IPmModule->WaitSignaled();<br />
<br />
Fs_IPmModule->GetRequest(&state);<br />
switch (state) {<br />
case WakingUp:<br />
/* hardware devices are woken up here */<br />
case GoingToSleep:<br />
/* hardware devices are put to sleep here */<br />
case ShuttingDown:<br />
/* hardware devices are turned off here */<br />
}<br />
<br />
Fs_IPmModule->Acknowledge(state);<br />
}<br />
<br />
= psc:c =<br />
This is "nn::psc::sf::IPmControl".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || Initialize<br />
|-<br />
| 1 || DispatchRequest<br />
|-<br />
| 2 || GetResult<br />
|-<br />
| 3 || GetState<br />
|-<br />
| 4 || Cancel<br />
|-<br />
| 5 || PrintModuleInformation<br />
|-<br />
| 6 || GetModuleInformation<br />
|}<br />
<br />
= psc:m =<br />
This is "nn::psc::sf::IPmService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetPmModule || Returns an [[#IPmModule]].<br />
|}<br />
<br />
== IPmModule ==<br />
This is "nn::psc::sf::IPmModule".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || Initialize<br />
|-<br />
| 1 || GetRequest<br />
|-<br />
| 2 || Acknowledge<br />
|-<br />
| 3 || Finalize<br />
|-<br />
| 4 || [5.1.0+] AcknowledgeEx<br />
|}<br />
<br />
= srepo:u, srepo:a =<br />
These are "nn::srepo::detail::ipc::ISrepoService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 10100 ||<br />
|-<br />
| 10101 || [6.0.0+]<br />
|-<br />
| 10200 || [6.0.0+]<br />
|-<br />
| 10201 || [6.0.0+]<br />
|-<br />
| 11000 || [6.0.0+]<br />
|-<br />
| 11001 || [6.0.0+]<br />
|-<br />
| 11002 || [6.0.0+]<br />
|-<br />
| 11003 || [6.0.0+]<br />
|-<br />
| 11004 || [6.0.0+]<br />
|-<br />
| 11100 || [6.0.0+]<br />
|-<br />
| 11200 || [6.0.0+]<br />
|-<br />
| 11300 || [6.0.0+]<br />
|-<br />
| 11400 || [6.0.0+]<br />
|-<br />
| 11500 || [6.0.0+]<br />
|-<br />
| 11600 || [6.0.0+]<br />
|-<br />
| 11601 || [6.0.0+]<br />
|-<br />
| 11602 || [6.0.0+]<br />
|-<br />
| 11700 || [6.0.0+]<br />
|-<br />
| 11800 || [6.0.0+]<br />
|-<br />
| 11801 || [6.0.0+]<br />
|-<br />
| 20100 ||<br />
|-<br />
| 20200 ||<br />
|-<br />
| 20300 || [6.0.0+]<br />
|-<br />
| 20400 || [6.0.0+]<br />
|-<br />
| 20401 || [6.0.0+]<br />
|-<br />
| 20402 || [7.0.0+]<br />
|}<br />
<br />
= PSC Module IDs =<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! ID || Module<br />
|-<br />
| 0x03 ||<br />
|-<br />
| 0x04 || [[USB services|USB]]<br />
|-<br />
| 0x05 ||<br />
|-<br />
| 0x07 ||<br />
|-<br />
| 0x08 ||<br />
|-<br />
| 0x09 || [[Bus services|Gpio]]<br />
|-<br />
| 0x0A || [[Bus services|Pinmux]]<br />
|-<br />
| 0x0B || [[Bus services|Uart]]<br />
|-<br />
| 0x0C || [[Bus services|I2c]]<br />
|-<br />
| 0x0D || [[Bus services|I2c:Pcv]]<br />
|-<br />
| 0x0F || [[Bus services|Pwn]]<br />
|-<br />
| 0x10 ||<br />
|-<br />
| 0x13 || [[PCIe services|PCIe]]<br />
|-<br />
| 0x14 || [[Backlight services|Backlight]]<br />
|-<br />
| 0x15 || [[Nvnflinger services|Nvnflinger]]<br />
|-<br />
| 0x18 ||<br />
|-<br />
| 0x1B ||<br />
|-<br />
| 0x1C || [[Audio services|Audio]]<br />
|-<br />
| 0x1E ||<br />
|-<br />
| 0x1F || [[Bluetooth Driver services|Bluetooth]]<br />
|-<br />
| 0x20 ||<br />
|-<br />
| 0x21 || [[PTM services|Ptm]]<br />
|-<br />
| 0x23 || [[NFC services|nn::psc::PmModuleId_Nfc]]<br />
|- <br />
| 0x24 || [[PPC services|Ppc]]<br />
|-<br />
| 0x25 ||<br />
|-<br />
| 0x26 || [[Network Interface services|Nifm]]<br />
|-<br />
| 0x28 || [[NPNS services|Npns]]<br />
|-<br />
| 0x29 || [[Log services|nn::psc::PmModuleId_Lm]]<br />
|-<br />
| 0x2A || [[BCAT services|Bcat]]<br />
|-<br />
| 0x2C || [[Parental Control services|Pctl]]<br />
|-<br />
| 0x2D || [[Error Report services|Erpt]]<br />
|-<br />
| 0x2E || [[Error Upload services|Eupld]]<br />
|-<br />
| 0x2F || [[Friend services|Friend]]<br />
|-<br />
| 0x30 || [[Glue services|Glue]]<br />
|-<br />
| 0x31 || [[Account services|Account]]<br />
|-<br />
| 0x32 || [[Bus services|SasBus]]<br />
|-<br />
| 0x65 || [[NV services|NV]]<br />
|}<br />
<br />
[[Category:Services]]<br />
<br />
= Power Management States =<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! ID || Name || Description<br />
|-<br />
| Awake || 0 || Everything is awake.<br />
|-<br />
| ReadyAwaken || 1 || Preparing to transition to awake.<br />
|-<br />
| ReadySleep || 2 || Preparing to transition to sleep.<br />
|-<br />
| ReadySleepCritical || 3 || Critical services are ready to sleep.<br />
|-<br />
| ReadyAwakenCritical || 4 || Critical services are ready to wake up.<br />
|-<br />
| ReadyShutdown || 5 || Preparing to transition to shutdown.<br />
|}</div>
Thog
https://switchbrew.org/w/index.php?title=Rtld&diff=6447
Rtld
2019-03-27T20:04:39Z
<p>Thog: Add R_AARCH64_ABS32 relocation type</p>
<hr />
<div>rtld, short for “runtime link-editor”, is the first executable code belonging to the program that the system launches. This serves as the program entry point and crt0. rtld's entry point is defined to be the start of its .text section.<br />
<br />
rtld is tasked with relocating the [[NSO|NSOs]] that were loaded in to memory by the system loader, at a random base address. To do this, it requires that binaries include a [[NSO#MOD|module header]], and a pointer to it at offset +0x04 in the .text section.<br />
<br />
rtld receives two parameters from the system, in X0 and X1. The first parameter should be null. The second parameter is the handle of the main thread. See the [[Homebrew_ABI#Entrypoint_Arguments|entrypoint arguments]] section.<br />
<br />
rtld initially derives absolute pointers by using the BL instruction to skip over an offset value, and then accessing and adding X30.<br />
<br />
== Functionality ==<br />
<br />
An outline of rtld's functions is below.<br />
<br />
* Check the first parameter. Hangs if set.<br />
* Clear rtld .bss.<br />
<br />
The main function for loading all of the modules now executes.<br />
<br />
* Iterate over the rtld .dynamic section to establish REL, RELA, RELENT, RELAENT, RELCOUNT and RELACOUNT.<br />
* With the above information, process relative relocations (R_AARCH64_RELATIVE) on rtld.<br />
* rtld initializes load lists and a module object for itself, which formalizes loading of the rtld .dynamic section.<br />
* Prepare to iterate over all modules. rtld does this by scanning memory using [[SVC#svcQueryMemory|svcQueryMemory]]. The memory must be R-X and STATIC. If the address matches the rtld base address, the module is skipped here.<br />
* Each valid memory region is read, and must contain 'MOD0' magic at offset +0x04. If this check fails, rtld hangs.<br />
* Read the .dynamic and .bss pointers from the module header. If the .bss pointers are unequal, rtld clears the .bss for this module.<br />
* Initialize a module object for this module, using the same function that was used to initialize an object for rtld itself. This object is typically stored in the module's .bss, via another pointer in the module header.<br />
* Process relative relocations for this module.<br />
* Update list pointers for the rtld lists and the module object.<br />
* Prepare for next iteration - the next memory query address is calculated by adding the size of the current memory region to the current address.<br />
* Once all modules are loaded, rtld resolves symbols. The full list of supported relocation types is available below. This uses the .dynsym, .dynstr and .hash sections.<br />
<br />
Once the above function returns, rtld serves as a general initialization routine for the program.<br />
<br />
* Initializes the standard library “musl”.<br />
* Initializes the SDK. The second parameter (thread handle) passed to rtld is passed to this function.<br />
* Calls program-defined initialization routine.<br />
* Calls each module's initialization function.<br />
* Calls program main().<br />
* Finalizes the SDK.<br />
* Jumps to [[SVC#svcExitProcess|svcExitProcess]].<br />
<br />
== Relocation types ==<br />
<br />
{| class=wikitable<br />
! Value || Name<br />
|-<br />
| 257 || R_AARCH64_ABS64<br />
|-<br />
| 258 || R_AARCH64_ABS32<br />
|-<br />
| 1025 || R_AARCH64_GLOB_DAT<br />
|-<br />
| 1026 || R_AARCH64_JUMP_SLOT<br />
|-<br />
| 1027 || R_AARCH64_RELATIVE <br />
|}</div>
Thog
https://switchbrew.org/w/index.php?title=Services_API&diff=5885
Services API
2018-12-26T21:01:53Z
<p>Thog: bgtc:t & bgtc:sc are from 2.0.0</p>
<hr />
<div>Services are system processes running in the background which wait for incoming requests. When a process wants to communicate with a service, it first needs to get a handle to the named service, and then it can communicate with the service via inter-process communication (each service has a name up to 8 characters).<br />
<br />
Handles for services are retrieved from the service manager port, "sm:", and are released via svcCloseHandle or when a process is terminated or crashes. Manager service "sm:m" also exists. Services are an abstraction of ports, they operate the same way except regular ports can have their handles retrieved directly from a SVC. Services are also able to limit the number of handles given to other processes.<br />
<br />
= sm: =<br />
This is "nn::sm::detail::IUserInterface".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#Initialize]]<br />
|-<br />
| 1 || [[#GetService]]<br />
|-<br />
| 2 || [[#RegisterService]]<br />
|-<br />
| 3 || [[#UnregisterService]]<br />
|}<br />
<br />
== Initialize ==<br />
Takes a pid descriptor and a reserved input u64.<br />
<br />
== GetService ==<br />
Takes a zero-padded service name encoded as an u64 integer. Returns a handle.<br />
<br />
== RegisterService ==<br />
Takes a zero-padded service name encoded as an u64 integer, an u8 bool, and an u32 (session count) at the next word. Returns a handle.<br />
<br />
== UnregisterService ==<br />
Takes a zero-padded service name encoded as an u64 integer.<br />
<br />
= sm:m =<br />
This is "nn::sm::detail::IManagerInterface".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#RegisterProcess]]<br />
|-<br />
| 1 || [[#UnregisterProcess]]<br />
|}<br />
<br />
== RegisterProcess ==<br />
Takes a pid and two A descriptors with the ACID and ACI0 service lists. That data originates from [[NPDM]].<br />
<br />
== UnregisterProcess ==<br />
Takes a pid.<br />
<br />
= Service List =<br />
{| class="wikitable" border="1"<br />
|-<br />
! Service names<br />
! scope="col" width="200" | Description<br />
! scope="col" width="200" | Notes<br />
|-<br />
| acc:u0, acc:u1, acc:aa, acc:su, [5.0.0+] dauth:0<br />
| [[Account services]]<br />
| u0: System, u1: User, su: Admin, aa: Baas<br />
|-<br />
| ahid:cd, ahid:hdr, hid, hid:dbg, hid:sys, irs, irs:sys, xcd:sys, [4.0.0+] hid:tmp, [5.0.0+] hidbus<br />
| [[HID services]]<br />
|<br />
|-<br />
| appletAE, appletOE, idle:sys, omm, spsm, [5.0.0+] tcap, [6.0.0+] caps:su <br />
| [[AM services]]<br />
| <br />
|-<br />
| [1.0.0-2.3.0] aoc:u, mii:u, mii:e, ns:am, ns:su, ns:dev, pl:u, ovln:rcv, ovln:snd, pdm:ntfy, pdm:qry<br />
<br />
[3.0.0+] aoc:u, ns:am2, ns:dev, ns:ec, ns:rid, ns:rt, ns:su, ns:vm, ns:web, ovln:rcv, ovln:snd<br />
| [[NS Services]]<br />
| am: Application Manager, su: System Update<br />
|-<br />
| apm, apm:p, apm:dbg, apm:sys, fgm, fgm:0, fgm:9, fgm:dbg<br />
| [[PPC services]]<br />
| fgm:1, fgm:2, fgm:3, fgm:4, fgm:5, fgm:6 and fgm:7 used to exist, but are now deprecated.<br />
|-<br />
| arp:r, arp:w, [2.0.0+] bgtc:t, [2.0.0+] bgtc:sc<br />
| [[Glue services]]<br />
| <br />
|-<br />
| audin:a, audin:d, audin:u, audout:a, audout:d, audout:u, audren:a, audren:d, audren:u, audrec:a, audrec:d, audrec:u, audctl, codecctl, hwopus, auddebug, [6.0.0+] auddev<br />
| [[Audio services]]<br />
|<br />
|-<br />
| <nowiki>banana</nowiki><br />
| [[Profiler services]]<br />
| Not currently available on retail units.<br />
|-<br />
| <nowiki>bcat:a, bcat:u, bcat:m, bcat:s, news:a, news:c, news:m, news:p, news:v, prepo:u, prepo:s, prepo:m, [1.0.0-5.1.0] prepo:a, [6.0.0+] prepo:a2</nowiki><br />
| [[BCAT services]]<br />
|<br />
|-<br />
| [1.0.0] bpc:c, bpc:b, bpc:r, bpc:w, pcv, pcv:arb, pcv:imm, time:u, time:a, time:s<br />
[2.0.0+] bpc, bpc:r, pcv, pcv:arb, pcv:imm, time:u, time:a, time:s<br />
| [[PCV services]]<br />
|<br />
|-<br />
| bsd:u, bsd:s, bsdcfg, ethc:c, ethc:i, nsd:u, nsd:a, sfdnsres<br />
| [[Sockets services]]<br />
|<br />
|-<br />
| btdrv, [5.0.0+] bt<br />
| [[Bluetooth Driver services]]<br />
| <br />
|-<br />
| btm, btm:dbg, btm:sys, [5.0.0+] btm:u<br />
| [[BTM services]]<br />
| <br />
|-<br />
| caps:a, caps:c, [1.0.0] mm:u, [5.0.0+] caps:u<br />
| [[Capture services]]<br />
| a: AlbumAccessor, c: AlbumControl<br />
|-<br />
| [2.0.0+] caps:sc, [2.0.0+] caps:ss, vi:m, vi:s, vi:u, cec-mgr, [2.0.0+] mm:u, [4.0.0-5.1.0] caps:su<br />
| [[Display services]]<br />
| <br />
|-<br />
| dispdrv<br />
| [[Nvnflinger services]]<br />
|<br />
|-<br />
| dmnt:-<br />
| [[Debug Monitor services]]<br />
| Not currently available on retail units.<br />
|-<br />
| erpt:c, erpt:r<br />
| [[Error Report services]]<br />
|<br />
|-<br />
| eupld:c, eupld:r<br />
| [[Error Upload services]]<br />
|<br />
|-<br />
| es<br />
| [[ETicket services]]<br />
|<br />
|-<br />
| fan, psm, tc, ts, <nowiki>pcm</nowiki><br />
| [[PTM services]]<br />
| pcm is not available on retail units.<br />
|-<br />
| fatal:u, fatal:p<br />
| [[Fatal services]]<br />
| <br />
|-<br />
| friend:u, friend:v, friend:m, friend:s, friend:a, [5.0.0+] nd:app, nd:sys<br />
| [[Friend services]]<br />
|<br />
|-<br />
| fsp-srv, fsp-ldr, fsp-pr<br />
| [[Filesystem services]]<br />
| srv: Main, ldr: Loader, pr: Program Registry<br />
|-<br />
| gpio, i2c, i2c:pcv, pinmux, pwm, uart, [3.0.0+] sasbus<br />
| [[Bus services]]<br />
|<br />
|-<br />
| htc, htcs, htc:tenv, file_io, gds, tma_log, tmagent<br />
| [[TMA services]]<br />
| <br />
|-<br />
| jit:u<br />
| [[JIT services]]<br />
| Not currently available on retail units.<br />
|-<br />
| lbl<br />
| [[Backlight services]]<br />
| <br />
|-<br />
| ldn:m, ldn:s, ldn:u, [5.0.0+] ndd<br />
| [[LDN services]]<br />
|<br />
|-<br />
| [1.0.0+] ldr:pm, ldr:ro, ldr:shel, ldr:dmnt<br />
<br />
[3.0.0+] ldr:pm, ldr:shel, ldr:dmnt<br />
| [[Loader services]]<br />
|<br />
|-<br />
| lm, lm:get<br />
| [[Log services]]<br />
|<br />
|-<br />
| manu<br />
| [[Manu Services]]<br />
| "Manufacturing", present in factory firmware but not installed on retail systems.<br />
|-<br />
| lr, ncm, ncm:v<br />
| [[NCM services]]<br />
|<br />
|-<br />
| nfc:am, nfc:mf:u, nfc:user, nfc:sys, nfp:user, nfp:dbg, nfp:sys<br />
| [[NFC services]]<br />
| <br />
|-<br />
| nifm:u, nifm:a, nifm:s<br />
| [[Network Interface services]]<br />
| <br />
|-<br />
| nim, nim:shp, ntc, [5.0.0+] nim:eca<br />
| [[NIM services]]<br />
| <br />
|-<br />
| npns:u, npns:s<br />
| [[NPNS services]]<br />
|<br />
|-<br />
| nvdrv:a, nvdrv:s, nvdrv:t, nvdrv, nvdrvdbg, nvgem:c, nvgem:cd, nvmemp<br />
| [[NV services]]<br />
|<br />
|-<br />
| pcie, [6.0.0+] pcie:log<br />
| [[PCIe services]]<br />
|<br />
|-<br />
| pctl, pctl:a, pctl:s, pctl:r<br />
| [[Parental Control services]]<br />
|<br />
|-<br />
| pm:bm, pm:info, pm:shell<br />
| [[Process Manager services]]<br />
|<br />
|-<br />
| psc:c, psc:m, [5.0.0+] srepo:u, srepo:a<br />
| [[PSC services]]<br />
| <br />
|-<br />
| [3.0.0+] ldr:ro, ro:dmnt<br />
| [[Loader services|RO services]]<br />
|<br />
|-<br />
| set, set:fd, set:cal, set:sys<br />
| [[Settings services]]<br />
| cal: calibration, sys: System Settings<br />
|-<br />
| [3.0.0+] mii:u, mii:e, pdm:ntfy, pdm:qry, pl:u, [5.0.0+] miiimg, [6.0.0+] avm<br />
| [[Shared Database services]]<br />
|<br />
|-<br />
| ssl<br />
| [[SSL services]]<br />
|<br />
|-<br />
| csrng, spl:, [4.0.0+] spl:mig, spl:fs, spl:ssl, spl:es, [5.0.0+] spl:manu<br />
| [[SPL services]]<br />
| <br />
|-<br />
| sf-uds<br />
| ?<br />
| System debug applet "recovery" has access to this service, but it doesn't appear to exist.<br />
|-<br />
| tspm<br />
| ?<br />
| Applications on [1.0.0] used to have access to this service, but it doesn't appear to be present on retail devices.<br />
|-<br />
| usb:ds, usb:hs, usb:pd, usb:pd:c, [1.0.0] usb:pd:m, usb:pm<br />
| [[USB services]]<br />
| <br />
|-<br />
| wlan:inf, wlan:lcl, wlan:lg, wlan:lga, wlan:sg, wlan:soc, [6.0.0+] wlan:dtc<br />
| [[WLAN services]]<br />
|<br />
|-<br />
| [4.0.0+] grc:c, [6.0.0+] grc:d<br />
| [[GRC services]]<br />
| <br />
|-<br />
| [4.0.0+] mig:usr<br />
| [[Migration services]]<br />
| <br />
|-<br />
| [4.0.0+] caps:dc<br />
| [[Jpegdec services]]<br />
| <br />
|-<br />
| [6.0.0+] olsc:s<br />
| [[OLSC services]]<br />
| <br />
|}<br />
<br />
[[Category:Services]]</div>
Thog
https://switchbrew.org/w/index.php?title=PSC_services&diff=5836
PSC services
2018-12-20T11:01:06Z
<p>Thog: Add PCIe to the module IDs list</p>
<hr />
<div>PSC (Power State Control) provides services related to power state changes in the system.<br />
<br />
= Concept =<br />
<br />
psc:m allows a process to register a module that depends on power management in some way. A client calls GetPmModule to receive an IPmModule (Power Managed Module), and then calls IPmModule->Initialize(module_id, module_dependency_list) where module_id is the ModuleId enum member for the client, and the dependency list is an array of module IDs for the modules that this depends on. Initialize() returns an event handle that the client can wait on to be notified of a power state change.<br />
<br />
psc:c allows a module to the power state controller for the system (in practice, AM is the only client to the controller). IPmControl->DispatchRequest() is used notify all IPmModules of a state change.<br />
<br />
For example, FS registers itself as an IPmModule with dependencies on pinmux, gpio, pcv, tma, and initializes the SD card once those dependencies have registered.. <br />
<br />
It then does (basically) the following pseudocode (actual code located at .text + 0xB2DB0 in 6.0.0 FS):<br />
<br />
while (true) {<br />
Fs_IPmModule->WaitSignaled();<br />
<br />
Fs_IPmModule->GetRequest(&state);<br />
switch (state) {<br />
case WakingUp:<br />
/* hardware devices are woken up here */<br />
case GoingToSleep:<br />
/* hardware devices are put to sleep here */<br />
case ShuttingDown:<br />
/* hardware devices are turned off here */<br />
}<br />
<br />
Fs_IPmModule->Acknowledge(state);<br />
}<br />
<br />
= psc:c =<br />
This is "nn::psc::sf::IPmControl".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || Initialize<br />
|-<br />
| 1 || DispatchRequest<br />
|-<br />
| 2 || GetResult<br />
|-<br />
| 3 || GetState<br />
|-<br />
| 4 || Cancel<br />
|-<br />
| 5 || PrintModuleInformation<br />
|-<br />
| 6 || GetModuleInformation<br />
|}<br />
<br />
= psc:m =<br />
This is "nn::psc::sf::IPmService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetPmModule || Returns an [[#IPmModule]].<br />
|}<br />
<br />
== IPmModule ==<br />
This is "nn::psc::sf::IPmModule".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || Initialize<br />
|-<br />
| 1 || GetRequest<br />
|-<br />
| 2 || Acknowledge<br />
|-<br />
| 3 || Finalize<br />
|-<br />
| 4 || [6.0.0+] AcknowledgeEx<br />
|}<br />
<br />
= srepo:u, srepo:a =<br />
These are "nn::srepo::detail::ipc::ISrepoService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 10100 ||<br />
|-<br />
| 10101 || [6.0.0+]<br />
|-<br />
| 10200 || [6.0.0+]<br />
|-<br />
| 10201 || [6.0.0+]<br />
|-<br />
| 11000 || [6.0.0+]<br />
|-<br />
| 11001 || [6.0.0+]<br />
|-<br />
| 11002 || [6.0.0+]<br />
|-<br />
| 11003 || [6.0.0+]<br />
|-<br />
| 11004 || [6.0.0+]<br />
|-<br />
| 11100 || [6.0.0+]<br />
|-<br />
| 11200 || [6.0.0+]<br />
|-<br />
| 11300 || [6.0.0+]<br />
|-<br />
| 11400 || [6.0.0+]<br />
|-<br />
| 11500 || [6.0.0+]<br />
|-<br />
| 11600 || [6.0.0+]<br />
|-<br />
| 11601 || [6.0.0+]<br />
|-<br />
| 11602 || [6.0.0+]<br />
|-<br />
| 11700 || [6.0.0+]<br />
|-<br />
| 11800 || [6.0.0+]<br />
|-<br />
| 11801 || [6.0.0+]<br />
|-<br />
| 20100 ||<br />
|-<br />
| 20200 ||<br />
|-<br />
| 20300 || [6.0.0+]<br />
|-<br />
| 20400 || [6.0.0+]<br />
|-<br />
| 20401 || [6.0.0+]<br />
|}<br />
<br />
= PSC Module IDs =<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! ID || Module<br />
|-<br />
| 0x13 || [[PCIe services|PCIe]]<br />
|-<br />
| 0x1B ||<br />
|-<br />
| 0x1E ||<br />
|-<br />
| 0x29 || [[Log services|nn::psc::PmModuleId_Lm]]<br />
|}<br />
<br />
[[Category:Services]]</div>
Thog
https://switchbrew.org/w/index.php?title=NS_services&diff=4954
NS services
2018-08-31T13:13:53Z
<p>Thog: </p>
<hr />
<div>= aoc:u =<br />
This is "nn::aocsrv::detail::IAddOnContentManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || CountAddOnContentByApplicationId<br />
|-<br />
| 1 || ListAddOnContentByApplicationId<br />
|-<br />
| 2 || CountAddOnContent<br />
|-<br />
| 3 || ListAddOnContent<br />
|-<br />
| 4 || GetAddOnContentBaseIdByApplicationId<br />
|-<br />
| 5 || GetAddOnContentBaseId<br />
|-<br />
| 6 || PrepareAddOnContentByApplicationId<br />
|-<br />
| 7 || PrepareAddOnContent<br />
|-<br />
| 8 || [4.0.0+] GetAddOnContentListChangedEvent<br />
|}<br />
<br />
= ns:am =<br />
This is "nn::ns::detail::IApplicationManagerInterface".<br />
<br />
[3.0.0+] This service was replaced by [[#ns:am2, ns:ec, ns:rid, ns:rt, ns:web|ns:am2]].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#ListApplicationRecord]]<br />
|-<br />
| 1 || GenerateApplicationRecordCount<br />
|-<br />
| 2 || GetApplicationRecordUpdateSystemEvent<br />
|-<br />
| 3 || GetApplicationViewDeprecated<br />
|-<br />
| 4 || DeleteApplicationEntity<br />
|-<br />
| 5 || DeleteApplicationCompletely<br />
|-<br />
| 6 || IsAnyApplicationEntityRedundant<br />
|-<br />
| 7 || DeleteRedundantApplicationEntity<br />
|-<br />
| 8 || IsApplicationEntityMovable<br />
|-<br />
| 9 || MoveApplicationEntity<br />
|-<br />
| 11 || CalculateApplicationOccupiedSize<br />
|-<br />
| 16 || PushApplicationRecord<br />
|-<br />
| 17 || ListApplicationRecordContentMeta<br />
|-<br />
| 18 || <br />
|-<br />
| 19 || [[#LaunchApplication]]<br />
|-<br />
| 21 || [[#GetApplicationContentPath]]<br />
|-<br />
| 22 || TerminateApplication<br />
|-<br />
| 23 || [2.0.0+] ResolveApplicationContentPath<br />
|-<br />
| 26 || BeginInstallApplication<br />
|-<br />
| 27 || DeleteApplicationRecord<br />
|-<br />
| 30 || RequestApplicationUpdateInfo<br />
|-<br />
| 31 || RequestUpdateApplication<br />
|-<br />
| 32 || CancelApplicationDownload<br />
|-<br />
| 33 || ResumeApplicationDownload<br />
|-<br />
| 34 || <br />
|-<br />
| 35 || UpdateVersionList<br />
|-<br />
| 36 || PushLaunchVersion<br />
|-<br />
| 37 || ListRequiredVersion<br />
|-<br />
| 38 || CheckApplicationLaunchVersion<br />
|-<br />
| 39 || CheckApplicationLaunchRights<br />
|-<br />
| 40 || GetApplicationLogoData<br />
|-<br />
| 41 || CalculateApplicationDownloadRequiredSize<br />
|-<br />
| 42 || CleanupSdCard<br />
|-<br />
| 43 || CheckSdCardMountStatus<br />
|-<br />
| 44 || GetSdCardMountStatusChangedEvent<br />
|-<br />
| 45 || GetGameCardAttachmentEvent<br />
|-<br />
| 46 || GetGameCardAttachmentInfo<br />
|-<br />
| 47 || [[#GetTotalSpaceSize]]<br />
|-<br />
| 48 || [[#GetFreeSpaceSize]]<br />
|-<br />
| 49 || GetSdCardRemovedEvent<br />
|-<br />
| 52 || GetGameCardUpdateDetectionEvent<br />
|-<br />
| 53 || DisableApplicationAutoDelete<br />
|-<br />
| 54 || EnableApplicationAutoDelete<br />
|-<br />
| 55 || [[#GetApplicationDesiredLanguage]]<br />
|-<br />
| 56 || SetApplicationTerminateResult<br />
|-<br />
| 57 || ClearApplicationTerminateResult<br />
|-<br />
| 58 || GetLastSdCardMountUnexpectedResult<br />
|-<br />
| 59 || ConvertApplicationLanguageToLanguageCode<br />
|-<br />
| 60 || [[#ConvertLanguageCodeToApplicationLanguage]]<br />
|-<br />
| 61 || GetBackgroundDownloadStressTaskInfo<br />
|-<br />
| 62 || GetGameCardStopper<br />
|-<br />
| 63 || IsSystemProgramInstalled<br />
|-<br />
| 64 || [2.0.0+] StartApplyDeltaTask<br />
|-<br />
| 65 || [2.0.0+] GetRequestServerStopper<br />
|-<br />
| 100 || ResetToFactorySettings<br />
|-<br />
| 101 || ResetToFactorySettingsWithoutUserSaveData<br />
|-<br />
| 102 || [2.0.0+] ResetToFactorySettingsForRefurbishment<br />
|-<br />
| 200 || CalculateUserSaveDataStatistics<br />
|-<br />
| 201 || DeleteUserSaveDataAll<br />
|-<br />
| 210 || DeleteUserSystemSaveData<br />
|-<br />
| 220 || UnregisterNetworkServiceAccount<br />
|-<br />
| 300 || GetApplicationShellEvent<br />
|-<br />
| 301 || PopApplicationShellEventInfo<br />
|-<br />
| 302 || LaunchLibraryApplet<br />
|-<br />
| 303 || TerminateLibraryApplet<br />
|-<br />
| 304 || LaunchSystemApplet<br />
|-<br />
| 305 || TerminateSystemApplet<br />
|-<br />
| 306 || LaunchOverlayApplet<br />
|-<br />
| 307 || TerminateOverlayApplet<br />
|-<br />
| 400 || [[#GetApplicationControlData]]<br />
|-<br />
| 401 || InvalidateAllApplicationControlCache<br />
|-<br />
| 402 || RequestDownloadApplicationControlData<br />
|-<br />
| 403 || GetMaxApplicationControlCacheCount<br />
|-<br />
| 404 || [2.0.0+] InvalidateApplicationControlCache<br />
|-<br />
| 405 || [2.0.0+] ListApplicationControlCacheEntryInfo<br />
|-<br />
| 502 || [2.0.0+] RequestCheckGameCardRegistration<br />
|-<br />
| 503 || [2.0.0+] RequestGameCardRegistrationGoldPoint<br />
|-<br />
| 504 || [2.0.0+] RequestRegisterGameCard<br />
|-<br />
| 600 || [2.0.0+] CountApplicationContentMeta<br />
|-<br />
| 601 || [2.0.0+] [[#ListApplicationContentMetaStatus]]<br />
|-<br />
| 602 || [2.0.0+] ListAvailableAddOnContent<br />
|-<br />
| 603 || [2.0.0+] GetOwnedApplicationContentMetaStatus<br />
|-<br />
| 604 || [2.0.0+] RegisterContentsExternalKey<br />
|-<br />
| 605 || [2.0.0+] ListApplicationContentMetaStatusWithRightsCheck<br />
|-<br />
| 700 || [2.0.0+] PushDownloadTaskList<br />
|-<br />
| 701 || [2.0.0+] ClearTaskStatusList<br />
|-<br />
| 702 || [2.0.0+] RequestDownloadTaskList<br />
|-<br />
| 703 || [2.0.0+] RequestEnsureDownloadTask<br />
|-<br />
| 704 || [2.0.0+] ListDownloadTaskStatus<br />
|-<br />
| 705 || [2.0.0+] RequestDownloadTaskListData<br />
|-<br />
| 800 || [2.0.0+] RequestVersionList<br />
|-<br />
| 801 || [2.0.0+] ListVersionList<br />
|-<br />
| 900 || [2.0.0+] GetApplicationRecord<br />
|-<br />
| 901 || [2.0.0+] GetApplicationRecordProperty<br />
|-<br />
| 902 || [2.0.0+] EnableApplicationAutoUpdate<br />
|-<br />
| 903 || [2.0.0+] DisableApplicationAutoUpdate<br />
|-<br />
| 904 || [2.0.0+] TouchApplication<br />
|-<br />
| 905 || [2.0.0+] RequestApplicationUpdate<br />
|-<br />
| 906 || [2.0.0+] IsApplicationUpdateRequested<br />
|-<br />
| 907 || [2.0.0+] WithdrawApplicationUpdateRequest<br />
|-<br />
| 908 || [2.0.0+] ListApplicationRecordInstalledContentMeta<br />
|-<br />
| 1000 || [2.0.0+] RequestVerifyApplicationDeprecated<br />
|-<br />
| 1001 || [2.0.0+] CorruptApplicationForDebug<br />
|-<br />
| 1200 || [2.0.0+] NeedsUpdateVulnerability<br />
|-<br />
| 1300 || [2.0.0+] IsAnyApplicationEntityInstalled<br />
|-<br />
| 1301 || [2.0.0+] DeleteApplicationContentEntities<br />
|-<br />
| 1302 || [2.0.0+] CleanupUnrecordedApplicationEntity<br />
|-<br />
| 1400 || [2.0.0+] PrepareShutdown<br />
|-<br />
| 1500 || [2.0.0+] FormatSdCard<br />
|-<br />
| 1501 || [2.0.0+] NeedsSystemUpdateToFormatSdCard<br />
|-<br />
| 1502 || [2.0.0+] GetLastSdCardFormatUnexpectedResult<br />
|-<br />
| 1503 || [2.0.0+]<br />
|-<br />
| 1600 || [2.0.0+] GetSystemSeedForPseudoDeviceId<br />
|-<br />
| 1700 || [2.0.0+] ListApplicationDownloadingContentMeta<br />
|-<br />
| 1800 || [2.0.0+] IsNotificationSetupCompleted<br />
|-<br />
| 1801 || [2.0.0+] GetLastNotificationInfoCount<br />
|-<br />
| 1802 || [2.0.0+] ListLastNotificationInfo<br />
|}<br />
<br />
== ListApplicationRecord ==<br />
Takes a type-6 output buffer and an u64.<br />
<br />
Returns an array of title-info entries using the specified offset and size. No input titleID is passed to this.<br />
<br />
=== Application Record Format ===<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset<br />
! Size<br />
! Description<br />
|-<br />
| 0x0<br />
| 0x8<br />
| Title ID<br />
|-<br />
| 0x8<br />
| 0x1<br />
| Type? (Known values: 2=Installing?, 3=Gamecard?, 4=Installed?)<br />
|-<br />
| 0x9<br />
| 0x1<br />
| Unknown, usually 0x02<br />
|-<br />
| 0xA<br />
| 0x6<br />
| Unknown, usually zeros?<br />
|-<br />
| 0x10<br />
| 0x1<br />
| Unknown, seems to change between reboots and removing/reinserting gamecards<br />
|-<br />
| 0x11<br />
| 0x7<br />
| Unknown, usually zeros?<br />
|}<br />
<br />
== LaunchApplication ==<br />
Takes an input u64 titleID, returns an output u64 PID.<br />
<br />
Launches an application title which is registered with NS.<br />
<br />
== GetApplicationContentPath ==<br />
Takes a 0x16-type output buffer, an u8 [[NCA|type]], and an u64 titleID.<br />
<br />
The input titleID is used with the application-title table like various other cmds, anything not in that table can't be used with this.<br />
<br />
Returns a string path for the specified type of patch content with this titleID, otherwise returns regular-application paths when update-title not installed. Returns an error when the specified type of content doesn't exist for this title. Starts with "@{SdCardContent,UserContent}://" and ends in ".nca".<br />
<br />
For gamecard content, the output path is: "@GcSXXXXXXXX:/<NcaId>.nca". NCA-type0 with gamecard returns 0 with an empty output string.<br />
<br />
The output string is then used by the user-process with [[Filesystem_services|FS]] to mount the content.<br />
<br />
== GetTotalSpaceSize ==<br />
Takes an input media-id that must be 5.<br />
<br />
Returns the u64 from [[Content_Manager_services#IContentStorage]] cmd22.<br />
<br />
== GetFreeSpaceSize ==<br />
Takes an input media-id that must be 5.<br />
<br />
Returns the u64 from [[Content_Manager_services#IContentStorage]] cmd23.<br />
<br />
== GetApplicationDesiredLanguage ==<br />
Takes an input u8 language-bitmask, returns an output u8 [[control.nacp]] langentry index.<br />
<br />
User-processes generate the language-bitmask with the following for all 16 lang-entries: <code>if(<either string in langentry[i] is non-empty>)bitmask |= 1<<i</code><br />
<br />
== ConvertLanguageCodeToApplicationLanguage ==<br />
Takes an input u8 pointer for the resulting Id to be written to and a string represented as a u64 (i.e 0x53552D6E65 for 'en-US').<br />
<br />
Returns 0 if an ID was successfully found, otherwise returns 0x25810.<br />
<br />
== GetApplicationControlData ==<br />
Takes an input u8 flag, an u64 titleID, and a type-0x6 output buffer. Returns an output u32 for actual_size. Official user-processes use buffer size 0x24000. [[qlaunch]] only uses flag value 0x1.<br />
<br />
Loads cached [[control.nacp]] to buf+0 and the cached icon to buf+0x4000. Returns an error if the buffer is too small.<br />
<br />
== ListApplicationContentMetaStatus ==<br />
Returns 0x10-byte entries using the specified titleID starting at the specified u32 entryindex. Can only return game titles. The second entry if any is the update-title usually. When the input entryindex is >= totalentries, this will return 0 with out_entrycount=0.<br />
<br />
Entry structure:<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset<br />
! Size<br />
! Description<br />
|-<br />
| 0x0<br />
| 0x1<br />
| u8 "type". [[Content_Manager_services|Title type]] (String is from web-applet)<br />
|-<br />
| 0x1<br />
| 0x1<br />
| u8 "installedStorage" / [[Filesystem_services|StorageId]] (String is from web-applet)<br />
|-<br />
| 0x2<br />
| 0x1<br />
| Unknown. Non-zero with output from cmd 605, differs for app/update titles.<br />
|-<br />
| 0x3<br />
| 0x1<br />
| Padding<br />
|-<br />
| 0x4<br />
| 0x4<br />
| u32 Title-version<br />
|-<br />
| 0x8<br />
| 0x8<br />
| u64 titleID<br />
|}<br />
<br />
= ns:am2, ns:ec, ns:rid, ns:rt, ns:web =<br />
These services are all, at the top level, "nn::ns::detail::IServiceGetterInterface". These commands check a state field for a command-specific bit and returns an error if not set, this is likely a permissions check for service+command.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 7992 || [[#IECommerceInterface|GetECommerceInterface]]<br />
|-<br />
| 7993 || [[#IApplicationVersionInterface|GetApplicationVersionInterface]]<br />
|-<br />
| 7994 || [[#IFactoryResetInterface|GetFactoryResetInterface]]<br />
|-<br />
| 7995 || [[#IAccountProxyInterface|GetAccountProxyInterface]]<br />
|-<br />
| 7996 || [[#IApplicationManagerInterface|GetApplicationManagerInterface]]<br />
|-<br />
| 7997 || [[#IDownloadTaskInterface|GetDownloadTaskInterface]]<br />
|-<br />
| 7998 || [[#IContentManagementInterface|GetContentManagementInterface]]<br />
|-<br />
| 7999 || [[#IDocumentInterface|GetDocumentInterface]]<br />
|-<br />
|}<br />
<br />
=== IAccountProxyInterface ===<br />
This is "nn::ns::detail::IAccountProxyInterface".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || CreateUserAccount<br />
|-<br />
|}<br />
<br />
=== IApplicationManagerInterface ===<br />
This is "nn::ns::detail::IApplicationManagerInterface".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#ListApplicationRecord]]<br />
|-<br />
| 1 || GenerateApplicationRecordCount<br />
|-<br />
| 2 || GetApplicationRecordUpdateSystemEvent<br />
|-<br />
| 3 || GetApplicationViewDeprecated<br />
|-<br />
| 4 || DeleteApplicationEntity<br />
|-<br />
| 5 || DeleteApplicationCompletely<br />
|-<br />
| 6 || IsAnyApplicationEntityRedundant<br />
|-<br />
| 7 || DeleteRedundantApplicationEntity<br />
|-<br />
| 8 || IsApplicationEntityMovable<br />
|-<br />
| 9 || MoveApplicationEntity<br />
|-<br />
| 11 || CalculateApplicationOccupiedSize<br />
|-<br />
| 16 || PushApplicationRecord<br />
|-<br />
| 17 || ListApplicationRecordContentMeta<br />
|-<br />
| 19 || [1.0.0-5.1.0] [[#LaunchApplication]]<br />
|-<br />
| 21 || [[#GetApplicationContentPath]]<br />
|-<br />
| 22 || TerminateApplication<br />
|-<br />
| 23 || ResolveApplicationContentPath<br />
|-<br />
| 26 || BeginInstallApplication<br />
|-<br />
| 27 || DeleteApplicationRecord<br />
|-<br />
| 30 || RequestApplicationUpdateInfo<br />
|-<br />
| 32 || CancelApplicationDownload<br />
|-<br />
| 33 || ResumeApplicationDownload<br />
|-<br />
| 35 || UpdateVersionList<br />
|-<br />
| 36 || PushLaunchVersion<br />
|-<br />
| 37 || ListRequiredVersion<br />
|-<br />
| 38 || CheckApplicationLaunchVersion<br />
|-<br />
| 39 || CheckApplicationLaunchRights<br />
|-<br />
| 40 || GetApplicationLogoData<br />
|-<br />
| 41 || CalculateApplicationDownloadRequiredSize<br />
|-<br />
| 42 || CleanupSdCard<br />
|-<br />
| 43 || CheckSdCardMountStatus<br />
|-<br />
| 44 || GetSdCardMountStatusChangedEvent<br />
|-<br />
| 45 || GetGameCardAttachmentEvent<br />
|-<br />
| 46 || GetGameCardAttachmentInfo<br />
|-<br />
| 47 || [[#GetTotalSpaceSize]]<br />
|-<br />
| 48 || [[#GetFreeSpaceSize]]<br />
|-<br />
| 49 || GetSdCardRemovedEvent<br />
|-<br />
| 52 || GetGameCardUpdateDetectionEvent<br />
|-<br />
| 53 || DisableApplicationAutoDelete<br />
|-<br />
| 54 || EnableApplicationAutoDelete<br />
|-<br />
| 55 || GetApplicationDesiredLanguage<br />
|-<br />
| 56 || SetApplicationTerminateResult<br />
|-<br />
| 57 || ClearApplicationTerminateResult<br />
|-<br />
| 58 || GetLastSdCardMountUnexpectedResult<br />
|-<br />
| 59 || ConvertApplicationLanguageToLanguageCode<br />
|-<br />
| 60 || [[#ConvertLanguageCodeToApplicationLanguage]]<br />
|-<br />
| 61 || GetBackgroundDownloadStressTaskInfo<br />
|-<br />
| 62 || GetGameCardStopper<br />
|-<br />
| 63 || IsSystemProgramInstalled<br />
|-<br />
| 64 || StartApplyDeltaTask<br />
|-<br />
| 65 || GetRequestServerStopper<br />
|-<br />
| 66 || GetBackgroundApplyDeltaStressTaskInfo<br />
|-<br />
| 67 || CancelApplicationApplyDelta<br />
|-<br />
| 68 || ResumeApplicationApplyDelta<br />
|-<br />
| 69 || CalculateApplicationApplyDeltaRequiredSize<br />
|-<br />
| 70 || ResumeAll<br />
|-<br />
| 71 || GetStorageSize<br />
|-<br />
| 80 || RequestDownloadApplication<br />
|-<br />
| 81 || RequestDownloadAddOnContent<br />
|-<br />
| 82 || DownloadApplication<br />
|-<br />
| 83 || CheckApplicationResumeRights<br />
|-<br />
| 84 || GetDynamicCommitEvent<br />
|-<br />
| 85 || RequestUpdateApplication2<br />
|-<br />
| 86 || EnableApplicationCrashReport<br />
|-<br />
| 87 || IsApplicationCrashReportEnabled<br />
|-<br />
| 90 || BoostSystemMemoryResourceLimit<br />
|-<br />
| 91 || [5.0.0+]<br />
|-<br />
| 92 || [5.0.0+]<br />
|-<br />
| 93 || [5.0.0+]<br />
|-<br />
| 94 || [6.0.0+] LaunchApplication2<br />
|-<br />
| 95 || [6.0.0+]<br />
|-<br />
| 96 || [6.0.0+]<br />
|-<br />
| 97 || [6.0.0+]<br />
|-<br />
| 98 || [6.0.0+]<br />
|-<br />
| 100 || ResetToFactorySettings<br />
|-<br />
| 101 || ResetToFactorySettingsWithoutUserSaveData<br />
|-<br />
| 102 || ResetToFactorySettingsForRefurbishment<br />
|-<br />
| 200 || CalculateUserSaveDataStatistics<br />
|-<br />
| 201 || DeleteUserSaveDataAll<br />
|-<br />
| 210 || DeleteUserSystemSaveData<br />
|-<br />
| 211 || [6.0.0+]<br />
|-<br />
| 220 || UnregisterNetworkServiceAccount<br />
|-<br />
| 221 || [6.0.0+]<br />
|-<br />
| 300 || GetApplicationShellEvent<br />
|-<br />
| 301 || PopApplicationShellEventInfo<br />
|-<br />
| 302 || LaunchLibraryApplet<br />
|-<br />
| 303 || TerminateLibraryApplet<br />
|-<br />
| 304 || LaunchSystemApplet<br />
|-<br />
| 305 || TerminateSystemApplet<br />
|-<br />
| 306 || LaunchOverlayApplet<br />
|-<br />
| 307 || TerminateOverlayApplet<br />
|-<br />
| 400 || GetApplicationControlData<br />
|-<br />
| 401 || InvalidateAllApplicationControlCache<br />
|-<br />
| 402 || RequestDownloadApplicationControlData<br />
|-<br />
| 403 || GetMaxApplicationControlCacheCount<br />
|-<br />
| 404 || InvalidateApplicationControlCache<br />
|-<br />
| 405 || ListApplicationControlCacheEntryInfo<br />
|-<br />
| 406 || [6.0.0+]<br />
|-<br />
| 502 || RequestCheckGameCardRegistration<br />
|-<br />
| 503 || RequestGameCardRegistrationGoldPoint<br />
|-<br />
| 504 || RequestRegisterGameCard<br />
|-<br />
| 505 || GetGameCardMountFailureEvent<br />
|-<br />
| 506 || IsGameCardInserted<br />
|-<br />
| 507 || EnsureGameCardAccess<br />
|-<br />
| 508 || GetLastGameCardMountFailureResult<br />
|-<br />
| 509 || ListApplicationIdOnGameCard<br />
|-<br />
| 600 || CountApplicationContentMeta<br />
|-<br />
| 601 || [[#ListApplicationContentMetaStatus]]<br />
|-<br />
| 602 || [2.0.0-5.1.0] ListAvailableAddOnContent<br />
|-<br />
| 603 || GetOwnedApplicationContentMetaStatus<br />
|-<br />
| 604 || RegisterContentsExternalKey<br />
|-<br />
| 605 || ListApplicationContentMetaStatusWithRightsCheck<br />
|-<br />
| 606 || GetContentMetaStorage<br />
|-<br />
| 607 || [6.0.0+]<br />
|-<br />
| 700 || PushDownloadTaskList<br />
|-<br />
| 701 || ClearTaskStatusList<br />
|-<br />
| 702 || RequestDownloadTaskList<br />
|-<br />
| 703 || RequestEnsureDownloadTask<br />
|-<br />
| 704 || ListDownloadTaskStatus<br />
|-<br />
| 705 || RequestDownloadTaskListData<br />
|-<br />
| 800 || RequestVersionList<br />
|-<br />
| 801 || ListVersionList<br />
|-<br />
| 802 || RequestVersionListData<br />
|-<br />
| 900 || GetApplicationRecord<br />
|-<br />
| 901 || GetApplicationRecordProperty<br />
|-<br />
| 902 || EnableApplicationAutoUpdate<br />
|-<br />
| 903 || DisableApplicationAutoUpdate<br />
|-<br />
| 904 || TouchApplication<br />
|-<br />
| 905 || RequestApplicationUpdate<br />
|-<br />
| 906 || IsApplicationUpdateRequested<br />
|-<br />
| 907 || WithdrawApplicationUpdateRequest<br />
|-<br />
| 908 || ListApplicationRecordInstalledContentMeta<br />
|-<br />
| 909 || WithdrawCleanupAddOnContentsWithNoRightsRecommendation<br />
|-<br />
| 910 || [6.0.0+]<br />
|-<br />
| 911 || [6.0.0+]<br />
|-<br />
| 912 || [6.0.0+]<br />
|-<br />
| 1000 || RequestVerifyApplicationDeprecated<br />
|-<br />
| 1001 || CorruptApplicationForDebug<br />
|-<br />
| 1002 || RequestVerifyAddOnContentsRights<br />
|-<br />
| 1003 || RequestVerifyApplication<br />
|-<br />
| 1004 || CorruptContentForDebug<br />
|-<br />
| 1200 || NeedsUpdateVulnerability<br />
|-<br />
| 1300 || IsAnyApplicationEntityInstalled<br />
|-<br />
| 1301 || DeleteApplicationContentEntities<br />
|-<br />
| 1302 || CleanupUnrecordedApplicationEntity<br />
|-<br />
| 1303 || CleanupAddOnContentsWithNoRights<br />
|-<br />
| 1304 || DeleteApplicationContentEntity<br />
|-<br />
| 1305 || [?.?.?-5.1.0] TryDeleteRunningApplicationEntity<br />
|-<br />
| 1306 || [?.?.?-5.1.0] TryDeleteRunningApplicationCompletely<br />
|-<br />
| 1307 || [?.?.?-5.1.0] TryDeleteRunningApplicationContentEntities<br />
|-<br />
| 1308 || [6.0.0+]<br />
|-<br />
| 1309 || [6.0.0+]<br />
|-<br />
| 1400 || PrepareShutdown<br />
|-<br />
| 1500 || FormatSdCard<br />
|-<br />
| 1501 || NeedsSystemUpdateToFormatSdCard<br />
|-<br />
| 1502 || GetLastSdCardFormatUnexpectedResult<br />
|-<br />
| 1504 || InsertSdCard<br />
|-<br />
| 1505 || RemoveSdCard<br />
|-<br />
| 1600 || GetSystemSeedForPseudoDeviceId<br />
|-<br />
| 1601 || ResetSystemSeedForPseudoDeviceId<br />
|-<br />
| 1700 || ListApplicationDownloadingContentMeta<br />
|-<br />
| 1701 || GetApplicationView<br />
|-<br />
| 1702 || GetApplicationDownloadTaskStatus<br />
|-<br />
| 1703 || GetApplicationViewDownloadErrorContext<br />
|-<br />
| 1800 || IsNotificationSetupCompleted<br />
|-<br />
| 1801 || GetLastNotificationInfoCount<br />
|-<br />
| 1802 || ListLastNotificationInfo<br />
|-<br />
| 1803 || ListNotificationTask<br />
|-<br />
| 1900 || IsActiveAccount<br />
|-<br />
| 1901 || RequestDownloadApplicationPrepurchasedRights<br />
|-<br />
| 1902 || GetApplicationTicketInfo<br />
|-<br />
| 2000 || GetSystemDeliveryInfo<br />
|-<br />
| 2001 || SelectLatestSystemDeliveryInfo<br />
|-<br />
| 2002 || VerifyDeliveryProtocolVersion<br />
|-<br />
| 2003 || GetApplicationDeliveryInfo<br />
|-<br />
| 2004 || HasAllContentsToDeliver<br />
|-<br />
| 2005 || CompareApplicationDeliveryInfo<br />
|-<br />
| 2006 || CanDeliverApplication<br />
|-<br />
| 2007 || ListContentMetaKeyToDeliverApplication<br />
|-<br />
| 2008 || NeedsSystemUpdateToDeliverApplication<br />
|-<br />
| 2009 || EstimateRequiredSize<br />
|-<br />
| 2010 || RequestReceiveApplication<br />
|-<br />
| 2011 || CommitReceiveApplication<br />
|-<br />
| 2012 || GetReceiveApplicationProgress<br />
|-<br />
| 2013 || RequestSendApplication<br />
|-<br />
| 2014 || GetSendApplicationProgress<br />
|-<br />
| 2015 || CompareSystemDeliveryInfo<br />
|-<br />
| 2016 || ListNotCommittedContentMeta<br />
|-<br />
| 2017 || CreateDownloadTask<br />
|-<br />
| 2018 || [6.0.0+]<br />
|-<br />
| 2050 || [6.0.0+]<br />
|-<br />
| 2100 || [6.0.0+]<br />
|-<br />
| 2101 || [6.0.0+]<br />
|-<br />
| 2150 || [6.0.0+]<br />
|-<br />
| 2151 || [6.0.0+]<br />
|-<br />
| 2152 || [6.0.0+]<br />
|-<br />
| 2153 || [6.0.0+]<br />
|-<br />
| 2154 || [6.0.0+]<br />
|-<br />
| 2160 || [6.0.0+]<br />
|-<br />
| 2161 || [6.0.0+]<br />
|-<br />
| 2170 || [6.0.0+]<br />
|-<br />
| 2171 || [6.0.0+]<br />
|-<br />
| 2180 || [6.0.0+]<br />
|-<br />
| 2181 || [6.0.0+]<br />
|-<br />
| 2182 || [6.0.0+]<br />
|-<br />
| 2190 || [6.0.0+]<br />
|-<br />
| 2199 || [6.0.0+]<br />
|-<br />
| 2200 || [6.0.0+]<br />
|-<br />
| 2201 || [6.0.0+]<br />
|-<br />
| 2250 || [6.0.0+]<br />
|-<br />
| 2300 || [6.0.0+] <br />
|-<br />
|}<br />
<br />
=== IApplicationVersionInterface ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || GetLaunchRequiredVersion<br />
|-<br />
| 1 || UpgradeLaunchRequiredVersion<br />
|-<br />
| 35 || UpdateVersionList<br />
|-<br />
| 36 || PushLaunchVersion<br />
|-<br />
| 37 || ListRequiredVersion<br />
|-<br />
| 800 || RequestVersionList<br />
|-<br />
| 801 || ListVersionList<br />
|-<br />
| 802 || RequestVersionListData<br />
|-<br />
| 1000 || PerformAutoUpdate<br />
|-<br />
|}<br />
<br />
=== IContentManagerInterface ===<br />
This is "nn::ns::detail::IContentManagementInterface".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 11 || CalculateApplicationOccupiedSize<br />
|-<br />
| 43 || CheckSdCardMountStatus<br />
|-<br />
| 47 || GetTotalSpaceSize<br />
|-<br />
| 48 || GetFreeSpaceSize<br />
|-<br />
| 600 || CountApplicationContentMeta<br />
|-<br />
| 601 || ListApplicationContentMetaStatus<br />
|-<br />
| 605 || ListApplicationContentMetaStatusWithRightsCheck<br />
|-<br />
| 607 || IsAnyApplicationRunning<br />
|-<br />
|}<br />
<br />
=== IDocumentInterface ===<br />
This is "nn::ns::detail::IDocumentInterface".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 21 || GetApplicationContentPath<br />
|-<br />
| 23 || ResolveApplicationContentPath<br />
|-<br />
|}<br />
<br />
=== IDownloadTaskInterface ===<br />
This is "nn::ns::detail::IDownloadTaskInterface".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 701 || ClearTaskStatusList<br />
|-<br />
| 702 || RequestDownloadTaskList<br />
|-<br />
| 703 || RequestEnsureDownloadTask<br />
|-<br />
| 704 || ListDownloadTaskStatus<br />
|-<br />
| 705 || RequestDownloadTaskListData<br />
|-<br />
| 706 || TryCommitCurrentApplicationDownloadTask<br />
|-<br />
| 707 || EnableAutoCommit<br />
|-<br />
| 708 || DisableAutoCommit<br />
|-<br />
| 709 || TriggerDynamicCommitEvent<br />
|-<br />
|}<br />
<br />
=== IECommerceInterface===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || RequestLinkDevice<br />
|-<br />
|}<br />
<br />
=== IFactoryResetInterface ===<br />
This is "nn::ns::detail::IFactoryResetInterface".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 100 || ResetToFactorySettings<br />
|-<br />
| 101 || ResetToFactorySettingsWithoutUserSaveData<br />
|-<br />
| 102 || ResetToFactorySettingsForRefurbishment<br />
|-<br />
|}<br />
<br />
= ns:vm =<br />
This is "nn::ns::detail::IVulnerabilityManagerInterface".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 1200 || [3.0.0+] NeedsUpdateVulnerability<br />
|-<br />
| 1201 || [4.0.0+] UpdateSafeSystemVersionForDebug<br />
|-<br />
| 1202 || [4.0.0+] GetSafeSystemVersion<br />
|-<br />
|}<br />
<br />
= ns:su =<br />
This is "nn::ns::detail::ISystemUpdateInterface".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || GetBackgroundNetworkUpdateState<br />
|-<br />
| 1 || [[#ISystemUpdateControl|OpenSystemUpdateControl]]<br />
|-<br />
| 2 || NotifyExFatDriverRequired<br />
|-<br />
| 3 || ClearExFatDriverStatusForDebug<br />
|-<br />
| 4 || RequestBackgroundNetworkUpdate<br />
|-<br />
| 5 || NotifyBackgroundNetworkUpdate<br />
|-<br />
| 6 || NotifyExFatDriverDownloadedForDebug<br />
|-<br />
| 9 || GetSystemUpdateNotificationEventForContentDelivery<br />
|-<br />
| 10 || NotifySystemUpdateForContentDelivery<br />
|-<br />
| 11 || PrepareShutdown<br />
|-<br />
| 16 || DestroySystemUpdateTask<br />
|-<br />
| 17 || RequestSendSystemUpdate<br />
|-<br />
| 18 || GetSendSystemUpdateProgress<br />
|-<br />
|}<br />
<br />
== ISystemUpdateControl ==<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || HasDownloaded<br />
|-<br />
| 1 || RequestCheckLatestUpdate<br />
|-<br />
| 2 || RequestDownloadLatestUpdate<br />
|-<br />
| 3 || GetDownloadProgress<br />
|-<br />
| 4 || ApplyDownloadedUpdate<br />
|-<br />
| 5 || RequestPrepareCardUpdate<br />
|-<br />
| 6 || GetPrepareCardUpdateProgress<br />
|-<br />
| 7 || HasPreparedCardUpdate<br />
|-<br />
| 8 || ApplyCardUpdate<br />
|-<br />
| 9 || GetDownloadedEulaDataSize<br />
|-<br />
| 10 || GetDownloadedEulaData<br />
|-<br />
| 11 || SetupCardUpdate<br />
|-<br />
| 12 || GetPreparedCardUpdateEulaDataSize<br />
|-<br />
| 13 || GetPreparedCardUpdateEulaData<br />
|-<br />
| 14 || SetupCardUpdateViaSystemUpdater<br />
|-<br />
| 15 || HasReceived<br />
|-<br />
| 16 || RequestReceiveSystemUpdate<br />
|-<br />
| 17 || GetReceiveProgress<br />
|-<br />
| 18 || ApplyReceivedUpdate<br />
|-<br />
| 19 || GetReceivedEulaDataSize<br />
|-<br />
| 20 || GetReceivedEulaData<br />
|-<br />
| 21 || SetupToReceiveSystemUpdate<br />
|-<br />
|}<br />
<br />
= ns:dev =<br />
This is "nn::ns::detail::IDevelopInterface".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#LaunchProgram]]<br />
|-<br />
| 1 || [[#TerminateProcess]]<br />
|-<br />
| 2 || [[#TerminateProgram]]<br />
|-<br />
| 4 || [[#GetShellEventHandle]]<br />
|-<br />
| 5 || [[#GetShellEventInfo]]<br />
|-<br />
| 6 || [[#TerminateApplication]]<br />
|-<br />
| 7 || [[#PrepareLaunchProgramFromHost]]<br />
|-<br />
| 8 || [[#LaunchApplication_2|#LaunchApplication]]<br />
|-<br />
| 9 || [[#LaunchApplicationWithStorageId]]<br />
|-<br />
|}<br />
<br />
== LaunchProgram ==<br />
Wrapper for "pm:shell" [[Process_Manager_services#LaunchProcess|LaunchProcess]].<br />
<br />
== TerminateProcess ==<br />
Wrapper for "pm:shell" [[Process_Manager_services#TerminateTitleByPid|TerminateTitleByPid]].<br />
<br />
== TerminateProgram ==<br />
Wrapper for "pm:shell" [[Process_Manager_services#TerminateTitleByTitleId|TerminateTitleByTitleId]].<br />
<br />
== GetShellEventHandle==<br />
Wrapper for "pm:shell" [[Process_Manager_services#GetProcessEventWaiter|GetProcessEventWaiter]].<br />
<br />
== GetShellEventInfo ==<br />
Wrapper for "pm:shell" [[Process_Manager_services#GetProcessEventType|GetProcessEventType]].<br />
<br />
== TerminateApplication ==<br />
Calls "pm:shell" [[Process_Manager_services#GetCrashingProcessPid|GetCrashingProcessPid]] and sends PID to [[Process_Manager_services#TerminateTitleByPid|TerminateTitleByPid]].<br />
<br />
== PrepareLaunchProgramFromHost ==<br />
Takes a type-0x5 input buffer containing the [[Filesystem_services|ContentPath]], returns an output 0x10-byte struct.<br />
<br />
Calls [[NCM_services#IPathResolverForStorage|IPathResolverForStorage]] Set...NcaPath functions.<br />
<br />
== LaunchApplication ==<br />
Takes an input u32 [[Process_Manager_services|launch_flags]] and u64 titleID, returns an output u64 PID.<br />
<br />
Same as LaunchApplicationWithStorageId except the last two params passed to the internal vtable funcptr call are value 0x6, instead of from the command input.<br />
<br />
== LaunchApplicationWithStorageId ==<br />
Takes 2 input u8s, an u32 [[Process_Manager_services|launch_flags]], and an u64 titleID. Returns an output u64 PID.<br />
<br />
Launches an application title which is registered with NS. <br />
<br />
[[Category:Services]]</div>
Thog
https://switchbrew.org/w/index.php?title=NS_services&diff=4953
NS services
2018-08-31T12:52:39Z
<p>Thog: </p>
<hr />
<div>= aoc:u =<br />
This is "nn::aocsrv::detail::IAddOnContentManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || CountAddOnContentByApplicationId<br />
|-<br />
| 1 || ListAddOnContentByApplicationId<br />
|-<br />
| 2 || CountAddOnContent<br />
|-<br />
| 3 || ListAddOnContent<br />
|-<br />
| 4 || GetAddOnContentBaseIdByApplicationId<br />
|-<br />
| 5 || GetAddOnContentBaseId<br />
|-<br />
| 6 || PrepareAddOnContentByApplicationId<br />
|-<br />
| 7 || PrepareAddOnContent<br />
|-<br />
| 8 || [4.0.0+] GetAddOnContentListChangedEvent<br />
|}<br />
<br />
= ns:am =<br />
This is "nn::ns::detail::IApplicationManagerInterface".<br />
<br />
[3.0.0+] This service was replaced by [[#ns:am2, ns:ec, ns:rid, ns:rt, ns:web|ns:am2]].<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#ListApplicationRecord]]<br />
|-<br />
| 1 || GenerateApplicationRecordCount<br />
|-<br />
| 2 || GetApplicationRecordUpdateSystemEvent<br />
|-<br />
| 3 || GetApplicationViewDeprecated<br />
|-<br />
| 4 || DeleteApplicationEntity<br />
|-<br />
| 5 || DeleteApplicationCompletely<br />
|-<br />
| 6 || IsAnyApplicationEntityRedundant<br />
|-<br />
| 7 || DeleteRedundantApplicationEntity<br />
|-<br />
| 8 || IsApplicationEntityMovable<br />
|-<br />
| 9 || MoveApplicationEntity<br />
|-<br />
| 11 || CalculateApplicationOccupiedSize<br />
|-<br />
| 16 || PushApplicationRecord<br />
|-<br />
| 17 || ListApplicationRecordContentMeta<br />
|-<br />
| 18 || <br />
|-<br />
| 19 || [[#LaunchApplication]]<br />
|-<br />
| 21 || [[#GetApplicationContentPath]]<br />
|-<br />
| 22 || TerminateApplication<br />
|-<br />
| 23 || [2.0.0+] ResolveApplicationContentPath<br />
|-<br />
| 26 || BeginInstallApplication<br />
|-<br />
| 27 || DeleteApplicationRecord<br />
|-<br />
| 30 || RequestApplicationUpdateInfo<br />
|-<br />
| 31 || RequestUpdateApplication<br />
|-<br />
| 32 || CancelApplicationDownload<br />
|-<br />
| 33 || ResumeApplicationDownload<br />
|-<br />
| 34 || <br />
|-<br />
| 35 || UpdateVersionList<br />
|-<br />
| 36 || PushLaunchVersion<br />
|-<br />
| 37 || ListRequiredVersion<br />
|-<br />
| 38 || CheckApplicationLaunchVersion<br />
|-<br />
| 39 || CheckApplicationLaunchRights<br />
|-<br />
| 40 || GetApplicationLogoData<br />
|-<br />
| 41 || CalculateApplicationDownloadRequiredSize<br />
|-<br />
| 42 || CleanupSdCard<br />
|-<br />
| 43 || CheckSdCardMountStatus<br />
|-<br />
| 44 || GetSdCardMountStatusChangedEvent<br />
|-<br />
| 45 || GetGameCardAttachmentEvent<br />
|-<br />
| 46 || GetGameCardAttachmentInfo<br />
|-<br />
| 47 || [[#GetTotalSpaceSize]]<br />
|-<br />
| 48 || [[#GetFreeSpaceSize]]<br />
|-<br />
| 49 || GetSdCardRemovedEvent<br />
|-<br />
| 52 || GetGameCardUpdateDetectionEvent<br />
|-<br />
| 53 || DisableApplicationAutoDelete<br />
|-<br />
| 54 || EnableApplicationAutoDelete<br />
|-<br />
| 55 || [[#GetApplicationDesiredLanguage]]<br />
|-<br />
| 56 || SetApplicationTerminateResult<br />
|-<br />
| 57 || ClearApplicationTerminateResult<br />
|-<br />
| 58 || GetLastSdCardMountUnexpectedResult<br />
|-<br />
| 59 || ConvertApplicationLanguageToLanguageCode<br />
|-<br />
| 60 || [[#ConvertLanguageCodeToApplicationLanguage]]<br />
|-<br />
| 61 || GetBackgroundDownloadStressTaskInfo<br />
|-<br />
| 62 || GetGameCardStopper<br />
|-<br />
| 63 || IsSystemProgramInstalled<br />
|-<br />
| 64 || [2.0.0+] StartApplyDeltaTask<br />
|-<br />
| 65 || [2.0.0+] GetRequestServerStopper<br />
|-<br />
| 100 || ResetToFactorySettings<br />
|-<br />
| 101 || ResetToFactorySettingsWithoutUserSaveData<br />
|-<br />
| 102 || [2.0.0+] ResetToFactorySettingsForRefurbishment<br />
|-<br />
| 200 || CalculateUserSaveDataStatistics<br />
|-<br />
| 201 || DeleteUserSaveDataAll<br />
|-<br />
| 210 || DeleteUserSystemSaveData<br />
|-<br />
| 220 || UnregisterNetworkServiceAccount<br />
|-<br />
| 300 || GetApplicationShellEvent<br />
|-<br />
| 301 || PopApplicationShellEventInfo<br />
|-<br />
| 302 || LaunchLibraryApplet<br />
|-<br />
| 303 || TerminateLibraryApplet<br />
|-<br />
| 304 || LaunchSystemApplet<br />
|-<br />
| 305 || TerminateSystemApplet<br />
|-<br />
| 306 || LaunchOverlayApplet<br />
|-<br />
| 307 || TerminateOverlayApplet<br />
|-<br />
| 400 || [[#GetApplicationControlData]]<br />
|-<br />
| 401 || InvalidateAllApplicationControlCache<br />
|-<br />
| 402 || RequestDownloadApplicationControlData<br />
|-<br />
| 403 || GetMaxApplicationControlCacheCount<br />
|-<br />
| 404 || [2.0.0+] InvalidateApplicationControlCache<br />
|-<br />
| 405 || [2.0.0+] ListApplicationControlCacheEntryInfo<br />
|-<br />
| 502 || [2.0.0+] RequestCheckGameCardRegistration<br />
|-<br />
| 503 || [2.0.0+] RequestGameCardRegistrationGoldPoint<br />
|-<br />
| 504 || [2.0.0+] RequestRegisterGameCard<br />
|-<br />
| 600 || [2.0.0+] CountApplicationContentMeta<br />
|-<br />
| 601 || [2.0.0+] [[#ListApplicationContentMetaStatus]]<br />
|-<br />
| 602 || [2.0.0+] ListAvailableAddOnContent<br />
|-<br />
| 603 || [2.0.0+] GetOwnedApplicationContentMetaStatus<br />
|-<br />
| 604 || [2.0.0+] RegisterContentsExternalKey<br />
|-<br />
| 605 || [2.0.0+] ListApplicationContentMetaStatusWithRightsCheck<br />
|-<br />
| 700 || [2.0.0+] PushDownloadTaskList<br />
|-<br />
| 701 || [2.0.0+] ClearTaskStatusList<br />
|-<br />
| 702 || [2.0.0+] RequestDownloadTaskList<br />
|-<br />
| 703 || [2.0.0+] RequestEnsureDownloadTask<br />
|-<br />
| 704 || [2.0.0+] ListDownloadTaskStatus<br />
|-<br />
| 705 || [2.0.0+] RequestDownloadTaskListData<br />
|-<br />
| 800 || [2.0.0+] RequestVersionList<br />
|-<br />
| 801 || [2.0.0+] ListVersionList<br />
|-<br />
| 900 || [2.0.0+] GetApplicationRecord<br />
|-<br />
| 901 || [2.0.0+] GetApplicationRecordProperty<br />
|-<br />
| 902 || [2.0.0+] EnableApplicationAutoUpdate<br />
|-<br />
| 903 || [2.0.0+] DisableApplicationAutoUpdate<br />
|-<br />
| 904 || [2.0.0+] TouchApplication<br />
|-<br />
| 905 || [2.0.0+] RequestApplicationUpdate<br />
|-<br />
| 906 || [2.0.0+] IsApplicationUpdateRequested<br />
|-<br />
| 907 || [2.0.0+] WithdrawApplicationUpdateRequest<br />
|-<br />
| 908 || [2.0.0+] ListApplicationRecordInstalledContentMeta<br />
|-<br />
| 1000 || [2.0.0+] RequestVerifyApplicationDeprecated<br />
|-<br />
| 1001 || [2.0.0+] CorruptApplicationForDebug<br />
|-<br />
| 1200 || [2.0.0+] NeedsUpdateVulnerability<br />
|-<br />
| 1300 || [2.0.0+] IsAnyApplicationEntityInstalled<br />
|-<br />
| 1301 || [2.0.0+] DeleteApplicationContentEntities<br />
|-<br />
| 1302 || [2.0.0+] CleanupUnrecordedApplicationEntity<br />
|-<br />
| 1400 || [2.0.0+] PrepareShutdown<br />
|-<br />
| 1500 || [2.0.0+] FormatSdCard<br />
|-<br />
| 1501 || [2.0.0+] NeedsSystemUpdateToFormatSdCard<br />
|-<br />
| 1502 || [2.0.0+] GetLastSdCardFormatUnexpectedResult<br />
|-<br />
| 1503 || [2.0.0+]<br />
|-<br />
| 1600 || [2.0.0+] GetSystemSeedForPseudoDeviceId<br />
|-<br />
| 1700 || [2.0.0+] ListApplicationDownloadingContentMeta<br />
|-<br />
| 1800 || [2.0.0+] IsNotificationSetupCompleted<br />
|-<br />
| 1801 || [2.0.0+] GetLastNotificationInfoCount<br />
|-<br />
| 1802 || [2.0.0+] ListLastNotificationInfo<br />
|}<br />
<br />
== ListApplicationRecord ==<br />
Takes a type-6 output buffer and an u64.<br />
<br />
Returns an array of title-info entries using the specified offset and size. No input titleID is passed to this.<br />
<br />
=== Application Record Format ===<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset<br />
! Size<br />
! Description<br />
|-<br />
| 0x0<br />
| 0x8<br />
| Title ID<br />
|-<br />
| 0x8<br />
| 0x1<br />
| Type? (Known values: 2=Installing?, 3=Gamecard?, 4=Installed?)<br />
|-<br />
| 0x9<br />
| 0x1<br />
| Unknown, usually 0x02<br />
|-<br />
| 0xA<br />
| 0x6<br />
| Unknown, usually zeros?<br />
|-<br />
| 0x10<br />
| 0x1<br />
| Unknown, seems to change between reboots and removing/reinserting gamecards<br />
|-<br />
| 0x11<br />
| 0x7<br />
| Unknown, usually zeros?<br />
|}<br />
<br />
== LaunchApplication ==<br />
Takes an input u64 titleID, returns an output u64 PID.<br />
<br />
Launches an application title which is registered with NS.<br />
<br />
== GetApplicationContentPath ==<br />
Takes a 0x16-type output buffer, an u8 [[NCA|type]], and an u64 titleID.<br />
<br />
The input titleID is used with the application-title table like various other cmds, anything not in that table can't be used with this.<br />
<br />
Returns a string path for the specified type of patch content with this titleID, otherwise returns regular-application paths when update-title not installed. Returns an error when the specified type of content doesn't exist for this title. Starts with "@{SdCardContent,UserContent}://" and ends in ".nca".<br />
<br />
For gamecard content, the output path is: "@GcSXXXXXXXX:/<NcaId>.nca". NCA-type0 with gamecard returns 0 with an empty output string.<br />
<br />
The output string is then used by the user-process with [[Filesystem_services|FS]] to mount the content.<br />
<br />
== GetTotalSpaceSize ==<br />
Takes an input media-id that must be 5.<br />
<br />
Returns the u64 from [[Content_Manager_services#IContentStorage]] cmd22.<br />
<br />
== GetFreeSpaceSize ==<br />
Takes an input media-id that must be 5.<br />
<br />
Returns the u64 from [[Content_Manager_services#IContentStorage]] cmd23.<br />
<br />
== GetApplicationDesiredLanguage ==<br />
Takes an input u8 language-bitmask, returns an output u8 [[control.nacp]] langentry index.<br />
<br />
User-processes generate the language-bitmask with the following for all 16 lang-entries: <code>if(<either string in langentry[i] is non-empty>)bitmask |= 1<<i</code><br />
<br />
== ConvertLanguageCodeToApplicationLanguage ==<br />
Takes an input u8 pointer for the resulting Id to be written to and a string represented as a u64 (i.e 0x53552D6E65 for 'en-US').<br />
<br />
Returns 0 if an ID was successfully found, otherwise returns 0x25810.<br />
<br />
== GetApplicationControlData ==<br />
Takes an input u8 flag, an u64 titleID, and a type-0x6 output buffer. Returns an output u32 for actual_size. Official user-processes use buffer size 0x24000. [[qlaunch]] only uses flag value 0x1.<br />
<br />
Loads cached [[control.nacp]] to buf+0 and the cached icon to buf+0x4000. Returns an error if the buffer is too small.<br />
<br />
== ListApplicationContentMetaStatus ==<br />
Returns 0x10-byte entries using the specified titleID starting at the specified u32 entryindex. Can only return game titles. The second entry if any is the update-title usually. When the input entryindex is >= totalentries, this will return 0 with out_entrycount=0.<br />
<br />
Entry structure:<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset<br />
! Size<br />
! Description<br />
|-<br />
| 0x0<br />
| 0x1<br />
| u8 "type". [[Content_Manager_services|Title type]] (String is from web-applet)<br />
|-<br />
| 0x1<br />
| 0x1<br />
| u8 "installedStorage" / [[Filesystem_services|StorageId]] (String is from web-applet)<br />
|-<br />
| 0x2<br />
| 0x1<br />
| Unknown. Non-zero with output from cmd 605, differs for app/update titles.<br />
|-<br />
| 0x3<br />
| 0x1<br />
| Padding<br />
|-<br />
| 0x4<br />
| 0x4<br />
| u32 Title-version<br />
|-<br />
| 0x8<br />
| 0x8<br />
| u64 titleID<br />
|}<br />
<br />
= ns:am2, ns:ec, ns:rid, ns:rt, ns:web =<br />
These services are all, at the top level, "nn::ns::detail::IServiceGetterInterface". These commands check a state field for a command-specific bit and returns an error if not set, this is likely a permissions check for service+command.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 7992 || [[#IECommerceInterface|GetECommerceInterface]]<br />
|-<br />
| 7993 || [[#IApplicationVersionInterface|GetApplicationVersionInterface]]<br />
|-<br />
| 7994 || [[#IFactoryResetInterface|GetFactoryResetInterface]]<br />
|-<br />
| 7995 || [[#IAccountProxyInterface|GetAccountProxyInterface]]<br />
|-<br />
| 7996 || [[#IApplicationManagerInterface|GetApplicationManagerInterface]]<br />
|-<br />
| 7997 || [[#IDownloadTaskInterface|GetDownloadTaskInterface]]<br />
|-<br />
| 7998 || [[#IContentManagementInterface|GetContentManagementInterface]]<br />
|-<br />
| 7999 || [[#IDocumentInterface|GetDocumentInterface]]<br />
|-<br />
|}<br />
<br />
=== IAccountProxyInterface ===<br />
This is "nn::ns::detail::IAccountProxyInterface".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || CreateUserAccount<br />
|-<br />
|}<br />
<br />
=== IApplicationManagerInterface ===<br />
This is "nn::ns::detail::IApplicationManagerInterface".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#ListApplicationRecord]]<br />
|-<br />
| 1 || GenerateApplicationRecordCount<br />
|-<br />
| 2 || GetApplicationRecordUpdateSystemEvent<br />
|-<br />
| 3 || GetApplicationViewDeprecated<br />
|-<br />
| 4 || DeleteApplicationEntity<br />
|-<br />
| 5 || DeleteApplicationCompletely<br />
|-<br />
| 6 || IsAnyApplicationEntityRedundant<br />
|-<br />
| 7 || DeleteRedundantApplicationEntity<br />
|-<br />
| 8 || IsApplicationEntityMovable<br />
|-<br />
| 9 || MoveApplicationEntity<br />
|-<br />
| 11 || CalculateApplicationOccupiedSize<br />
|-<br />
| 16 || PushApplicationRecord<br />
|-<br />
| 17 || ListApplicationRecordContentMeta<br />
|-<br />
| 19 || [1.0.0-5.1.0] [[#LaunchApplication]]<br />
|-<br />
| 21 || [[#GetApplicationContentPath]]<br />
|-<br />
| 22 || TerminateApplication<br />
|-<br />
| 23 || ResolveApplicationContentPath<br />
|-<br />
| 26 || BeginInstallApplication<br />
|-<br />
| 27 || DeleteApplicationRecord<br />
|-<br />
| 30 || RequestApplicationUpdateInfo<br />
|-<br />
| 32 || CancelApplicationDownload<br />
|-<br />
| 33 || ResumeApplicationDownload<br />
|-<br />
| 35 || UpdateVersionList<br />
|-<br />
| 36 || PushLaunchVersion<br />
|-<br />
| 37 || ListRequiredVersion<br />
|-<br />
| 38 || CheckApplicationLaunchVersion<br />
|-<br />
| 39 || CheckApplicationLaunchRights<br />
|-<br />
| 40 || GetApplicationLogoData<br />
|-<br />
| 41 || CalculateApplicationDownloadRequiredSize<br />
|-<br />
| 42 || CleanupSdCard<br />
|-<br />
| 43 || CheckSdCardMountStatus<br />
|-<br />
| 44 || GetSdCardMountStatusChangedEvent<br />
|-<br />
| 45 || GetGameCardAttachmentEvent<br />
|-<br />
| 46 || GetGameCardAttachmentInfo<br />
|-<br />
| 47 || [[#GetTotalSpaceSize]]<br />
|-<br />
| 48 || [[#GetFreeSpaceSize]]<br />
|-<br />
| 49 || GetSdCardRemovedEvent<br />
|-<br />
| 52 || GetGameCardUpdateDetectionEvent<br />
|-<br />
| 53 || DisableApplicationAutoDelete<br />
|-<br />
| 54 || EnableApplicationAutoDelete<br />
|-<br />
| 55 || GetApplicationDesiredLanguage<br />
|-<br />
| 56 || SetApplicationTerminateResult<br />
|-<br />
| 57 || ClearApplicationTerminateResult<br />
|-<br />
| 58 || GetLastSdCardMountUnexpectedResult<br />
|-<br />
| 59 || ConvertApplicationLanguageToLanguageCode<br />
|-<br />
| 60 || [[#ConvertLanguageCodeToApplicationLanguage]]<br />
|-<br />
| 61 || GetBackgroundDownloadStressTaskInfo<br />
|-<br />
| 62 || GetGameCardStopper<br />
|-<br />
| 63 || IsSystemProgramInstalled<br />
|-<br />
| 64 || StartApplyDeltaTask<br />
|-<br />
| 65 || GetRequestServerStopper<br />
|-<br />
| 66 || GetBackgroundApplyDeltaStressTaskInfo<br />
|-<br />
| 67 || CancelApplicationApplyDelta<br />
|-<br />
| 68 || ResumeApplicationApplyDelta<br />
|-<br />
| 69 || CalculateApplicationApplyDeltaRequiredSize<br />
|-<br />
| 70 || ResumeAll<br />
|-<br />
| 71 || GetStorageSize<br />
|-<br />
| 80 || RequestDownloadApplication<br />
|-<br />
| 81 || RequestDownloadAddOnContent<br />
|-<br />
| 82 || DownloadApplication<br />
|-<br />
| 83 || CheckApplicationResumeRights<br />
|-<br />
| 84 || GetDynamicCommitEvent<br />
|-<br />
| 85 || RequestUpdateApplication2<br />
|-<br />
| 86 || EnableApplicationCrashReport<br />
|-<br />
| 87 || IsApplicationCrashReportEnabled<br />
|-<br />
| 90 || BoostSystemMemoryResourceLimit<br />
|-<br />
| 91 || [6.0.0+]<br />
|-<br />
| 92 || [6.0.0+]<br />
|-<br />
| 93 || [6.0.0+]<br />
|-<br />
| 94 || [6.0.0+] LaunchApplication2<br />
|-<br />
| 95 || [6.0.0+]<br />
|-<br />
| 96 || [6.0.0+]<br />
|-<br />
| 97 || [6.0.0+]<br />
|-<br />
| 98 || [6.0.0+]<br />
|-<br />
| 100 || ResetToFactorySettings<br />
|-<br />
| 101 || ResetToFactorySettingsWithoutUserSaveData<br />
|-<br />
| 102 || ResetToFactorySettingsForRefurbishment<br />
|-<br />
| 200 || CalculateUserSaveDataStatistics<br />
|-<br />
| 201 || DeleteUserSaveDataAll<br />
|-<br />
| 210 || DeleteUserSystemSaveData<br />
|-<br />
| 211 || [6.0.0+]<br />
|-<br />
| 220 || UnregisterNetworkServiceAccount<br />
|-<br />
| 221 || [6.0.0+]<br />
|-<br />
| 300 || GetApplicationShellEvent<br />
|-<br />
| 301 || PopApplicationShellEventInfo<br />
|-<br />
| 302 || LaunchLibraryApplet<br />
|-<br />
| 303 || TerminateLibraryApplet<br />
|-<br />
| 304 || LaunchSystemApplet<br />
|-<br />
| 305 || TerminateSystemApplet<br />
|-<br />
| 306 || LaunchOverlayApplet<br />
|-<br />
| 307 || TerminateOverlayApplet<br />
|-<br />
| 400 || GetApplicationControlData<br />
|-<br />
| 401 || InvalidateAllApplicationControlCache<br />
|-<br />
| 402 || RequestDownloadApplicationControlData<br />
|-<br />
| 403 || GetMaxApplicationControlCacheCount<br />
|-<br />
| 404 || InvalidateApplicationControlCache<br />
|-<br />
| 405 || ListApplicationControlCacheEntryInfo<br />
|-<br />
| 406 || [6.0.0+]<br />
|-<br />
| 502 || RequestCheckGameCardRegistration<br />
|-<br />
| 503 || RequestGameCardRegistrationGoldPoint<br />
|-<br />
| 504 || RequestRegisterGameCard<br />
|-<br />
| 505 || GetGameCardMountFailureEvent<br />
|-<br />
| 506 || IsGameCardInserted<br />
|-<br />
| 507 || EnsureGameCardAccess<br />
|-<br />
| 508 || GetLastGameCardMountFailureResult<br />
|-<br />
| 509 || ListApplicationIdOnGameCard<br />
|-<br />
| 600 || CountApplicationContentMeta<br />
|-<br />
| 601 || [[#ListApplicationContentMetaStatus]]<br />
|-<br />
| 602 || [2.0.0-5.1.0] ListAvailableAddOnContent<br />
|-<br />
| 603 || GetOwnedApplicationContentMetaStatus<br />
|-<br />
| 604 || RegisterContentsExternalKey<br />
|-<br />
| 605 || ListApplicationContentMetaStatusWithRightsCheck<br />
|-<br />
| 606 || GetContentMetaStorage<br />
|-<br />
| 607 || [6.0.0+]<br />
|-<br />
| 700 || PushDownloadTaskList<br />
|-<br />
| 701 || ClearTaskStatusList<br />
|-<br />
| 702 || RequestDownloadTaskList<br />
|-<br />
| 703 || RequestEnsureDownloadTask<br />
|-<br />
| 704 || ListDownloadTaskStatus<br />
|-<br />
| 705 || RequestDownloadTaskListData<br />
|-<br />
| 800 || RequestVersionList<br />
|-<br />
| 801 || ListVersionList<br />
|-<br />
| 802 || RequestVersionListData<br />
|-<br />
| 900 || GetApplicationRecord<br />
|-<br />
| 901 || GetApplicationRecordProperty<br />
|-<br />
| 902 || EnableApplicationAutoUpdate<br />
|-<br />
| 903 || DisableApplicationAutoUpdate<br />
|-<br />
| 904 || TouchApplication<br />
|-<br />
| 905 || RequestApplicationUpdate<br />
|-<br />
| 906 || IsApplicationUpdateRequested<br />
|-<br />
| 907 || WithdrawApplicationUpdateRequest<br />
|-<br />
| 908 || ListApplicationRecordInstalledContentMeta<br />
|-<br />
| 909 || WithdrawCleanupAddOnContentsWithNoRightsRecommendation<br />
|-<br />
| 910 || [6.0.0+]<br />
|-<br />
| 911 || [6.0.0+]<br />
|-<br />
| 912 || [6.0.0+]<br />
|-<br />
| 1000 || RequestVerifyApplicationDeprecated<br />
|-<br />
| 1001 || CorruptApplicationForDebug<br />
|-<br />
| 1002 || RequestVerifyAddOnContentsRights<br />
|-<br />
| 1003 || RequestVerifyApplication<br />
|-<br />
| 1004 || CorruptContentForDebug<br />
|-<br />
| 1200 || NeedsUpdateVulnerability<br />
|-<br />
| 1300 || IsAnyApplicationEntityInstalled<br />
|-<br />
| 1301 || DeleteApplicationContentEntities<br />
|-<br />
| 1302 || CleanupUnrecordedApplicationEntity<br />
|-<br />
| 1303 || CleanupAddOnContentsWithNoRights<br />
|-<br />
| 1304 || DeleteApplicationContentEntity<br />
|-<br />
| 1305 || [?.?.?-5.1.0] TryDeleteRunningApplicationEntity<br />
|-<br />
| 1306 || [?.?.?-5.1.0] TryDeleteRunningApplicationCompletely<br />
|-<br />
| 1307 || [?.?.?-5.1.0] TryDeleteRunningApplicationContentEntities<br />
|-<br />
| 1308 || [6.0.0+]<br />
|-<br />
| 1309 || [6.0.0+]<br />
|-<br />
| 1400 || PrepareShutdown<br />
|-<br />
| 1500 || FormatSdCard<br />
|-<br />
| 1501 || NeedsSystemUpdateToFormatSdCard<br />
|-<br />
| 1502 || GetLastSdCardFormatUnexpectedResult<br />
|-<br />
| 1504 || InsertSdCard<br />
|-<br />
| 1505 || RemoveSdCard<br />
|-<br />
| 1600 || GetSystemSeedForPseudoDeviceId<br />
|-<br />
| 1601 || ResetSystemSeedForPseudoDeviceId<br />
|-<br />
| 1700 || ListApplicationDownloadingContentMeta<br />
|-<br />
| 1701 || GetApplicationView<br />
|-<br />
| 1702 || GetApplicationDownloadTaskStatus<br />
|-<br />
| 1703 || GetApplicationViewDownloadErrorContext<br />
|-<br />
| 1800 || IsNotificationSetupCompleted<br />
|-<br />
| 1801 || GetLastNotificationInfoCount<br />
|-<br />
| 1802 || ListLastNotificationInfo<br />
|-<br />
| 1803 || ListNotificationTask<br />
|-<br />
| 1900 || IsActiveAccount<br />
|-<br />
| 1901 || RequestDownloadApplicationPrepurchasedRights<br />
|-<br />
| 1902 || GetApplicationTicketInfo<br />
|-<br />
| 2000 || GetSystemDeliveryInfo<br />
|-<br />
| 2001 || SelectLatestSystemDeliveryInfo<br />
|-<br />
| 2002 || VerifyDeliveryProtocolVersion<br />
|-<br />
| 2003 || GetApplicationDeliveryInfo<br />
|-<br />
| 2004 || HasAllContentsToDeliver<br />
|-<br />
| 2005 || CompareApplicationDeliveryInfo<br />
|-<br />
| 2006 || CanDeliverApplication<br />
|-<br />
| 2007 || ListContentMetaKeyToDeliverApplication<br />
|-<br />
| 2008 || NeedsSystemUpdateToDeliverApplication<br />
|-<br />
| 2009 || EstimateRequiredSize<br />
|-<br />
| 2010 || RequestReceiveApplication<br />
|-<br />
| 2011 || CommitReceiveApplication<br />
|-<br />
| 2012 || GetReceiveApplicationProgress<br />
|-<br />
| 2013 || RequestSendApplication<br />
|-<br />
| 2014 || GetSendApplicationProgress<br />
|-<br />
| 2015 || CompareSystemDeliveryInfo<br />
|-<br />
| 2016 || ListNotCommittedContentMeta<br />
|-<br />
| 2017 || CreateDownloadTask<br />
|-<br />
| 2018 || [6.0.0+]<br />
|-<br />
| 2050 || [6.0.0+]<br />
|-<br />
| 2100 || [6.0.0+]<br />
|-<br />
| 2101 || [6.0.0+]<br />
|-<br />
| 2150 || [6.0.0+]<br />
|-<br />
| 2151 || [6.0.0+]<br />
|-<br />
| 2152 || [6.0.0+]<br />
|-<br />
| 2153 || [6.0.0+]<br />
|-<br />
| 2154 || [6.0.0+]<br />
|-<br />
| 2160 || [6.0.0+]<br />
|-<br />
| 2161 || [6.0.0+]<br />
|-<br />
| 2170 || [6.0.0+]<br />
|-<br />
| 2171 || [6.0.0+]<br />
|-<br />
| 2180 || [6.0.0+]<br />
|-<br />
| 2181 || [6.0.0+]<br />
|-<br />
| 2182 || [6.0.0+]<br />
|-<br />
| 2190 || [6.0.0+]<br />
|-<br />
| 2199 || [6.0.0+]<br />
|-<br />
| 2200 || [6.0.0+]<br />
|-<br />
| 2201 || [6.0.0+]<br />
|-<br />
| 2250 || [6.0.0+]<br />
|-<br />
| 2300 || [6.0.0+] <br />
|-<br />
|}<br />
<br />
=== IApplicationVersionInterface ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || GetLaunchRequiredVersion<br />
|-<br />
| 1 || UpgradeLaunchRequiredVersion<br />
|-<br />
| 35 || UpdateVersionList<br />
|-<br />
| 36 || PushLaunchVersion<br />
|-<br />
| 37 || ListRequiredVersion<br />
|-<br />
| 800 || RequestVersionList<br />
|-<br />
| 801 || ListVersionList<br />
|-<br />
| 802 || RequestVersionListData<br />
|-<br />
| 1000 || PerformAutoUpdate<br />
|-<br />
|}<br />
<br />
=== IContentManagerInterface ===<br />
This is "nn::ns::detail::IContentManagementInterface".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 11 || CalculateApplicationOccupiedSize<br />
|-<br />
| 43 || CheckSdCardMountStatus<br />
|-<br />
| 47 || GetTotalSpaceSize<br />
|-<br />
| 48 || GetFreeSpaceSize<br />
|-<br />
| 600 || CountApplicationContentMeta<br />
|-<br />
| 601 || ListApplicationContentMetaStatus<br />
|-<br />
| 605 || ListApplicationContentMetaStatusWithRightsCheck<br />
|-<br />
| 607 || IsAnyApplicationRunning<br />
|-<br />
|}<br />
<br />
=== IDocumentInterface ===<br />
This is "nn::ns::detail::IDocumentInterface".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 21 || GetApplicationContentPath<br />
|-<br />
| 23 || ResolveApplicationContentPath<br />
|-<br />
|}<br />
<br />
=== IDownloadTaskInterface ===<br />
This is "nn::ns::detail::IDownloadTaskInterface".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 701 || ClearTaskStatusList<br />
|-<br />
| 702 || RequestDownloadTaskList<br />
|-<br />
| 703 || RequestEnsureDownloadTask<br />
|-<br />
| 704 || ListDownloadTaskStatus<br />
|-<br />
| 705 || RequestDownloadTaskListData<br />
|-<br />
| 706 || TryCommitCurrentApplicationDownloadTask<br />
|-<br />
| 707 || EnableAutoCommit<br />
|-<br />
| 708 || DisableAutoCommit<br />
|-<br />
| 709 || TriggerDynamicCommitEvent<br />
|-<br />
|}<br />
<br />
=== IECommerceInterface===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || RequestLinkDevice<br />
|-<br />
|}<br />
<br />
=== IFactoryResetInterface ===<br />
This is "nn::ns::detail::IFactoryResetInterface".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 100 || ResetToFactorySettings<br />
|-<br />
| 101 || ResetToFactorySettingsWithoutUserSaveData<br />
|-<br />
| 102 || ResetToFactorySettingsForRefurbishment<br />
|-<br />
|}<br />
<br />
= ns:vm =<br />
This is "nn::ns::detail::IVulnerabilityManagerInterface".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 1200 || [3.0.0+] NeedsUpdateVulnerability<br />
|-<br />
| 1201 || [4.0.0+] UpdateSafeSystemVersionForDebug<br />
|-<br />
| 1202 || [4.0.0+] GetSafeSystemVersion<br />
|-<br />
|}<br />
<br />
= ns:su =<br />
This is "nn::ns::detail::ISystemUpdateInterface".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || GetBackgroundNetworkUpdateState<br />
|-<br />
| 1 || [[#ISystemUpdateControl|OpenSystemUpdateControl]]<br />
|-<br />
| 2 || NotifyExFatDriverRequired<br />
|-<br />
| 3 || ClearExFatDriverStatusForDebug<br />
|-<br />
| 4 || RequestBackgroundNetworkUpdate<br />
|-<br />
| 5 || NotifyBackgroundNetworkUpdate<br />
|-<br />
| 6 || NotifyExFatDriverDownloadedForDebug<br />
|-<br />
| 9 || GetSystemUpdateNotificationEventForContentDelivery<br />
|-<br />
| 10 || NotifySystemUpdateForContentDelivery<br />
|-<br />
| 11 || PrepareShutdown<br />
|-<br />
| 16 || DestroySystemUpdateTask<br />
|-<br />
| 17 || RequestSendSystemUpdate<br />
|-<br />
| 18 || GetSendSystemUpdateProgress<br />
|-<br />
|}<br />
<br />
== ISystemUpdateControl ==<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || HasDownloaded<br />
|-<br />
| 1 || RequestCheckLatestUpdate<br />
|-<br />
| 2 || RequestDownloadLatestUpdate<br />
|-<br />
| 3 || GetDownloadProgress<br />
|-<br />
| 4 || ApplyDownloadedUpdate<br />
|-<br />
| 5 || RequestPrepareCardUpdate<br />
|-<br />
| 6 || GetPrepareCardUpdateProgress<br />
|-<br />
| 7 || HasPreparedCardUpdate<br />
|-<br />
| 8 || ApplyCardUpdate<br />
|-<br />
| 9 || GetDownloadedEulaDataSize<br />
|-<br />
| 10 || GetDownloadedEulaData<br />
|-<br />
| 11 || SetupCardUpdate<br />
|-<br />
| 12 || GetPreparedCardUpdateEulaDataSize<br />
|-<br />
| 13 || GetPreparedCardUpdateEulaData<br />
|-<br />
| 14 || SetupCardUpdateViaSystemUpdater<br />
|-<br />
| 15 || HasReceived<br />
|-<br />
| 16 || RequestReceiveSystemUpdate<br />
|-<br />
| 17 || GetReceiveProgress<br />
|-<br />
| 18 || ApplyReceivedUpdate<br />
|-<br />
| 19 || GetReceivedEulaDataSize<br />
|-<br />
| 20 || GetReceivedEulaData<br />
|-<br />
| 21 || SetupToReceiveSystemUpdate<br />
|-<br />
|}<br />
<br />
= ns:dev =<br />
This is "nn::ns::detail::IDevelopInterface".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || [[#LaunchProgram]]<br />
|-<br />
| 1 || [[#TerminateProcess]]<br />
|-<br />
| 2 || [[#TerminateProgram]]<br />
|-<br />
| 4 || [[#GetShellEventHandle]]<br />
|-<br />
| 5 || [[#GetShellEventInfo]]<br />
|-<br />
| 6 || [[#TerminateApplication]]<br />
|-<br />
| 7 || [[#PrepareLaunchProgramFromHost]]<br />
|-<br />
| 8 || [[#LaunchApplication_2|#LaunchApplication]]<br />
|-<br />
| 9 || [[#LaunchApplicationWithStorageId]]<br />
|-<br />
|}<br />
<br />
== LaunchProgram ==<br />
Wrapper for "pm:shell" [[Process_Manager_services#LaunchProcess|LaunchProcess]].<br />
<br />
== TerminateProcess ==<br />
Wrapper for "pm:shell" [[Process_Manager_services#TerminateTitleByPid|TerminateTitleByPid]].<br />
<br />
== TerminateProgram ==<br />
Wrapper for "pm:shell" [[Process_Manager_services#TerminateTitleByTitleId|TerminateTitleByTitleId]].<br />
<br />
== GetShellEventHandle==<br />
Wrapper for "pm:shell" [[Process_Manager_services#GetProcessEventWaiter|GetProcessEventWaiter]].<br />
<br />
== GetShellEventInfo ==<br />
Wrapper for "pm:shell" [[Process_Manager_services#GetProcessEventType|GetProcessEventType]].<br />
<br />
== TerminateApplication ==<br />
Calls "pm:shell" [[Process_Manager_services#GetCrashingProcessPid|GetCrashingProcessPid]] and sends PID to [[Process_Manager_services#TerminateTitleByPid|TerminateTitleByPid]].<br />
<br />
== PrepareLaunchProgramFromHost ==<br />
Takes a type-0x5 input buffer containing the [[Filesystem_services|ContentPath]], returns an output 0x10-byte struct.<br />
<br />
Calls [[NCM_services#IPathResolverForStorage|IPathResolverForStorage]] Set...NcaPath functions.<br />
<br />
== LaunchApplication ==<br />
Takes an input u32 [[Process_Manager_services|launch_flags]] and u64 titleID, returns an output u64 PID.<br />
<br />
Same as LaunchApplicationWithStorageId except the last two params passed to the internal vtable funcptr call are value 0x6, instead of from the command input.<br />
<br />
== LaunchApplicationWithStorageId ==<br />
Takes 2 input u8s, an u32 [[Process_Manager_services|launch_flags]], and an u64 titleID. Returns an output u64 PID.<br />
<br />
Launches an application title which is registered with NS. <br />
<br />
[[Category:Services]]</div>
Thog
https://switchbrew.org/w/index.php?title=Settings_services&diff=4906
Settings services
2018-08-11T21:10:48Z
<p>Thog: Add details about set:fd</p>
<hr />
<div>= set =<br />
This is "nn::settings::ISettingsServer".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetLanguageCode || No input, returns an output [[#LanguageCode]]. This is the current system language.<br />
|-<br />
| 1 || GetAvailableLanguageCodes || Takes a type-0xA buffer containing the [[#LanguageCode]] output array, returns an output s32.<br />
|-<br />
| 2 || [4.0.0+] MakeLanguageCode || Takes an input [[#Language]], returns an output [[#LanguageCode]].<br />
|-<br />
| 3 || GetAvailableLanguageCodeCount || No input, returns an output s32.<br />
|-<br />
| 4 || GetRegionCode || No input, returns an output s32.<br />
|-<br />
| 5 || [4.0.0+] GetAvailableLanguageCodes2 || Takes a type-0x6 buffer containing the [[#LanguageCode]] output array, returns an output s32.<br />
|-<br />
| 6 || [4.0.0+] GetAvailableLanguageCodeCount2 || No input, returns an output s32.<br />
|-<br />
| 7 || [4.0.0+] GetKeyCodeMap || <br />
|-<br />
| 8 || [5.0.0+] GetQuestFlag || Identical to "set:sys" [[#set:sys|GetQuestFlag]].<br />
|}<br />
<br />
[4.0.0+] Official user-processes now use GetAvailableLanguageCodes2/GetAvailableLanguageCodeCount2 instead of {original commands}.<br />
<br />
In official user-processes in the [[#Language]]->[[#LanguageCode]] conversion function (MakeLanguageCode):<br />
* During one-time init, GetAvailableLanguageCodes is used to initialize the LanguageCodes array cache, with max_entries=0xF (buffer size in u64s). [4.0.0+] GetAvailableLanguageCodes2 is now used with max_entries 0x40.<br />
* [4.0.0+] When the input [[#Language]] is larger than the cached total_entries from the above command output, or [[#Language]] is negative, command MakeLanguageCode is used instead of the array.<br />
<br />
== GetKeyCodeMap ==<br />
Takes a type-0x16 output buffer containing KeyCodeMap, official sw uses fixed size 0x1000. This is probably related to HID keyboard.<br />
<br />
== Language ==<br />
"nn::settings::Language" (s32) is basically array indices in the output array from GetAvailableLanguageCodes.<br />
<br />
== LanguageCode ==<br />
This is "nn::settings::LanguageCode".<br />
<br />
This is an u64, which is a NUL-terminated string.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Array-index / [[#Language]] || [[#LanguageCode]] || Icon [[NCA_Content_FS#FS-type3|language]] filename<br />
|-<br />
| 0 || ja || "Japanese"<br />
|-<br />
| 1 || en-US || "AmericanEnglish"<br />
|-<br />
| 2 || fr || "French"<br />
|-<br />
| 3 || de || "German"<br />
|-<br />
| 4 || it || "Italian"<br />
|-<br />
| 5 || es || "Spanish"<br />
|-<br />
| 6 || zh-CN || "Chinese"<br />
|-<br />
| 7 || ko || "Korean"<br />
|-<br />
| 8 || nl || "Dutch"<br />
|-<br />
| 9 || pt || "Portuguese"<br />
|-<br />
| 10 || ru || "Russian"<br />
|-<br />
| 11 || zh-TW || "Taiwanese"<br />
|-<br />
| 12 || en-GB || "BritishEnglish"<br />
|-<br />
| 13 || fr-CA || "CanadianFrench"<br />
|-<br />
| 14 || es-419 || "LatinAmericanSpanish"<br />
|-<br />
| [4.0.0+] 15 || zh-Hans || "SimplifiedChinese"<br />
|-<br />
| [4.0.0+] 16 || zh-Hant || "TraditionalChinese"<br />
|}<br />
<br />
= set:fd =<br />
[4.0.0+] Only exposed if in [[SPL_services#IsDebugMode|debug mode]].<br />
<br />
This is "nn::settings::IFirmwareDebugSettingsServer".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 2 || SetSettingsItemValue ||<br />
|-<br />
| 3 || ResetSettingsItemValue ||<br />
|-<br />
| 4 || CreateSettingsItemKeyIterator || Returns an [[#ISettingsItemKeyIterator]].<br />
|-<br />
| 10 || [4.0.0+] ReadSettings ||<br />
|-<br />
| 11 || [4.0.0+] ResetSettings ||<br />
|-<br />
| 20 || [4.0.0+] SetWebInspectorFlag ||<br />
|-<br />
| 21 || [4.0.0+] SetAllowedSslHosts ||<br />
|-<br />
| 22 || [4.0.0+] SetHostFsMountPoint ||<br />
|}<br />
<br />
== ISettingsItemKeyIterator ==<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || GoNext<br />
|-<br />
| 1 || GetKeySize<br />
|-<br />
| 2 || GetKey<br />
|}<br />
<br />
= set:cal =<br />
This is "nn::settings::IFactorySettingsServer".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || GetBluetoothBdAddress<br />
|-<br />
| 1 || GetConfigurationId1<br />
|-<br />
| 2 || GetAccelerometerOffset<br />
|-<br />
| 3 || GetAccelerometerScale<br />
|-<br />
| 4 || GetGyroscopeOffset<br />
|-<br />
| 5 || GetGyroscopeScale<br />
|-<br />
| 6 || GetWirelessLanMacAddress<br />
|-<br />
| 7 || GetWirelessLanCountryCodeCount<br />
|-<br />
| 8 || GetWirelessLanCountryCodes<br />
|-<br />
| 9 || GetSerialNumber<br />
|-<br />
| 10 || SetInitialSystemAppletProgramId<br />
|-<br />
| 11 || SetOverlayDispProgramId<br />
|-<br />
| 12 || GetBatteryLot<br />
|-<br />
| 14 || [[#GetEciDeviceCertificate]]<br />
|-<br />
| 15 || [[#GetEticketDeviceCertificate]]<br />
|-<br />
| 16 || [[#GetSslKey]]<br />
|-<br />
| 17 || [[#GetSslCertificate]]<br />
|-<br />
| 18 || [[#GetGameCardKey]]<br />
|-<br />
| 19 || [[#GetGameCardCertificate]]<br />
|-<br />
| 20 || [[#GetEciDeviceKey]]<br />
|-<br />
| 21 || [[#GetEticketDeviceKey]]<br />
|-<br />
| 22 || GetSpeakerParameter<br />
|-<br />
| 23 || [4.0.0+] GetLcdVendorId<br />
|-<br />
| 24 || [5.0.0+] GetEciDeviceCertificate2<br />
|-<br />
| 25 || [5.0.0+] GetEciDeviceKey2<br />
|-<br />
| 26 || [5.0.0+] GetAmiiboKey<br />
|-<br />
| 27 || [5.0.0+] GetAmiiboEcqvCertificate<br />
|-<br />
| 28 || [5.0.0+] GetAmiiboEcdsaCertificate<br />
|-<br />
| 29 || [5.0.0+] GetAmiiboEcqvBlsKey<br />
|-<br />
| 30 || [5.0.0+] GetAmiiboEcqvBlsCertificate<br />
|-<br />
| 31 || [5.0.0+] GetAmiiboEcqvBlsRootCertificate<br />
|-<br />
| 32 || [5.0.0+] GetUnknownId<br />
|}<br />
<br />
Used for accessing data calibrated at the factory.<br />
<br />
== GetEciDeviceCertificate ==<br />
Takes a type-0x16 output buffer with fixed size 0x180.<br />
<br />
Returns the device certificate (ECC signed). This is identical to 3DS DeviceCert/CTCert besides the strings. NIM loads the DeviceId from this.<br />
<br />
== GetEticketDeviceCertificate ==<br />
Takes a type-0x16 output buffer with fixed size 0x240.<br />
<br />
Returns the ETicket certificate (RSA signed).<br />
<br />
== GetSslKey ==<br />
Takes a type-0x16 output buffer with fixed size 0x134.<br />
<br />
Returns the extended SSL key (0x130 bytes) from [[Calibration#CAL0|CAL0]]. If the extended key is not programmed then it falls back to the normal SSL key (0x110 bytes).<br />
<br />
Used by SSL-sysmodule, see [[SSL_services|here]].<br />
<br />
== GetSslCertificate ==<br />
Takes a type-0x16 output buffer with fixed size 0x804.<br />
<br />
Returns a [[Settings_services#setcal_Container_Structure|container]] with the plaintext SSL certificate.<br />
<br />
Used by SSL-sysmodule, see [[SSL_services|here]].<br />
<br />
== GetGameCardKey ==<br />
Takes a type-0x16 output buffer with fixed size 0x134.<br />
<br />
Returns the extended GameCard key (0x130 bytes) from [[Calibration#CAL0|CAL0]]. If the extended key is not programmed then it falls back to the normal GameCard key (0x110 bytes).<br />
<br />
== GetGameCardCertificate ==<br />
Takes a type-0x16 output buffer with fixed size 0x404.<br />
<br />
Returns a [[Settings_services#setcal_Container_Structure|container]] with the GameCard certificate.<br />
<br />
== GetEciDeviceKey ==<br />
Returns the extended device ECC-B233 key (0x50 bytes) from [[Calibration#CAL0|CAL0]]. If the extended key is not programmed then it falls back to the normal device ECC-B233 key (0x30 bytes).<br />
<br />
== GetEticketDeviceKey ==<br />
Takes a type-0x16 output buffer with fixed size 0x244.<br />
<br />
Returns the extended ETicket RSA-2048 key (0x240 bytes) from [[Calibration#CAL0|CAL0]]. If the extended key is not programmed then it falls back to the normal ETicket RSA-2048 key (0x220 bytes).<br />
<br />
== setcal Container Structure ==<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset<br />
! Size<br />
! Name<br />
|-<br />
| 0x0<br />
| 0x4<br />
| Size (same size used for decryption if needed)<br />
|-<br />
| 0x4<br />
| {above size}<br />
| Actual data starts here.<br />
|}<br />
<br />
This container is used for returning data with variable sizes.<br />
<br />
= set:sys =<br />
This is "nn::settings::ISystemSettingsServer".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || SetLanguageCode<br />
|-<br />
| 1 || SetNetworkSettings<br />
|-<br />
| 2 || GetNetworkSettings<br />
|-<br />
| 3 || [[#GetFirmwareVersion]]<br />
|-<br />
| 4 || [3.0.0+] GetFirmwareVersion2<br />
|-<br />
| 5 || [5.0.0+] GetFirmwareVersionDigest<br />
|-<br />
| 7 || GetLockScreenFlag<br />
|-<br />
| 8 || SetLockScreenFlag<br />
|-<br />
| 9 || GetBacklightSettings<br />
|-<br />
| 10 || SetBacklightSettings<br />
|-<br />
| 11 || SetBluetoothDevicesSettings<br />
|-<br />
| 12 || GetBluetoothDevicesSettings<br />
|-<br />
| 13 || GetExternalSteadyClockSourceId<br />
|-<br />
| 14 || SetExternalSteadyClockSourceId<br />
|-<br />
| 15 || GetUserSystemClockContext<br />
|-<br />
| 16 || SetUserSystemClockContext<br />
|-<br />
| 17 || GetAccountSettings<br />
|-<br />
| 18 || SetAccountSettings<br />
|-<br />
| 19 || GetAudioVolume<br />
|-<br />
| 20 || SetAudioVolume<br />
|-<br />
| 21 || GetEulaVersions<br />
|-<br />
| 22 || SetEulaVersions<br />
|-<br />
| 23 || [[#GetColorSetId]]<br />
|-<br />
| 24 || [[#SetColorSetId]]<br />
|-<br />
| 25 || GetConsoleInformationUploadFlag<br />
|-<br />
| 26 || SetConsoleInformationUploadFlag<br />
|-<br />
| 27 || GetAutomaticApplicationDownloadFlag<br />
|-<br />
| 28 || SetAutomaticApplicationDownloadFlag<br />
|-<br />
| 29 || GetNotificationSettings<br />
|-<br />
| 30 || SetNotificationSettings<br />
|-<br />
| 31 || GetAccountNotificationSettings<br />
|-<br />
| 32 || SetAccountNotificationSettings<br />
|-<br />
| 35 || GetVibrationMasterVolume<br />
|-<br />
| 36 || SetVibrationMasterVolume<br />
|-<br />
| 37 || GetSettingsItemValueSize<br />
|-<br />
| 38 || [[#GetSettingsItemValue]]<br />
|-<br />
| 39 || GetTvSettings<br />
|-<br />
| 40 || SetTvSettings<br />
|-<br />
| 41 || GetEdid<br />
|-<br />
| 42 || SetEdid<br />
|-<br />
| 43 || GetAudioOutputMode<br />
|-<br />
| 44 || SetAudioOutputMode<br />
|-<br />
| 45 || IsForceMuteOnHeadphoneRemoved<br />
|-<br />
| 46 || SetForceMuteOnHeadphoneRemoved<br />
|-<br />
| 47 || [[#GetQuestFlag]]<br />
|-<br />
| 48 || SetQuestFlag<br />
|-<br />
| 49 || GetDataDeletionSettings<br />
|-<br />
| 50 || SetDataDeletionSettings<br />
|-<br />
| 51 || GetInitialSystemAppletProgramId<br />
|-<br />
| 52 || GetOverlayDispProgramId<br />
|-<br />
| 53 || GetDeviceTimeZoneLocationName<br />
|-<br />
| 54 || SetDeviceTimeZoneLocationName<br />
|-<br />
| 55 || GetWirelessCertificationFileSize<br />
|-<br />
| 56 || [[Flash_Filesystem#PRODINFOF|GetWirelessCertificationFile]]<br />
|-<br />
| 57 || SetRegionCode<br />
|-<br />
| 58 || GetNetworkSystemClockContext<br />
|-<br />
| 59 || SetNetworkSystemClockContext<br />
|-<br />
| 60 || IsUserSystemClockAutomaticCorrectionEnabled<br />
|-<br />
| 61 || SetUserSystemClockAutomaticCorrectionEnabled<br />
|-<br />
| 62 || [[#GetDebugModeFlag]]<br />
|-<br />
| 63 || GetPrimaryAlbumStorage<br />
|-<br />
| 64 || SetPrimaryAlbumStorage<br />
|-<br />
| 65 || GetUsb30EnableFlag<br />
|-<br />
| 66 || SetUsb30EnableFlag<br />
|-<br />
| 67 || GetBatteryLot<br />
|-<br />
| 68 || [[#GetSerialNumber]]<br />
|-<br />
| 69 || GetNfcEnableFlag<br />
|-<br />
| 70 || SetNfcEnableFlag<br />
|-<br />
| 71 || GetSleepSettings<br />
|-<br />
| 72 || SetSleepSettings<br />
|-<br />
| 73 || GetWirelessLanEnableFlag<br />
|-<br />
| 74 || SetWirelessLanEnableFlag<br />
|-<br />
| 75 || GetInitialLaunchSettings<br />
|-<br />
| 76 || SetInitialLaunchSettings<br />
|-<br />
| 77 || GetDeviceNickName<br />
|-<br />
| 78 || SetDeviceNickName<br />
|-<br />
| 79 || GetProductModel<br />
|-<br />
| 80 || GetLdnChannel<br />
|-<br />
| 81 || SetLdnChannel<br />
|-<br />
| 82 || AcquireTelemetryDirtyFlagEventHandle<br />
|-<br />
| 83 || GetTelemetryDirtyFlags<br />
|-<br />
| 84 || GetPtmBatteryLot<br />
|-<br />
| 85 || SetPtmBatteryLot<br />
|-<br />
| 86 || GetPtmFuelGaugeParameter<br />
|-<br />
| 87 || SetPtmFuelGaugeParameter<br />
|-<br />
| 88 || GetBluetoothEnableFlag<br />
|-<br />
| 89 || SetBluetoothEnableFlag<br />
|-<br />
| 90 || GetMiiAuthorId<br />
|-<br />
| 91 || SetShutdownRtcValue<br />
|-<br />
| 92 || GetShutdownRtcValue<br />
|-<br />
| 93 || AcquireFatalDirtyFlagEventHandle<br />
|-<br />
| 94 || GetFatalDirtyFlags<br />
|-<br />
| 95 || [2.0.0+] GetAutoUpdateEnableFlag<br />
|-<br />
| 96 || [2.0.0+] SetAutoUpdateEnableFlag<br />
|-<br />
| 97 || [2.0.0+] GetNxControllerSettings<br />
|-<br />
| 98 || [2.0.0+] SetNxControllerSettings<br />
|-<br />
| 99 || [2.0.0+] GetBatteryPercentageFlag<br />
|-<br />
| 100 || [2.0.0+] SetBatteryPercentageFlag<br />
|-<br />
| 101 || [2.0.0+] GetExternalRtcResetFlag<br />
|-<br />
| 102 || [2.0.0+] SetExternalRtcResetFlag<br />
|-<br />
| 103 || [3.0.0+] GetUsbFullKeyEnableFlag<br />
|-<br />
| 104 || [3.0.0+] SetUsbFullKeyEnableFlag<br />
|-<br />
| 105 || [3.0.0+] SetExternalSteadyClockInternalOffset<br />
|-<br />
| 106 || [3.0.0+] GetExternalSteadyClockInternalOffset<br />
|-<br />
| 107 || [3.0.0+] GetBacklightSettingsEx<br />
|-<br />
| 108 || [3.0.0+] SetBacklightSettingsEx<br />
|-<br />
| 109 || [3.0.0+] GetHeadphoneVolumeWarningCount<br />
|-<br />
| 110 || [3.0.0+] SetHeadphoneVolumeWarningCount<br />
|-<br />
| 111 || [3.0.0+] GetBluetoothAfhEnableFlag<br />
|-<br />
| 112 || [3.0.0+] SetBluetoothAfhEnableFlag<br />
|-<br />
| 113 || [3.0.0+] GetBluetoothBoostEnableFlag<br />
|-<br />
| 114 || [3.0.0+] SetBluetoothBoostEnableFlag<br />
|-<br />
| 115 || [3.0.0+] GetInRepairProcessEnableFlag<br />
|-<br />
| 116 || [3.0.0+] SetInRepairProcessEnableFlag<br />
|-<br />
| 117 || [3.0.0+] GetHeadphoneVolumeUpdateFlag<br />
|-<br />
| 118 || [3.0.0+] SetHeadphoneVolumeUpdateFlag<br />
|-<br />
| 119 || [3.0.0+] NeedsToUpdateHeadphoneVolume<br />
|-<br />
| 120 || [3.0.0+] GetPushNotificationActivityModeOnSleep<br />
|-<br />
| 121 || [3.0.0+] SetPushNotificationActivityModeOnSleep<br />
|-<br />
| 122 || [4.0.0+] [[#GetServiceDiscoveryControlSettings]]<br />
|-<br />
| 123 || [4.0.0+] SetServiceDiscoveryControlSettings<br />
|-<br />
| 124 || [4.0.0+] GetErrorReportSharePermission<br />
|-<br />
| 125 || [4.0.0+] SetErrorReportSharePermission<br />
|-<br />
| 126 || [4.0.0+] GetAppletLaunchFlags<br />
|-<br />
| 127 || [4.0.0+] SetAppletLaunchFlags<br />
|-<br />
| 128 || [4.0.0+] GetConsoleSixAxisSensorAccelerationBias<br />
|-<br />
| 129 || [4.0.0+] SetConsoleSixAxisSensorAccelerationBias<br />
|-<br />
| 130 || [4.0.0+] GetConsoleSixAxisSensorAngularVelocityBias<br />
|-<br />
| 131 || [4.0.0+] SetConsoleSixAxisSensorAngularVelocityBias<br />
|-<br />
| 132 || [4.0.0+] GetConsoleSixAxisSensorAccelerationGain<br />
|-<br />
| 133 || [4.0.0+] SetConsoleSixAxisSensorAccelerationGain<br />
|-<br />
| 134 || [4.0.0+] GetConsoleSixAxisSensorAngularVelocityGain<br />
|-<br />
| 135 || [4.0.0+] SetConsoleSixAxisSensorAngularVelocityGain<br />
|-<br />
| 136 || [4.0.0+] GetKeyboardLayout<br />
|-<br />
| 137 || [4.0.0+] SetKeyboardLayout<br />
|-<br />
| 138 || [4.0.0+] GetWebInspectorFlag<br />
|-<br />
| 139 || [4.0.0+] [[#GetAllowedSslHosts]]<br />
|-<br />
| 140 || [4.0.0+] GetHostFsMountPoint<br />
|-<br />
| 141 || [5.0.0+] GetRequiresRunRepairTimeReviser<br />
|-<br />
| 142 || [5.0.0+] SetRequiresRunRepairTimeReviser<br />
|-<br />
| 143 || [5.0.0+] SetBlePairingSettings<br />
|-<br />
| 144 || [5.0.0+] GetBlePairingSettings<br />
|-<br />
| 145 || [5.0.0+] GetConsoleSixAxisSensorAngularVelocityTimeBias<br />
|-<br />
| 146 || [5.0.0+] SetConsoleSixAxisSensorAngularVelocityTimeBias<br />
|-<br />
| 147 || [5.0.0+] GetConsoleSixAxisSensorAngularAcceleration<br />
|-<br />
| 148 || [5.0.0+] SetConsoleSixAxisSensorAngularAcceleration<br />
|-<br />
| 149 || [5.0.0+] GetRebootlessSystemUpdateVersion<br />
|}<br />
<br />
Official user-processes get a new service session handle each time a set:sys cmd is used, with the session being closed aftewards.<br />
<br />
== GetFirmwareVersion ==<br />
Takes a type-0x1A output buffer. User-processes use hard-coded size 0x100.<br />
<br />
If needed, reads the content of the [[System_Version_Title]] "/file" into state. This is only done once.<br />
<br />
Then the above 0x100-byte data is copied to the output buffer.<br />
<br />
== GetColorSetId ==<br />
No input, returns an output s32.<br />
<br />
This is the current Theme set by System Settings.<br />
<br />
* 0: "Basic White"<br />
* 1: "Basic Black"<br />
<br />
== SetColorSetId ==<br />
Takes an input s32, no output.<br />
<br />
== GetSettingsItemValue ==<br />
Takes two type-0x19 input buffers and a type-0x6 output buffer. Returns an output u64 for the actual size written to the outbuf.<br />
<br />
The outbuf_size is compared with the config_size. When config_size is larger than outbuf_size, outbuf_size is used for the memcpy, otherwise config_size is used. Afterwards the size used for the memcpy is written to output(see above).<br />
<br />
If loading from main config fails, it will also attempt to load config from various state if the input strings match hard-coded strings.<br />
<br />
== GetDebugModeFlag ==<br />
Returns an output u8.<br />
<br />
Loads the 1-byte config for <"settings_debug", "is_debug_mode_enabled">. If that fails, value 0x1 is written to output. This uses the same func as ReadSetting internally.<br />
<br />
Returned retval is always 0.<br />
<br />
== GetSerialNumber ==<br />
Returns the 0x18-byte SerialNumber string.<br />
<br />
== GetServiceDiscoveryControlSettings ==<br />
Returns 0x01 if [[Safemode|safemode]] needs to be launched.<br />
<br />
== GetAllowedSslHosts ==<br />
Takes a type-0x6 output buffer, returns an output s32. This buffer contains an array of 0x8-byte "nn::settings::system::AllowedSslHost" entries.<br />
<br />
== GetQuestFlag ==<br />
Gets a flag determining whether the console is a kiosk unit (codenamed "Quest"). Used by qlaunch to determine whether to launch Retail Interactive Display Menu.<br />
<br />
=System Config=<br />
There's a common config title (*818), and a config title for each [[SPL_services|HardwareType]].<br />
<br />
[5.0.0+] New config fields were added to the HardwareType-specific config:<br />
<br />
* "systeminitializer!eks_enabled" 1 for non-Mariko, 0 otherwise.<br />
* "systeminitializer!bct_eks_offset" Offset within the [[BCT]] where the [[Flash_Filesystem|keyblob]]/"EKS" is stored.<br />
* "systeminitializer!bct_version_offset" Offset within the [[BCT]] where the keyblob version is stored (bootloader0_info.version).<br />
* "systeminitializer!boot_image_update_type" 0 for non-Mariko, 1 otherwise.<br />
<br />
"bct_eks_offset" and "bct_version_offset" are only present in non-Mariko config, since (?) Mariko "eks_enabled" is 0. This presumably means the [[Flash_Filesystem|keyblob]]/"EKS" is not embedded in [[BCT]] with Mariko?<br />
<br />
[[Category:Services]]</div>
Thog
https://switchbrew.org/w/index.php?title=Error_codes&diff=4887
Error codes
2018-08-08T22:36:06Z
<p>Thog: </p>
<hr />
<div>= Structure =<br />
These have been redesigned from the 3DS so that they fit within a Aarch64 MOV instruction immediate most of the time (without requiring the additional MOVK).<br />
<br />
{| class=wikitable<br />
! Bits || Field<br />
|-<br />
| 8-0 || Module<br />
|-<br />
| 21-9 || Description<br />
|}<br />
<br />
When a fatal-error is received the error code is outputted using the following formatter:<br />
%04d-%04d<br />
<br />
.. where the first code is <code>2000 + Module</code>, and the other being <code>Description</code>. Bits >=22 from the error-code are unused when displaying fatal-errors, since the Description ends with bit21.<br />
<br />
= Modules =<br />
{| class=wikitable<br />
! Value || Name<br />
|-<br />
| 1 || Kernel<br />
|-<br />
| 2 || FS<br />
|-<br />
| 3 || OS (Memory, Thread, Mutex, NVIDIA)<br />
|-<br />
| 4 || HTCS<br />
|-<br />
| 5 || NCM<br />
|-<br />
| 6 || DD<br />
|-<br />
| 7 || Debug Monitor<br />
|-<br />
| 8 || LR<br />
|-<br />
| 9 || Loader<br />
|-<br />
| 10 || CMIF (IPC command interface)<br />
|-<br />
| 11 || HIPC (IPC)<br />
|-<br />
| 15 || PM<br />
|-<br />
| 16 || NS<br />
|-<br />
| 17 || Sockets<br />
|-<br />
| 18 || HTC<br />
|-<br />
| 20 || NCM Content<br />
|-<br />
| 21 || SM<br />
|-<br />
| 22 || RO userland<br />
|-<br />
| 24 || SDMMC<br />
|-<br />
| 25 || OVLN<br />
|-<br />
| 26 || SPL<br />
|-<br />
| 100 || ETHC<br />
|-<br />
| 101 || I2C<br />
|-<br />
| 102 || GPIO<br />
|-<br />
| 103 || UART<br />
|-<br />
| 105 || Settings<br />
|-<br />
| 107 || WLAN<br />
|-<br />
| 108 || XCD<br />
|-<br />
| 110 || NIFM<br />
|-<br />
| 111 || Hwopus<br />
|-<br />
| 113 || Bluetooth<br />
|-<br />
| 114 || VI<br />
|-<br />
| 115 || NFP<br />
|-<br />
| 116 || Time<br />
|-<br />
| 117 || FGM<br />
|-<br />
| 118 || OE<br />
|-<br />
| 120 || PCIe<br />
|-<br />
| 121 || Friends<br />
|-<br />
| 122 || BCAT<br />
|-<br />
| 123 || SSL<br />
|-<br />
| 124 || Account<br />
|-<br />
| 125 || News<br />
|-<br />
| 126 || Mii<br />
|-<br />
| 127 || NFC<br />
|-<br />
| 128 || AM<br />
|-<br />
| 129 || Play Report<br />
|-<br />
| 130 || AHID<br />
|-<br />
| 132 || Home Menu (Qlaunch)<br />
|-<br />
| 133 || PCV<br />
|-<br />
| 134 || OMM<br />
|-<br />
| 135 || BPC<br />
|-<br />
| 136 || PSM<br />
|-<br />
| 137 || NIM<br />
|-<br />
| 138 || PSC<br />
|-<br />
| 139 || TC<br />
|-<br />
| 140 || USB<br />
|-<br />
| 141 || NSD<br />
|-<br />
| 142 || PCTL<br />
|-<br />
| 143 || BTM<br />
|-<br />
| 144 || EC (Shop)<br />
|-<br />
| 145 || ETicket<br />
|-<br />
| 146 || NGC (Bad Words)<br />
|-<br />
| 147 || Error Report<br />
|-<br />
| 148 || APM<br />
|-<br />
| 150 || Profiler<br />
|-<br />
| 151 || Error Upload<br />
|-<br />
| 153 || Audio<br />
|-<br />
| 154 || NPNS<br />
|-<br />
| 155 || NPNS HTTP Stream<br />
|-<br />
| 157 || ARP<br />
|-<br />
| 158 || SWKBD<br />
|-<br />
| 159 || Boot<br />
|-<br />
| 161 || NFC Mifare<br />
|-<br />
| 162 || Userland assert<br />
|-<br />
| 163 || Fatal<br />
|-<br />
| 164 || NIM Shop<br />
|-<br />
| 165 || SPSM<br />
|-<br />
| 167 || BGTC<br />
|-<br />
| 168 || Userland crash<br />
|-<br />
| 180 || SREPO<br />
|-<br />
| 181 || Dauth<br />
|-<br />
| 202 || HID<br />
|-<br />
| 203 || LDN<br />
|-<br />
| 205 || Irsensor<br />
|-<br />
| 206 || Capture<br />
|-<br />
| 208 || Manu<br />
|-<br />
| 209 || ATK<br />
|-<br />
| 210 || Web<br />
|-<br />
| 211 ||<br />
|-<br />
| 212 || GRC<br />
|-<br />
| 216 || Migration<br />
|-<br />
| 217 || Migration Idc Server<br />
|-<br />
| 345 || libnx<br />
|-<br />
| 346 || [[Homebrew ABI]]<br />
|-<br />
| 347 || Homebrew Loader<br />
|-<br />
| 348 || libnx Nvidia errors<br />
|-<br />
| 800 || [[Internet_Browser|General web-applet]]<br />
|-<br />
| 809 || [[Internet_Browser|WifiWebAuthApplet]]<br />
|-<br />
| 810 || [[Internet_Browser|Whitelisted-applet]]<br />
|-<br />
| 811 || [[Internet_Browser|ShopN]]<br />
|}<br />
<br />
8XX is for/includes system applets.<br />
<br />
= Error codes =<br />
{| class=wikitable<br />
! Value || Module || Description || Notes<br />
|-<br />
| 0x1C01 || 1 || 14 || Invalid kernel capability descriptor<br />
|-<br />
| 0x4201 || 1 || 33 || [[SPL_services#GetConfig|IsDebugMode]] isn't set.<br />
|-<br />
| 0x8C01 || 1 || 70 || No more debug events<br />
|-<br />
| 0xCA01 || 1 || 101 || Invalid size<br />
|-<br />
| 0xCC01 || 1 || 102 || Invalid address<br />
|-<br />
| 0xCE01 || 1 || 103 || Slabheap full<br />
|-<br />
| 0xD001 || 1 || 104 || Memory full<br />
|-<br />
| 0xD201 || 1 || 105 || Handle-table full.<br />
|-<br />
| 0xD401 || 1 || 106 || Invalid memory state / invalid memory permissions.<br />
|-<br />
| 0xD801 || 1 || 108 || Invalid memory permissions.<br />
|-<br />
| 0xDC01 || 1 || 110 || Invalid memory range<br />
|-<br />
| 0xE001 || 1 || 112 || Invalid thread priority.<br />
|-<br />
| 0xE201 || 1 || 113 || Invalid processor id.<br />
|-<br />
| 0xE401 || 1 || 114 || Invalid handle.<br />
|-<br />
| 0xE601 || 1 || 115 || Syscall copy from user failed.<br />
|-<br />
| 0xE801 || 1 || 116 || Invalid combination<br />
|-<br />
| 0xEA01 || 1 || 117 || Time out. Also when you give 0 handles to svcWaitSynchronizationN.<br />
|-<br />
| 0xEC01 || 1 || 118 || Canceled/interrupted [?]<br />
|-<br />
| 0xEE01 || 1 || 119 || Exceeding maximum<br />
|-<br />
| 0xF001 || 1 || 120 || Invalid enum<br />
|-<br />
| 0xF201 || 1 || 121 || No such entry<br />
|-<br />
| 0xF401 || 1 || 122 || Irq/DeviceAddressSpace/{...} already registered<br />
|-<br />
| 0xF601 || 1 || 123 || Port remote dead<br />
|-<br />
| 0xF801 || 1 || 124 || [Usermode] Unhandled interrupt<br />
|-<br />
| 0xFA01 || 1 || 125 || Wrong memory permission?<br />
|-<br />
| 0xFC01 || 1 || 126 || Reserved value<br />
|-<br />
| 0xFE01 || 1 || 127 || Invalid hardware breakpoint<br />
|-<br />
| 0x10001 || 1 || 128 || [Usermode] Fatal exception<br />
|-<br />
| 0x10201 || 1 || 129 || Last thread didn't belong to your process<br />
|-<br />
| 0x10601 || 1 || 131 || Port max sessions exceeded<br />
|-<br />
| 0x10801 || 1 || 132 || Resource limit exceeded<br />
|-<br />
| 0x20801 || 1 || 260 || Command buffer too small<br />
|-<br />
| 0x41001 || 1 || 520 || Process not being debugged<br />
|-<br />
| 0x402 || 2 || 2 || Directory/file(?) already exists.<br />
|-<br />
| 0xE02 || 2 || 7 || Savedata [[Filesystem_services|already]] mounted<br />
|-<br />
| 0x7802 || 2 || 60 || The specified [[NCA]]-type doesn't exist for this title.<br />
|-<br />
| 0x7D202 || 2 || 1001 || Process does not have RomFs <br />
|-<br />
| 0x7D402 || 2 || 1002 || Title-id not found / savedata not found.<br />
|-<br />
| 0xFA202 || 2 || 2001 || SD card not inserted<br />
|-<br />
| 0x13B002 || 2 || 2520 || Gamecard not inserted<br />
|-<br />
| 0x13DA02 || 2 || 2541 || Version check failed when mounting gamecard sysupdate partition?<br />
|-<br />
| 0x171402 || 2 || 2954 || Invalid gamecard handle.<br />
|-<br />
| 0x196002 || 2 || 3248 || Out of memory<br />
|-<br />
| 0x196202 || 2 || 3249 || Out of memory<br />
|-<br />
| 0x1A4A02 || 2 || 3365 || Out of memory<br />
|-<br />
| 0x235202 || 2 || 4521 || Invalid NCA Key index<br />
|-<br />
| 0x235E02 || 2 || 4527 || NCA-path used with the wrong titleID.<br />
|-<br />
| 0x250E02 || 2 || 4743 || [[NAX0|Corrupted]] NAX0 header.<br />
|-<br />
| 0x251002 || 2 || 4744 || Invalid [[NAX0]] magicnum.<br />
|-<br />
| 0x296A02 || 2 || 5301 || Mountpoint not found<br />
|-<br />
| 0x2EE202 || 2 || 6001 || Invalid input<br />
|-<br />
| 0x2EE602 || 2 || 6003 || Path too long<br />
|-<br />
| 0x2EEA02 || 2 || 6005 || Invalid directory path.<br />
|-<br />
| 0x2F5A02 || 2 || 6061 || Offset outside storage<br />
|-<br />
| 0x313802 || 2 || 6300 || Operation not supported<br />
|-<br />
| 0x320002 || 2 || 6400 || Permission denied<br />
|-<br />
| 0x326602 || 2 || 6451 || Missing titlekey(?) required to mount content<br />
|-<br />
| 0x3EA03 || 3 || 501 || Invalid handle<br />
|-<br />
| 0x3EE03 || 3 || 503 || Invalid memory mirror<br />
|-<br />
| 0x7FE03 || 3 || 1023 || TLS slot is not allocated<br />
|-<br />
| 0xA05 || 5 || 5 || [[Content_Manager_services|NcaID]] not found. Returned when attempting to mount titles which exist that aren't *8XX titles, the same way *8XX titles are mounted.<br />
|-<br />
| 0xE05 || 5 || 7 || TitleId not found<br />
|-<br />
| 0x1805 || 5 || 12 || Invalid StorageId<br />
|-<br />
| 0xDC05 || 5 || 110 || Gamecard not inserted<br />
|-<br />
| 0x17C05 || 5 || 190 || Gamecard not initialized<br />
|-<br />
| 0x1F405 || 5 || 250 || Sdcard not inserted<br />
|-<br />
| 0x20805 || 5 || 260 || Storage not mounted<br />
|-<br />
| 0x806 || 6 || 4 || Converted from error 0xD401<br />
|-<br />
| 0x1006 || 6 || 8 || Converted from error 0xE401<br />
|-<br />
| 0x408 || 8 || 2 || Program location entry not found<br />
|-<br />
| 0x608 || 8 || 3 || Invalid context for control location<br />
|-<br />
| 0x808 || 8 || 4 || Storage not found<br />
|-<br />
| 0xA08 || 8 || 5 || Access denied<br />
|-<br />
| 0xC08 || 8 || 6 || Offline manual HTML location entry not found<br />
|-<br />
| 0xE08 || 8 || 7 || Title is not registered<br />
|-<br />
| 0x1008 || 8 || 8 || Control location entry for host not found<br />
|-<br />
| 0x1208 || 8 || 9 || Legal info HTML location entry not found<br />
|-<br />
| 0x209 || 9 || 1 || Args too long.<br />
|-<br />
| 0x409 || 9 || 2 || Maximum processes loaded.<br />
|-<br />
| 0x609 || 9 || 3 || NPDM too big.<br />
|-<br />
| 0x19009 || 9 || 200 || Invalid access control sizes in NPDM.<br />
|-<br />
| 0x809 || 9 || 4 || Invalid NPDM.<br />
|-<br />
| 0xA09 || 9 || 5 || Invalid files.<br />
|-<br />
| 0xE09 || 9 || 7 || Already registered.<br />
|-<br />
| 0x1009 || 9 || 8 || Title not found.<br />
|-<br />
| 0x1209 || 9 || 9 || Title-id in ACI0 doesn't match range in ACID.<br />
|-<br />
| 0x6609 || 9 || 51 || Invalid memory state/permission<br />
|-<br />
| 0x6A09 || 9 || 53 || Invalid NRR<br />
|-<br />
| 0xA209 || 9 || 81 || Unaligned NRR address<br />
|-<br />
| 0xA409 || 9 || 82 || Bad NRR size<br />
|-<br />
| 0xAA09 || 9 || 85 || Bad NRR address<br />
|-<br />
| 0xAE09 || 9 || 87 || Bad initialization<br />
|-<br />
| 0xC809 || 9 || 100 || Unknown ACI0 descriptor<br />
|-<br />
| 0xCE09 || 9 || 103 || ACID/ACI0 don't match for descriptor "KernelFlags"<br />
|-<br />
| 0xD009 || 9 || 104 || ACID/ACI0 don't match for descriptor "SyscallMask"<br />
|-<br />
| 0xD409 || 9 || 106 || ACID/ACI0 don't match for descriptor "MapIoOrNormalRange"<br />
|-<br />
| 0xD609 || 9 || 107 || ACID/ACI0 don't match for descriptor "MapNormalPage"<br />
|-<br />
| 0xDE09 || 9 || 111 || ACID/ACI0 don't match for descriptor "InterruptPair"<br />
|-<br />
| 0xE209 || 9 || 113 || ACID/ACI0 don't match for descriptor "ApplicationType"<br />
|-<br />
| 0xE409 || 9 || 114 || ACID/ACI0 don't match for descriptor "KernelReleaseVersion"<br />
|-<br />
| 0xE609 || 9 || 115 || ACID/ACI0 don't match for descriptor "HandleTableSize"<br />
|-<br />
| 0xE809 || 9 || 116 || ACID/ACI0 don't match for descriptor "DebugFlags"<br />
|-<br />
| 0x1A80A || 10 || 212 || Bad magic (expected 'SFCO')<br />
|-<br />
| 0x20B || 11 || 1 || Size too big to fit to marshal.<br />
|-<br />
| 0x11A0B || 11 || 141 || Went past maximum during marshalling.<br />
|-<br />
| 0x1900B || 11 || 200 || Session doesn't support domains.<br />
|-<br />
| 0x25A0B || 11 || 301 || Remote process is dead.<br />
|-<br />
| 0x3D60B || 11 || 491 || IPC Query 1 failed.<br />
|-<br />
| 0x20F || 15 || 1 || Pid not found<br />
|-<br />
| 0x60F || 15 || 3 || Process has no pending events<br />
|-<br />
| 0xA0F || 15 || 5 || Application already running<br />
|-<br />
| 0x410 || 16 || 2 || Title-id not found<br />
|-<br />
| 0xF010 || 16 || 120 || Gamecard sysupdate not required<br />
|-<br />
| 0x1F610 || 16 || 251 || Unexpected StorageId<br />
|-<br />
| 0x415 || 21 || 2 || Not initialized.<br />
|-<br />
| 0x615 || 21 || 3 || Max sessions<br />
|-<br />
| 0xC15 || 21 || 6 || Invalid name (all zeroes)<br />
|-<br />
| 0x1015 || 21 || 8 || Permission denied<br />
|-<br />
| 0x416 || 22 || 2 || Address space is full<br />
|-<br />
| 0x616 || 22 || 3 || NRO already loaded<br />
|-<br />
| 0x816 || 22 || 4 || Invalid NRO header values<br />
|-<br />
| 0xC16 || 22 || 6 || Bad NRR magic<br />
|-<br />
| 0x1016 || 22 || 8 || Reached max NRR count<br />
|-<br />
| 0x1216 || 22 || 9 || Unable to verify NRO hash or NRR signature<br />
|-<br />
| 0x80216 || 22 || 1025 || Address not page-aligned<br />
|-<br />
| 0x80416 || 22 || 1026 || Incorrect NRO size<br />
|-<br />
| 0x80816 || 22 || 1028 || NRO not loaded<br />
|-<br />
| 0x80A16 || 22 || 1029 || NRR not loaded<br />
|-<br />
| 0x80C16 || 22 || 1030 || Already initialized<br />
|-<br />
| 0x80E16 || 22 || 1031 || Not initialized<br />
|-<br />
| 0x41A || 26 || 2 || Argument is invalid<br />
|-<br />
| 0xC81A || 26 || 100 || Incorrect buffer size<br />
|-<br />
| 0xCA1A || 26 || 101 || Unknown TZ error<br />
|-<br />
| 0xD01A || 26 || 104 || All AES engines busy<br />
|-<br />
| 0xD21A || 26 || 105 || Invalid AES engine-id<br />
|-<br />
| 0x19669 || 105 || 203 || Setting value cannot be NULL<br />
|-<br />
| 0x1BA69 || 105 || 221 || Setting group name has zero length<br />
|-<br />
| 0x1E269 || 105 || 241 || Setting group name is too long (64 character limit?)<br />
|-<br />
| 0x1E469 || 105 || 242 || Setting name is too long (64 character limit?)<br />
|-<br />
| 0x20A69 || 105 || 261 || Setting group name ends with '.' or contains invalid characters (allowed: [a-z0-9_\-.])<br />
|-<br />
| 0x20C69 || 105 || 262 || Setting name ends with '.' or contains invalid characters (allowed: [a-z0-9_\-.])<br />
|-<br />
| 0x272 || 114 || 1 || Generic error<br />
|-<br />
| 0xCC74 || 116 || 102 || Time not set<br />
|-<br />
| 0x287C || 124 || 20 || Argument is NULL<br />
|-<br />
| 0x2C7C || 124 || 22 || Argument is invalid<br />
|-<br />
| 0x3C7C || 124 || 30 || Bad input buffer size<br />
|-<br />
| 0x407C || 124 || 32 || Invalid input buffer<br />
|-<br />
| 0x3EC80 || 128 || 502 || must close IStorageAccessor before pushing IStorage<br />
|-<br />
| 0x7A880 || 128 || 980 || <code>am.debug!dev_function</code> setting needs to be set<br />
|-<br />
| 0x3CF089 || 137 || 7800 || Unknown/invalid libcurl error.<br />
|-<br />
| 0x3E8289-0x3F4089 || 137 || 8001-8096 || libcurl error 1-96. Some of the libcurl errors in the error-table map to the above unknown-libcurl-error however.<br />
|-<br />
| 0x68A || 138 || 3 || Not initialized.<br />
|-<br />
| 0x668C || 140 || 51 || USB data-transfer in progress<br />
|-<br />
| 0xD48C || 140 || 106 || Invalid descriptor<br />
|-<br />
| 0x1928C || 140 || 201 || USB device not bound / interface already enabled<br />
|-<br />
| 0x299 || 153 || 1 || Invalid audio device<br />
|-<br />
| 0x499 || 153 || 2 || Invalid buffer address<br />
|-<br />
| 0x699 || 153 || 3 || Invalid sample rate<br />
|-<br />
| 0x1499 || 153 || 10 || Invalid channel count<br />
|-<br />
| 0xC0899 || 153 || 1540 || Audio output was already started<br />
|-<br />
| 0x3C9D || 157 || 30 || Address is NULL<br />
|-<br />
| 0x3E9D || 157 || 31 || PID is NULL<br />
|-<br />
| 0x549D || 157 || 42 || Already bound<br />
|-<br />
| 0xCC9D || 157 || 102 || Invalid PID<br />
|-<br />
| 0xF0CD || 205 || 120 || IR image data not available/ready.<br />
|-<br />
| 0x35B || 347 || 1 || Failed to init SM.<br />
|-<br />
| 0x55B || 347 || 2 || Failed to init FS.<br />
|-<br />
| 0x75B || 347 || 3 || Failed to to open NRO file. May also happen when SD card isn't inserted / SD mounting failed earlier.<br />
|-<br />
| 0x95B || 347 || 4 || Failed to read NRO header.<br />
|-<br />
| 0xB5B || 347 || 5 || Invalid NRO magic.<br />
|-<br />
| 0xD5B || 347 || 6 || Invalid NRO segments.<br />
|-<br />
| 0xF5B || 347 || 7 || Failed to read NRO.<br />
|-<br />
| 0x135B || 347 || 9 || Failed to allocate heap.<br />
|-<br />
| 0x255B || 347 || 18 || Failed to map code-binary memory.<br />
|-<br />
| 0x275B || 347 || 19 || Failed to map code memory (.text).<br />
|-<br />
| 0x295B || 347 || 20 || Failed to map code memory (.rodata).<br />
|-<br />
| 0x2B5B || 347 || 21 || Failed to map code memory (.data+.bss).<br />
|-<br />
| 0x315B || 347 || 24 || Failed to unmap code memory (.text).<br />
|-<br />
| 0x335B || 347 || 25 || Failed to unmap code memory (.rodata).<br />
|-<br />
| 0x355B || 347 || 26 || Failed to unmap code memory (.data+.bss).<br />
|}<br />
<br />
== FS Error Codes ==<br />
The following are the error codes recognized by nn::fs::detail::LogErrorMessage found in some [[Factory Setup|factory]] titles:<br />
<br />
{| class=wikitable<br />
! Value || Description || Message<br />
|-<br />
| 0x7802 || 60 || Error: Specified mount name already exists.<br />
|-<br />
| 0xD401 || 106 || Error: Passed buffer is not usable for fs library.<br />
|-<br />
| 0x7D202 || 1001 || Error: Specified partition is not found.<br />
|-<br />
| 0x7D402 || 1002 || Error: Specified target is not found.<br />
|-<br />
| 0xFA002 - 0x138602 || 2000 - 2499 || Error: Failed to access SD card.<br />
|-<br />
| 0x136802 - 0x176E02 || 2500 - 2999 || Error: Failed to access game card.<br />
|-<br />
| 0x177202 || 3001 || Error: Specified operation is not implemented.<br />
|-<br />
| 0x177A02 || 3005 || Error: Specified value is out of range.<br />
|-<br />
| 0x1B5802 - 0x1F3E02 || 3500 - 3999 || Error: Failed to access MMC.<br />
|-<br />
| 0x1F4202 - 0x219602 || 4001 - 4299 || Error: ROM is corrupted.<br />
|-<br />
| 0x219A02 - 0x232602 || 4301 - 4499 || Error: Save data is corrupted.<br />
|-<br />
| 0x232A02 - 0x23EE02 || 4501 - 4599 || Error: NCA is corrupted.<br />
|-<br />
| 0x23F202 - 0x243E02 || 4601 - 4639 || Error: Integrity verification failed.<br />
|-<br />
| 0x244202 - 0x246602 || 4641 - 4659 || Error: Partition FS is corrupted.<br />
|-<br />
| 0x246A02 - 0x248E02 || 4661 - 4679 || Error: Built-in-storage is corrupted.<br />
|-<br />
| 0x249202 - 0x24B602 || 4681 - 4699 || Error: FAT FS is corrupted.<br />
|-<br />
| 0x24BA02 - 0x24DE02 || 4701 - 4719 || Error: HOST FS is corrupted.<br />
|-<br />
| 0x1F4002 - 0x270E02 || 4000, 4300, 4500, 4600, 4640, 4660, 4680, 4700, 4720-4999 || Error: Data is corrupted.<br />
|-<br />
| 0x271002 - 0x2EDE02 || 5000-5999 || Error: Unexpected failure occurred.<br />
|-<br />
| 0x2EE402 - 0x2F1A02 || 6002-6029 || Error: Invalid path was specified.<br />
|-<br />
| 0x2F5A02 || 6061 || Error: Invalid offset was specified.<br />
|-<br />
| 0x2F5C02 || 6062 || Error: Invalid size was specified.<br />
|-<br />
| 0x2F5E02 || 6063 || Error: Null pointer argument was specified.<br />
|-<br />
| 0x2EE002 || 6000 || Error: Precondition violation.<br />
|-<br />
| 0x2EE202 - 0x306E02 || 6001-6199 || Error: Invalid argument was specified.<br />
|-<br />
| 0x307202 || 6201 || Error: OpenMode_AllowAppend is required for implicit extension of file size by WriteFile().<br />
|-<br />
| 0x307002 - 0x313602 || 6200, 6202 - 6299 || Error: Invalid operation for the open mode.<br />
|-<br />
| 0x313802 - 0x31FE02 || 6300-6399 || Error: Unsupported operation.<br />
|-<br />
| 0x320002 - 0x32C602 || 6400-6499 || Error: Permission denied.<br />
|-<br />
| 0x346402 || 6706 || Error: Enough journal space is not left.<br />
|-<br />
| 0x346A02 || 6709 || Error: The open count of files and directories reached the limitation.<br />
|}<br />
<br />
= Fatal Errors =<br />
{| class=wikitable<br />
! Error || Description<br />
|-<br />
| 2162-0002<br />
| Can be triggered by running [[SVC|svcBreak]]. The svcBreak params have no affect on the value of the thrown error-code.<br />
|-<br />
| 2168-0000<br />
| Userland ARM undefined instruction exception<br />
|-<br />
| 2168-0001<br />
| Userland ARM prefetch-abort due to PC set to non-executable region<br />
|-<br />
| 2168-0002<br />
| Userland ARM data abort. Also caused by abnormal process termination via [[SVC|svcExitProcess]]. Note: directly jumping to nnMain()-retaddr from non-main-thread has the same result.<br />
|-<br />
| 2168-0003<br />
| Userland PC address not aligned to 4 bytes<br />
|-<br />
| 2168-0008<br />
| Can occur when attempting to call an svc outside the whitelist<br />
|}<br />
<br />
= Support Errors =<br />
{| class=wikitable<br />
! Error || Module || Description || Notes<br />
|-<br />
| <br />
| {web-applets listed above}<br />
| 2750<br />
| MP4 parsing failed.<br />
|}<br />
<br />
Normal error-codes displayed by the system also use the same format as fatal-errors.</div>
Thog
https://switchbrew.org/w/index.php?title=Software_Keyboard&diff=4874
Software Keyboard
2018-08-03T09:48:02Z
<p>Thog: </p>
<hr />
<div>The software keyboard expects to be passed three [[AM_services#IStorage|IStorage]]s via [[AM_services#ILibraryAppletAccessor|PushInData]].<br />
<br />
== Common Arguments ==<br />
<br />
The first IStorage passed to this applet should contain the common library applet arguments. This is populated by <code>nn::la::CommonArgumentsWriter</code> and has the following format.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Typical Value || Notes <br />
|-<br />
| 0x0 || 4 || 1 || Common Arguments version<br />
|-<br />
| 0x4 || 4 || 0x20 || Common Arguments size<br />
|-<br />
| 0x8 || 4 || 5 || Library applet version (some kind of API version?)<br />
|-<br />
| 0xC || 4 || 0 || Theme color<br />
|-<br />
| 0x10 || 1 || 0 || Play startup sound<br />
|-<br />
| 0x18 || 8 || N/A || System tick (see [[SVC#svcGetSystemTick|svcGetSystemTick]])<br />
|-<br />
| 0x20 || || || End of struct<br />
|}<br />
<br />
== KeyboardConfig ==<br />
<br />
The second IStorage passed to this applet should contain the configuration for the keyboard.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Typical Value || Notes <br />
|-<br />
| 0x0 || 4 || 2 ||<br />
|-<br />
| 0x4 || 18 || u"OK" || UTF-16 text displayed in the submit button<br />
|-<br />
| 0x16 || 2 || 0 || UTF-16 "left optional symbol key"<br />
|-<br />
| 0x18 || 2 || 0 || UTF-16 "right optional symbol key"<br />
|-<br />
| 0x1A || 1 || 0 ||<br />
|-<br />
| 0x1C || 4 || 0 || Key set disable bitmask<br />
|-<br />
| 0x20 || 4 || 1 || Initial cursor position (0 = start of string, 1 = end of string)<br />
|-<br />
| 0x24 || 130 || u"" || UTF-16 header text<br />
|-<br />
| 0xA6 || 258 || u"" || UTF-16 sub text<br />
|-<br />
| 0x1A8 || 514 || u"" || UTF-16 guide text<br />
|-<br />
| 0x3AC || 4 || 0 || String length limit (defaults to 500?)<br />
|-<br />
| 0x3B0 || 4 || 0 ||<br />
|-<br />
| 0x3B4 || 4 || 0 || Password flag (0 = not password, 1 = password)<br />
|-<br />
| 0x3B8 || 4 || 1 ||<br />
|-<br />
| 0x3BC || 2 || 1 ||<br />
|-<br />
| 0x3BE || 1 || 1 || Draw background (0 = no, 1 = yes)<br />
|-<br />
| 0x3C0 || 4 || 20 || Offset of initial string in work buffer (or 0)<br />
|-<br />
| 0x3C4 || 4 || 0 || Size of initial string in work buffer (bytes)<br />
|-<br />
| 0x3C8 || 4 || 2024 || Offset of user dictionary in work buffer (or 0)<br />
|-<br />
| 0x3CC || 4 || 0 || Length of user dictionary (number of entries)<br />
|-<br />
| 0x3D0 || 1 || 0 || [[#Text check]] enable<br />
|-<br />
| 0x3D8 || 8 || 0 || [[#Text check]] callback function address. Not sure why this is included here<br />
|-<br />
| 0x3E0 || || || End of struct<br />
|}<br />
<br />
If the length limit is <= 32, the text entry box will be a single row and show the header/sub text. Otherwise, it will use multiple rows and the header/sub text will not be shown.<br />
<br />
Each entry in the user dictionary is 100 bytes long.<br />
<br />
=== Key Set Disable Bitmask ===<br />
<br />
Various bits in this field disable certain keys on the keyboard. This list is incomplete.<br />
<br />
<pre><br />
0x02: disable ' '<br />
0x04: disable '@'<br />
0x08: disable '%'<br />
0x10: disable '\' and '/'<br />
0x40: disable numbers<br />
0x80: used for download codes<br />
</pre><br />
<br />
== Work Buffer ==<br />
<br />
This is the third IStorage passed to this applet. It is a transfer memory storage. The transfer memory should have size 0x1000 (0xd000 in certain cases) and permissions 0.<br />
<br />
The layout of the work buffer doesn't seem to matter as long as the offsets in the [[#KeyboardConfig]] are adjusted, but official code lays it out like this.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Notes <br />
|-<br />
| 20 (decimal) || Unknown || UTF-16 initial string<br />
|-<br />
| 2024 (decimal) || Unknown || User dictionary<br />
|}<br />
<br />
== Text Check ==<br />
<br />
If text checking is enabled in [[#KeyboardConfig]], text will be checked when the submit button is pressed. First, swkbd sends the text via PushInteractiveOutData.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Notes <br />
|-<br />
| 0x0 || 0x4 || Buffer size<br />
|-<br />
| 0x4 || Variable || UTF-16 text<br />
|-<br />
| 0x7d4 || || Size of storage<br />
|}<br />
<br />
The application then has an opportunity to validate or reject the text. It creates a new IStorage, writes the response to it, and sends it via PushInteractiveInData.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Notes <br />
|-<br />
| 0x0 || 0x4 || Status (0 = OK, 1 = bad)<br />
|-<br />
| 0x4 || Variable || UTF-16 error message (shown in a dialog box)<br />
|-<br />
| 0x7d4 || || Size of storage<br />
|}<br />
<br />
== Output ==<br />
<br />
When either the submit button is pressed and input has been validated, or the user cancels the text entry, swkbd will push its response and exit. The response IStorage has the following format.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Notes <br />
|-<br />
| 0x0 || 0x4 || Result code (0 = OK, 1 = Cancel)<br />
|-<br />
| 0x4 || Variable || UTF-16 text<br />
|-<br />
| 0x7d8 || || Size of storage<br />
|}</div>
Thog
https://switchbrew.org/w/index.php?title=PCV_services&diff=4855
PCV services
2018-07-30T11:36:11Z
<p>Thog: Fix cmdid of ToPosixTime and ToPosixTimeWithMyRule</p>
<hr />
<div>= bpc =<br />
This is "nn::bpc::IBoardPowerControlManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || ShutdownSystem<br />
|-<br />
| 1 || RebootSystem<br />
|-<br />
| 2 || GetWakeupReason<br />
|-<br />
| 3 || GetShutdownReason<br />
|-<br />
| 4 || GetAcOk<br />
|-<br />
| 5 || GetBoardPowerControlEvent<br />
|-<br />
| 6 || GetSleepButtonState<br />
|-<br />
| 7 || GetPowerEvent<br />
|-<br />
| 8 ||<br />
|-<br />
| 9 ||<br />
|-<br />
| 10 ||<br />
|}<br />
<br />
= bpc:r =<br />
This is "nn::bpc::IRtcManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || GetExternalRtcValue<br />
|-<br />
| 1 || SetExternalRtcValue<br />
|-<br />
| 2 || ReadExternalRtcResetFlag<br />
|-<br />
| 3 || ClearExternalRtcResetFlag<br />
|}<br />
<br />
GetExternalRtcValue / SetExternalRtcValue directly accesses the max77620_rtc0 device.<br />
<br />
= pcv =<br />
This is "nn::pcv::detail::IPcvService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || SetPowerEnabled<br />
|-<br />
| 1 || SetClockEnabled<br />
|-<br />
| 2 || SetClockRate<br />
|-<br />
| 3 || GetClockRate<br />
|-<br />
| 4 || GetState<br />
|-<br />
| 5 || GetPossibleClockRates<br />
|-<br />
| 6 || SetMinVClockRate<br />
|-<br />
| 7 || SetReset<br />
|-<br />
| 8 || SetVoltageEnabled<br />
|-<br />
| 9 || GetVoltageEnabled<br />
|-<br />
| 10 || GetVoltageRange<br />
|-<br />
| 11 || SetVoltageValue<br />
|-<br />
| 12 || GetVoltageValue<br />
|-<br />
| 13 || GetTemperatureThresholds<br />
|-<br />
| 14 || SetTemperature<br />
|-<br />
| 15 || Initialize<br />
|-<br />
| 16 || IsInitialized<br />
|-<br />
| 17 || Finalize<br />
|-<br />
| 18 || PowerOn<br />
|-<br />
| 19 || PowerOff<br />
|-<br />
| 20 || ChangeVoltage<br />
|-<br />
| 21 || GetPowerClockInfoEvent<br />
|-<br />
| 22 || GetOscillatorClock<br />
|-<br />
| 23 || GetDvfsTable<br />
|-<br />
| 24 || GetModuleStateTable<br />
|-<br />
| 25 || GetPowerDomainStateTable<br />
|-<br />
| 26 || GetFuseInfo<br />
|-<br />
|}<br />
<br />
== User Name to Block Maps ==<br />
<br />
=== Power Switch / Clocking / Reset ===<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Name || Block || Rail || Notes<br />
|-<br />
| 0 || CpuBus || vdd_cpu ||<br />
|-<br />
| 1 || GPU || vdd_gpu ||<br />
|-<br />
| 2 || I2S1 || vdd_soc ||<br />
|-<br />
| 3 || I2S2 || vdd_soc ||<br />
|-<br />
| 4 || I2S3 || vdd_soc ||<br />
|-<br />
| 5 || PWM || vdd_soc ||<br />
|-<br />
| 6 || I2C1 || vdd_soc ||<br />
|-<br />
| 7 || I2C2 || vdd_soc ||<br />
|-<br />
| 8 || I2C3 || vdd_soc ||<br />
|-<br />
| 9 || I2C4 || vdd_soc ||<br />
|-<br />
| 10 || I2C5 || vdd_soc ||<br />
|-<br />
| 11 || I2C6 || vdd_soc ||<br />
|-<br />
| 12 || SPI1 || vdd_soc ||<br />
|-<br />
| 13 || SPI2 || vdd_soc ||<br />
|-<br />
| 14 || SPI3 || vdd_soc ||<br />
|-<br />
| 15 || SPI4 || vdd_soc ||<br />
|-<br />
| 16 || DISP1 || vdd_soc ||<br />
|-<br />
| 17 || DISP2 || vdd_soc ||<br />
|-<br />
| 20 || SDMMC1 || vdd_soc ||<br />
|-<br />
| 21 || SDMMC2 || vdd_soc ||<br />
|-<br />
| 22 || SDMMC3 || vdd_soc ||<br />
|-<br />
| 23 || SDMMC4 || vdd_soc ||<br />
|-<br />
| 24 || - || - || Not actual block. Used for debug and stuff.<br />
|-<br />
| 25 || CSITE || vdd_soc ||<br />
|-<br />
| 26 || TSEC || vdd_soc ||<br />
|-<br />
| 27 || MSELECT || vdd_soc ||<br />
|-<br />
| 28 || HDA2CODEC_2X || vdd_soc ||<br />
|-<br />
| 29 || ACTMON || vdd_soc ||<br />
|-<br />
| 30 || I2C_SLOW || vdd_soc ||<br />
|-<br />
| 31 || SOR1 || vdd_soc ||<br />
|-<br />
| 33 || HDA || vdd_soc ||<br />
|-<br />
| 34 || XUSB_CORE_HOST || vdd_soc ||<br />
|-<br />
| 35 || XUSB_FALCON || vdd_soc ||<br />
|-<br />
| 36 || XUSB_FS || vdd_soc ||<br />
|-<br />
| 37 || XUSB_CORE_DEV || vdd_soc ||<br />
|-<br />
| 38 || XUSB_SS_HOSTDEV || vdd_soc ||<br />
|-<br />
| 39 || UARTA || vdd_soc ||<br />
|-<br />
| 40 || UARTB || vdd_soc ||<br />
|-<br />
| 41 || UARTC || vdd_soc ||<br />
|-<br />
| 42 || UARTD || vdd_soc ||<br />
|-<br />
| 43 || HOST1X || vdd_soc ||<br />
|-<br />
| 44 || ENTROPY || vdd_soc ||<br />
|-<br />
| 45 || SOC_THERM || vdd_soc ||<br />
|-<br />
| 46 || VIC || vdd_soc ||<br />
|-<br />
| 47 || NVENC || vdd_soc ||<br />
|-<br />
| 48 || NVJPG || vdd_soc ||<br />
|-<br />
| 49 || NVDEC || vdd_soc ||<br />
|-<br />
| 50 || QSPI || vdd_soc ||<br />
|-<br />
| 52 || TSECB || vdd_soc ||<br />
|-<br />
| 53 || APE || vdd_soc ||<br />
|-<br />
| 54 || ACLK || vdd_soc ||<br />
|-<br />
| 55 || UARTAPE || vdd_soc ||<br />
|-<br />
| 56 || EMC || vdd_soc ||<br />
|-<br />
| 57 || PLLE0 || vdd_soc ||<br />
|-<br />
| 58 || PLLE0 || vdd_soc ||<br />
|-<br />
| 59 || DSI || vdd_soc ||<br />
|-<br />
| 60 || MAUD || vdd_soc ||<br />
|-<br />
| 61 || DPAUX1 || vdd_soc ||<br />
|-<br />
| 62 || MIPI_CAL || vdd_soc ||<br />
|-<br />
| 63 || UART_FST_MIPI_CAL || vdd_soc ||<br />
|-<br />
| 64 || OSC || vdd_soc ||<br />
|-<br />
| 65 || SCLK || vdd_soc ||<br />
|-<br />
| 66 || SOR_SAFE || vdd_soc ||<br />
|-<br />
| 67 || XUSB_SS || vdd_soc ||<br />
|-<br />
| 68 || XUSB_HOST || vdd_soc ||<br />
|-<br />
| 69 || XUSB_DEV || vdd_soc ||<br />
|-<br />
| 70 || EXTPERIPH1 || vdd_soc ||<br />
|-<br />
| 71 || AHUB || vdd_soc ||<br />
|-<br />
| 72 || HDA2HDMICODEC || vdd_soc ||<br />
|-<br />
| 73 || PLLP5 || vdd_soc ||<br />
|-<br />
| 74 || USBD || vdd_soc ||<br />
|-<br />
| 75 || USB2 || vdd_soc ||<br />
|-<br />
| 76 || PCIE || vdd_soc ||<br />
|-<br />
| 77 || AFI || vdd_soc ||<br />
|-<br />
| 78 || PCIEXCLK || vdd_soc ||<br />
|-<br />
| 79 || PEX_USB_UPHY || vdd_soc ||<br />
|-<br />
| 80 || XUSB_PADCTL || vdd_soc ||<br />
|-<br />
| 81 || APBDMA || vdd_soc ||<br />
|-<br />
| 82 || USB2_TRK || vdd_soc ||<br />
|-<br />
| 83 || PLLE0 || vdd_soc ||<br />
|-<br />
| 84 || PLLE0 || vdd_soc ||<br />
|-<br />
| 85 || CEC || vdd_soc ||<br />
|-<br />
|}<br />
<br />
=== Voltage ===<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Name || Block || Notes<br />
|-<br />
| 0 || max77620_sd0 || <br />
|-<br />
| 1 || max77620_sd1 || <br />
|-<br />
| 2 || max77620_sd2 || <br />
|-<br />
| 3 || max77620_sd3 || <br />
|-<br />
| 4 || max77620_ldo0 || 1.2v<br />
|-<br />
| 5 || max77620_ldo1 || <br />
|-<br />
| 6 || max77620_ldo2 || SDcard power, 3.3v - 1.8v<br />
|-<br />
| 7 || max77620_ldo3 || <br />
|-<br />
| 8 || max77620_ldo4 || RTC power, 0.85v<br />
|-<br />
| 9 || max77620_ldo5 || <br />
|-<br />
| 10 || max77620_ldo6 || AVDD touchscreen, 2.9v<br />
|-<br />
| 11 || max77620_ldo7 || <br />
|-<br />
| 12 || max77620_ldo8 || DisplayPort, 1.05v<br />
|-<br />
| 13 || max77621_cpu || <br />
|-<br />
| 14 || max77621_gpu || <br />
|-<br />
|}<br />
<br />
Note: max77620 GPIOs are only used internally by the driver during init, and not exposed via an API.<br />
<br />
= pcv:arb =<br />
This is "nn::pcv::IArbitrationManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || ReleaseControl<br />
|-<br />
|}<br />
<br />
= pcv:imm =<br />
This is "nn::pcv::IImmediateManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || SetClockRate<br />
|-<br />
|}<br />
<br />
= time:u, time:a, time:s =<br />
This is "nn::timesrv::detail::service::IStaticService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetStandardUserSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 1 || GetStandardNetworkSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 2 || GetStandardSteadyClock || Returns an [[#ISteadyClock]].<br />
|-<br />
| 3 || GetTimeZoneService || Returns an [[#ITimeZoneService]].<br />
|-<br />
| 4 || GetStandardLocalSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 5 || [4.0.0+] GetEphemeralNetworkSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 50 || [4.0.0+] SetStandardSteadyClockInternalOffset || <br />
|-<br />
| 100 || IsStandardUserSystemClockAutomaticCorrectionEnabled || <br />
|-<br />
| 101 || SetStandardUserSystemClockAutomaticCorrectionEnabled || <br />
|-<br />
| 102 || [5.0.0+] GetStandardUserSystemClockInitialYear || <br />
|-<br />
| 200 || [3.0.0+] IsStandardNetworkSystemClockAccuracySufficient || <br />
|-<br />
| 300 || [4.0.0+] CalculateMonotonicSystemClockBaseTimePoint || <br />
|-<br />
| 400 || [4.0.0+] GetClockSnapshot || <br />
|-<br />
| 401 || [4.0.0+] GetClockSnapshotFromSystemClockContext || <br />
|-<br />
| 500 || [4.0.0+] CalculateStandardUserSystemClockDifferenceByUser || <br />
|-<br />
| 501 || [4.0.0+] CalculateSpanBetween || <br />
|}<br />
<br />
== ISteadyClock ==<br />
This is "nn::timesrv::detail::service::ISteadyClock".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetCurrentTimePoint || No input, returns an output [[#SteadyClockTimePoint]].<br />
|-<br />
| 2 || GetTestOffset || No input, returns an output [[#TimeSpanType]].<br />
|-<br />
| 3 || SetTestOffset || Takes an input [[#TimeSpanType]], no output.<br />
|-<br />
| 100 || [2.0.0+] GetRtcValue || No input, returns an output s64.<br />
|-<br />
| 101 || [2.0.0+] IsRtcResetDetected || No input, returns an output u8 bool.<br />
|-<br />
| 102 || [2.0.0+] GetSetupResultValue || No input, returns an output u32.<br />
|-<br />
| 200 || [3.0.0+] GetInternalOffset || No input, returns an output [[#TimeSpanType]].<br />
|-<br />
| 201 || [3.0.0-3.0.2] SetInternalOffset || Takes an input [[#TimeSpanType]], no output.<br />
|}<br />
<br />
=== SteadyClockTimePoint ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x8|| a u64 representing a point in time.<br />
|-<br />
| 0x8 || 0x10 || ?<br />
|}<br />
This is a 0x18-byte struct.<br />
<br />
=== TimeSpanType ===<br />
This is an u64.<br />
<br />
== ISystemClock ==<br />
This is "nn::timesrv::detail::service::ISystemClock".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetCurrentTime || Returns an output [[#PosixTime]].<br />
|-<br />
| 1 || SetCurrentTime || Takes an input [[#PosixTime]].<br />
|-<br />
| 2 || GetSystemClockContext || Returns an output [[#SystemClockContext]].<br />
|-<br />
| 3 || SetSystemClockContext || Takes an input [[#SystemClockContext]].<br />
|-<br />
|}<br />
<br />
=== PosixTime ===<br />
This is an u64 for UTC POSIX time.<br />
<br />
=== SystemClockContext ===<br />
This is an 0x20-byte struct.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x8|| a [[#PosixTime]] representing the system clock epoch.<br />
|-<br />
| 0x8 || 0x18 || a [[#SteadyClockTimePoint]]<br />
|}<br />
<br />
== ITimeZoneService ==<br />
This is "nn::timesrv::detail::service::ITimeZoneService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetDeviceLocationName || No input, returns an output [[#LocationName]].<br />
|-<br />
| 1 || SetDeviceLocationName || Takes an input [[#LocationName]], no output.<br />
|-<br />
| 2 || GetTotalLocationNameCount || No input, returns an output s32.<br />
|-<br />
| 3 || LoadLocationNameList || <br />
|-<br />
| 4 || LoadTimeZoneRule || Takes an input [[#LocationName]] and a type-0x16 output buffer for [[#TimeZoneRule]], no output.<br />
|-<br />
| 5 || [2.0.0+] GetTimeZoneRuleVersion || No input, returns an output [[#TimeZoneRuleVersion]].<br />
|-<br />
| 100 || ToCalendarTime || Takes an input [[#PosixTime]] and a type-0x15 input buffer for [[#TimeZoneRule]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].<br />
|-<br />
| 101 || ToCalendarTimeWithMyRule || Takes an input [[#PosixTime]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].<br />
|-<br />
| 201 || ToPosixTime || Takes an input [[#CalendarTime]], a type-0x15 input buffer for [[#TimeZoneRule]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.<br />
|-<br />
| 202 || ToPosixTimeWithMyRule || Takes an input [[#CalendarTime]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.<br />
|-<br />
|}<br />
<br />
=== LoadLocationNameList ===<br />
Takes an input s32 LocationName_index and a type-0x6 output buffer for [[#LocationName]], returns an output s32 for total output entries.<br />
<br />
=== LocationName ===<br />
This contains a TimeZone location string with a max size of 0x24 bytes.<br />
<br />
=== TimeZoneRule ===<br />
This is an 0x4000-byte struct. Official sw uses fixed-size 0x4000 for the buffer size with the above commands.<br />
<br />
=== TimeZoneRuleVersion ===<br />
This is an u128.<br />
<br />
=== CalendarTime ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x2 || Year<br />
|-<br />
| 0x2 || 0x1 || Month<br />
|-<br />
| 0x3 || 0x1 || Day<br />
|-<br />
| 0x4 || 0x1 || Hour<br />
|-<br />
| 0x5 || 0x1 || Minute<br />
|-<br />
| 0x6 || 0x1 || Second<br />
|-<br />
| 0x7 || 0x1 || Padding / unknown?<br />
|}<br />
<br />
This is an 0x8-byte struct.<br />
<br />
=== CalendarAdditionalInfo ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x4 || 0-based day-of-week.<br />
|-<br />
| 0x4 || 0x4 || 0-based day-of-year.<br />
|-<br />
| 0x8 || ? || Timezone name string.<br />
|-<br />
| 0x10 || 0x4 || 0 = no DST, 1 = DST.<br />
|-<br />
| 0x14 || 0x4 || s32 seconds relative to UTC for this timezone.<br />
|}<br />
<br />
This is an 0x18-byte struct. This stores timezone info.<br />
<br />
[[Category:Services]]</div>
Thog
https://switchbrew.org/w/index.php?title=Log_services&diff=4842
Log services
2018-07-20T17:17:17Z
<p>Thog: ILogger Cmd 1 -> 3.0.0+</p>
<hr />
<div>= lm =<br />
This is "nn::lm::ILogService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || OpenLogger<br />
|}<br />
<br />
== ILogger ==<br />
This is "nn::lm::ILogger".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || Initialize<br />
|-<br />
| 1 || [3.0.0+] SetDestination<br />
|}<br />
<br />
= lm:get =<br />
This is "nn::lm::ILogGetter".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || StartLogging<br />
|-<br />
| 1 || StopLogging<br />
|-<br />
| 2 || GetLog<br />
|}<br />
<br />
This service doesn't normally exist on retail.<br />
<br />
[[Category:Services]]</div>
Thog
https://switchbrew.org/w/index.php?title=PCV_services&diff=4821
PCV services
2018-07-09T18:16:36Z
<p>Thog: </p>
<hr />
<div>= bpc =<br />
This is "nn::bpc::IBoardPowerControlManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || ShutdownSystem<br />
|-<br />
| 1 || RebootSystem<br />
|-<br />
| 2 || GetWakeupReason<br />
|-<br />
| 3 || GetShutdownReason<br />
|-<br />
| 4 || GetAcOk<br />
|-<br />
| 5 || GetBoardPowerControlEvent<br />
|-<br />
| 6 || GetSleepButtonState<br />
|-<br />
| 7 || GetPowerEvent<br />
|-<br />
| 8 ||<br />
|-<br />
| 9 ||<br />
|-<br />
| 10 ||<br />
|}<br />
<br />
= bpc:r =<br />
This is "nn::bpc::IRtcManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || GetExternalRtcValue<br />
|-<br />
| 1 || SetExternalRtcValue<br />
|-<br />
| 2 || ReadExternalRtcResetFlag<br />
|-<br />
| 3 || ClearExternalRtcResetFlag<br />
|}<br />
<br />
GetExternalRtcValue / SetExternalRtcValue directly accesses the max77620_rtc0 device.<br />
<br />
= pcv =<br />
This is "nn::pcv::detail::IPcvService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || SetPowerEnabled<br />
|-<br />
| 1 || SetClockEnabled<br />
|-<br />
| 2 || SetClockRate<br />
|-<br />
| 3 || GetClockRate<br />
|-<br />
| 4 || GetState<br />
|-<br />
| 5 || GetPossibleClockRates<br />
|-<br />
| 6 || SetMinVClockRate<br />
|-<br />
| 7 || SetReset<br />
|-<br />
| 8 || SetVoltageEnabled<br />
|-<br />
| 9 || GetVoltageEnabled<br />
|-<br />
| 10 || GetVoltageRange<br />
|-<br />
| 11 || SetVoltageValue<br />
|-<br />
| 12 || GetVoltageValue<br />
|-<br />
| 13 || GetTemperatureThresholds<br />
|-<br />
| 14 || SetTemperature<br />
|-<br />
| 15 || Initialize<br />
|-<br />
| 16 || IsInitialized<br />
|-<br />
| 17 || Finalize<br />
|-<br />
| 18 || PowerOn<br />
|-<br />
| 19 || PowerOff<br />
|-<br />
| 20 || ChangeVoltage<br />
|-<br />
| 21 || GetPowerClockInfoEvent<br />
|-<br />
| 22 || GetOscillatorClock<br />
|-<br />
| 23 || GetDvfsTable<br />
|-<br />
| 24 || GetModuleStateTable<br />
|-<br />
| 25 || GetPowerDomainStateTable<br />
|-<br />
| 26 || GetFuseInfo<br />
|-<br />
|}<br />
<br />
== User Name to Block Maps ==<br />
<br />
=== Power Switch / Clocking / Reset ===<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Name || Block || Rail || Notes<br />
|-<br />
| 0 || CpuBus || vdd_cpu ||<br />
|-<br />
| 1 || GPU || vdd_gpu ||<br />
|-<br />
| 2 || I2S1 || vdd_soc ||<br />
|-<br />
| 3 || I2S2 || vdd_soc ||<br />
|-<br />
| 4 || I2S3 || vdd_soc ||<br />
|-<br />
| 5 || PWM || vdd_soc ||<br />
|-<br />
| 6 || I2C1 || vdd_soc ||<br />
|-<br />
| 7 || I2C2 || vdd_soc ||<br />
|-<br />
| 8 || I2C3 || vdd_soc ||<br />
|-<br />
| 9 || I2C4 || vdd_soc ||<br />
|-<br />
| 10 || I2C5 || vdd_soc ||<br />
|-<br />
| 11 || I2C6 || vdd_soc ||<br />
|-<br />
| 12 || SPI1 || vdd_soc ||<br />
|-<br />
| 13 || SPI2 || vdd_soc ||<br />
|-<br />
| 14 || SPI3 || vdd_soc ||<br />
|-<br />
| 15 || SPI4 || vdd_soc ||<br />
|-<br />
| 16 || DISP1 || vdd_soc ||<br />
|-<br />
| 17 || DISP2 || vdd_soc ||<br />
|-<br />
| 20 || SDMMC1 || vdd_soc ||<br />
|-<br />
| 21 || SDMMC2 || vdd_soc ||<br />
|-<br />
| 22 || SDMMC3 || vdd_soc ||<br />
|-<br />
| 23 || SDMMC4 || vdd_soc ||<br />
|-<br />
| 24 || - || - || Not actual block. Used for debug and stuff.<br />
|-<br />
| 25 || CSITE || vdd_soc ||<br />
|-<br />
| 26 || TSEC || vdd_soc ||<br />
|-<br />
| 27 || MSELECT || vdd_soc ||<br />
|-<br />
| 28 || HDA2CODEC_2X || vdd_soc ||<br />
|-<br />
| 29 || ACTMON || vdd_soc ||<br />
|-<br />
| 30 || I2C_SLOW || vdd_soc ||<br />
|-<br />
| 31 || SOR1 || vdd_soc ||<br />
|-<br />
| 33 || HDA || vdd_soc ||<br />
|-<br />
| 34 || XUSB_CORE_HOST || vdd_soc ||<br />
|-<br />
| 35 || XUSB_FALCON || vdd_soc ||<br />
|-<br />
| 36 || XUSB_FS || vdd_soc ||<br />
|-<br />
| 37 || XUSB_CORE_DEV || vdd_soc ||<br />
|-<br />
| 38 || XUSB_SS_HOSTDEV || vdd_soc ||<br />
|-<br />
| 39 || UARTA || vdd_soc ||<br />
|-<br />
| 40 || UARTB || vdd_soc ||<br />
|-<br />
| 41 || UARTC || vdd_soc ||<br />
|-<br />
| 42 || UARTD || vdd_soc ||<br />
|-<br />
| 43 || HOST1X || vdd_soc ||<br />
|-<br />
| 44 || ENTROPY || vdd_soc ||<br />
|-<br />
| 45 || SOC_THERM || vdd_soc ||<br />
|-<br />
| 46 || VIC || vdd_soc ||<br />
|-<br />
| 47 || NVENC || vdd_soc ||<br />
|-<br />
| 48 || NVJPG || vdd_soc ||<br />
|-<br />
| 49 || NVDEC || vdd_soc ||<br />
|-<br />
| 50 || QSPI || vdd_soc ||<br />
|-<br />
| 52 || TSECB || vdd_soc ||<br />
|-<br />
| 53 || APE || vdd_soc ||<br />
|-<br />
| 54 || ACLK || vdd_soc ||<br />
|-<br />
| 55 || UARTAPE || vdd_soc ||<br />
|-<br />
| 56 || EMC || vdd_soc ||<br />
|-<br />
| 57 || PLLE0 || vdd_soc ||<br />
|-<br />
| 58 || PLLE0 || vdd_soc ||<br />
|-<br />
| 59 || DSI || vdd_soc ||<br />
|-<br />
| 60 || MAUD || vdd_soc ||<br />
|-<br />
| 61 || DPAUX1 || vdd_soc ||<br />
|-<br />
| 62 || MIPI_CAL || vdd_soc ||<br />
|-<br />
| 63 || UART_FST_MIPI_CAL || vdd_soc ||<br />
|-<br />
| 64 || OSC || vdd_soc ||<br />
|-<br />
| 65 || SCLK || vdd_soc ||<br />
|-<br />
| 66 || SOR_SAFE || vdd_soc ||<br />
|-<br />
| 67 || XUSB_SS || vdd_soc ||<br />
|-<br />
| 68 || XUSB_HOST || vdd_soc ||<br />
|-<br />
| 69 || XUSB_DEV || vdd_soc ||<br />
|-<br />
| 70 || EXTPERIPH1 || vdd_soc ||<br />
|-<br />
| 71 || AHUB || vdd_soc ||<br />
|-<br />
| 72 || HDA2HDMICODEC || vdd_soc ||<br />
|-<br />
| 73 || PLLP5 || vdd_soc ||<br />
|-<br />
| 74 || USBD || vdd_soc ||<br />
|-<br />
| 75 || USB2 || vdd_soc ||<br />
|-<br />
| 76 || PCIE || vdd_soc ||<br />
|-<br />
| 77 || AFI || vdd_soc ||<br />
|-<br />
| 78 || PCIEXCLK || vdd_soc ||<br />
|-<br />
| 79 || PEX_USB_UPHY || vdd_soc ||<br />
|-<br />
| 80 || XUSB_PADCTL || vdd_soc ||<br />
|-<br />
| 81 || APBDMA || vdd_soc ||<br />
|-<br />
| 82 || USB2_TRK || vdd_soc ||<br />
|-<br />
| 83 || PLLE0 || vdd_soc ||<br />
|-<br />
| 84 || PLLE0 || vdd_soc ||<br />
|-<br />
| 85 || CEC || vdd_soc ||<br />
|-<br />
|}<br />
<br />
=== Voltage ===<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Name || Block || Notes<br />
|-<br />
| 0 || max77620_sd0 || <br />
|-<br />
| 1 || max77620_sd1 || <br />
|-<br />
| 2 || max77620_sd2 || <br />
|-<br />
| 3 || max77620_sd3 || <br />
|-<br />
| 4 || max77620_ldo0 || 1.2v<br />
|-<br />
| 5 || max77620_ldo1 || <br />
|-<br />
| 6 || max77620_ldo2 || SDcard power, 3.3v - 1.8v<br />
|-<br />
| 7 || max77620_ldo3 || <br />
|-<br />
| 8 || max77620_ldo4 || RTC power, 0.85v<br />
|-<br />
| 9 || max77620_ldo5 || <br />
|-<br />
| 10 || max77620_ldo6 || AVDD touchscreen, 2.9v<br />
|-<br />
| 11 || max77620_ldo7 || <br />
|-<br />
| 12 || max77620_ldo8 || DisplayPort, 1.05v<br />
|-<br />
| 13 || max77621_cpu || <br />
|-<br />
| 14 || max77621_gpu || <br />
|-<br />
|}<br />
<br />
Note: max77620 GPIOs are only used internally by the driver during init, and not exposed via an API.<br />
<br />
= pcv:arb =<br />
This is "nn::pcv::IArbitrationManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || ReleaseControl<br />
|-<br />
|}<br />
<br />
= pcv:imm =<br />
This is "nn::pcv::IImmediateManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || SetClockRate<br />
|-<br />
|}<br />
<br />
= time:u, time:a, time:s =<br />
This is "nn::timesrv::detail::service::IStaticService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetStandardUserSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 1 || GetStandardNetworkSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 2 || GetStandardSteadyClock || Returns an [[#ISteadyClock]].<br />
|-<br />
| 3 || GetTimeZoneService || Returns an [[#ITimeZoneService]].<br />
|-<br />
| 4 || GetStandardLocalSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 5 || [4.0.0+] GetEphemeralNetworkSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 50 || [4.0.0+] SetStandardSteadyClockInternalOffset || <br />
|-<br />
| 100 || IsStandardUserSystemClockAutomaticCorrectionEnabled || <br />
|-<br />
| 101 || SetStandardUserSystemClockAutomaticCorrectionEnabled || <br />
|-<br />
| 102 || [5.0.0+] GetStandardUserSystemClockInitialYear || <br />
|-<br />
| 200 || [3.0.0+] IsStandardNetworkSystemClockAccuracySufficient || <br />
|-<br />
| 300 || [4.0.0+] CalculateMonotonicSystemClockBaseTimePoint || <br />
|-<br />
| 400 || [4.0.0+] GetClockSnapshot || <br />
|-<br />
| 401 || [4.0.0+] GetClockSnapshotFromSystemClockContext || <br />
|-<br />
| 500 || [4.0.0+] CalculateStandardUserSystemClockDifferenceByUser || <br />
|-<br />
| 501 || [4.0.0+] CalculateSpanBetween || <br />
|}<br />
<br />
== ISteadyClock ==<br />
This is "nn::timesrv::detail::service::ISteadyClock".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetCurrentTimePoint || No input, returns an output [[#SteadyClockTimePoint]].<br />
|-<br />
| 2 || GetTestOffset || No input, returns an output [[#TimeSpanType]].<br />
|-<br />
| 3 || SetTestOffset || Takes an input [[#TimeSpanType]], no output.<br />
|-<br />
| 100 || [2.0.0+] GetRtcValue || No input, returns an output s64.<br />
|-<br />
| 101 || [2.0.0+] IsRtcResetDetected || No input, returns an output u8 bool.<br />
|-<br />
| 102 || [2.0.0+] GetSetupResultValue || No input, returns an output u32.<br />
|-<br />
| 200 || [3.0.0+] GetInternalOffset || No input, returns an output [[#TimeSpanType]].<br />
|-<br />
| 201 || [3.0.0-3.0.2] SetInternalOffset || Takes an input [[#TimeSpanType]], no output.<br />
|}<br />
<br />
=== SteadyClockTimePoint ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x8|| a u64 representing a point in time.<br />
|-<br />
| 0x8 || 0x10 || ?<br />
|}<br />
This is a 0x18-byte struct.<br />
<br />
=== TimeSpanType ===<br />
This is an u64.<br />
<br />
== ISystemClock ==<br />
This is "nn::timesrv::detail::service::ISystemClock".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetCurrentTime || Returns an output [[#PosixTime]].<br />
|-<br />
| 1 || SetCurrentTime || Takes an input [[#PosixTime]].<br />
|-<br />
| 2 || GetSystemClockContext || Returns an output [[#SystemClockContext]].<br />
|-<br />
| 3 || SetSystemClockContext || Takes an input [[#SystemClockContext]].<br />
|-<br />
|}<br />
<br />
=== PosixTime ===<br />
This is an u64 for UTC POSIX time.<br />
<br />
=== SystemClockContext ===<br />
This is an 0x20-byte struct.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x8|| a [[#PosixTime]] representing the system clock epoch.<br />
|-<br />
| 0x8 || 0x18 || a [[#SteadyClockTimePoint]]<br />
|}<br />
<br />
== ITimeZoneService ==<br />
This is "nn::timesrv::detail::service::ITimeZoneService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetDeviceLocationName || No input, returns an output [[#LocationName]].<br />
|-<br />
| 1 || SetDeviceLocationName || Takes an input [[#LocationName]], no output.<br />
|-<br />
| 2 || GetTotalLocationNameCount || No input, returns an output s32.<br />
|-<br />
| 3 || LoadLocationNameList || <br />
|-<br />
| 4 || LoadTimeZoneRule || Takes an input [[#LocationName]] and a type-0x16 output buffer for [[#TimeZoneRule]], no output.<br />
|-<br />
| 5 || [2.0.0+] GetTimeZoneRuleVersion || No input, returns an output [[#TimeZoneRuleVersion]].<br />
|-<br />
| 100 || ToCalendarTime || Takes an input [[#PosixTime]] and a type-0x15 input buffer for [[#TimeZoneRule]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].<br />
|-<br />
| 101 || ToCalendarTimeWithMyRule || Takes an input [[#PosixTime]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].<br />
|-<br />
| 200 || ToPosixTime || Takes an input [[#CalendarTime]], a type-0x15 input buffer for [[#TimeZoneRule]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.<br />
|-<br />
| 201 || ToPosixTimeWithMyRule || Takes an input [[#CalendarTime]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.<br />
|-<br />
| 202 || ||<br />
|-<br />
|}<br />
<br />
=== LoadLocationNameList ===<br />
Takes an input s32 LocationName_index and a type-0x6 output buffer for [[#LocationName]], returns an output s32 for total output entries.<br />
<br />
=== LocationName ===<br />
This contains a TimeZone location string with a max size of 0x24 bytes.<br />
<br />
=== TimeZoneRule ===<br />
This is an 0x4000-byte struct. Official sw uses fixed-size 0x4000 for the buffer size with the above commands.<br />
<br />
=== TimeZoneRuleVersion ===<br />
This is an u128.<br />
<br />
=== CalendarTime ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x2 || Year<br />
|-<br />
| 0x2 || 0x1 || Month<br />
|-<br />
| 0x3 || 0x1 || Day<br />
|-<br />
| 0x4 || 0x1 || Hour<br />
|-<br />
| 0x5 || 0x1 || Minute<br />
|-<br />
| 0x6 || 0x1 || Second<br />
|-<br />
| 0x7 || 0x1 || Padding / unknown?<br />
|}<br />
<br />
This is an 0x8-byte struct.<br />
<br />
=== CalendarAdditionalInfo ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x4 || 0-based day-of-week.<br />
|-<br />
| 0x4 || 0x4 || 0-based day-of-year.<br />
|-<br />
| 0x8 || ? || Timezone name string.<br />
|-<br />
| 0x10 || 0x4 || 0 = no DST, 1 = DST.<br />
|-<br />
| 0x14 || 0x4 || s32 seconds relative to UTC for this timezone.<br />
|}<br />
<br />
This is an 0x18-byte struct. This stores timezone info.<br />
<br />
[[Category:Services]]</div>
Thog
https://switchbrew.org/w/index.php?title=PCV_services&diff=4808
PCV services
2018-07-01T22:05:39Z
<p>Thog: Add firmware versions and a missing cmd</p>
<hr />
<div>= bpc =<br />
This is "nn::bpc::IBoardPowerControlManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || ShutdownSystem<br />
|-<br />
| 1 || RebootSystem<br />
|-<br />
| 2 || GetWakeupReason<br />
|-<br />
| 3 || GetShutdownReason<br />
|-<br />
| 4 || GetAcOk<br />
|-<br />
| 5 || GetBoardPowerControlEvent<br />
|-<br />
| 6 || GetSleepButtonState<br />
|-<br />
| 7 || GetPowerEvent<br />
|-<br />
| 8 ||<br />
|-<br />
| 9 ||<br />
|-<br />
| 10 ||<br />
|}<br />
<br />
= bpc:r =<br />
This is "nn::bpc::IRtcManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || GetExternalRtcValue<br />
|-<br />
| 1 || SetExternalRtcValue<br />
|-<br />
| 2 || ReadExternalRtcResetFlag<br />
|-<br />
| 3 || ClearExternalRtcResetFlag<br />
|}<br />
<br />
GetExternalRtcValue / SetExternalRtcValue directly accesses the max77620_rtc0 device.<br />
<br />
= pcv =<br />
This is "nn::pcv::detail::IPcvService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || SetPowerEnabled<br />
|-<br />
| 1 || SetClockEnabled<br />
|-<br />
| 2 || SetClockRate<br />
|-<br />
| 3 || GetClockRate<br />
|-<br />
| 4 || GetState<br />
|-<br />
| 5 || GetPossibleClockRates<br />
|-<br />
| 6 || SetMinVClockRate<br />
|-<br />
| 7 || SetReset<br />
|-<br />
| 8 || SetVoltageEnabled<br />
|-<br />
| 9 || GetVoltageEnabled<br />
|-<br />
| 10 || GetVoltageRange<br />
|-<br />
| 11 || SetVoltageValue<br />
|-<br />
| 12 || GetVoltageValue<br />
|-<br />
| 13 || GetTemperatureThresholds<br />
|-<br />
| 14 || SetTemperature<br />
|-<br />
| 15 || Initialize<br />
|-<br />
| 16 || IsInitialized<br />
|-<br />
| 17 || Finalize<br />
|-<br />
| 18 || PowerOn<br />
|-<br />
| 19 || PowerOff<br />
|-<br />
| 20 || ChangeVoltage<br />
|-<br />
| 21 || GetPowerClockInfoEvent<br />
|-<br />
| 22 || GetOscillatorClock<br />
|-<br />
| 23 || GetDvfsTable<br />
|-<br />
| 24 || GetModuleStateTable<br />
|-<br />
| 25 || GetPowerDomainStateTable<br />
|-<br />
| 26 || GetFuseInfo<br />
|-<br />
|}<br />
<br />
== User Name to Block Maps ==<br />
<br />
=== Power Switch / Clocking / Reset ===<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Name || Block || Rail || Notes<br />
|-<br />
| 0 || CpuBus || vdd_cpu ||<br />
|-<br />
| 1 || GPU || vdd_gpu ||<br />
|-<br />
| 2 || I2S1 || vdd_soc ||<br />
|-<br />
| 3 || I2S2 || vdd_soc ||<br />
|-<br />
| 4 || I2S3 || vdd_soc ||<br />
|-<br />
| 5 || PWM || vdd_soc ||<br />
|-<br />
| 6 || I2C1 || vdd_soc ||<br />
|-<br />
| 7 || I2C2 || vdd_soc ||<br />
|-<br />
| 8 || I2C3 || vdd_soc ||<br />
|-<br />
| 9 || I2C4 || vdd_soc ||<br />
|-<br />
| 10 || I2C5 || vdd_soc ||<br />
|-<br />
| 11 || I2C6 || vdd_soc ||<br />
|-<br />
| 12 || SPI1 || vdd_soc ||<br />
|-<br />
| 13 || SPI2 || vdd_soc ||<br />
|-<br />
| 14 || SPI3 || vdd_soc ||<br />
|-<br />
| 15 || SPI4 || vdd_soc ||<br />
|-<br />
| 16 || DISP1 || vdd_soc ||<br />
|-<br />
| 17 || DISP2 || vdd_soc ||<br />
|-<br />
| 20 || SDMMC1 || vdd_soc ||<br />
|-<br />
| 21 || SDMMC2 || vdd_soc ||<br />
|-<br />
| 22 || SDMMC3 || vdd_soc ||<br />
|-<br />
| 23 || SDMMC4 || vdd_soc ||<br />
|-<br />
| 24 || - || - || Not actual block. Used for debug and stuff.<br />
|-<br />
| 25 || CSITE || vdd_soc ||<br />
|-<br />
| 26 || TSEC || vdd_soc ||<br />
|-<br />
| 27 || MSELECT || vdd_soc ||<br />
|-<br />
| 28 || HDA2CODEC_2X || vdd_soc ||<br />
|-<br />
| 29 || ACTMON || vdd_soc ||<br />
|-<br />
| 30 || I2C_SLOW || vdd_soc ||<br />
|-<br />
| 31 || SOR1 || vdd_soc ||<br />
|-<br />
| 33 || HDA || vdd_soc ||<br />
|-<br />
| 34 || XUSB_CORE_HOST || vdd_soc ||<br />
|-<br />
| 35 || XUSB_FALCON || vdd_soc ||<br />
|-<br />
| 36 || XUSB_FS || vdd_soc ||<br />
|-<br />
| 37 || XUSB_CORE_DEV || vdd_soc ||<br />
|-<br />
| 38 || XUSB_SS_HOSTDEV || vdd_soc ||<br />
|-<br />
| 39 || UARTA || vdd_soc ||<br />
|-<br />
| 40 || UARTB || vdd_soc ||<br />
|-<br />
| 41 || UARTC || vdd_soc ||<br />
|-<br />
| 42 || UARTD || vdd_soc ||<br />
|-<br />
| 43 || HOST1X || vdd_soc ||<br />
|-<br />
| 44 || ENTROPY || vdd_soc ||<br />
|-<br />
| 45 || SOC_THERM || vdd_soc ||<br />
|-<br />
| 46 || VIC || vdd_soc ||<br />
|-<br />
| 47 || NVENC || vdd_soc ||<br />
|-<br />
| 48 || NVJPG || vdd_soc ||<br />
|-<br />
| 49 || NVDEC || vdd_soc ||<br />
|-<br />
| 50 || QSPI || vdd_soc ||<br />
|-<br />
| 52 || TSECB || vdd_soc ||<br />
|-<br />
| 53 || APE || vdd_soc ||<br />
|-<br />
| 54 || ACLK || vdd_soc ||<br />
|-<br />
| 55 || UARTAPE || vdd_soc ||<br />
|-<br />
| 56 || EMC || vdd_soc ||<br />
|-<br />
| 57 || PLLE0 || vdd_soc ||<br />
|-<br />
| 58 || PLLE0 || vdd_soc ||<br />
|-<br />
| 59 || DSI || vdd_soc ||<br />
|-<br />
| 60 || MAUD || vdd_soc ||<br />
|-<br />
| 61 || DPAUX1 || vdd_soc ||<br />
|-<br />
| 62 || MIPI_CAL || vdd_soc ||<br />
|-<br />
| 63 || UART_FST_MIPI_CAL || vdd_soc ||<br />
|-<br />
| 64 || OSC || vdd_soc ||<br />
|-<br />
| 65 || SCLK || vdd_soc ||<br />
|-<br />
| 66 || SOR_SAFE || vdd_soc ||<br />
|-<br />
| 67 || XUSB_SS || vdd_soc ||<br />
|-<br />
| 68 || XUSB_HOST || vdd_soc ||<br />
|-<br />
| 69 || XUSB_DEV || vdd_soc ||<br />
|-<br />
| 70 || EXTPERIPH1 || vdd_soc ||<br />
|-<br />
| 71 || AHUB || vdd_soc ||<br />
|-<br />
| 72 || HDA2HDMICODEC || vdd_soc ||<br />
|-<br />
| 73 || PLLP5 || vdd_soc ||<br />
|-<br />
| 74 || USBD || vdd_soc ||<br />
|-<br />
| 75 || USB2 || vdd_soc ||<br />
|-<br />
| 76 || PCIE || vdd_soc ||<br />
|-<br />
| 77 || AFI || vdd_soc ||<br />
|-<br />
| 78 || PCIEXCLK || vdd_soc ||<br />
|-<br />
| 79 || PEX_USB_UPHY || vdd_soc ||<br />
|-<br />
| 80 || XUSB_PADCTL || vdd_soc ||<br />
|-<br />
| 81 || APBDMA || vdd_soc ||<br />
|-<br />
| 82 || USB2_TRK || vdd_soc ||<br />
|-<br />
| 83 || PLLE0 || vdd_soc ||<br />
|-<br />
| 84 || PLLE0 || vdd_soc ||<br />
|-<br />
| 85 || CEC || vdd_soc ||<br />
|-<br />
|}<br />
<br />
=== Voltage ===<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Name || Block || Notes<br />
|-<br />
| 0 || max77620_sd0 || <br />
|-<br />
| 1 || max77620_sd1 || <br />
|-<br />
| 2 || max77620_sd2 || <br />
|-<br />
| 3 || max77620_sd3 || <br />
|-<br />
| 4 || max77620_ldo0 || 1.2v<br />
|-<br />
| 5 || max77620_ldo1 || <br />
|-<br />
| 6 || max77620_ldo2 || SDcard power, 3.3v - 1.8v<br />
|-<br />
| 7 || max77620_ldo3 || <br />
|-<br />
| 8 || max77620_ldo4 || RTC power, 0.85v<br />
|-<br />
| 9 || max77620_ldo5 || <br />
|-<br />
| 10 || max77620_ldo6 || AVDD touchscreen, 2.9v<br />
|-<br />
| 11 || max77620_ldo7 || <br />
|-<br />
| 12 || max77620_ldo8 || DisplayPort, 1.05v<br />
|-<br />
| 13 || max77621_cpu || <br />
|-<br />
| 14 || max77621_gpu || <br />
|-<br />
|}<br />
<br />
Note: max77620 GPIOs are only used internally by the driver during init, and not exposed via an API.<br />
<br />
= pcv:arb =<br />
This is "nn::pcv::IArbitrationManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || ReleaseControl<br />
|-<br />
|}<br />
<br />
= pcv:imm =<br />
This is "nn::pcv::IImmediateManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || SetClockRate<br />
|-<br />
|}<br />
<br />
= time:u, time:a, time:s =<br />
This is "nn::timesrv::detail::service::IStaticService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetStandardUserSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 1 || GetStandardNetworkSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 2 || GetStandardSteadyClock || Returns an [[#ISteadyClock]].<br />
|-<br />
| 3 || GetTimeZoneService || Returns an [[#ITimeZoneService]].<br />
|-<br />
| 4 || GetStandardLocalSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 5 || [4.0.0+] GetEphemeralNetworkSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 50 || [4.0.0+] SetStandardSteadyClockInternalOffset || <br />
|-<br />
| 100 || IsStandardUserSystemClockAutomaticCorrectionEnabled || <br />
|-<br />
| 101 || SetStandardUserSystemClockAutomaticCorrectionEnabled || <br />
|-<br />
| 102 || [5.0.0+] GetStandardUserSystemClockInitialYear || <br />
|-<br />
| 200 || [3.0.0+] IsStandardNetworkSystemClockAccuracySufficient || <br />
|-<br />
| 300 || [4.0.0+] CalculateMonotonicSystemClockBaseTimePoint || <br />
|-<br />
| 400 || [4.0.0+] GetClockSnapshot || <br />
|-<br />
| 401 || [4.0.0+] GetClockSnapshotFromSystemClockContext || <br />
|-<br />
| 500 || [4.0.0+] CalculateStandardUserSystemClockDifferenceByUser || <br />
|-<br />
| 501 || [4.0.0+] CalculateSpanBetween || <br />
|}<br />
<br />
== ISteadyClock ==<br />
This is "nn::timesrv::detail::service::ISteadyClock".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetCurrentTimePoint || No input, returns an output [[#SteadyClockTimePoint]].<br />
|-<br />
| 2 || GetTestOffset || No input, returns an output [[#TimeSpanType]].<br />
|-<br />
| 3 || SetTestOffset || Takes an input [[#TimeSpanType]], no output.<br />
|-<br />
| 100 || [2.0.0+] GetRtcValue || No input, returns an output s64.<br />
|-<br />
| 101 || [2.0.0+] IsRtcResetDetected || No input, returns an output u8 bool.<br />
|-<br />
| 102 || [2.0.0+] GetSetupResultValue || No input, returns an output u32.<br />
|-<br />
| 200 || [3.0.0+] GetInternalOffset || No input, returns an output [[#TimeSpanType]].<br />
|-<br />
| 201 || [3.0.0-3.0.2] SetInternalOffset || Takes an input [[#TimeSpanType]], no output.<br />
|}<br />
<br />
=== SteadyClockTimePoint ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x8|| a u64 representing a point in time.<br />
|-<br />
| 0x8 || 0x10 || ?<br />
|}<br />
This is a 0x18-byte struct.<br />
<br />
=== TimeSpanType ===<br />
This is an u64.<br />
<br />
== ISystemClock ==<br />
This is "nn::timesrv::detail::service::ISystemClock".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetCurrentTime || Returns an output [[#PosixTime]].<br />
|-<br />
| 1 || SetCurrentTime || Takes an input [[#PosixTime]].<br />
|-<br />
| 2 || GetSystemClockContext || Returns an output [[#SystemClockContext]].<br />
|-<br />
| 3 || SetSystemClockContext || Takes an input [[#SystemClockContext]].<br />
|-<br />
|}<br />
<br />
=== PosixTime ===<br />
This is an u64 for UTC POSIX time.<br />
<br />
=== SystemClockContext ===<br />
This is an 0x20-byte struct.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x8|| a [[#PosixTime]] representing the system clock epoch.<br />
|-<br />
| 0x8 || 0x18 || a [[#SteadyClockTimePoint]]<br />
|}<br />
<br />
== ITimeZoneService ==<br />
This is "nn::timesrv::detail::service::ITimeZoneService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetDeviceLocationName || No input, returns an output [[#LocationName]].<br />
|-<br />
| 1 || SetDeviceLocationName || Takes an input [[#LocationName]], no output.<br />
|-<br />
| 2 || GetTotalLocationNameCount || No input, returns an output s32.<br />
|-<br />
| 3 || LoadLocationNameList || <br />
|-<br />
| 4 || LoadTimeZoneRule || Takes an input [[#LocationName]] and a type-0x16 output buffer for [[#TimeZoneRule]], no output.<br />
|-<br />
| 5 || [2.0.0+] GetTimeZoneRuleVersion || No input, returns an output [[#TimeZoneRuleVersion]].<br />
|-<br />
| 100 || ToCalendarTime || Takes an input [[#PosixTime]] and a type-0x15 input buffer for [[#TimeZoneRule]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].<br />
|-<br />
| 101 || ToCalendarTimeWithMyRule || Takes an input [[#PosixTime]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].<br />
|-<br />
| 200 || ToPosixTime || Takes an input [[#CalendarTime]], a type-0x15 input buffer for [[#TimeZoneRule]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.<br />
|-<br />
| 201 || ToPosixTimeWithMyRule || Takes an input [[#CalendarTime]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.<br />
|-<br />
| 202 || ||<br />
|-<br />
|}<br />
<br />
=== LoadLocationNameList ===<br />
Takes an input s32 LocationName_index and a type-0x6 output buffer for [[#LocationName]], returns an output s32 for total output entries.<br />
<br />
=== LocationName ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x10 || Location name string, no NUL-terminator.<br />
|-<br />
| 0x10 || ? || <br />
|-<br />
| 0x18 || 0x8? || ?<br />
|-<br />
| 0x20 || ? || ?<br />
|}<br />
<br />
This is an 0x24-byte struct.<br />
<br />
=== TimeZoneRule ===<br />
This is an 0x4000-byte struct. Official sw uses fixed-size 0x4000 for the buffer size with the above commands.<br />
<br />
=== TimeZoneRuleVersion ===<br />
This is an u128.<br />
<br />
=== CalendarTime ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x2 || Year<br />
|-<br />
| 0x2 || 0x1 || Month<br />
|-<br />
| 0x3 || 0x1 || Day<br />
|-<br />
| 0x4 || 0x1 || Hour<br />
|-<br />
| 0x5 || 0x1 || Minute<br />
|-<br />
| 0x6 || 0x1 || Second<br />
|-<br />
| 0x7 || 0x1 || Padding / unknown?<br />
|}<br />
<br />
This is an 0x8-byte struct.<br />
<br />
=== CalendarAdditionalInfo ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x4 || 0-based day-of-week.<br />
|-<br />
| 0x4 || 0x4 || 0-based day-of-year.<br />
|-<br />
| 0x8 || ? || Timezone name string.<br />
|-<br />
| 0x10 || 0x4 || 0 = no DST, 1 = DST.<br />
|-<br />
| 0x14 || 0x4 || s32 seconds relative to UTC for this timezone.<br />
|}<br />
<br />
This is an 0x18-byte struct. This stores timezone info.<br />
<br />
[[Category:Services]]</div>
Thog
https://switchbrew.org/w/index.php?title=PCV_services&diff=4805
PCV services
2018-06-30T19:57:05Z
<p>Thog: </p>
<hr />
<div>= bpc =<br />
This is "nn::bpc::IBoardPowerControlManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || ShutdownSystem<br />
|-<br />
| 1 || RebootSystem<br />
|-<br />
| 2 || GetWakeupReason<br />
|-<br />
| 3 || GetShutdownReason<br />
|-<br />
| 4 || GetAcOk<br />
|-<br />
| 5 || GetBoardPowerControlEvent<br />
|-<br />
| 6 || GetSleepButtonState<br />
|-<br />
| 7 || GetPowerEvent<br />
|-<br />
| 8 ||<br />
|-<br />
| 9 ||<br />
|-<br />
| 10 ||<br />
|}<br />
<br />
= bpc:r =<br />
This is "nn::bpc::IRtcManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || GetExternalRtcValue<br />
|-<br />
| 1 || SetExternalRtcValue<br />
|-<br />
| 2 || ReadExternalRtcResetFlag<br />
|-<br />
| 3 || ClearExternalRtcResetFlag<br />
|}<br />
<br />
GetExternalRtcValue / SetExternalRtcValue directly accesses the max77620_rtc0 device.<br />
<br />
= pcv =<br />
This is "nn::pcv::detail::IPcvService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || SetPowerEnabled<br />
|-<br />
| 1 || SetClockEnabled<br />
|-<br />
| 2 || SetClockRate<br />
|-<br />
| 3 || GetClockRate<br />
|-<br />
| 4 || GetState<br />
|-<br />
| 5 || GetPossibleClockRates<br />
|-<br />
| 6 || SetMinVClockRate<br />
|-<br />
| 7 || SetReset<br />
|-<br />
| 8 || SetVoltageEnabled<br />
|-<br />
| 9 || GetVoltageEnabled<br />
|-<br />
| 10 || GetVoltageRange<br />
|-<br />
| 11 || SetVoltageValue<br />
|-<br />
| 12 || GetVoltageValue<br />
|-<br />
| 13 || GetTemperatureThresholds<br />
|-<br />
| 14 || SetTemperature<br />
|-<br />
| 15 || Initialize<br />
|-<br />
| 16 || IsInitialized<br />
|-<br />
| 17 || Finalize<br />
|-<br />
| 18 || PowerOn<br />
|-<br />
| 19 || PowerOff<br />
|-<br />
| 20 || ChangeVoltage<br />
|-<br />
| 21 || GetPowerClockInfoEvent<br />
|-<br />
| 22 || GetOscillatorClock<br />
|-<br />
| 23 || GetDvfsTable<br />
|-<br />
| 24 || GetModuleStateTable<br />
|-<br />
| 25 || GetPowerDomainStateTable<br />
|-<br />
| 26 || GetFuseInfo<br />
|-<br />
|}<br />
<br />
== User Name to Block Maps ==<br />
<br />
=== Power Switch / Clocking / Reset ===<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Name || Block || Rail || Notes<br />
|-<br />
| 0 || CpuBus || vdd_cpu ||<br />
|-<br />
| 1 || GPU || vdd_gpu ||<br />
|-<br />
| 2 || I2S1 || vdd_soc ||<br />
|-<br />
| 3 || I2S2 || vdd_soc ||<br />
|-<br />
| 4 || I2S3 || vdd_soc ||<br />
|-<br />
| 5 || PWM || vdd_soc ||<br />
|-<br />
| 6 || I2C1 || vdd_soc ||<br />
|-<br />
| 7 || I2C2 || vdd_soc ||<br />
|-<br />
| 8 || I2C3 || vdd_soc ||<br />
|-<br />
| 9 || I2C4 || vdd_soc ||<br />
|-<br />
| 10 || I2C5 || vdd_soc ||<br />
|-<br />
| 11 || I2C6 || vdd_soc ||<br />
|-<br />
| 12 || SPI1 || vdd_soc ||<br />
|-<br />
| 13 || SPI2 || vdd_soc ||<br />
|-<br />
| 14 || SPI3 || vdd_soc ||<br />
|-<br />
| 15 || SPI4 || vdd_soc ||<br />
|-<br />
| 16 || DISP1 || vdd_soc ||<br />
|-<br />
| 17 || DISP2 || vdd_soc ||<br />
|-<br />
| 20 || SDMMC1 || vdd_soc ||<br />
|-<br />
| 21 || SDMMC2 || vdd_soc ||<br />
|-<br />
| 22 || SDMMC3 || vdd_soc ||<br />
|-<br />
| 23 || SDMMC4 || vdd_soc ||<br />
|-<br />
| 24 || - || - || Not actual block. Used for debug and stuff.<br />
|-<br />
| 25 || CSITE || vdd_soc ||<br />
|-<br />
| 26 || TSEC || vdd_soc ||<br />
|-<br />
| 27 || MSELECT || vdd_soc ||<br />
|-<br />
| 28 || HDA2CODEC_2X || vdd_soc ||<br />
|-<br />
| 29 || ACTMON || vdd_soc ||<br />
|-<br />
| 30 || I2C_SLOW || vdd_soc ||<br />
|-<br />
| 31 || SOR1 || vdd_soc ||<br />
|-<br />
| 33 || HDA || vdd_soc ||<br />
|-<br />
| 34 || XUSB_CORE_HOST || vdd_soc ||<br />
|-<br />
| 35 || XUSB_FALCON || vdd_soc ||<br />
|-<br />
| 36 || XUSB_FS || vdd_soc ||<br />
|-<br />
| 37 || XUSB_CORE_DEV || vdd_soc ||<br />
|-<br />
| 38 || XUSB_SS_HOSTDEV || vdd_soc ||<br />
|-<br />
| 39 || UARTA || vdd_soc ||<br />
|-<br />
| 40 || UARTB || vdd_soc ||<br />
|-<br />
| 41 || UARTC || vdd_soc ||<br />
|-<br />
| 42 || UARTD || vdd_soc ||<br />
|-<br />
| 43 || HOST1X || vdd_soc ||<br />
|-<br />
| 44 || ENTROPY || vdd_soc ||<br />
|-<br />
| 45 || SOC_THERM || vdd_soc ||<br />
|-<br />
| 46 || VIC || vdd_soc ||<br />
|-<br />
| 47 || NVENC || vdd_soc ||<br />
|-<br />
| 48 || NVJPG || vdd_soc ||<br />
|-<br />
| 49 || NVDEC || vdd_soc ||<br />
|-<br />
| 50 || QSPI || vdd_soc ||<br />
|-<br />
| 52 || TSECB || vdd_soc ||<br />
|-<br />
| 53 || APE || vdd_soc ||<br />
|-<br />
| 54 || ACLK || vdd_soc ||<br />
|-<br />
| 55 || UARTAPE || vdd_soc ||<br />
|-<br />
| 56 || EMC || vdd_soc ||<br />
|-<br />
| 57 || PLLE0 || vdd_soc ||<br />
|-<br />
| 58 || PLLE0 || vdd_soc ||<br />
|-<br />
| 59 || DSI || vdd_soc ||<br />
|-<br />
| 60 || MAUD || vdd_soc ||<br />
|-<br />
| 61 || DPAUX1 || vdd_soc ||<br />
|-<br />
| 62 || MIPI_CAL || vdd_soc ||<br />
|-<br />
| 63 || UART_FST_MIPI_CAL || vdd_soc ||<br />
|-<br />
| 64 || OSC || vdd_soc ||<br />
|-<br />
| 65 || SCLK || vdd_soc ||<br />
|-<br />
| 66 || SOR_SAFE || vdd_soc ||<br />
|-<br />
| 67 || XUSB_SS || vdd_soc ||<br />
|-<br />
| 68 || XUSB_HOST || vdd_soc ||<br />
|-<br />
| 69 || XUSB_DEV || vdd_soc ||<br />
|-<br />
| 70 || EXTPERIPH1 || vdd_soc ||<br />
|-<br />
| 71 || AHUB || vdd_soc ||<br />
|-<br />
| 72 || HDA2HDMICODEC || vdd_soc ||<br />
|-<br />
| 73 || PLLP5 || vdd_soc ||<br />
|-<br />
| 74 || USBD || vdd_soc ||<br />
|-<br />
| 75 || USB2 || vdd_soc ||<br />
|-<br />
| 76 || PCIE || vdd_soc ||<br />
|-<br />
| 77 || AFI || vdd_soc ||<br />
|-<br />
| 78 || PCIEXCLK || vdd_soc ||<br />
|-<br />
| 79 || PEX_USB_UPHY || vdd_soc ||<br />
|-<br />
| 80 || XUSB_PADCTL || vdd_soc ||<br />
|-<br />
| 81 || APBDMA || vdd_soc ||<br />
|-<br />
| 82 || USB2_TRK || vdd_soc ||<br />
|-<br />
| 83 || PLLE0 || vdd_soc ||<br />
|-<br />
| 84 || PLLE0 || vdd_soc ||<br />
|-<br />
| 85 || CEC || vdd_soc ||<br />
|-<br />
|}<br />
<br />
=== Voltage ===<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Name || Block || Notes<br />
|-<br />
| 0 || max77620_sd0 || <br />
|-<br />
| 1 || max77620_sd1 || <br />
|-<br />
| 2 || max77620_sd2 || <br />
|-<br />
| 3 || max77620_sd3 || <br />
|-<br />
| 4 || max77620_ldo0 || 1.2v<br />
|-<br />
| 5 || max77620_ldo1 || <br />
|-<br />
| 6 || max77620_ldo2 || SDcard power, 3.3v - 1.8v<br />
|-<br />
| 7 || max77620_ldo3 || <br />
|-<br />
| 8 || max77620_ldo4 || RTC power, 0.85v<br />
|-<br />
| 9 || max77620_ldo5 || <br />
|-<br />
| 10 || max77620_ldo6 || AVDD touchscreen, 2.9v<br />
|-<br />
| 11 || max77620_ldo7 || <br />
|-<br />
| 12 || max77620_ldo8 || DisplayPort, 1.05v<br />
|-<br />
| 13 || max77621_cpu || <br />
|-<br />
| 14 || max77621_gpu || <br />
|-<br />
|}<br />
<br />
Note: max77620 GPIOs are only used internally by the driver during init, and not exposed via an API.<br />
<br />
= pcv:arb =<br />
This is "nn::pcv::IArbitrationManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || ReleaseControl<br />
|-<br />
|}<br />
<br />
= pcv:imm =<br />
This is "nn::pcv::IImmediateManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || SetClockRate<br />
|-<br />
|}<br />
<br />
= time:u, time:a, time:s =<br />
This is "nn::timesrv::detail::service::IStaticService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetStandardUserSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 1 || GetStandardNetworkSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 2 || GetStandardSteadyClock || Returns an [[#ISteadyClock]].<br />
|-<br />
| 3 || GetTimeZoneService || Returns an [[#ITimeZoneService]].<br />
|-<br />
| 4 || GetStandardLocalSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 5 || [4.0.0+] GetEphemeralNetworkSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 50 || [4.0.0+] SetStandardSteadyClockInternalOffset || <br />
|-<br />
| 100 || IsStandardUserSystemClockAutomaticCorrectionEnabled || <br />
|-<br />
| 101 || SetStandardUserSystemClockAutomaticCorrectionEnabled || <br />
|-<br />
| 102 || [5.0.0+] GetStandardUserSystemClockInitialYear || <br />
|-<br />
| 200 || IsStandardNetworkSystemClockAccuracySufficient || <br />
|-<br />
| 300 || [4.0.0+] CalculateMonotonicSystemClockBaseTimePoint || <br />
|-<br />
| 400 || [4.0.0+] GetClockSnapshot || <br />
|-<br />
| 401 || [4.0.0+] GetClockSnapshotFromSystemClockContext || <br />
|-<br />
| 500 || [4.0.0+] CalculateStandardUserSystemClockDifferenceByUser || <br />
|-<br />
| 501 || [4.0.0+] CalculateSpanBetween || <br />
|}<br />
<br />
== ISteadyClock ==<br />
This is "nn::timesrv::detail::service::ISteadyClock".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetCurrentTimePoint || No input, returns an output [[#SteadyClockTimePoint]].<br />
|-<br />
| 2 || GetTestOffset || No input, returns an output [[#TimeSpanType]].<br />
|-<br />
| 3 || SetTestOffset || Takes an input [[#TimeSpanType]], no output.<br />
|-<br />
| 100 || GetRtcValue || No input, returns an output s64.<br />
|-<br />
| 101 || IsRtcResetDetected || No input, returns an output u8 bool.<br />
|-<br />
| 102 || GetSetupResultValue || No input, returns an output u32.<br />
|-<br />
| 200 || GetInternalOffset || No input, returns an output [[#TimeSpanType]].<br />
|-<br />
| 201 || SetInternalOffset || Takes an input [[#TimeSpanType]], no output. Removed in [4.0.0+].<br />
|}<br />
<br />
=== SteadyClockTimePoint ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x8|| a u64 representing a point in time.<br />
|-<br />
| 0x8 || 0x10 || ?<br />
|}<br />
This is a 0x18-byte struct.<br />
<br />
=== TimeSpanType ===<br />
This is an u64.<br />
<br />
== ISystemClock ==<br />
This is "nn::timesrv::detail::service::ISystemClock".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetCurrentTime || Returns an output [[#PosixTime]].<br />
|-<br />
| 1 || SetCurrentTime || Takes an input [[#PosixTime]].<br />
|-<br />
| 2 || GetSystemClockContext || Returns an output [[#SystemClockContext]].<br />
|-<br />
| 3 || SetSystemClockContext || Takes an input [[#SystemClockContext]].<br />
|-<br />
|}<br />
<br />
=== PosixTime ===<br />
This is an u64 for UTC POSIX time.<br />
<br />
=== SystemClockContext ===<br />
This is an 0x20-byte struct.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x8|| a [[#PosixTime]] representing the system clock epoch.<br />
|-<br />
| 0x8 || 0x18 || a [[#SteadyClockTimePoint]]<br />
|}<br />
<br />
== ITimeZoneService ==<br />
This is "nn::timesrv::detail::service::ITimeZoneService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetDeviceLocationName || No input, returns an output [[#LocationName]].<br />
|-<br />
| 1 || SetDeviceLocationName || Takes an input [[#LocationName]], no output.<br />
|-<br />
| 2 || GetTotalLocationNameCount || No input, returns an output s32.<br />
|-<br />
| 3 || LoadLocationNameList || <br />
|-<br />
| 4 || LoadTimeZoneRule || Takes an input [[#LocationName]] and a type-0x16 output buffer for [[#TimeZoneRule]], no output.<br />
|-<br />
| 5 || GetTimeZoneRuleVersion || No input, returns an output [[#TimeZoneRuleVersion]].<br />
|-<br />
| 100 || ToCalendarTime || Takes an input [[#PosixTime]] and a type-0x15 input buffer for [[#TimeZoneRule]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].<br />
|-<br />
| 101 || ToCalendarTimeWithMyRule || Takes an input [[#PosixTime]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].<br />
|-<br />
| 200 || ToPosixTime || Takes an input [[#CalendarTime]], a type-0x15 input buffer for [[#TimeZoneRule]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.<br />
|-<br />
| 201 || ToPosixTimeWithMyRule || Takes an input [[#CalendarTime]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.<br />
|-<br />
|}<br />
<br />
=== LoadLocationNameList ===<br />
Takes an input s32 LocationName_index and a type-0x6 output buffer for [[#LocationName]], returns an output s32 for total output entries.<br />
<br />
=== LocationName ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x10 || Location name string, no NUL-terminator.<br />
|-<br />
| 0x10 || ? || <br />
|-<br />
| 0x18 || 0x8? || ?<br />
|-<br />
| 0x20 || ? || ?<br />
|}<br />
<br />
This is an 0x24-byte struct.<br />
<br />
=== TimeZoneRule ===<br />
This is an 0x4000-byte struct. Official sw uses fixed-size 0x4000 for the buffer size with the above commands.<br />
<br />
=== TimeZoneRuleVersion ===<br />
This is an u128.<br />
<br />
=== CalendarTime ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x2 || Year<br />
|-<br />
| 0x2 || 0x1 || Month<br />
|-<br />
| 0x3 || 0x1 || Day<br />
|-<br />
| 0x4 || 0x1 || Hour<br />
|-<br />
| 0x5 || 0x1 || Minute<br />
|-<br />
| 0x6 || 0x1 || Second<br />
|-<br />
| 0x7 || 0x1 || Padding / unknown?<br />
|}<br />
<br />
This is an 0x8-byte struct.<br />
<br />
=== CalendarAdditionalInfo ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x4 || 0-based day-of-week.<br />
|-<br />
| 0x4 || 0x4 || 0-based day-of-year.<br />
|-<br />
| 0x8 || ? || Timezone name string.<br />
|-<br />
| 0x10 || 0x4 || 0 = no DST, 1 = DST.<br />
|-<br />
| 0x14 || 0x4 || s32 seconds relative to UTC for this timezone.<br />
|}<br />
<br />
This is an 0x18-byte struct. This stores timezone info.<br />
<br />
[[Category:Services]]</div>
Thog
https://switchbrew.org/w/index.php?title=PCV_services&diff=4804
PCV services
2018-06-30T18:01:33Z
<p>Thog: SystemClockContext & SteadyClockTimePoint</p>
<hr />
<div>= bpc =<br />
This is "nn::bpc::IBoardPowerControlManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || ShutdownSystem<br />
|-<br />
| 1 || RebootSystem<br />
|-<br />
| 2 || GetWakeupReason<br />
|-<br />
| 3 || GetShutdownReason<br />
|-<br />
| 4 || GetAcOk<br />
|-<br />
| 5 || GetBoardPowerControlEvent<br />
|-<br />
| 6 || GetSleepButtonState<br />
|-<br />
| 7 || GetPowerEvent<br />
|-<br />
| 8 ||<br />
|-<br />
| 9 ||<br />
|-<br />
| 10 ||<br />
|}<br />
<br />
= bpc:r =<br />
This is "nn::bpc::IRtcManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || GetExternalRtcValue<br />
|-<br />
| 1 || SetExternalRtcValue<br />
|-<br />
| 2 || ReadExternalRtcResetFlag<br />
|-<br />
| 3 || ClearExternalRtcResetFlag<br />
|}<br />
<br />
GetExternalRtcValue / SetExternalRtcValue directly accesses the max77620_rtc0 device.<br />
<br />
= pcv =<br />
This is "nn::pcv::detail::IPcvService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || SetPowerEnabled<br />
|-<br />
| 1 || SetClockEnabled<br />
|-<br />
| 2 || SetClockRate<br />
|-<br />
| 3 || GetClockRate<br />
|-<br />
| 4 || GetState<br />
|-<br />
| 5 || GetPossibleClockRates<br />
|-<br />
| 6 || SetMinVClockRate<br />
|-<br />
| 7 || SetReset<br />
|-<br />
| 8 || SetVoltageEnabled<br />
|-<br />
| 9 || GetVoltageEnabled<br />
|-<br />
| 10 || GetVoltageRange<br />
|-<br />
| 11 || SetVoltageValue<br />
|-<br />
| 12 || GetVoltageValue<br />
|-<br />
| 13 || GetTemperatureThresholds<br />
|-<br />
| 14 || SetTemperature<br />
|-<br />
| 15 || Initialize<br />
|-<br />
| 16 || IsInitialized<br />
|-<br />
| 17 || Finalize<br />
|-<br />
| 18 || PowerOn<br />
|-<br />
| 19 || PowerOff<br />
|-<br />
| 20 || ChangeVoltage<br />
|-<br />
| 21 || GetPowerClockInfoEvent<br />
|-<br />
| 22 || GetOscillatorClock<br />
|-<br />
| 23 || GetDvfsTable<br />
|-<br />
| 24 || GetModuleStateTable<br />
|-<br />
| 25 || GetPowerDomainStateTable<br />
|-<br />
| 26 || GetFuseInfo<br />
|-<br />
|}<br />
<br />
== User Name to Block Maps ==<br />
<br />
=== Power Switch / Clocking / Reset ===<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Name || Block || Rail || Notes<br />
|-<br />
| 0 || CpuBus || vdd_cpu ||<br />
|-<br />
| 1 || GPU || vdd_gpu ||<br />
|-<br />
| 2 || I2S1 || vdd_soc ||<br />
|-<br />
| 3 || I2S2 || vdd_soc ||<br />
|-<br />
| 4 || I2S3 || vdd_soc ||<br />
|-<br />
| 5 || PWM || vdd_soc ||<br />
|-<br />
| 6 || I2C1 || vdd_soc ||<br />
|-<br />
| 7 || I2C2 || vdd_soc ||<br />
|-<br />
| 8 || I2C3 || vdd_soc ||<br />
|-<br />
| 9 || I2C4 || vdd_soc ||<br />
|-<br />
| 10 || I2C5 || vdd_soc ||<br />
|-<br />
| 11 || I2C6 || vdd_soc ||<br />
|-<br />
| 12 || SPI1 || vdd_soc ||<br />
|-<br />
| 13 || SPI2 || vdd_soc ||<br />
|-<br />
| 14 || SPI3 || vdd_soc ||<br />
|-<br />
| 15 || SPI4 || vdd_soc ||<br />
|-<br />
| 16 || DISP1 || vdd_soc ||<br />
|-<br />
| 17 || DISP2 || vdd_soc ||<br />
|-<br />
| 20 || SDMMC1 || vdd_soc ||<br />
|-<br />
| 21 || SDMMC2 || vdd_soc ||<br />
|-<br />
| 22 || SDMMC3 || vdd_soc ||<br />
|-<br />
| 23 || SDMMC4 || vdd_soc ||<br />
|-<br />
| 24 || - || - || Not actual block. Used for debug and stuff.<br />
|-<br />
| 25 || CSITE || vdd_soc ||<br />
|-<br />
| 26 || TSEC || vdd_soc ||<br />
|-<br />
| 27 || MSELECT || vdd_soc ||<br />
|-<br />
| 28 || HDA2CODEC_2X || vdd_soc ||<br />
|-<br />
| 29 || ACTMON || vdd_soc ||<br />
|-<br />
| 30 || I2C_SLOW || vdd_soc ||<br />
|-<br />
| 31 || SOR1 || vdd_soc ||<br />
|-<br />
| 33 || HDA || vdd_soc ||<br />
|-<br />
| 34 || XUSB_CORE_HOST || vdd_soc ||<br />
|-<br />
| 35 || XUSB_FALCON || vdd_soc ||<br />
|-<br />
| 36 || XUSB_FS || vdd_soc ||<br />
|-<br />
| 37 || XUSB_CORE_DEV || vdd_soc ||<br />
|-<br />
| 38 || XUSB_SS_HOSTDEV || vdd_soc ||<br />
|-<br />
| 39 || UARTA || vdd_soc ||<br />
|-<br />
| 40 || UARTB || vdd_soc ||<br />
|-<br />
| 41 || UARTC || vdd_soc ||<br />
|-<br />
| 42 || UARTD || vdd_soc ||<br />
|-<br />
| 43 || HOST1X || vdd_soc ||<br />
|-<br />
| 44 || ENTROPY || vdd_soc ||<br />
|-<br />
| 45 || SOC_THERM || vdd_soc ||<br />
|-<br />
| 46 || VIC || vdd_soc ||<br />
|-<br />
| 47 || NVENC || vdd_soc ||<br />
|-<br />
| 48 || NVJPG || vdd_soc ||<br />
|-<br />
| 49 || NVDEC || vdd_soc ||<br />
|-<br />
| 50 || QSPI || vdd_soc ||<br />
|-<br />
| 52 || TSECB || vdd_soc ||<br />
|-<br />
| 53 || APE || vdd_soc ||<br />
|-<br />
| 54 || ACLK || vdd_soc ||<br />
|-<br />
| 55 || UARTAPE || vdd_soc ||<br />
|-<br />
| 56 || EMC || vdd_soc ||<br />
|-<br />
| 57 || PLLE0 || vdd_soc ||<br />
|-<br />
| 58 || PLLE0 || vdd_soc ||<br />
|-<br />
| 59 || DSI || vdd_soc ||<br />
|-<br />
| 60 || MAUD || vdd_soc ||<br />
|-<br />
| 61 || DPAUX1 || vdd_soc ||<br />
|-<br />
| 62 || MIPI_CAL || vdd_soc ||<br />
|-<br />
| 63 || UART_FST_MIPI_CAL || vdd_soc ||<br />
|-<br />
| 64 || OSC || vdd_soc ||<br />
|-<br />
| 65 || SCLK || vdd_soc ||<br />
|-<br />
| 66 || SOR_SAFE || vdd_soc ||<br />
|-<br />
| 67 || XUSB_SS || vdd_soc ||<br />
|-<br />
| 68 || XUSB_HOST || vdd_soc ||<br />
|-<br />
| 69 || XUSB_DEV || vdd_soc ||<br />
|-<br />
| 70 || EXTPERIPH1 || vdd_soc ||<br />
|-<br />
| 71 || AHUB || vdd_soc ||<br />
|-<br />
| 72 || HDA2HDMICODEC || vdd_soc ||<br />
|-<br />
| 73 || PLLP5 || vdd_soc ||<br />
|-<br />
| 74 || USBD || vdd_soc ||<br />
|-<br />
| 75 || USB2 || vdd_soc ||<br />
|-<br />
| 76 || PCIE || vdd_soc ||<br />
|-<br />
| 77 || AFI || vdd_soc ||<br />
|-<br />
| 78 || PCIEXCLK || vdd_soc ||<br />
|-<br />
| 79 || PEX_USB_UPHY || vdd_soc ||<br />
|-<br />
| 80 || XUSB_PADCTL || vdd_soc ||<br />
|-<br />
| 81 || APBDMA || vdd_soc ||<br />
|-<br />
| 82 || USB2_TRK || vdd_soc ||<br />
|-<br />
| 83 || PLLE0 || vdd_soc ||<br />
|-<br />
| 84 || PLLE0 || vdd_soc ||<br />
|-<br />
| 85 || CEC || vdd_soc ||<br />
|-<br />
|}<br />
<br />
=== Voltage ===<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Name || Block || Notes<br />
|-<br />
| 0 || max77620_sd0 || <br />
|-<br />
| 1 || max77620_sd1 || <br />
|-<br />
| 2 || max77620_sd2 || <br />
|-<br />
| 3 || max77620_sd3 || <br />
|-<br />
| 4 || max77620_ldo0 || 1.2v<br />
|-<br />
| 5 || max77620_ldo1 || <br />
|-<br />
| 6 || max77620_ldo2 || SDcard power, 3.3v - 1.8v<br />
|-<br />
| 7 || max77620_ldo3 || <br />
|-<br />
| 8 || max77620_ldo4 || RTC power, 0.85v<br />
|-<br />
| 9 || max77620_ldo5 || <br />
|-<br />
| 10 || max77620_ldo6 || AVDD touchscreen, 2.9v<br />
|-<br />
| 11 || max77620_ldo7 || <br />
|-<br />
| 12 || max77620_ldo8 || DisplayPort, 1.05v<br />
|-<br />
| 13 || max77621_cpu || <br />
|-<br />
| 14 || max77621_gpu || <br />
|-<br />
|}<br />
<br />
Note: max77620 GPIOs are only used internally by the driver during init, and not exposed via an API.<br />
<br />
= pcv:arb =<br />
This is "nn::pcv::IArbitrationManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || ReleaseControl<br />
|-<br />
|}<br />
<br />
= pcv:imm =<br />
This is "nn::pcv::IImmediateManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || SetClockRate<br />
|-<br />
|}<br />
<br />
= time:u, time:a, time:s =<br />
This is "nn::timesrv::detail::service::IStaticService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetStandardUserSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 1 || GetStandardNetworkSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 2 || GetStandardSteadyClock || Returns an [[#ISteadyClock]].<br />
|-<br />
| 3 || GetTimeZoneService || Returns an [[#ITimeZoneService]].<br />
|-<br />
| 4 || GetStandardLocalSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 5 || [4.0.0+] GetEphemeralNetworkSystemClock || Returns an [[#ISystemClock]].<br />
|-<br />
| 50 || [4.0.0+] SetStandardSteadyClockInternalOffset || <br />
|-<br />
| 100 || IsStandardUserSystemClockAutomaticCorrectionEnabled || <br />
|-<br />
| 101 || SetStandardUserSystemClockAutomaticCorrectionEnabled || <br />
|-<br />
| 102 || [5.0.0+] GetStandardUserSystemClockInitialYear || <br />
|-<br />
| 200 || IsStandardNetworkSystemClockAccuracySufficient || <br />
|-<br />
| 300 || [4.0.0+] CalculateMonotonicSystemClockBaseTimePoint || <br />
|-<br />
| 400 || [4.0.0+] GetClockSnapshot || <br />
|-<br />
| 401 || [4.0.0+] GetClockSnapshotFromSystemClockContext || <br />
|-<br />
| 500 || [4.0.0+] CalculateStandardUserSystemClockDifferenceByUser || <br />
|-<br />
| 501 || [4.0.0+] CalculateSpanBetween || <br />
|}<br />
<br />
== ISteadyClock ==<br />
This is "nn::timesrv::detail::service::ISteadyClock".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetCurrentTimePoint || No input, returns an output [[#SteadyClockTimePoint]].<br />
|-<br />
| 2 || GetTestOffset || No input, returns an output [[#TimeSpanType]].<br />
|-<br />
| 3 || SetTestOffset || Takes an input [[#TimeSpanType]], no output.<br />
|-<br />
| 100 || GetRtcValue || No input, returns an output s64.<br />
|-<br />
| 101 || IsRtcResetDetected || No input, returns an output u8 bool.<br />
|-<br />
| 102 || GetSetupResultValue || No input, returns an output u32.<br />
|-<br />
| 200 || GetInternalOffset || No input, returns an output [[#TimeSpanType]].<br />
|-<br />
| 201 || SetInternalOffset || Takes an input [[#TimeSpanType]], no output. Removed in [4.0.0+].<br />
|}<br />
<br />
=== SteadyClockTimePoint ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x8|| a [[#PosixTime]] representing a point in time.<br />
|-<br />
| 0x8 || 0x10 || ?<br />
|}<br />
This is a 0x18-byte struct.<br />
<br />
=== TimeSpanType ===<br />
This is an u64.<br />
<br />
== ISystemClock ==<br />
This is "nn::timesrv::detail::service::ISystemClock".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetCurrentTime || Returns an output [[#PosixTime]].<br />
|-<br />
| 1 || SetCurrentTime || Takes an input [[#PosixTime]].<br />
|-<br />
| 2 || GetSystemClockContext || Returns an output [[#SystemClockContext]].<br />
|-<br />
| 3 || SetSystemClockContext || Takes an input [[#SystemClockContext]].<br />
|-<br />
|}<br />
<br />
=== PosixTime ===<br />
This is an u64 for UTC POSIX time.<br />
<br />
=== SystemClockContext ===<br />
This is an 0x20-byte struct.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x8|| a [[#PosixTime]] representing the system clock epoch.<br />
|-<br />
| 0x8 || 0x18 || a [[#SteadyClockTimePoint]]<br />
|}<br />
<br />
== ITimeZoneService ==<br />
This is "nn::timesrv::detail::service::ITimeZoneService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name || Notes<br />
|-<br />
| 0 || GetDeviceLocationName || No input, returns an output [[#LocationName]].<br />
|-<br />
| 1 || SetDeviceLocationName || Takes an input [[#LocationName]], no output.<br />
|-<br />
| 2 || GetTotalLocationNameCount || No input, returns an output s32.<br />
|-<br />
| 3 || LoadLocationNameList || <br />
|-<br />
| 4 || LoadTimeZoneRule || Takes an input [[#LocationName]] and a type-0x16 output buffer for [[#TimeZoneRule]], no output.<br />
|-<br />
| 5 || GetTimeZoneRuleVersion || No input, returns an output [[#TimeZoneRuleVersion]].<br />
|-<br />
| 100 || ToCalendarTime || Takes an input [[#PosixTime]] and a type-0x15 input buffer for [[#TimeZoneRule]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].<br />
|-<br />
| 101 || ToCalendarTimeWithMyRule || Takes an input [[#PosixTime]], returns an output [[#CalendarTime]] and [[#CalendarAdditionalInfo]].<br />
|-<br />
| 200 || ToPosixTime || Takes an input [[#CalendarTime]], a type-0x15 input buffer for [[#TimeZoneRule]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.<br />
|-<br />
| 201 || ToPosixTimeWithMyRule || Takes an input [[#CalendarTime]], an type-0xA output buffer for [[#PosixTime]] array, and returns an output s32.<br />
|-<br />
|}<br />
<br />
=== LoadLocationNameList ===<br />
Takes an input s32 LocationName_index and a type-0x6 output buffer for [[#LocationName]], returns an output s32 for total output entries.<br />
<br />
=== LocationName ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x10 || Location name string, no NUL-terminator.<br />
|-<br />
| 0x10 || ? || <br />
|-<br />
| 0x18 || 0x8? || ?<br />
|-<br />
| 0x20 || ? || ?<br />
|}<br />
<br />
This is an 0x24-byte struct.<br />
<br />
=== TimeZoneRule ===<br />
This is an 0x4000-byte struct. Official sw uses fixed-size 0x4000 for the buffer size with the above commands.<br />
<br />
=== TimeZoneRuleVersion ===<br />
This is an u128.<br />
<br />
=== CalendarTime ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x2 || Year<br />
|-<br />
| 0x2 || 0x1 || Month<br />
|-<br />
| 0x3 || 0x1 || Day<br />
|-<br />
| 0x4 || 0x1 || Hour<br />
|-<br />
| 0x5 || 0x1 || Minute<br />
|-<br />
| 0x6 || 0x1 || Second<br />
|-<br />
| 0x7 || 0x1 || Padding / unknown?<br />
|}<br />
<br />
This is an 0x8-byte struct.<br />
<br />
=== CalendarAdditionalInfo ===<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset || Size || Description<br />
|-<br />
| 0x0 || 0x4 || 0-based day-of-week.<br />
|-<br />
| 0x4 || 0x4 || 0-based day-of-year.<br />
|-<br />
| 0x8 || ? || Timezone name string.<br />
|-<br />
| 0x10 || 0x4 || 0 = no DST, 1 = DST.<br />
|-<br />
| 0x14 || 0x4 || s32 seconds relative to UTC for this timezone.<br />
|}<br />
<br />
This is an 0x18-byte struct. This stores timezone info.<br />
<br />
[[Category:Services]]</div>
Thog
https://switchbrew.org/w/index.php?title=Error_Report_services&diff=4722
Error Report services
2018-05-31T21:44:42Z
<p>Thog: erpt:c Cmd 2 to 5 -> 3.0.0+</p>
<hr />
<div>= erpt:c =<br />
This is "nn::erpt::sf::IContext".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || SubmitContext<br />
|-<br />
| 1 || CreateReport<br />
|-<br />
| 2 || [3.0.0+]<br />
|-<br />
| 3 || [3.0.0+]<br />
|-<br />
| 4 || [3.0.0+]<br />
|-<br />
| 5 || [3.0.0+]<br />
|-<br />
| 6 || [5.0.0+]<br />
|}<br />
<br />
= erpt:r =<br />
This is "nn::erpt::sf::ISession".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || OpenReport<br />
|-<br />
| 1 || OpenManager<br />
|}<br />
<br />
== IReport ==<br />
This is "nn::erpt::sf::IReport".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || Open<br />
|-<br />
| 1 || Read<br />
|-<br />
| 2 || SetFlags<br />
|-<br />
| 3 || GetFlags<br />
|-<br />
| 4 || Close<br />
|-<br />
| 5 || GetSize<br />
|}<br />
<br />
== IManager ==<br />
This is "nn::erpt::sf::IManager".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 0 || GetReportList<br />
|-<br />
| 1 || GetEvent<br />
|-<br />
| 2 || [4.0.0+]<br />
|-<br />
| 3 || [5.0.0+]<br />
|-<br />
| 4 || [5.0.0+]<br />
|}<br />
<br />
= Reports =<br />
== Fields ==<br />
{| class="wikitable" border="1"<br />
|-<br />
! Name<br />
! Format<br />
! Description<br />
|-<br />
| TestU64<br />
| <br />
| <br />
|-<br />
| TestU32<br />
| <br />
| <br />
|-<br />
| TestI64<br />
| <br />
| <br />
|-<br />
| TestI32<br />
| <br />
| <br />
|-<br />
| TestString<br />
| <br />
| <br />
|-<br />
| TestU8Array<br />
| <br />
| <br />
|-<br />
| TestU32Array<br />
| <br />
| <br />
|-<br />
| TestU64Array<br />
| <br />
| <br />
|-<br />
| TestI32Array<br />
| <br />
| <br />
|-<br />
| TestI64Array<br />
| <br />
| <br />
|-<br />
| ErrorCode<br />
| <br />
| <br />
|-<br />
| ErrorDescription<br />
| <br />
| <br />
|-<br />
| OccurrenceTimestamp<br />
| Integer<br />
| UTC unix timestamp from [[PCV_services|user-time]].<br />
|-<br />
| ReportIdentifier<br />
| <br />
| <br />
|-<br />
| ConnectionStatus<br />
| <br />
| <br />
|-<br />
| AccessPointSSID<br />
| <br />
| <br />
|-<br />
| AccessPointSecurityType<br />
| <br />
| <br />
|-<br />
| RadioStrength<br />
| <br />
| <br />
|-<br />
| NXMacAddress<br />
| <br />
| <br />
|-<br />
| IPAddressAcquisitionMethod<br />
| <br />
| <br />
|-<br />
| CurrentIPAddress<br />
| <br />
| <br />
|-<br />
| SubnetMask<br />
| <br />
| <br />
|-<br />
| GatewayIPAddress<br />
| <br />
| <br />
|-<br />
| DNSType<br />
| <br />
| <br />
|-<br />
| PriorityDNSIPAddress<br />
| <br />
| <br />
|-<br />
| AlternateDNSIPAddress<br />
| <br />
| <br />
|-<br />
| UseProxyFlag<br />
| <br />
| <br />
|-<br />
| ProxyIPAddress<br />
| <br />
| <br />
|-<br />
| ProxyPort<br />
| <br />
| <br />
|-<br />
| ProxyAutoAuthenticateFlag<br />
| <br />
| <br />
|-<br />
| MTU<br />
| <br />
| <br />
|-<br />
| ConnectAutomaticallyFlag<br />
| <br />
| <br />
|-<br />
| UseStealthNetworkFlag<br />
| <br />
| <br />
|-<br />
| LimitHighCapacityFlag<br />
| <br />
| <br />
|-<br />
| NATType<br />
| <br />
| <br />
|-<br />
| WirelessAPMacAddress<br />
| <br />
| <br />
|-<br />
| GlobalIPAddress<br />
| <br />
| <br />
|-<br />
| EnableWirelessInterfaceFlag<br />
| <br />
| <br />
|-<br />
| EnableWifiFlag<br />
| <br />
| <br />
|-<br />
| EnableBluetoothFlag<br />
| <br />
| <br />
|-<br />
| EnableNFCFlag<br />
| <br />
| <br />
|-<br />
| NintendoZoneSSIDListVersion<br />
| <br />
| <br />
|-<br />
| LANAdapterMacAddress<br />
| <br />
| <br />
|-<br />
| ApplicationID<br />
| <br />
| <br />
|-<br />
| ApplicationTitle<br />
| <br />
| <br />
|-<br />
| ApplicationVersion<br />
| <br />
| <br />
|-<br />
| ApplicationStorageLocation<br />
| <br />
| <br />
|-<br />
| DownloadContentType<br />
| <br />
| <br />
|-<br />
| InstallContentType<br />
| <br />
| <br />
|-<br />
| ConsoleStartingUpFlag<br />
| <br />
| <br />
|-<br />
| SystemStartingUpFlag<br />
| <br />
| <br />
|-<br />
| ConsoleFirstInitFlag<br />
| <br />
| <br />
|-<br />
| HomeMenuScreenDisplayedFlag<br />
| <br />
| <br />
|-<br />
| DataManagementScreenDisplayedFlag<br />
| <br />
| <br />
|-<br />
| ConnectionTestingFlag<br />
| <br />
| <br />
|-<br />
| ApplicationRunningFlag<br />
| <br />
| <br />
|-<br />
| DataCorruptionDetectedFlag<br />
| <br />
| <br />
|-<br />
| ProductModel<br />
| <br />
| <br />
|-<br />
| CurrentLanguage<br />
| <br />
| <br />
|-<br />
| UseNetworkTimeProtocolFlag<br />
| <br />
| <br />
|-<br />
| TimeZone<br />
| <br />
| <br />
|-<br />
| ControllerFirmware<br />
| <br />
| <br />
|-<br />
| VideoOutputSetting<br />
| <br />
| <br />
|-<br />
| NANDFreeSpace<br />
| <br />
| <br />
|-<br />
| SDCardFreeSpace<br />
| <br />
| <br />
|-<br />
| SerialNumber<br />
| <br />
| <br />
|-<br />
| OsVersion<br />
| <br />
| <br />
|-<br />
| ScreenBrightnessAutoAdjustFlag<br />
| <br />
| <br />
|-<br />
| HdmiAudioOutputMode<br />
| <br />
| <br />
|-<br />
| SpeakerAudioOutputMode<br />
| <br />
| <br />
|-<br />
| HeadphoneAudioOutputMode<br />
| <br />
| <br />
|-<br />
| MuteOnHeadsetUnpluggedFlag<br />
| <br />
| <br />
|-<br />
| NumUserRegistered<br />
| <br />
| <br />
|-<br />
| StorageAutoOrganizeFlag<br />
| <br />
| <br />
|-<br />
| ControllerVibrationVolume<br />
| <br />
| <br />
|-<br />
| LockScreenFlag<br />
| <br />
| <br />
|-<br />
| InternalBatteryLotNumber<br />
| <br />
| <br />
|-<br />
| LeftControllerSerialNumber<br />
| <br />
| <br />
|-<br />
| RightControllerSerialNumber<br />
| <br />
| <br />
|-<br />
| NotifyInGameDownloadCompletionFlag<br />
| <br />
| <br />
|-<br />
| NotificationSoundFlag<br />
| <br />
| <br />
|-<br />
| TVResolutionSetting<br />
| <br />
| <br />
|-<br />
| RGBRangeSetting<br />
| <br />
| <br />
|-<br />
| ReduceScreenBurnFlag<br />
| <br />
| <br />
|-<br />
| TVAllowsCecFlag<br />
| <br />
| <br />
|-<br />
| HandheldModeTimeToScreenSleep<br />
| <br />
| <br />
|-<br />
| ConsoleModeTimeToScreenSleep<br />
| <br />
| <br />
|-<br />
| StopAutoSleepDuringContentPlayFlag<br />
| <br />
| <br />
|-<br />
| LastConnectionTestDownloadSpeed<br />
| <br />
| <br />
|-<br />
| LastConnectionTestUploadSpeed<br />
| <br />
| <br />
|-<br />
| [5.0.0+] DEPRECATED_ServerFQDN ([1.0.0-4.1.0] ServerFQDN)<br />
| <br />
| <br />
|-<br />
| HTTPRequestContents<br />
| <br />
| <br />
|-<br />
| HTTPRequestResponseContents<br />
| <br />
| <br />
|-<br />
| EdgeServerIPAddress<br />
| <br />
| <br />
|-<br />
| CDNContentPath<br />
| <br />
| <br />
|-<br />
| FileAccessPath<br />
| <br />
| <br />
|-<br />
| GameCardCID<br />
| <br />
| <br />
|-<br />
| NANDCID<br />
| <br />
| <br />
|-<br />
| MicroSDCID<br />
| <br />
| <br />
|-<br />
| NANDSpeedMode<br />
| <br />
| <br />
|-<br />
| MicroSDSpeedMode<br />
| <br />
| <br />
|-<br />
| GameCardSpeedMode<br />
| <br />
| <br />
|-<br />
| UserAccountInternalID<br />
| <br />
| <br />
|-<br />
| NetworkServiceAccountInternalID<br />
| <br />
| <br />
|-<br />
| NintendoAccountInternalID<br />
| <br />
| <br />
|-<br />
| USB3AvailableFlag<br />
| <br />
| <br />
|-<br />
| CallStack<br />
| <br />
| <br />
|-<br />
| SystemStartupLog<br />
| <br />
| <br />
|-<br />
| RegionSetting<br />
| <br />
| <br />
|-<br />
| NintendoZoneConnectedFlag<br />
| <br />
| <br />
|-<br />
| ForcedSleepHighTemperatureReading<br />
| <br />
| <br />
|-<br />
| ForcedSleepFanSpeedReading<br />
| <br />
| <br />
|-<br />
| ForcedSleepHWInfo<br />
| <br />
| <br />
|-<br />
| AbnormalPowerStateInfo<br />
| <br />
| <br />
|-<br />
| ScreenBrightnessLevel<br />
| <br />
| <br />
|-<br />
| ProgramId<br />
| <br />
| <br />
|-<br />
| AbortFlag<br />
| <br />
| <br />
|-<br />
| ReportVisibilityFlag<br />
| <br />
| <br />
|-<br />
| FatalFlag<br />
| <br />
| <br />
|-<br />
| OccurrenceTimestampNet<br />
| Integer<br />
| UTC unix timestamp from [[PCV_services|network-time]].<br />
|-<br />
| ResultBacktrace<br />
| <br />
| <br />
|-<br />
| GeneralRegisterAarch32<br />
| <br />
| <br />
|-<br />
| StackBacktrace32<br />
| <br />
| <br />
|-<br />
| ExceptionInfoAarch32<br />
| <br />
| <br />
|-<br />
| GeneralRegisterAarch64<br />
| <br />
| <br />
|-<br />
| ExceptionInfoAarch64<br />
| <br />
| <br />
|-<br />
| StackBacktrace64<br />
| <br />
| <br />
|-<br />
| RegisterSetFlag32<br />
| <br />
| <br />
|-<br />
| RegisterSetFlag64<br />
| <br />
| <br />
|-<br />
| ProgramMappedAddr32<br />
| <br />
| <br />
|-<br />
| ProgramMappedAddr64<br />
| <br />
| <br />
|-<br />
| AbortType<br />
| <br />
| <br />
|-<br />
| PrivateOsVersion<br />
| <br />
| <br />
|-<br />
| CurrentSystemPowerState<br />
| <br />
| <br />
|-<br />
| PreviousSystemPowerState<br />
| <br />
| <br />
|-<br />
| DestinationSystemPowerState<br />
| <br />
| <br />
|-<br />
| PscTransitionCurrentState<br />
| <br />
| <br />
|-<br />
| PscTransitionPreviousState<br />
| <br />
| <br />
|-<br />
| PscInitializedList<br />
| <br />
| <br />
|-<br />
| PscCurrentPmStateList<br />
| <br />
| <br />
|-<br />
| PscNextPmStateList<br />
| <br />
| <br />
|-<br />
| PerformanceMode<br />
| <br />
| <br />
|-<br />
| PerformanceConfiguration<br />
| <br />
| <br />
|-<br />
| Throttled<br />
| <br />
| <br />
|-<br />
| ThrottlingDuration<br />
| <br />
| <br />
|-<br />
| ThrottlingTimestamp<br />
| Integer<br />
| UTC unix timestamp<br />
|-<br />
| GameCardCrcErrorCount<br />
| <br />
| <br />
|-<br />
| GameCardAsicCrcErrorCount<br />
| <br />
| <br />
|-<br />
| GameCardRefreshCount<br />
| <br />
| <br />
|-<br />
| GameCardReadRetryCount<br />
| <br />
| <br />
|-<br />
| EdidBlock<br />
| <br />
| <br />
|-<br />
| EdidExtensionBlock<br />
| <br />
| <br />
|-<br />
| CreateProcessFailureFlag<br />
| <br />
| <br />
|-<br />
| TemperaturePcb<br />
| <br />
| <br />
|-<br />
| TemperatureSoc<br />
| <br />
| <br />
|-<br />
| CurrentFanDuty<br />
| <br />
| <br />
|-<br />
| LastDvfsThresholdTripped<br />
| <br />
| <br />
|-<br />
| CradlePdcHFwVersion<br />
| <br />
| <br />
|-<br />
| CradlePdcAFwVersion<br />
| <br />
| <br />
|-<br />
| CradleMcuFwVersion<br />
| <br />
| <br />
|-<br />
| CradleDp2HdmiFwVersion<br />
| <br />
| <br />
|-<br />
| RunningApplicationId<br />
| <br />
| <br />
|-<br />
| RunningApplicationTitle<br />
| <br />
| <br />
|-<br />
| RunningApplicationVersion<br />
| <br />
| <br />
|-<br />
| RunningApplicationStorageLocation<br />
| <br />
| <br />
|-<br />
| RunningAppletList<br />
| <br />
| <br />
|-<br />
| FocusedAppletHistory<br />
| <br />
| <br />
|-<br />
| CompositorState<br />
| <br />
| <br />
|-<br />
| CompositorLayerState<br />
| <br />
| <br />
|-<br />
| CompositorDisplayState<br />
| <br />
| <br />
|-<br />
| CompositorHWCState<br />
| <br />
| <br />
|-<br />
| InputCurrentLimit<br />
| <br />
| <br />
|-<br />
| BoostModeCurrentLimit<br />
| <br />
| <br />
|-<br />
| FastChargeCurrentLimit<br />
| <br />
| <br />
|-<br />
| ChargeVoltageLimit<br />
| <br />
| <br />
|-<br />
| ChargeConfiguration<br />
| <br />
| <br />
|-<br />
| HizMode<br />
| <br />
| <br />
|-<br />
| ChargeEnabled<br />
| <br />
| <br />
|-<br />
| PowerSupplyPath<br />
| <br />
| <br />
|-<br />
| BatteryTemperature<br />
| <br />
| <br />
|-<br />
| BatteryChargePercent<br />
| <br />
| <br />
|-<br />
| BatteryChargeVoltage<br />
| <br />
| <br />
|-<br />
| BatteryAge<br />
| <br />
| <br />
|-<br />
| PowerRole<br />
| <br />
| <br />
|-<br />
| PowerSupplyType<br />
| <br />
| <br />
|-<br />
| PowerSupplyVoltage<br />
| <br />
| <br />
|-<br />
| PowerSupplyCurrent<br />
| <br />
| <br />
|-<br />
| FastBatteryChargingEnabled<br />
| <br />
| <br />
|-<br />
| ControllerPowerSupplyAcquired<br />
| <br />
| <br />
|-<br />
| OtgRequested<br />
| <br />
| <br />
|-<br />
| NANDPreEolInfo<br />
| <br />
| <br />
|-<br />
| NANDDeviceLifeTimeEstTypA<br />
| <br />
| <br />
|-<br />
| NANDDeviceLifeTimeEstTypB<br />
| <br />
| <br />
|-<br />
| NANDPatrolCount<br />
| <br />
| <br />
|-<br />
| NANDNumActivationFailures<br />
| <br />
| <br />
|-<br />
| NANDNumActivationErrorCorrections<br />
| <br />
| <br />
|-<br />
| NANDNumReadWriteFailures<br />
| <br />
| <br />
|-<br />
| NANDNumReadWriteErrorCorrections<br />
| <br />
| <br />
|-<br />
| NANDErrorLog<br />
| <br />
| <br />
|-<br />
| SdCardUserAreaSize<br />
| <br />
| <br />
|-<br />
| SdCardProtectedAreaSize<br />
| <br />
| <br />
|-<br />
| SdCardNumActivationFailures<br />
| <br />
| <br />
|-<br />
| SdCardNumActivationErrorCorrections<br />
| <br />
| <br />
|-<br />
| SdCardNumReadWriteFailures<br />
| <br />
| <br />
|-<br />
| SdCardNumReadWriteErrorCorrections<br />
| <br />
| <br />
|-<br />
| SdCardErrorLog<br />
| <br />
| <br />
|-<br />
| EncryptionKey<br />
| <br />
| <br />
|-<br />
| EncryptedExceptionInfo<br />
| <br />
| <br />
|-<br />
| GameCardTimeoutRetryErrorCount<br />
| <br />
| <br />
|-<br />
| FsRemountForDataCorruptCount<br />
| <br />
| <br />
|-<br />
| FsRemountForDataCorruptRetryOutCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GameCardInsertionCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GameCardRemovalCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GameCardAsicInitializeCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] TestU16<br />
| <br />
| <br />
|-<br />
| [3.0.0+] TestU8<br />
| <br />
| <br />
|-<br />
| [3.0.0+] TestI16<br />
| <br />
| <br />
|-<br />
| [3.0.0+] TestI8<br />
| <br />
| <br />
|-<br />
| [3.0.0+] SystemAppletScene<br />
| <br />
| <br />
|-<br />
| [3.0.0+] CodecType<br />
| <br />
| <br />
|-<br />
| [3.0.0+] DecodeBuffers<br />
| <br />
| <br />
|-<br />
| [3.0.0+] FrameWidth<br />
| <br />
| <br />
|-<br />
| [3.0.0+] FrameHeight<br />
| <br />
| <br />
|-<br />
| [3.0.0+] ColorPrimaries<br />
| <br />
| <br />
|-<br />
| [3.0.0+] TransferCharacteristics<br />
| <br />
| <br />
|-<br />
| [3.0.0+] MatrixCoefficients<br />
| <br />
| <br />
|-<br />
| [3.0.0+] DisplayWidth<br />
| <br />
| <br />
|-<br />
| [3.0.0+] DisplayHeight<br />
| <br />
| <br />
|-<br />
| [3.0.0+] DARWidth<br />
| <br />
| <br />
|-<br />
| [3.0.0+] DARHeight<br />
| <br />
| <br />
|-<br />
| [3.0.0+] ColorFormat<br />
| <br />
| <br />
|-<br />
| [3.0.0+] ColorSpace<br />
| <br />
| <br />
|-<br />
| [3.0.0+] SurfaceLayout<br />
| <br />
| <br />
|-<br />
| [3.0.0+] BitStream<br />
| <br />
| <br />
|-<br />
| [3.0.0+] VideoDecState<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GpuErrorChannelId<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GpuErrorAruId<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GpuErrorType<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GpuErrorFaultInfo<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GpuErrorWriteAccess<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GpuErrorFaultAddress<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GpuErrorFaultUnit<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GpuErrorFaultType<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GpuErrorHwContextPointer<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GpuErrorContextStatus<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GpuErrorPbdmaIntr<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GpuErrorPbdmaErrorType<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GpuErrorPbdmaHeaderShadow<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GpuErrorPbdmaHeader<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GpuErrorPbdmaGpShadow0<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GpuErrorPbdmaGpShadow1<br />
| <br />
| <br />
|-<br />
| [3.0.0+] AccessPointChannel<br />
| <br />
| <br />
|-<br />
| [3.0.0+] ThreadName<br />
| <br />
| <br />
|-<br />
| [3.0.0+] AdspExceptionRegisters<br />
| <br />
| <br />
|-<br />
| [3.0.0+] AdspExceptionSpsr<br />
| <br />
| <br />
|-<br />
| [3.0.0+] AdspExceptionProgramCounter<br />
| <br />
| <br />
|-<br />
| [3.0.0+] AdspExceptionLinkRegister<br />
| <br />
| <br />
|-<br />
| [3.0.0+] AdspExceptionStackPointer<br />
| <br />
| <br />
|-<br />
| [3.0.0+] AdspExceptionArmModeRegisters<br />
| <br />
| <br />
|-<br />
| [3.0.0+] AdspExceptionStackAddress<br />
| <br />
| <br />
|-<br />
| [3.0.0+] AdspExceptionStackDump<br />
| <br />
| <br />
|-<br />
| [3.0.0+] AdspExceptionReason<br />
| <br />
| <br />
|-<br />
| [3.0.0+] OscillatorClock<br />
| <br />
| <br />
|-<br />
| [3.0.0+] CpuDvfsTableClocks<br />
| <br />
| <br />
|-<br />
| [3.0.0+] CpuDvfsTableVoltages<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GpuDvfsTableClocks<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GpuDvfsTableVoltages<br />
| <br />
| <br />
|-<br />
| [3.0.0+] EmcDvfsTableClocks<br />
| <br />
| <br />
|-<br />
| [3.0.0+] EmcDvfsTableVoltages<br />
| <br />
| <br />
|-<br />
| [3.0.0+] ModuleClockFrequencies<br />
| <br />
| <br />
|-<br />
| [3.0.0+] ModuleClockEnableFlags<br />
| <br />
| <br />
|-<br />
| [3.0.0+] ModulePowerEnableFlags<br />
| <br />
| <br />
|-<br />
| [3.0.0+] ModuleResetAssertFlags<br />
| <br />
| <br />
|-<br />
| [3.0.0+] ModuleMinimumVoltageClockRates<br />
| <br />
| <br />
|-<br />
| [3.0.0+] PowerDomainEnableFlags<br />
| <br />
| <br />
|-<br />
| [3.0.0+] PowerDomainVoltages<br />
| <br />
| <br />
|-<br />
| [3.0.0+] AccessPointRssi<br />
| <br />
| <br />
|-<br />
| [3.0.0+] FuseInfo<br />
| <br />
| <br />
|-<br />
| [3.0.0+] VideoLog<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GameCardDeviceId<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GameCardAsicReinitializeCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GameCardAsicReinitializeFailureCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GameCardAsicReinitializeFailureDetail<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GameCardRefreshSuccessCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GameCardAwakenCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GameCardAwakenFailureCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GameCardReadCountFromInsert<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GameCardReadCountFromAwaken<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GameCardLastReadErrorPageAddress<br />
| <br />
| <br />
|-<br />
| [3.0.0+] GameCardLastReadErrorPageCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] AppletManagerContextTrace<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispIsRegistered<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispIsSuspend<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDC0SurfaceNum<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDC1SurfaceNum<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispWindowSrcRectX<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispWindowSrcRectY<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispWindowSrcRectWidth<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispWindowSrcRectHeight<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispWindowDstRectX<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispWindowDstRectY<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispWindowDstRectWidth<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispWindowDstRectHeight<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispWindowIndex<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispWindowBlendOperation<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispWindowAlphaOperation<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispWindowDepth<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispWindowAlpha<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispWindowHFilter<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispWindowVFilter<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispWindowOptions<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispWindowSyncPointId<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPSorPower<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPClkType<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPEnable<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPState<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPEdid<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPEdidSize<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPEdidExtSize<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPFakeMode<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPModeNumber<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPPlugInOut<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPAuxIntHandler<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPForceMaxLinkBW<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPIsConnected<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkValid<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkMaxBW<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkMaxLaneCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkDownSpread<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkSupportEnhancedFraming<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkBpp<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkScaramberCap<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkBW<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkLaneCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkEnhancedFraming<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkScrambleEnable<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkActivePolarity<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkActiveCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkTUSize<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkActiveFrac<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkWatermark<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkHBlank<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkVBlank<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkOnlyEnhancedFraming<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkOnlyEdpCap<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkSupportFastLT<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkLTDataValid<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkTsp3Support<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDPLinkAuxInterval<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispHdcpCreated<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispHdcpUserRequest<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispHdcpPlugged<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispHdcpState<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispHdcpFailCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispHdcpHdcp22<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispHdcpMaxRetry<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispHdcpHpd<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispHdcpRepeater<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispCecRxBuf<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispCecRxLength<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispCecTxBuf<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispCecTxLength<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispCecTxRet<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispCecState<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispCecTxInfo<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispCecRxInfo<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDCIndex<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDCInitialize<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDCClock<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDCFrequency<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDCFailed<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDCModeWidth<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDCModeHeight<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDCModeBpp<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDCPanelFrequency<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDCWinDirty<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDCWinEnable<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDCVrr<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDCPanelInitialize<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDsiDataFormat<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDsiVideoMode<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDsiRefreshRate<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDsiLpCmdModeFrequency<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDsiHsCmdModeFrequency<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDsiPanelResetTimeout<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDsiPhyFrequency<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDsiFrequency<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDsiInstance<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDcDsiHostCtrlEnable<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDcDsiInit<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDcDsiEnable<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDcDsiHsMode<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDcDsiVendorId<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDcDsiLcdVendorNum<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDcDsiHsClockControl<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDcDsiEnableHsClockInLpMode<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDcDsiTeFrameUpdate<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDcDsiGangedType<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispDcDsiHbpInPktSeq<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispErrID<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispErrData0<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NvDispErrData1<br />
| <br />
| <br />
|-<br />
| [3.0.0+] SdCardMountStatus<br />
| <br />
| <br />
|-<br />
| [3.0.0+] SdCardMountUnexpectedResult<br />
| <br />
| <br />
|-<br />
| [3.0.0+] NANDTotalSize<br />
| <br />
| <br />
|-<br />
| [3.0.0+] SdCardTotalSize<br />
| <br />
| <br />
|-<br />
| [3.0.0+] ElapsedTimeSinceInitialLaunch<br />
| <br />
| <br />
|-<br />
| [3.0.0+] ElapsedTimeSincePowerOn<br />
| <br />
| <br />
|-<br />
| [3.0.0+] ElapsedTimeSinceLastAwake<br />
| <br />
| <br />
|-<br />
| [3.0.0+] OccurrenceTick<br />
| <br />
| <br />
|-<br />
| [3.0.0+] RetailInteractiveDisplayFlag<br />
| <br />
| <br />
|-<br />
| [3.0.0+] FatFsError<br />
| <br />
| <br />
|-<br />
| [3.0.0+] FatFsExtraError<br />
| <br />
| <br />
|-<br />
| [3.0.0+] FatFsErrorDrive<br />
| <br />
| <br />
|-<br />
| [3.0.0+] FatFsErrorName<br />
| <br />
| <br />
|-<br />
| [3.0.0+] MonitorManufactureCode<br />
| <br />
| <br />
|-<br />
| [3.0.0+] MonitorProductCode<br />
| <br />
| <br />
|-<br />
| [3.0.0+] MonitorSerialNumber<br />
| <br />
| <br />
|-<br />
| [3.0.0+] MonitorManufactureYear<br />
| <br />
| <br />
|-<br />
| [3.0.0+] PhysicalAddress<br />
| <br />
| <br />
|-<br />
| [3.0.0+] Is4k60Hz<br />
| <br />
| <br />
|-<br />
| [3.0.0+] Is4k30Hz<br />
| <br />
| <br />
|-<br />
| [3.0.0+] Is1080P60Hz<br />
| <br />
| <br />
|-<br />
| [3.0.0+] Is720P60Hz<br />
| <br />
| <br />
|-<br />
| [3.0.0+] PcmChannelMax<br />
| <br />
| <br />
|-<br />
| [3.0.0+] CrashReportHash<br />
| <br />
| <br />
|-<br />
| [3.0.0+] ErrorReportSharePermission<br />
| <br />
| <br />
|-<br />
| [3.0.0+] VideoCodecTypeEnum<br />
| <br />
| <br />
|-<br />
| [3.0.0+] VideoBitRate<br />
| <br />
| <br />
|-<br />
| [3.0.0+] VideoFrameRate<br />
| <br />
| <br />
|-<br />
| [3.0.0+] VideoWidth<br />
| <br />
| <br />
|-<br />
| [3.0.0+] VideoHeight<br />
| <br />
| <br />
|-<br />
| [3.0.0+] AudioCodecTypeEnum<br />
| <br />
| <br />
|-<br />
| [3.0.0+] AudioSampleRate<br />
| <br />
| <br />
|-<br />
| [3.0.0+] AudioChannelCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] AudioBitRate<br />
| <br />
| <br />
|-<br />
| [3.0.0+] MultimediaContainerType<br />
| <br />
| <br />
|-<br />
| [3.0.0+] MultimediaProfileType<br />
| <br />
| <br />
|-<br />
| [3.0.0+] MultimediaLevelType<br />
| <br />
| <br />
|-<br />
| [3.0.0+] MultimediaCacheSizeEnum<br />
| <br />
| <br />
|-<br />
| [3.0.0+] MultimediaErrorStatusEnum<br />
| <br />
| <br />
|-<br />
| [3.0.0+] MultimediaErrorLog<br />
| <br />
| <br />
|-<br />
| [3.0.0+] ServerFqdn<br />
| <br />
| <br />
|-<br />
| [3.0.0+] ServerIpAddress<br />
| <br />
| <br />
|-<br />
| [3.0.0+] TestStringEncrypt<br />
| <br />
| <br />
|-<br />
| [3.0.0+] TestU8ArrayEncrypt<br />
| <br />
| <br />
|-<br />
| [3.0.0+] TestU32ArrayEncrypt<br />
| <br />
| <br />
|-<br />
| [3.0.0+] TestU64ArrayEncrypt<br />
| <br />
| <br />
|-<br />
| [3.0.0+] TestI32ArrayEncrypt<br />
| <br />
| <br />
|-<br />
| [3.0.0+] TestI64ArrayEncrypt<br />
| <br />
| <br />
|-<br />
| [3.0.0+] CipherKey<br />
| <br />
| <br />
|-<br />
| [3.0.0+] FileSystemPath<br />
| <br />
| <br />
|-<br />
| [3.0.0+] WebMediaPlayerOpenUrl<br />
| <br />
| <br />
|-<br />
| [3.0.0+] WebMediaPlayerLastSocketErrors<br />
| <br />
| <br />
|-<br />
| [3.0.0+] UnknownControllerCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] AttachedControllerCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] BluetoothControllerCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] UsbControllerCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] ControllerTypeList<br />
| <br />
| <br />
|-<br />
| [3.0.0+] ControllerInterfaceList<br />
| <br />
| <br />
|-<br />
| [3.0.0+] ControllerStyleList<br />
| <br />
| <br />
|-<br />
| [3.0.0+] FsPooledBufferPeakFreeSize<br />
| <br />
| <br />
|-<br />
| [3.0.0+] FsPooledBufferRetriedCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] FsPooledBufferReduceAllocationCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] FsBufferManagerPeakFreeSize<br />
| <br />
| <br />
|-<br />
| [3.0.0+] FsBufferManagerRetriedCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] FsExpHeapPeakFreeSize<br />
| <br />
| <br />
|-<br />
| [3.0.0+] FsBufferPoolPeakFreeSize<br />
| <br />
| <br />
|-<br />
| [3.0.0+] FsPatrolReadAllocateBufferSuccessCount<br />
| <br />
| <br />
|-<br />
| [3.0.0+] FsPatrolReadAllocateBufferFailureCount<br />
| <br />
| <br />
|-<br />
| [5.0.0+] SteadyClockInternalOffset<br />
| <br />
| <br />
|-<br />
| [5.0.0+] SteadyClockCurrentTimePointValue<br />
| <br />
| <br />
|-<br />
| [5.0.0+] UserClockContextOffset<br />
| <br />
| <br />
|-<br />
| [5.0.0+] UserClockContextTimeStampValue<br />
| <br />
| <br />
|-<br />
| [5.0.0+] NetworkClockContextOffset<br />
| <br />
| <br />
|-<br />
| [5.0.0+] NetworkClockContextTimeStampValue<br />
| <br />
| <br />
|-<br />
| [5.0.0+] SystemAbortFlag<br />
| <br />
| <br />
|-<br />
| [5.0.0+] ApplicationAbortFlag<br />
| <br />
| <br />
|-<br />
| [5.0.0+] NifmErrorCode<br />
| <br />
| <br />
|-<br />
| [5.0.0+] LcsApplicationId<br />
| <br />
| <br />
|-<br />
| [5.0.0+] LcsContentMetaKeyIdList<br />
| <br />
| <br />
|-<br />
| [5.0.0+] LcsContentMetaKeyVersionList<br />
| <br />
| <br />
|-<br />
| [5.0.0+] LcsContentMetaKeyTypeList<br />
| <br />
| <br />
|-<br />
| [5.0.0+] LcsContentMetaKeyInstallTypeList<br />
| <br />
| <br />
|-<br />
| [5.0.0+] LcsSenderFlag<br />
| <br />
| <br />
|-<br />
| [5.0.0+] LcsApplicationRequestFlag<br />
| <br />
| <br />
|-<br />
| [5.0.0+] LcsHasExFatDriverFlag<br />
| <br />
| <br />
|-<br />
| [5.0.0+] LcsIpAddress<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpStartupUserAccount<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpAocRegistrationType<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpAttributeFlag<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpSupportedLanguageFlag<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpParentalControlFlag<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpScreenShot<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpVideoCapture<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpDataLossConfirmation<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpPlayLogPolicy<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpPresenceGroupId<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpRatingAge<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpAocBaseId<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpSaveDataOwnerId<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpUserAccountSaveDataSize<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpUserAccountSaveDataJournalSize<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpDeviceSaveDataSize<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpDeviceSaveDataJournalSize<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpBcatDeliveryCacheStorageSize<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpApplicationErrorCodeCategory<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpLocalCommunicationId<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpLogoType<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpLogoHandling<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpRuntimeAocInstall<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpCrashReport<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpHdcp<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpSeedForPseudoDeviceId<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpBcatPassphrase<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpUserAccountSaveDataSizeMax<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpUserAccountSaveDataJournalSizeMax<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpDeviceSaveDataSizeMax<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpDeviceSaveDataJournalSizeMax<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpTemporaryStorageSize<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpCacheStorageSize<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpCacheStorageJournalSize<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpCacheStorageDataAndJournalSizeMax<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpCacheStorageIndexMax<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpPlayLogQueryableApplicationId<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpPlayLogQueryCapability<br />
| <br />
| <br />
|-<br />
| [5.0.0+] AcpRepairFlag<br />
| <br />
| <br />
|-<br />
| [5.0.0+] RunningApplicationPatchStorageLocation<br />
| <br />
| <br />
|-<br />
| [5.0.0+] RunningApplicationVersionNumber<br />
| <br />
| <br />
|-<br />
| [5.0.0+] FsRecoveredByInvalidateCacheCount<br />
| <br />
| <br />
|-<br />
| [5.0.0+] FsSaveDataIndexCount<br />
| <br />
| <br />
|-<br />
| [5.0.0+] FsBufferManagerPeakTotalAllocatableSize<br />
| <br />
| <br />
|-<br />
| [5.0.0+] MonitorCurrentWidth<br />
| <br />
| <br />
|-<br />
| [5.0.0+] MonitorCurrentHeight<br />
| <br />
| <br />
|-<br />
| [5.0.0+] MonitorCurrentRefreshRate<br />
| <br />
| <br />
|-<br />
| [5.0.0+] RebootlessSystemUpdateVersion<br />
| <br />
| <br />
|-<br />
| [5.0.0+] EncryptedExceptionInfo1<br />
| <br />
| <br />
|-<br />
| [5.0.0+] EncryptedExceptionInfo2<br />
| <br />
| <br />
|-<br />
| [5.0.0+] EncryptedExceptionInfo3<br />
| <br />
| <br />
|-<br />
| [5.0.0+] EncryptedDyingMessage<br />
| <br />
| <br />
|-<br />
| [5.0.0+] DramId<br />
| <br />
| <br />
|}<br />
<br />
[[Category:Services]]</div>
Thog
https://switchbrew.org/w/index.php?title=ETicket_services&diff=4653
ETicket services
2018-05-14T12:45:28Z
<p>Thog: Cmd 21 -> 2.0.0+</p>
<hr />
<div>= es =<br />
This is "nn::es::IETicketService".<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Cmd || Name<br />
|-<br />
| 1 ||<br />
|-<br />
| 2 ||<br />
|-<br />
| 3 ||<br />
|-<br />
| 4 ||<br />
|-<br />
| 5 ||<br />
|-<br />
| 6 ||<br />
|-<br />
| 7 ||<br />
|-<br />
| 8 ||<br />
|-<br />
| 9 ||<br />
|-<br />
| 10 ||<br />
|-<br />
| 11 ||<br />
|-<br />
| 12 ||<br />
|-<br />
| 13 ||<br />
|-<br />
| 14 ||<br />
|-<br />
| 15 ||<br />
|-<br />
| 16 ||<br />
|-<br />
| 17 ||<br />
|-<br />
| 18 ||<br />
|-<br />
| 19 ||<br />
|-<br />
| 20 ||<br />
|-<br />
| 21 || [2.0.0+]<br />
|-<br />
| 22 || [4.0.0+]<br />
|-<br />
| 23 || [4.0.0+]<br />
|-<br />
| 24 || [4.0.0+]<br />
|-<br />
| 25 || [4.0.0+]<br />
|-<br />
| 26 || [4.0.0+]<br />
|-<br />
| 27 || [4.0.0+]<br />
|-<br />
| 28 || [4.0.0+]<br />
|-<br />
| 29 || [4.0.0+]<br />
|-<br />
| 30 || [5.0.0+]<br />
|-<br />
| 31 || [5.0.0+]<br />
|-<br />
| 32 || [5.0.0+]<br />
|-<br />
| 33 || [5.0.0+]<br />
|-<br />
| 34 || [5.0.0+]<br />
|-<br />
| 35 || [5.0.0+]<br />
|}</div>
Thog
https://switchbrew.org/w/index.php?title=Package1&diff=3814
Package1
2018-02-21T00:02:17Z
<p>Thog: FLOW_MODE_STOP -> FLOW_MODE_WAITEVENT (0x40000000 isn't FLOW_MODE_STOP)</p>
<hr />
<div>Present in the firmware package titles (0100000000000819, 010000000000081A, 010000000000081B and 010000000000081C) and installed into eMMC storage's [[Flash_Filesystem#Boot_Partitions|boot partitions 0 and 1]], "package1" contains the first Switch bootloader to run under the NVIDIA boot processor (an ARM7TDMI called "BPMP", "BPMP-Lite", "AVP" or "COP").<br />
<br />
The boot ROM validates, copies to IRAM and executes this package by parsing it's information block from the [[BCT|BCT]].<br />
<br />
= Format =<br />
Package1 is distributed as a plaintext initial bootloader and a secondary encrypted blob. Execution starts at the plaintext bootloader which will set up hardware, generate keys and decrypt the next stage.<br />
<br />
== Bootloader ==<br />
The code for this stage is stored in plaintext inside the package. By looking into the BCT's bootloader0_info (normal) or bootloader1_info (safe mode), the boot ROM starts executing this stage at address 0x40010020 in IRAM.<br />
<br />
=== Initialization ===<br />
The stack pointer is set.<br />
<br />
<syntaxhighlight lang="c"><br />
// Set the stack pointer<br />
*(u32 *)sp = 0x40008000;<br />
<br />
// Jump to main<br />
bootloader_main();<br />
<br />
// Infinite loop<br />
deadlock();<br />
</syntaxhighlight><br />
<br />
=== Main ===<br />
The bootloader poisons the exception vectors, cleans up memory (.bss and init_array), sets up hardware devices (including the security engine and fuses), does all the necessary checks, generates keys and finally decrypts and executes the next stage.<br />
<br />
<syntaxhighlight lang="c"><br />
// Poison all exception vectors<br />
*(u32 *)0x6000F200 = panic();<br />
*(u32 *)0x6000F204 = panic();<br />
*(u32 *)0x6000F208 = panic();<br />
*(u32 *)0x6000F20C = panic();<br />
*(u32 *)0x6000F210 = panic();<br />
*(u32 *)0x6000F214 = panic();<br />
*(u32 *)0x6000F218 = panic();<br />
*(u32 *)0x6000F21C = panic();<br />
<br />
u32 bss_addr_end = bss_addr_start;<br />
u32 bss_offset = 0;<br />
u32 bss_size = bss_addr_end - bss_addr_start;<br />
<br />
// Clear .bss region<br />
// Never happens due to bss_size being set to 0<br />
while (bss_offset < bss_size)<br />
{<br />
*(u32 *)bss_addr_start + bss_offset = 0;<br />
bss_offset += 0x04;<br />
}<br />
<br />
u32 init_array_addr_end = init_array_addr_start;<br />
u32 init_array_offset = init_array_addr_start;<br />
<br />
// Call init methods<br />
// Never happens due to init_array_addr_end being set to init_array_addr_start<br />
while (init_array_offset < init_array_addr_end)<br />
{<br />
u32 init_method_offset = *(u32 *)init_array_offset;<br />
<br />
call_init_method(init_method_offset + init_array_offset);<br />
init_array_offset += 0x04;<br />
}<br />
<br />
// Setup I2S1, I2S2, I2S3, I2S4, DISPLAY and VIC<br />
enable_hw_devices();<br />
<br />
// Program the SE clock and resets<br />
// Uses RST_DEVICES_V, CLK_OUT_ENB_V, CLK_SOURCE_SE and CLK_V_SE<br />
enable_se_clkrst();<br />
<br />
// Set MISC_CLK_ENB<br />
// This makes fuse registers visible<br />
enable_misc_clk(0x01);<br />
<br />
// Read FUSE_SKU_INFO and compare with 0x83<br />
check_sku();<br />
<br />
// Check configuration fuses<br />
check_config_fuses();<br />
<br />
u32 bct_iram_addr = 0x40000000;<br />
<br />
// Check bootloader version from BCT<br />
check_bootloader_ver(bct_iram_addr);<br />
<br />
// Check anti-downgrade fuses<br />
check_downgrade();<br />
<br />
// Set FUSE_DIS_PGM<br />
// Disables fuse programming until next reboot<br />
disable_fuse_pgm();<br />
<br />
// Setup memory controllers<br />
enable_mem_ctl();<br />
<br />
// Setup the security engine's address<br />
set_se_addr(0x70012000);<br />
<br />
// Check SE global config<br />
check_se_status();<br />
<br />
// Generate keys<br />
keygen(bct_iram_addr);<br />
<br />
u32 pk11_blob_addr = 0x40013FE0;<br />
<br />
// Decrypt the PK11 blob and get the next stage's entrypoint<br />
nx_boot_addr = decrypt_pk11_blob(pk11_blob_addr);<br />
<br />
u32 nx_boot_sp = 0x40007000;<br />
<br />
// Set the stack pointer and jump to a stub responsible<br />
// for cleaning up and branching into the next stage<br />
exec_nx_boot_stub(nx_boot_addr, nx_boot_stub_addr, nx_boot_sp);<br />
<br />
return;<br />
</syntaxhighlight><br />
<br />
==== Panic ====<br />
If a panic occurs, all sensitive memory contents are cleared, the security engine and fuse programming are disabled and the boot processor is left in a halted state.<br />
<br />
<syntaxhighlight lang="c"><br />
// Clear all stack contents<br />
clear_stack();<br />
<br />
// Terminate the security engine<br />
disable_se();<br />
<br />
// Set FUSE_DIS_PGM<br />
// Disables fuse programming until next reboot<br />
disable_fuse_pgm();<br />
<br />
// Clear temporary key storage memory<br />
clear_mem();<br />
<br />
// Clear the PK11 blob from memory<br />
clear_pk11_blob();<br />
<br />
u32 FLOW_CTLR_HALT_COP_EVENTS = 0x60007004;<br />
u32 FLOW_MODE_WAITEVENT = 0x40000000;<br />
u32 HALT_COP_EVENT_JTAG = 0x10000000;<br />
<br />
// Halt the boot processor<br />
while (true)<br />
*(u32 *)FLOW_CTLR_HALT_COP_EVENTS = (FLOW_MODE_WAITEVENT | HALT_COP_EVENT_JTAG);<br />
</syntaxhighlight><br />
<br />
==== Anti-downgrade ====<br />
See [[Fuses#Anti-downgrade|Anti-downgrade]].<br />
<br />
==== Memory controllers ====<br />
After disabling fuse programming, the bootloader configures the EMC and MEM/MC. It additionally disables QSPI resets and programs a special aperture designed for AHB redirected access to IRAM.<br />
<br />
<syntaxhighlight lang="c"><br />
u32 PERIPH_CLK_SOURCE_EMC = 0x6000619C;<br />
u32 CLK_OUT_ENB_SET_H = 0x60006328;<br />
u32 CLK_OUT_ENB_SET_X = 0x60006284;<br />
u32 RST_DEVICES_SET_H = 0x60006308;<br />
u32 RST_DEVICES_CLR_Y = 0x600062AC;<br />
u32 MC_IRAM_REG_CTRL = 0x70019964;<br />
u32 MC_IRAM_BOM = 0x7001965C;<br />
u32 MC_IRAM_TOM = 0x70019660;<br />
<br />
// Initialize EMC's clock source<br />
u32 emc_clk_src_val = *(u32 *)PERIPH_CLK_SOURCE_EMC;<br />
*(u32 *)PERIPH_CLK_SOURCE_EMC = (emc_clk_src_val | 0x40000000);<br />
<br />
// Enable CLK_H_EMC<br />
u32 clk_out_enb_h_val = *(u32 *)CLK_OUT_ENB_SET_H;<br />
clk_out_enb_h_val &= ~(0x2000000);<br />
clk_out_enb_h_val |= 0x2000000;<br />
*(u32 *)CLK_OUT_ENB_SET_H = clk_out_enb_h_val;<br />
<br />
// Enable CLK_H_MEM<br />
clk_out_enb_h_val = *(u32 *)CLK_OUT_ENB_SET_H;<br />
clk_out_enb_h_val &= ~(0x01);<br />
clk_out_enb_h_val |= 0x01;<br />
*(u32 *)CLK_OUT_ENB_SET_H = clk_out_enb_h_val;<br />
<br />
// Enable CLK_X_EMC_DLL<br />
u32 clk_out_enb_x_val = *(u32 *)CLK_OUT_ENB_SET_X;<br />
clk_out_enb_x_val &= ~(0x4000);<br />
clk_out_enb_x_val |= 0x4000;<br />
*(u32 *)CLK_OUT_ENB_SET_X = clk_out_enb_x_val;<br />
<br />
// Enable RST_H_EMC and RST_H_MEM<br />
*(u32 *)RST_DEVICES_SET_H = 0x2000001;<br />
<br />
// Wait a while<br />
mdelay(0x05);<br />
<br />
// Disable RST_Y_QSPI<br />
u32 rst_clr_y_val = *(u32 *)RST_DEVICES_CLR_Y;<br />
rst_clr_y_val &= ~(0x80000);<br />
rst_clr_y_val |= 0x80000;<br />
*(u32 *)RST_DEVICES_CLR_Y = rst_clr_y_val;<br />
<br />
// Refresh MC_IRAM_REG_CTRL<br />
// Should be set to 0 (MC_ENABLE_IRAM_CFG_WRITES)<br />
u32 mc_iram_reg_ctrl_val = *(u32 *)MC_IRAM_REG_CTRL;<br />
*(u32 *)MC_IRAM_REG_CTRL = mc_iram_reg_ctrl_val;<br />
<br />
// Set base and top addresses for AHB redirected IRAM path<br />
// This allows devices like the GPU to access this range<br />
*(u32 *)MC_IRAM_BOM = 0x40000000;<br />
*(u32 *)MC_IRAM_TOM = 0x4003F000;<br />
<br />
// Read back MC_IRAM_REG_CTRL<br />
mc_iram_reg_ctrl_val = *(u32 *)MC_IRAM_REG_CTRL;<br />
<br />
return mc_iram_reg_ctrl_val;<br />
</syntaxhighlight><br />
<br />
==== Key generation ====<br />
After the security engine is ready and before decrypting the next stage, the bootloader initializes and generates several keys into hardware keyslots.<br />
For more details on the Switch's cryptosystem, please see [[Cryptosystem|this page]].<br />
<br />
===== Selection =====<br />
Depending on [[Fuses#FUSE_RESERVED_ODM4|FUSE_RESERVED_ODM4]] and [[Fuses#FUSE_SPARE_BIT_5|FUSE_SPARE_BIT_5]] different static seeds are selected for key generation.<br />
<br />
<syntaxhighlight lang="c"><br />
// Initialize keyslots 0x0C and 0x0D as readable<br />
init_keyslot(0x0C, 0x15);<br />
init_keyslot(0x0D, 0x15);<br />
<br />
// Find the BCT's data address from IRAM header<br />
u32 bct_data_addr = *(u32 *)bct_imem_addr + 0x4C;<br />
u32 bct_customer_data_addr = *(u32 *)bct_data_addr + 0x450;<br />
<br />
// Wrapper to get unit type from FUSE_RESERVED_ODM4<br />
// This tells if the device is retail or debug<br />
bool is_retail = is_unit_retail();<br />
<br />
u32 master_static_seed_addr = 0;<br />
u32 master_static_seed_size = 0;<br />
<br />
if (is_retail)<br />
{<br />
// Read FUSE_SPARE_BIT_5<br />
// This tells which master key to use<br />
u32 master_key_ver = read_fuse_spare_bit_5();<br />
<br />
// Invalid for retail<br />
if (!master_key_ver)<br />
panic();<br />
else<br />
{<br />
master_static_seed_addr = static_seed1_addr;<br />
master_static_seed_size = 0x10;<br />
<br />
// Generate retail keys<br />
generate_retail_keys(bct_customer_data_addr, static_seed_addr, static_seed_size);<br />
}<br />
}<br />
else<br />
{<br />
// Read FUSE_SPARE_BIT_5<br />
// This tells which master key to use<br />
u32 master_key_ver = read_fuse_spare_bit_5();<br />
<br />
// Use debug key set<br />
if (!master_key_ver)<br />
{<br />
// Read the first byte of the BCT RSA PSS signature<br />
u8 rsa_pss_1_byte = *(u8 *)bct_data_addr + 0x210;<br />
<br />
if (rsa_pss_1_byte == 0x11)<br />
{<br />
master_static_seed_addr = static_seed6_addr;<br />
master_static_seed_size = 0x10;<br />
}<br />
else <br />
{<br />
master_static_seed_addr = static_seed7_addr;<br />
master_static_seed_size = 0x10;<br />
}<br />
<br />
// Generate debug keys<br />
generate_debug_keys(static_seed_addr, static_seed_size);<br />
}<br />
else<br />
{<br />
// Read the first byte of the BCT RSA PSS signature<br />
u8 rsa_pss_1_byte = *(u8 *)bct_data_addr + 0x210;<br />
<br />
if (rsa_pss_1_byte == 0x4F) // Different key as in retail mode<br />
{<br />
master_static_seed_addr = static_seed0_addr;<br />
master_static_seed_size = 0x10;<br />
}<br />
else // Same key as in retail mode<br />
{<br />
master_static_seed_addr = static_seed1_addr;<br />
master_static_seed_size = 0x10;<br />
}<br />
<br />
// Generate retail keys<br />
generate_retail_keys(bct_customer_data_addr, master_static_seed_addr, master_static_seed_size);<br />
}<br />
}<br />
<br />
// Initialize keyslots 0x0C and 0x0D as unreadable<br />
init_keyslot(0x0C, 0xFF);<br />
init_keyslot(0x0D, 0xFF);<br />
<br />
return;<br />
</syntaxhighlight><br />
<br />
===== generate_retail_keys =====<br />
In order to generate retail keys, the bootloader starts by initializing TSEC and grabbing it's [[TSEC#Device_key_generation|device key]]. Using static seeds and the SBK, the keyblob injected into the BCT's [[BCT#customer_data|customer_data]] is validated and decrypted. The resulting keys will then be used to generate the master static key and the master device key.<br />
<br />
See the pseudocode bellow for the detailed process.<br />
<br />
<syntaxhighlight lang="c"><br />
u32 in_addr = 0;<br />
u32 in_size = 0;<br />
u32 out_addr = 0;<br />
u32 out_size = 0;<br />
u32 keyslot = 0;<br />
u32 keyslot_dst = 0;<br />
<br />
// Get the TSEC device key<br />
tsec_get_device_key(tsec_device_key_addr, 0x10);<br />
<br />
// Install the TSEC device key into keyslot 0x0D<br />
set_keyslot_data(0x0D, tsec_device_key_addr, 0x10);<br />
<br />
in_addr = static_seed2_addr;<br />
in_size = 0x10;<br />
out_addr = keyblob_device_key_addr;<br />
out_size = 0x10;<br />
keyslot = 0x0D;<br />
<br />
// Use the tsec_device_key (keyslot 0x0D) to decrypt the static_seed2<br />
// This generates the keyblob_device_key<br />
aes_ecb_decrypt(out_addr, out_size, keyslot, in_addr, in_size);<br />
<br />
in_addr = keyblob_device_key_addr;<br />
in_size = 0x10;<br />
keyslot = 0x0E;<br />
keyslot_dst = 0x0D;<br />
<br />
// Use SBK (keyslot 0x0E) to further decrypt the<br />
// keyblob_device_key and install it into keyslot 0x0D<br />
// This will generate the keyblob_key<br />
decrypt_keyslot(keyslot_dst, keyslot, in_addr, in_size);<br />
<br />
// Clear SBK and SSK keyslots<br />
clear_keyslot(0x0E);<br />
clear_keyslot(0x0F);<br />
<br />
in_addr = static_seed4_addr;<br />
in_size = 0x10;<br />
keyslot = 0x0D;<br />
keyslot_dst = 0x0B;<br />
<br />
// Use keyblob_key (keyslot 0x0D) to decrypt the<br />
// static_seed4_addr and install it to keyslot 0x0B<br />
// This will generate the bct_mac_key<br />
decrypt_keyslot(keyslot_dst, keyslot, in_addr, in_size);<br />
<br />
in_addr = bct_customer_data_addr + 0x10;<br />
in_size = 0xA0;<br />
out_addr = mac_addr;<br />
out_size = 0x10;<br />
keyslot = 0x0B;<br />
<br />
// Use the bct_mac_key (keyslot 0x0B) to generate<br />
// CMAC over bct_customer_data_addr + 0x10<br />
aes_cmac(out_addr, out_size, keyslot, in_addr, in_size);<br />
<br />
// Comapre the generated hash with the first<br />
// 0x10 bytes of bct_customer_data<br />
bool match = safe_memcmp(mac_addr, bct_customer_data_addr, 0x10);<br />
<br />
// Hashes don't match<br />
if (!match)<br />
panic();<br />
<br />
in_addr = bct_customer_data_addr + 0x20;<br />
in_size = 0x90;<br />
ctr_addr = bct_customer_data_addr + 0x10;<br />
ctr_size = 0x10;<br />
out_addr = dec_payload_addr;<br />
out_size = 0x90;<br />
keyslot = 0x0D;<br />
<br />
// AES-CTR decrypt<br />
// Use the keyblob_key (keyslot 0x0D) to decrypt bct_customer_data_addr + 0x20<br />
// using bct_customer_data_addr + 0x10 as CTR<br />
aes_ctr_decrypt(out_addr, out_size, keyslot, in_addr, in_size, ctr_addr, ctr_size);<br />
<br />
// Install the last decrypted keyblob key into keyslot 0x0B<br />
// This is the pk11_key<br />
set_keyslot_data(0x0B, dec_payload_addr + 0x80, 0x10);<br />
<br />
// Install the first decrypted keyblob key into keyslot 0x0C<br />
// This is the master_static_kek<br />
set_keyslot_data(0x0C, dec_payload_addr, 0x10);<br />
<br />
// Clear out the decrypted data<br />
memclear(dec_payload_addr, 0x90);<br />
<br />
in_addr = master_static_seed_addr;<br />
in_size = master_static_seed_size;<br />
keyslot = 0x0C;<br />
keyslot_dst = 0x0C;<br />
<br />
// Use the master_static_kek (keyslot 0x0C) to decrypt<br />
// master_static_seed and install it into keyslot 0x0C<br />
// This will generate the master_static_key<br />
decrypt_keyslot(keyslot_dst, keyslot, in_addr, in_size);<br />
<br />
in_addr = static_seed3_addr;<br />
in_size = 0x10;<br />
keyslot = 0x0D;<br />
keyslot_dst = 0x0D;<br />
<br />
// Use keyblob_key (keyslot 0x0D) to decrypt<br />
// static_seed3_addr and install it into keyslot 0x0D<br />
// This will generate the master_device_key<br />
decrypt_keyslot(keyslot_dst, keyslot, in_addr, in_size);<br />
<br />
return;<br />
</syntaxhighlight><br />
<br />
===== generate_debug_keys =====<br />
In order to generate debug keys, the bootloader only uses static seeds, the SBK and the SSK.<br />
<br />
See the pseudocode bellow for the detailed process.<br />
<br />
<syntaxhighlight lang="c"><br />
u32 in_addr = 0;<br />
u32 in_size = 0;<br />
u32 keyslot = 0;<br />
u32 keyslot_dst = 0;<br />
<br />
in_addr = static_seed8_addr;<br />
in_size = 0x10;<br />
keyslot = 0x0E;<br />
keyslot_dst = 0x0B;<br />
<br />
// Use SBK (keyslot 0x0E) to decrypt the<br />
// static_seed8 and install it to keyslot 0x0B<br />
// This will generate debug_pk11_key<br />
decrypt_keyslot(keyslot_dst, keyslot, in_addr, in_size);<br />
<br />
in_addr = static_seed5_addr;<br />
in_size = 0x10;<br />
keyslot = 0x0E;<br />
keyslot_dst = 0x0C;<br />
<br />
// Use SBK (keyslot 0x0E) to decrypt the<br />
// static_seed5 and install it to keyslot 0x0C<br />
// This will generate debug_master_static_kek<br />
decrypt_keyslot(keyslot_dst, keyslot, in_addr, in_size);<br />
<br />
in_addr = static_seed9_addr;<br />
in_size = 0x10;<br />
keyslot = 0x0F;<br />
keyslot_dst = 0x0D;<br />
<br />
// Use SSK (keyslot 0x0F) to decrypt the<br />
// static_seed9 and install it to keyslot 0x0D<br />
// This will generate debug_keyblob_key<br />
decrypt_keyslot(keyslot_dst, keyslot, in_addr, in_size);<br />
<br />
// Clear SBK and SSK keyslots<br />
clear_keyslot(0x0E);<br />
clear_keyslot(0x0F);<br />
<br />
in_addr = master_static_seed_addr;<br />
in_size = master_static_seed_size;<br />
keyslot = 0x0C;<br />
keyslot_dst = 0x0C;<br />
<br />
// Use the debug_master_static_kek (keyslot 0x0C) to decrypt the<br />
// master_static_seed and install it to keyslot 0x0C<br />
// This will generate the master_static_key<br />
decrypt_keyslot(keyslot_dst, keyslot, in_addr, in_size);<br />
<br />
in_addr = static_seed3_addr;<br />
in_size = 0x10;<br />
keyslot = 0x0D;<br />
keyslot_dst = 0x0D;<br />
<br />
// Use debug_keyblob_key (keyslot 0x0D) to decrypt the<br />
// static_seed3 and install it to keyslot 0x0D<br />
// This will generate the master_device_key<br />
decrypt_keyslot(keyslot_dst, keyslot, in_addr, in_size);<br />
<br />
return;<br />
</syntaxhighlight><br />
<br />
== PK11 Blob ==<br />
This blob is stored encrypted inside the package and is decrypted by the initial bootloader.<br />
<br />
=== Encryption ===<br />
The encrypted blob is prepended with it's CTR and total image size. After checking the image's size against an hardcoded value (can change on firmware updates), the image is AES-CTR decrypted and the keyslot used for decryption is immediately cleared.<br />
<br />
<syntaxhighlight lang="c"><br />
// Maximum encrypted blob's size on firmware version 1.0.0<br />
u32 max_pk11_enc_blob_size = 0x29000;<br />
<br />
u32 pk11_enc_blob_size = *(u32 *)pk11_blob_addr;<br />
u32 pk11_enc_blob_ctr_addr = pk11_blob_addr + 0x10; <br />
u32 pk11_enc_blob_addr = pk11_blob_addr + 0x20;<br />
<br />
// Validate the encrypted blob's size<br />
if (pk11_enc_blob_size > max_pk11_enc_blob_size)<br />
panic();<br />
<br />
u32 in_addr = pk11_enc_blob_addr;<br />
u32 in_size = pk11_enc_blob_size;<br />
u32 ctr_addr = pk11_enc_blob_ctr_addr;<br />
u32 ctr_size = 0x10;<br />
u32 out_addr = pk11_dec_blob_addr;<br />
u32 out_size = pk11_dec_blob_size;<br />
u32 keyslot = 0x0B;<br />
<br />
// AES-CTR decrypt<br />
// Use the pk11_key (keyslot 0x0B) to decrypt the blob in place<br />
aes_ctr_decrypt(out_addr, out_size, keyslot, in_addr, in_size, ctr_addr, ctr_size);<br />
<br />
// Clear pk11_key keyslot<br />
clear_keyslot(0x0B);<br />
<br />
// Validate the decrypted blob<br />
// Checks the "PK11" magic and some pk11 header fields<br />
bool is_valid = check_pk11_header(pk11_dec_blob_addr, pk11_dec_blob_size);<br />
<br />
// Invalid PK11 image<br />
if (!is_valid)<br />
panic();<br />
<br />
u32 pk11_header_size = 0x20;<br />
u32 pk11_sec1_offset = *(u32 *)pk11_dec_blob_addr + 0x14;<br />
u32 pk11_sec2_size = *(u32 *)pk11_dec_blob_addr + 0x18;<br />
<br />
// Calculate NX bootloader's entrypoint<br />
u32 nx_boot_addr = (pk11_dec_blob_addr + pk11_header_size + pk11_sec1_offset + pk11_sec2_size);<br />
<br />
return nx_boot_addr;<br />
</syntaxhighlight><br />
<br />
=== Header ===<br />
When decrypted, the blob is encapsulated in the following header.<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Offset<br />
! Size<br />
! Description<br />
|-<br />
| 0x0<br />
| 4<br />
| Magic "PK11"<br />
|-<br />
| 0x4<br />
| 4<br />
| Section 0 size<br />
|-<br />
| 0x8<br />
| 4<br />
| Section 0 offset<br />
|-<br />
| 0xC<br />
| 4<br />
| Unknown<br />
|-<br />
| 0x10<br />
| 4<br />
| Section 1 size<br />
|-<br />
| 0x14<br />
| 4<br />
| Section 1 offset<br />
|-<br />
| 0x18<br />
| 4<br />
| Section 2 size<br />
|-<br />
| 0x1C<br />
| 4<br />
| Section 2 offset<br />
|}<br />
<br />
=== Section 0 ===<br />
This section contains the warmboot binary.<br />
<br />
=== Section 1 ===<br />
This section contains the NX bootloader, which is run after the initial bootloader in package1.<br />
<br />
=== Section 2 ===<br />
This section contains the Secure Monitor binary.<br />
<br />
= Changelog =<br />
== 2.0.0 ==<br />
* The encrypted binaries' order and calculation for next stage's entrypoint was changed.<br />
<br />
Old layout (before 2.0.0):<br />
1.- PK11 header<br />
2.- Secure Monitor blob<br />
3.- NX bootloader blob<br />
4.- Warmboot blob<br />
<br />
NX bootloader entrypoint is calculated as:<br />
0x40013FE0 + 0x20 + 0x20 + NX bootloader blob's offset + Secure Monitor blob's size<br />
<br />
New layout (2.0.0+):<br />
1.- PK11 header<br />
2.- Warmboot blob<br />
3.- NX bootloader blob<br />
4.- Secure Monitor blob<br />
<br />
NX bootloader entrypoint is calculated as:<br />
0x40013FE0 + 0x20 + 0x20 + NX bootloader blob's offset + Warmboot blob's size<br />
<br />
* Some AES-ECB decryption related code was refactored.<br />
<br />
== 3.0.0 ==<br />
* The functions set_se_addr() and check_se_status() are now called right after enabling the security engine clocks and resets.<br />
See [[Switch_System_Flaws#Stage_1_Bootloader]].<br />
<br />
* Keyslot 0x0A is now used instead of keyslot 0x0D for generating the master_device_key.</div>
Thog