<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://switchbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Adubbz</id>
	<title>Nintendo Switch Brew - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://switchbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Adubbz"/>
	<link rel="alternate" type="text/html" href="https://switchbrew.org/wiki/Special:Contributions/Adubbz"/>
	<updated>2026-04-30T23:02:06Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=NCM_services&amp;diff=8051</id>
		<title>NCM services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=NCM_services&amp;diff=8051"/>
		<updated>2019-10-01T09:55:34Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: RefreshExcluding&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NCM contains services for internal file path and content management.&lt;br /&gt;
&lt;br /&gt;
= Location Resolver services =&lt;br /&gt;
== lr ==&lt;br /&gt;
This is &amp;quot;nn::lr::ILocationResolverManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || OpenLocationResolver || [[Filesystem_services#StorageId|StorageID]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || OpenRegisteredLocationResolver || None || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || RefreshLocationResolver || [[Filesystem_services#StorageId|StorageID]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [2.0.0+] OpenAddOnContentLocationResolver || None  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The only sysmodules which use this service are [[Filesystem_services|FS]], [[Loader_services|Loader]], and [[NS_Services|NS]]. [[boot2]] has access but doesn&#039;t use it.&lt;br /&gt;
&lt;br /&gt;
=== ILocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::ILocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ResolveProgramPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#RedirectProgramPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#ResolveApplicationControlPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#ResolveApplicationHtmlDocumentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#ResolveDataPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#RedirectApplicationControlPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#RedirectApplicationHtmlDocumentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#ResolveApplicationLegalInformationPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#RedirectApplicationLegalInformationPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#Refresh]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [5.0.0+] [[#RedirectApplicationProgramPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [5.0.0+] [[#ClearApplicationRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [5.0.0+] [[#EraseProgramRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [5.0.0+] [[#EraseApplicationControlRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [5.0.0+] [[#EraseApplicationHtmlDocumentRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [5.0.0+] [[#EraseApplicationLegalInformationRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [7.0.0+] [[#ResolveProgramPathForDebug]] || Unofficial name&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [7.0.0+] [[#RedirectProgramPathForDebug]] || Unofficial name&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [7.0.0+] [[#RedirectApplicationProgramPathForDebug]] || Unofficial name&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [7.0.0+] [[#EraseProgramRedirectionForDebug]] || Unofficial name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If the supplied [[Filesystem_services#StorageId|StorageID]] is 1 (Host), a different set of internal functions is used to handle these commands. In this more restricted set of functions, GetControlNcaPath is stubbed and only returns error 0x608.&lt;br /&gt;
&lt;br /&gt;
The Get* commands load the [[Filesystem_services|ContentPath]] from linked-lists&#039; [[#Location_List_Entry|entries]] in memory using the input TitleID. When the command fails to find an entry for the specified TitleID, 0x408 is returned for GetProgramNcaPath and 0xA08 is returned for the rest.&lt;br /&gt;
&lt;br /&gt;
The Set* commands always return 0 and add a new entry to the list. If a matching entry is found, it&#039;s removed first.&lt;br /&gt;
&lt;br /&gt;
==== ResolveProgramPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectProgramPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 0.&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationControlPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationHtmlDocumentPath====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
==== ResolveDataPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationControlPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
[9.0.0+] Now takes an additional 8-bytes of input.&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationHtmlDocumentPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
[9.0.0+] Now takes an additional 8-bytes of input.&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationLegalInformationPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationLegalInformationPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
[9.0.0+] Now takes an additional 8-bytes of input.&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== Refresh ====&lt;br /&gt;
Takes no input. Frees all linked-lists&#039; entries that have &#039;&#039;&#039;flag&#039;&#039;&#039; set to 0.&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationProgramPath ====&lt;br /&gt;
Same as [[#RedirectProgramPath|RedirectProgramPath]], but inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
[9.0.0+] Now takes an additional 8-bytes of input.&lt;br /&gt;
&lt;br /&gt;
==== ClearApplicationRedirection ====&lt;br /&gt;
Takes no input. Frees all linked-lists&#039; entries that have &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
[9.0.0+] Now takes a type-0x5 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
==== EraseProgramRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== EraseApplicationControlRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== EraseApplicationHtmlDocumentRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== EraseApplicationLegalInformationRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== ResolveProgramPathForDebug ====&lt;br /&gt;
Same as [[#ResolveProgramPath|ResolveProgramPath]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
==== RedirectProgramPathForDebug ====&lt;br /&gt;
Same as [[#RedirectProgramPath|RedirectProgramPath]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationProgramPathForDebug ====&lt;br /&gt;
Same as [[#RedirectApplicationProgramPath |RedirectApplicationProgramPath ]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[9.0.0+] Like [[#RedirectApplicationProgramPath]] this now takes an additional 8-bytes of input.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
==== EraseProgramRedirectionForDebug ====&lt;br /&gt;
Same as [[#EraseProgramRedirection |EraseProgramRedirection ]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
=== IRegisteredLocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::IRegisteredLocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This works like [[#ILocationResolver]], but only two types of NCA paths can be gotten/set. In addition, each type has a fallback path that can be set for a single title ID at a time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || ResolveProgramPath || u64 TitleID + C descriptor || Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || RegisterProgramPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] [9.0.0+] Now takes an additional 8-bytes of input. || Sets the Type 0 fallback TID and path to the provided arguments.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || UnregisterProgramPath || u64 TitleID || If the Type 0 fallback TID is == argument TID, unregisters the fallback path. Otherwise, noop.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || RedirectProgramPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] [9.0.0+] Now takes an additional 8-bytes of input. ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [2.0.0+] ResolveHtmlDocumentPath || u64 TitleID + C descriptor ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [2.0.0+] RegisterHtmlDocumentPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] [9.0.0+] Now takes an additional 8-bytes of input. || Sets the Type 1 fallback TID and path to the provided arguments.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [2.0.0+] UnregisterHtmlDocumentPath || u64 TitleID || If the Type 1 fallback TID is == argument TID, unregisters the fallback path. Otherwise, noop.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [2.0.0+] RedirectHtmlDocumentPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] [9.0.0+] Now takes an additional 8-bytes of input. ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [7.0.0+] Refresh || No input/output. || &lt;br /&gt;
|-&lt;br /&gt;
| 9 || [9.0.0+] RefreshExcluding || Type-5 buffer || Unofficial name. Refreshes entries excluding those with application title ids contained in the buffer.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IAddOnContentLocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::IAddOnContentLocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || ResolveAddOnContentPath || u64 TitleID + C descriptor || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || RegisterAddOnContentStorage || [[Filesystem_services#StorageId|StorageID]] + u64 TitleID [9.0.0+] Now takes an additional u64 TitleID for the owner application. || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || UnregisterAllAddOnContentPath || None || Clears all registered titles here.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [9.0.0+] [[#RefreshApplicationAddOnContent]] || Type-5 buffer || Unofficial name&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [9.0.0+] [[#UnregisterApplicationAddOnContent]] || u64 TitleID || Unofficial name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== RefreshApplicationAddOnContent ====&lt;br /&gt;
Takes an type-5 buffer containing application title ids. Unregisters entries with application ids absent from the input buffer.&lt;br /&gt;
&lt;br /&gt;
==== UnregisterApplicationAddOnContent====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; for the application to unregister add on content entries for.&lt;br /&gt;
&lt;br /&gt;
=== Location List Entry ===&lt;br /&gt;
Total size is 0x320 bytes. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8|| Pointer to previous entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x8|| Pointer to next entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x8|| TitleID&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x300 || [[Filesystem_services|ContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x318 || 0x4 || Flag&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C || 0x4 || Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Content Manager services =&lt;br /&gt;
== ncm ==&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CreateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CreateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || VerifyContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || VerifyContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || OpenContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], [2.0.0+] Only returns a storage if one has previously been opened globally via OpenIContentStorage.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || OpenContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], [2.0.0+] Only returns a storage if one has previously been opened globally via OpenIContentStorage.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [1.0.0] CloseContentStorageForcibly || Takes a [[Filesystem_services#StorageId|StorageID]]. Calls IContentStorage-&amp;gt;CloseAndFlushStorage().&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [1.0.0] CloseContentMetaDatabaseForcibly || Takes a [[Filesystem_services#StorageId|StorageID]].  Calls IContentMetaDatabase-&amp;gt;CloseMetaDatabase().&lt;br /&gt;
|-&lt;br /&gt;
| 8 || CleanupContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and deletes the associated savedata.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [2.0.0+] ActivateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], and opens an IContentStorage for the StorageID to be gotten with GetIContentStorage. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [2.0.0+] InactivateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], and closes the associated IContentStorage. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [2.0.0+] ActivateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and opens an IContentMetaDatabase for the StorageID to be gotten with GetIContentMetaDatabase. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [2.0.0+] InactivateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and closes the associated IContentMetaDatabase. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [9.0.0+] InvalidateRightsIdCache ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IContentStorage ===&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentStorage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GeneratePlaceHolderId]] || Returns a random UUID for the Content Storage.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CreatePlaceHolder || Takes two [[#NcaID]]s, and a u64 filesize.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DeletePlaceHolder || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || HasPlaceHolder ||  Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || WritePlaceHolder || Takes a [[#NcaID]], a u64-offset, and type 5 buffer. Writes the buffer to the file for the NcaID&#039;s placeholder path at the specified offset.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Register || Takes two [[#NcaID]]s, moves the Placeholder NCA content to the registered NCA path.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Delete || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Has || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || GetPath || Takes a [[#NcaID]]. Returns a [[Filesystem_services#ContentPath|Content Path]].&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetPlaceHolderPath || Takes a [[#NcaID]]. Returns a [[Filesystem_services#ContentPath|Content Path]].&lt;br /&gt;
|-&lt;br /&gt;
| 10 || CleanupAllPlaceHolder || Deletes and re-creates the Placeholder directory.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || ListPlaceHolder || This is like [[#GetNumberOfRegisteredEntries]], but for the Placeholder directory.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#GetContentCount]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#ListContentId]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#GetSizeFromContentId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 15 || DisableForcibly || Closes/Flushes all resources for the storage, and causes all future IPC commands to the current session to return error 0xC805.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [2.0.0+] RevertToPlaceHolder || Takes three 0x10-sized [[#NcaID]]s. Creates the registered directory NCA path, and renames the placeholder path to the registered NCA path.&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [2.0.0+] SetPlaceHolderSize || Takes a [[#NcaID]], and a u64 size&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [2.0.0+] [[#ReadContentIdFile]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [2.0.0+] [[#GetRightsIdFromPlaceHolderId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 20 || [2.0.0+] [[#GetRightsIdFromContentId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 21 || [2.0.0+] WriteContentForDebug || Takes a [[#NcaID]], a u64 offset, and a type 5 buffer. On debug units, writes the buffer to the NCA&#039;s registered path. On retail units, this just aborts.&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [2.0.0+] GetFreeSpaceSize || Gets free space for the storage.&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [2.0.0+] GetTotalSpaceSize || Gets total space for the storage.&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [3.0.0+] FlushPlaceHolder || Flushes resources for the storage without closing it.&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [4.0.0+] GetSizeFromPlaceHolderId || &lt;br /&gt;
|-&lt;br /&gt;
| 26 || [4.0.0+] RepairInvalidFileAttribute || &lt;br /&gt;
|-&lt;br /&gt;
| 27 || [8.0.0+] GetRightsIdFromPlaceHolderIdWithCache || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== GeneratePlaceHolderId ====&lt;br /&gt;
Generates a random [[#NcaID]] for use as a placeholder.&lt;br /&gt;
&lt;br /&gt;
Calls nn::util::GenerateUuid(), which internally calls nn::os::GenerateRandomBytes(16);&lt;br /&gt;
&lt;br /&gt;
==== GetContentCount ====&lt;br /&gt;
Writes the total number of entries which can be read by GetEntries, to cmdreply &amp;lt;SFCO_offset&amp;gt;+0x10.&lt;br /&gt;
&lt;br /&gt;
==== ListContentId====&lt;br /&gt;
Takes an output buffer, u32 offset and gets all entries starting at that offset.&lt;br /&gt;
Returns number of entries read.&lt;br /&gt;
&lt;br /&gt;
Each entry is a [[#NcaID]].&lt;br /&gt;
&lt;br /&gt;
The total read entries is exactly the same as the number of &amp;quot;&amp;lt;hex&amp;gt;.nca&amp;quot; directories in the storage FS(or at least under the &amp;quot;registered&amp;quot; directory?).&lt;br /&gt;
&lt;br /&gt;
==== GetSizeFromContentId ====&lt;br /&gt;
Takes a [[#NcaID]] as input.&lt;br /&gt;
&lt;br /&gt;
Returns the total size readable by [[#ReadContentIdFile]]. This is the same as the size-field in the [[NAX0]] &amp;quot;&amp;lt;NcaID&amp;gt;.nca/00&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
==== ReadContentIdFile ====&lt;br /&gt;
Takes an output buffer, a [[#NcaID]] as input, and a u64 file offset.&lt;br /&gt;
&lt;br /&gt;
Reads plaintext NCA file contents from the Registered path for the NcaID.&lt;br /&gt;
&lt;br /&gt;
==== GetRightsIdFromPlaceHolderId ====&lt;br /&gt;
Takes a total of 0x10-bytes of input, returns a total of 0x10-bytes of output.&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] Returns an additional 8-bytes of output.&lt;br /&gt;
&lt;br /&gt;
Gets the Rights ID for the [[#NcaID]]&#039;s placeholder path.&lt;br /&gt;
&lt;br /&gt;
==== GetRightsIdFromContentId ====&lt;br /&gt;
Takes a total of 0x10-bytes of input, returns a total of 0x10-bytes of output.&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] Returns an additional 8-bytes of output.&lt;br /&gt;
&lt;br /&gt;
Gets the Rights ID for the [[#NcaID]]&#039;s registered path&lt;br /&gt;
&lt;br /&gt;
=== IContentMetaDatabase ===&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentMetaDatabase&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Set || Takes a [[#ContentMetaKey|Content Meta Key]], a type-5 [[CNMT#Content_records|Content Records]] buffer and a u64 size.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Get || Takes a [[#ContentMetaKey|Content Meta Key]], a type-6 buffer to write [[CNMT#Content_records|Content Records]] to and a u64 size. Returns the actual number of bytes read into the buffer. First 8 bytes of the data is header (u16 numExtraDataBytes, numContentRecords, numMetaRecords, padding). After the header is numExtraDataBytes of additional data, after which follow content records and content meta keys. Set takes this same data as input.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Remove || Takes a [[#ContentMetaKey|Content Meta Key]], and removes the associated record.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetContentIdByType || Takes a [[#ContentMetaKey|Content Meta Key]] and a u8 [[#ContentMetaType|Content Meta Type]]. Returns a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || ListContentInfo || Takes a type-6 buffer to write [[CNMT#Content_records|Content Record]] entries to, a [[#ContentMetaKey|Content Meta Key]], and a u32 index into the Content Record entries to start copying from. Returns a u32 entries_read.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || List || Takes a type-6 buffer to write [[#ContentMetaKey|Content Meta Key]]s to, a u32 [[#ContentMetaType|Content Meta Type]], a u64 TID, a u64 TID_LOW, and u64 TID_HIGH. Writes into the buffer all Content Meta Keys with low &amp;lt;= record-&amp;gt;title_id &amp;lt;= high, and record-&amp;gt;type == type. Returns u32 numEntriesTotal, numEntriesWritten. Additionally requires record-&amp;gt;title_id == TID, if record-&amp;gt;type is Application, Patch, Add-On, or Delta, otherwise, you can pass 0 for type to ignore the type and list them all in the range.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || GetLatestContentMetaKey || Takes a u64 title id, and returns the [[#ContentMetaKey|Content Meta Key]] with the highest version field for that title id.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#ListApplication]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Has || Takes a [[#ContentMetaKey|Content Meta Key]] and returns whether that record is present in the database.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || HasAll || Takes a type-5 buffer containing [[#ContentMetaKey|Content Meta Key]] (code assumes there are size/sizeof(meta_record) records in the buffer), and returns whether all of those records are present in the database.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetSize || Takes a [[#ContentMetaKey|Content Meta Key]], and returns the size of the associated [[CNMT#Content_records|Content Records]].&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetRequiredSystemVersion || Takes a [[#ContentMetaKey|Content Meta Key]], and returns u32 from ContentRecords + 16 (only if the content meta key has type Application or Patch).&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetPatchId || Takes a [[#ContentMetaKey|Content Meta Key]], and returns the update title id for that record.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || DisableForcibly ||  Closes the meta database, and causes all future IPC commands to the current session to return error 0xDC05.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#LookupOrphanContent]] || Takes a type-6 byte buffer, and a type-5 buffer of [[#NcaID]]s.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Commit || Flushes the in-memory database to savedata.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || HasContent || Takes a [[#ContentMetaKey|Content Meta Key]] and an [[#NcaID]]. Returns whether the content records for that content meta key contain the NcaID.&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListContentMetaInfo || Takes a type-6 [[#ContentMetaKey|Content Meta Key]] output buffer, a u32 offset into that buffer, and an input [[#ContentMetaKey|Content Meta Key]].&lt;br /&gt;
|-&lt;br /&gt;
| 18 || GetAttributes || Takes a [[#ContentMetaKey|Content Meta Key]], and returns u8 from ContentRecords + 6.&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [2.0.0+] GetRequiredApplicationVersion || Does the same thing as GetEntryUnknownRecordSize, but for AddOnContents.&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [5.0.0+] GetContentIdByTypeAndIdOffset ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== ListApplication ====&lt;br /&gt;
Each 24-byte entry (officially &amp;quot;ApplicationContentMetaKey&amp;quot;) is as follows:&lt;br /&gt;
  [[CNMT#Meta_records|meta_record]] meta_record;&lt;br /&gt;
  u64    base_title_id;&lt;br /&gt;
&lt;br /&gt;
This function takes in a type 6 buffer to write entries to, and a u8 &amp;quot;filter&amp;quot; [[#Title_Types|type]]. If filter is zero, all update records will be copied to to the output buffer (space permitting). Otherwise, only titles with type == filter_type will be copied to the output buffer.&lt;br /&gt;
&lt;br /&gt;
This func returns a u32 num_entries_total, and a u32 num_entries_written.&lt;br /&gt;
&lt;br /&gt;
==== ReadEntryMetaRecords ====&lt;br /&gt;
Takes a type-6 [[#ContentMetaKey|Content Meta Key]] output buffer, a u32 offset into that buffer, and an input [[#ContentMetaKey|Content Meta Key]] entry. Returns a u32 for total_read_entries.&lt;br /&gt;
&lt;br /&gt;
Reads the content meta keys stored in the entry&#039;s content records into the output buffer.&lt;br /&gt;
&lt;br /&gt;
This is used, for example, with System Update title 0100000000000816, which contains content meta keys for all other systitles in its Content Records.&lt;br /&gt;
&lt;br /&gt;
==== LookupOrphanContent ====&lt;br /&gt;
Takes a type-6 byte buffer, and a type-5 buffer containing [[#NcaID]]s.&lt;br /&gt;
&lt;br /&gt;
This function was stubbed to return 0xDC05 in [[2.0.0]].&lt;br /&gt;
&lt;br /&gt;
On 1.0.0: Initialized the output buffer to all 1s. Then, for each [[#NcaID]] in the input buffer, it checks if that NcaID is present anywhere in the database, and if so writes 0 to the corresponding output byte.&lt;br /&gt;
&lt;br /&gt;
In pseudocode, the function basically does the following:&lt;br /&gt;
&lt;br /&gt;
for i in range(len(out_buf)):&lt;br /&gt;
    out_buf[i] = 1&lt;br /&gt;
&lt;br /&gt;
for i, NcaID in NcaIDs:&lt;br /&gt;
    if is_present_in_database(NcaID):&lt;br /&gt;
        out_buf[i] = 0&lt;br /&gt;
&lt;br /&gt;
=== NcaID ===&lt;br /&gt;
This is a 0x10-byte entry. This is originally from the hex portion of &amp;quot;&amp;lt;hex&amp;gt;.nca&amp;quot; directory-names from this storage FS(like [[SD_Filesystem|SD]]). This is also referred to as &amp;quot;ContentId&amp;quot; in the official SDK.&lt;br /&gt;
&lt;br /&gt;
The NcaID is the same as the first 0x10-bytes from the calculated SHA256 hash, from hashing the entire output from [[#ReadContentIdFile]].&lt;br /&gt;
&lt;br /&gt;
== ContentInstallType ==&lt;br /&gt;
This is &amp;quot;nn::ncm::ContentInstallType&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| Full&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| FragmentOnly&lt;br /&gt;
|-&lt;br /&gt;
| 0x7&lt;br /&gt;
| Unknown (Invalid Content Install Type)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ContentMetaType ==&lt;br /&gt;
This is &amp;quot;nn::ncm::ContentMetaType&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| Unknown (Invalid Content Meta Type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| SystemProgram ([[Title_list#System_Modules|System Modules]] or [[Title_list#System_Applets|System Applets]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| SystemData ([[Title_list#System_Data_Archives|System Data Archives]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| SystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| BootImagePackage ([[Title_list|Firmware package A or C]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x05&lt;br /&gt;
| BootImagePackageSafe ([[Title_list|Firmware package B or D]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x80&lt;br /&gt;
| Application&lt;br /&gt;
|-&lt;br /&gt;
| 0x81&lt;br /&gt;
| Patch&lt;br /&gt;
|-&lt;br /&gt;
| 0x82&lt;br /&gt;
| AddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 0x83&lt;br /&gt;
| Delta&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ContentMetaKey ==&lt;br /&gt;
This is &amp;quot;nn::ncm::ContentMetaKey&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 &lt;br /&gt;
| 0x8 &lt;br /&gt;
| Title id&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| 0x4 &lt;br /&gt;
| Version&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| 0x1 &lt;br /&gt;
| [[#ContentMetaType|Content Meta Type]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| 0x1 &lt;br /&gt;
| [[#ContentInstallType|Content Install Type]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| 0x2 &lt;br /&gt;
| Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ncm:v ==&lt;br /&gt;
This service doesn&#039;t normally exist on retail.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=NCM_services&amp;diff=7848</id>
		<title>NCM services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=NCM_services&amp;diff=7848"/>
		<updated>2019-09-12T12:47:11Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NCM contains services for internal file path and content management.&lt;br /&gt;
&lt;br /&gt;
= Location Resolver services =&lt;br /&gt;
== lr ==&lt;br /&gt;
This is &amp;quot;nn::lr::ILocationResolverManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || OpenLocationResolver || [[Filesystem_services#StorageId|StorageID]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || OpenRegisteredLocationResolver || None || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || RefreshLocationResolver || [[Filesystem_services#StorageId|StorageID]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [2.0.0+] OpenAddOnContentLocationResolver || None  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The only sysmodules which use this service are [[Filesystem_services|FS]], [[Loader_services|Loader]], and [[NS_Services|NS]]. [[boot2]] has access but doesn&#039;t use it.&lt;br /&gt;
&lt;br /&gt;
=== ILocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::ILocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ResolveProgramPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#RedirectProgramPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#ResolveApplicationControlPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#ResolveApplicationHtmlDocumentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#ResolveDataPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#RedirectApplicationControlPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#RedirectApplicationHtmlDocumentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#ResolveApplicationLegalInformationPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#RedirectApplicationLegalInformationPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#Refresh]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [5.0.0+] [[#RedirectApplicationProgramPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [5.0.0+] [[#ClearApplicationRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [5.0.0+] [[#EraseProgramRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [5.0.0+] [[#EraseApplicationControlRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [5.0.0+] [[#EraseApplicationHtmlDocumentRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [5.0.0+] [[#EraseApplicationLegalInformationRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [7.0.0+] [[#ResolveProgramPathForDebug]] || Unofficial name&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [7.0.0+] [[#RedirectProgramPathForDebug]] || Unofficial name&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [7.0.0+] [[#RedirectApplicationProgramPathForDebug]] || Unofficial name&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [7.0.0+] [[#EraseProgramRedirectionForDebug]] || Unofficial name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If the supplied [[Filesystem_services#StorageId|StorageID]] is 1 (Host), a different set of internal functions is used to handle these commands. In this more restricted set of functions, GetControlNcaPath is stubbed and only returns error 0x608.&lt;br /&gt;
&lt;br /&gt;
The Get* commands load the [[Filesystem_services|ContentPath]] from linked-lists&#039; [[#Location_List_Entry|entries]] in memory using the input TitleID. When the command fails to find an entry for the specified TitleID, 0x408 is returned for GetProgramNcaPath and 0xA08 is returned for the rest.&lt;br /&gt;
&lt;br /&gt;
The Set* commands always return 0 and add a new entry to the list. If a matching entry is found, it&#039;s removed first.&lt;br /&gt;
&lt;br /&gt;
==== ResolveProgramPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectProgramPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 0.&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationControlPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationHtmlDocumentPath====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
==== ResolveDataPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationControlPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
[9.0.0+] Now takes an additional 8-bytes of input.&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationHtmlDocumentPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
[9.0.0+] Now takes an additional 8-bytes of input.&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationLegalInformationPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationLegalInformationPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
[9.0.0+] Now takes an additional 8-bytes of input.&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== Refresh ====&lt;br /&gt;
Takes no input. Frees all linked-lists&#039; entries that have &#039;&#039;&#039;flag&#039;&#039;&#039; set to 0.&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationProgramPath ====&lt;br /&gt;
Same as [[#RedirectProgramPath|RedirectProgramPath]], but inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
[9.0.0+] Now takes an additional 8-bytes of input.&lt;br /&gt;
&lt;br /&gt;
==== ClearApplicationRedirection ====&lt;br /&gt;
Takes no input. Frees all linked-lists&#039; entries that have &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
[9.0.0+] Now takes a type-0x5 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
==== EraseProgramRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== EraseApplicationControlRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== EraseApplicationHtmlDocumentRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== EraseApplicationLegalInformationRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== ResolveProgramPathForDebug ====&lt;br /&gt;
Same as [[#ResolveProgramPath|ResolveProgramPath]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
==== RedirectProgramPathForDebug ====&lt;br /&gt;
Same as [[#RedirectProgramPath|RedirectProgramPath]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationProgramPathForDebug ====&lt;br /&gt;
Same as [[#RedirectApplicationProgramPath |RedirectApplicationProgramPath ]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[9.0.0+] Like [[#RedirectApplicationProgramPath]] this now takes an additional 8-bytes of input.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
==== EraseProgramRedirectionForDebug ====&lt;br /&gt;
Same as [[#EraseProgramRedirection |EraseProgramRedirection ]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
=== IRegisteredLocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::IRegisteredLocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This works like [[#ILocationResolver]], but only two types of NCA paths can be gotten/set. In addition, each type has a fallback path that can be set for a single title ID at a time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || ResolveProgramPath || u64 TitleID + C descriptor || Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || RegisterProgramPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] [9.0.0+] Now takes an additional 8-bytes of input. || Sets the Type 0 fallback TID and path to the provided arguments.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || UnregisterProgramPath || u64 TitleID || If the Type 0 fallback TID is == argument TID, unregisters the fallback path. Otherwise, noop.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || RedirectProgramPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] [9.0.0+] Now takes an additional 8-bytes of input. ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [2.0.0+] ResolveHtmlDocumentPath || u64 TitleID + C descriptor ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [2.0.0+] RegisterHtmlDocumentPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] [9.0.0+] Now takes an additional 8-bytes of input. || Sets the Type 1 fallback TID and path to the provided arguments.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [2.0.0+] UnregisterHtmlDocumentPath || u64 TitleID || If the Type 1 fallback TID is == argument TID, unregisters the fallback path. Otherwise, noop.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [2.0.0+] RedirectHtmlDocumentPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] [9.0.0+] Now takes an additional 8-bytes of input. ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [7.0.0+] Refresh || No input/output. || &lt;br /&gt;
|-&lt;br /&gt;
| 9 || [9.0.0+] || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IAddOnContentLocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::IAddOnContentLocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || ResolveAddOnContentPath || u64 TitleID + C descriptor || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || RegisterAddOnContentStorage || [[Filesystem_services#StorageId|StorageID]] + u64 TitleID [9.0.0+] Now takes an additional u64 TitleID for the owner application. || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || UnregisterAllAddOnContentPath || None || Clears all registered titles here.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [9.0.0+] [[#RefreshApplicationAddOnContent]] || Type-5 buffer || Unofficial name&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [9.0.0+] [[#UnregisterApplicationAddOnContent]] || u64 TitleID || Unofficial name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== RefreshApplicationAddOnContent ====&lt;br /&gt;
Takes an type-5 buffer containing application title ids. Unregisters entries with application ids absent from the input buffer.&lt;br /&gt;
&lt;br /&gt;
==== UnregisterApplicationAddOnContent====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; for the application to unregister add on content entries for.&lt;br /&gt;
&lt;br /&gt;
=== Location List Entry ===&lt;br /&gt;
Total size is 0x320 bytes. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8|| Pointer to previous entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x8|| Pointer to next entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x8|| TitleID&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x300 || [[Filesystem_services|ContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x318 || 0x4 || Flag&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C || 0x4 || Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Content Manager services =&lt;br /&gt;
== ncm ==&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CreateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CreateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || VerifyContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || VerifyContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || OpenContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], [2.0.0+] Only returns a storage if one has previously been opened globally via OpenIContentStorage.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || OpenContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], [2.0.0+] Only returns a storage if one has previously been opened globally via OpenIContentStorage.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [1.0.0] CloseContentStorageForcibly || Takes a [[Filesystem_services#StorageId|StorageID]]. Calls IContentStorage-&amp;gt;CloseAndFlushStorage().&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [1.0.0] CloseContentMetaDatabaseForcibly || Takes a [[Filesystem_services#StorageId|StorageID]].  Calls IContentMetaDatabase-&amp;gt;CloseMetaDatabase().&lt;br /&gt;
|-&lt;br /&gt;
| 8 || CleanupContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and deletes the associated savedata.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [2.0.0+] ActivateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], and opens an IContentStorage for the StorageID to be gotten with GetIContentStorage. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [2.0.0+] InactivateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], and closes the associated IContentStorage. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [2.0.0+] ActivateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and opens an IContentMetaDatabase for the StorageID to be gotten with GetIContentMetaDatabase. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [2.0.0+] InactivateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and closes the associated IContentMetaDatabase. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [9.0.0+] InvalidateRightsIdCache ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IContentStorage ===&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentStorage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GeneratePlaceHolderId]] || Returns a random UUID for the Content Storage.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CreatePlaceHolder || Takes two [[#NcaID]]s, and a u64 filesize.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DeletePlaceHolder || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || HasPlaceHolder ||  Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || WritePlaceHolder || Takes a [[#NcaID]], a u64-offset, and type 5 buffer. Writes the buffer to the file for the NcaID&#039;s placeholder path at the specified offset.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Register || Takes two [[#NcaID]]s, moves the Placeholder NCA content to the registered NCA path.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Delete || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Has || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || GetPath || Takes a [[#NcaID]]. Returns a [[Filesystem_services#ContentPath|Content Path]].&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetPlaceHolderPath || Takes a [[#NcaID]]. Returns a [[Filesystem_services#ContentPath|Content Path]].&lt;br /&gt;
|-&lt;br /&gt;
| 10 || CleanupAllPlaceHolder || Deletes and re-creates the Placeholder directory.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || ListPlaceHolder || This is like [[#GetNumberOfRegisteredEntries]], but for the Placeholder directory.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#GetContentCount]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#ListContentId]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#GetSizeFromContentId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 15 || DisableForcibly || Closes/Flushes all resources for the storage, and causes all future IPC commands to the current session to return error 0xC805.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [2.0.0+] RevertToPlaceHolder || Takes three 0x10-sized [[#NcaID]]s. Creates the registered directory NCA path, and renames the placeholder path to the registered NCA path.&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [2.0.0+] SetPlaceHolderSize || Takes a [[#NcaID]], and a u64 size&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [2.0.0+] [[#ReadContentIdFile]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [2.0.0+] [[#GetRightsIdFromPlaceHolderId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 20 || [2.0.0+] [[#GetRightsIdFromContentId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 21 || [2.0.0+] WriteContentForDebug || Takes a [[#NcaID]], a u64 offset, and a type 5 buffer. On debug units, writes the buffer to the NCA&#039;s registered path. On retail units, this just aborts.&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [2.0.0+] GetFreeSpaceSize || Gets free space for the storage.&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [2.0.0+] GetTotalSpaceSize || Gets total space for the storage.&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [3.0.0+] FlushPlaceHolder || Flushes resources for the storage without closing it.&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [4.0.0+] GetSizeFromPlaceHolderId || &lt;br /&gt;
|-&lt;br /&gt;
| 26 || [4.0.0+] RepairInvalidFileAttribute || &lt;br /&gt;
|-&lt;br /&gt;
| 27 || [8.0.0+] GetRightsIdFromPlaceHolderIdWithCache || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== GeneratePlaceHolderId ====&lt;br /&gt;
Generates a random [[#NcaID]] for use as a placeholder.&lt;br /&gt;
&lt;br /&gt;
Calls nn::util::GenerateUuid(), which internally calls nn::os::GenerateRandomBytes(16);&lt;br /&gt;
&lt;br /&gt;
==== GetContentCount ====&lt;br /&gt;
Writes the total number of entries which can be read by GetEntries, to cmdreply &amp;lt;SFCO_offset&amp;gt;+0x10.&lt;br /&gt;
&lt;br /&gt;
==== ListContentId====&lt;br /&gt;
Takes an output buffer, u32 offset and gets all entries starting at that offset.&lt;br /&gt;
Returns number of entries read.&lt;br /&gt;
&lt;br /&gt;
Each entry is a [[#NcaID]].&lt;br /&gt;
&lt;br /&gt;
The total read entries is exactly the same as the number of &amp;quot;&amp;lt;hex&amp;gt;.nca&amp;quot; directories in the storage FS(or at least under the &amp;quot;registered&amp;quot; directory?).&lt;br /&gt;
&lt;br /&gt;
==== GetSizeFromContentId ====&lt;br /&gt;
Takes a [[#NcaID]] as input.&lt;br /&gt;
&lt;br /&gt;
Returns the total size readable by [[#ReadContentIdFile]]. This is the same as the size-field in the [[NAX0]] &amp;quot;&amp;lt;NcaID&amp;gt;.nca/00&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
==== ReadContentIdFile ====&lt;br /&gt;
Takes an output buffer, a [[#NcaID]] as input, and a u64 file offset.&lt;br /&gt;
&lt;br /&gt;
Reads plaintext NCA file contents from the Registered path for the NcaID.&lt;br /&gt;
&lt;br /&gt;
==== GetRightsIdFromPlaceHolderId ====&lt;br /&gt;
Takes a total of 0x10-bytes of input, returns a total of 0x10-bytes of output.&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] Returns an additional 8-bytes of output.&lt;br /&gt;
&lt;br /&gt;
Gets the Rights ID for the [[#NcaID]]&#039;s placeholder path.&lt;br /&gt;
&lt;br /&gt;
==== GetRightsIdFromContentId ====&lt;br /&gt;
Takes a total of 0x10-bytes of input, returns a total of 0x10-bytes of output.&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] Returns an additional 8-bytes of output.&lt;br /&gt;
&lt;br /&gt;
Gets the Rights ID for the [[#NcaID]]&#039;s registered path&lt;br /&gt;
&lt;br /&gt;
=== IContentMetaDatabase ===&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentMetaDatabase&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Set || Takes a [[#ContentMetaKey|Content Meta Key]], a type-5 [[CNMT#Content_records|Content Records]] buffer and a u64 size.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Get || Takes a [[#ContentMetaKey|Content Meta Key]], a type-6 buffer to write [[CNMT#Content_records|Content Records]] to and a u64 size. Returns the actual number of bytes read into the buffer. First 8 bytes of the data is header (u16 numExtraDataBytes, numContentRecords, numMetaRecords, padding). After the header is numExtraDataBytes of additional data, after which follow content records and content meta keys. Set takes this same data as input.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Remove || Takes a [[#ContentMetaKey|Content Meta Key]], and removes the associated record.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetContentIdByType || Takes a [[#ContentMetaKey|Content Meta Key]] and a u8 [[#ContentMetaType|Content Meta Type]]. Returns a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || ListContentInfo || Takes a type-6 buffer to write [[CNMT#Content_records|Content Record]] entries to, a [[#ContentMetaKey|Content Meta Key]], and a u32 index into the Content Record entries to start copying from. Returns a u32 entries_read.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || List || Takes a type-6 buffer to write [[#ContentMetaKey|Content Meta Key]]s to, a u32 [[#ContentMetaType|Content Meta Type]], a u64 TID, a u64 TID_LOW, and u64 TID_HIGH. Writes into the buffer all Content Meta Keys with low &amp;lt;= record-&amp;gt;title_id &amp;lt;= high, and record-&amp;gt;type == type. Returns u32 numEntriesTotal, numEntriesWritten. Additionally requires record-&amp;gt;title_id == TID, if record-&amp;gt;type is Application, Patch, Add-On, or Delta, otherwise, you can pass 0 for type to ignore the type and list them all in the range.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || GetLatestContentMetaKey || Takes a u64 title id, and returns the [[#ContentMetaKey|Content Meta Key]] with the highest version field for that title id.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#ListApplication]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Has || Takes a [[#ContentMetaKey|Content Meta Key]] and returns whether that record is present in the database.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || HasAll || Takes a type-5 buffer containing [[#ContentMetaKey|Content Meta Key]] (code assumes there are size/sizeof(meta_record) records in the buffer), and returns whether all of those records are present in the database.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetSize || Takes a [[#ContentMetaKey|Content Meta Key]], and returns the size of the associated [[CNMT#Content_records|Content Records]].&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetRequiredSystemVersion || Takes a [[#ContentMetaKey|Content Meta Key]], and returns u32 from ContentRecords + 16 (only if the content meta key has type Application or Patch).&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetPatchId || Takes a [[#ContentMetaKey|Content Meta Key]], and returns the update title id for that record.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || DisableForcibly ||  Closes the meta database, and causes all future IPC commands to the current session to return error 0xDC05.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#LookupOrphanContent]] || Takes a type-6 byte buffer, and a type-5 buffer of [[#NcaID]]s.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Commit || Flushes the in-memory database to savedata.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || HasContent || Takes a [[#ContentMetaKey|Content Meta Key]] and an [[#NcaID]]. Returns whether the content records for that content meta key contain the NcaID.&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListContentMetaInfo || Takes a type-6 [[#ContentMetaKey|Content Meta Key]] output buffer, a u32 offset into that buffer, and an input [[#ContentMetaKey|Content Meta Key]].&lt;br /&gt;
|-&lt;br /&gt;
| 18 || GetAttributes || Takes a [[#ContentMetaKey|Content Meta Key]], and returns u8 from ContentRecords + 6.&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [2.0.0+] GetRequiredApplicationVersion || Does the same thing as GetEntryUnknownRecordSize, but for AddOnContents.&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [5.0.0+] GetContentIdByTypeAndIdOffset ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== ListApplication ====&lt;br /&gt;
Each 24-byte entry (officially &amp;quot;ApplicationContentMetaKey&amp;quot;) is as follows:&lt;br /&gt;
  [[CNMT#Meta_records|meta_record]] meta_record;&lt;br /&gt;
  u64    base_title_id;&lt;br /&gt;
&lt;br /&gt;
This function takes in a type 6 buffer to write entries to, and a u8 &amp;quot;filter&amp;quot; [[#Title_Types|type]]. If filter is zero, all update records will be copied to to the output buffer (space permitting). Otherwise, only titles with type == filter_type will be copied to the output buffer.&lt;br /&gt;
&lt;br /&gt;
This func returns a u32 num_entries_total, and a u32 num_entries_written.&lt;br /&gt;
&lt;br /&gt;
==== ReadEntryMetaRecords ====&lt;br /&gt;
Takes a type-6 [[#ContentMetaKey|Content Meta Key]] output buffer, a u32 offset into that buffer, and an input [[#ContentMetaKey|Content Meta Key]] entry. Returns a u32 for total_read_entries.&lt;br /&gt;
&lt;br /&gt;
Reads the content meta keys stored in the entry&#039;s content records into the output buffer.&lt;br /&gt;
&lt;br /&gt;
This is used, for example, with System Update title 0100000000000816, which contains content meta keys for all other systitles in its Content Records.&lt;br /&gt;
&lt;br /&gt;
==== LookupOrphanContent ====&lt;br /&gt;
Takes a type-6 byte buffer, and a type-5 buffer containing [[#NcaID]]s.&lt;br /&gt;
&lt;br /&gt;
This function was stubbed to return 0xDC05 in [[2.0.0]].&lt;br /&gt;
&lt;br /&gt;
On 1.0.0: Initialized the output buffer to all 1s. Then, for each [[#NcaID]] in the input buffer, it checks if that NcaID is present anywhere in the database, and if so writes 0 to the corresponding output byte.&lt;br /&gt;
&lt;br /&gt;
In pseudocode, the function basically does the following:&lt;br /&gt;
&lt;br /&gt;
for i in range(len(out_buf)):&lt;br /&gt;
    out_buf[i] = 1&lt;br /&gt;
&lt;br /&gt;
for i, NcaID in NcaIDs:&lt;br /&gt;
    if is_present_in_database(NcaID):&lt;br /&gt;
        out_buf[i] = 0&lt;br /&gt;
&lt;br /&gt;
=== NcaID ===&lt;br /&gt;
This is a 0x10-byte entry. This is originally from the hex portion of &amp;quot;&amp;lt;hex&amp;gt;.nca&amp;quot; directory-names from this storage FS(like [[SD_Filesystem|SD]]). This is also referred to as &amp;quot;ContentId&amp;quot; in the official SDK.&lt;br /&gt;
&lt;br /&gt;
The NcaID is the same as the first 0x10-bytes from the calculated SHA256 hash, from hashing the entire output from [[#ReadContentIdFile]].&lt;br /&gt;
&lt;br /&gt;
== ContentInstallType ==&lt;br /&gt;
This is &amp;quot;nn::ncm::ContentInstallType&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| Full&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| FragmentOnly&lt;br /&gt;
|-&lt;br /&gt;
| 0x7&lt;br /&gt;
| Unknown (Invalid Content Install Type)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ContentMetaType ==&lt;br /&gt;
This is &amp;quot;nn::ncm::ContentMetaType&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| Unknown (Invalid Content Meta Type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| SystemProgram ([[Title_list#System_Modules|System Modules]] or [[Title_list#System_Applets|System Applets]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| SystemData ([[Title_list#System_Data_Archives|System Data Archives]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| SystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| BootImagePackage ([[Title_list|Firmware package A or C]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x05&lt;br /&gt;
| BootImagePackageSafe ([[Title_list|Firmware package B or D]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x80&lt;br /&gt;
| Application&lt;br /&gt;
|-&lt;br /&gt;
| 0x81&lt;br /&gt;
| Patch&lt;br /&gt;
|-&lt;br /&gt;
| 0x82&lt;br /&gt;
| AddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 0x83&lt;br /&gt;
| Delta&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ContentMetaKey ==&lt;br /&gt;
This is &amp;quot;nn::ncm::ContentMetaKey&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 &lt;br /&gt;
| 0x8 &lt;br /&gt;
| Title id&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| 0x4 &lt;br /&gt;
| Version&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| 0x1 &lt;br /&gt;
| [[#ContentMetaType|Content Meta Type]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| 0x1 &lt;br /&gt;
| [[#ContentInstallType|Content Install Type]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| 0x2 &lt;br /&gt;
| Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ncm:v ==&lt;br /&gt;
This service doesn&#039;t normally exist on retail.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=NCM_services&amp;diff=7847</id>
		<title>NCM services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=NCM_services&amp;diff=7847"/>
		<updated>2019-09-12T12:46:06Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: IAddOnContentLocationResolver 9.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NCM contains services for internal file path and content management.&lt;br /&gt;
&lt;br /&gt;
= Location Resolver services =&lt;br /&gt;
== lr ==&lt;br /&gt;
This is &amp;quot;nn::lr::ILocationResolverManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || OpenLocationResolver || [[Filesystem_services#StorageId|StorageID]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || OpenRegisteredLocationResolver || None || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || RefreshLocationResolver || [[Filesystem_services#StorageId|StorageID]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [2.0.0+] OpenAddOnContentLocationResolver || None  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The only sysmodules which use this service are [[Filesystem_services|FS]], [[Loader_services|Loader]], and [[NS_Services|NS]]. [[boot2]] has access but doesn&#039;t use it.&lt;br /&gt;
&lt;br /&gt;
=== ILocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::ILocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ResolveProgramPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#RedirectProgramPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#ResolveApplicationControlPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#ResolveApplicationHtmlDocumentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#ResolveDataPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#RedirectApplicationControlPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#RedirectApplicationHtmlDocumentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#ResolveApplicationLegalInformationPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#RedirectApplicationLegalInformationPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#Refresh]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [5.0.0+] [[#RedirectApplicationProgramPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [5.0.0+] [[#ClearApplicationRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [5.0.0+] [[#EraseProgramRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [5.0.0+] [[#EraseApplicationControlRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [5.0.0+] [[#EraseApplicationHtmlDocumentRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [5.0.0+] [[#EraseApplicationLegalInformationRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [7.0.0+] [[#ResolveProgramPathForDebug]] || Unofficial name&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [7.0.0+] [[#RedirectProgramPathForDebug]] || Unofficial name&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [7.0.0+] [[#RedirectApplicationProgramPathForDebug]] || Unofficial name&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [7.0.0+] [[#EraseProgramRedirectionForDebug]] || Unofficial name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If the supplied [[Filesystem_services#StorageId|StorageID]] is 1 (Host), a different set of internal functions is used to handle these commands. In this more restricted set of functions, GetControlNcaPath is stubbed and only returns error 0x608.&lt;br /&gt;
&lt;br /&gt;
The Get* commands load the [[Filesystem_services|ContentPath]] from linked-lists&#039; [[#Location_List_Entry|entries]] in memory using the input TitleID. When the command fails to find an entry for the specified TitleID, 0x408 is returned for GetProgramNcaPath and 0xA08 is returned for the rest.&lt;br /&gt;
&lt;br /&gt;
The Set* commands always return 0 and add a new entry to the list. If a matching entry is found, it&#039;s removed first.&lt;br /&gt;
&lt;br /&gt;
==== ResolveProgramPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectProgramPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 0.&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationControlPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationHtmlDocumentPath====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
==== ResolveDataPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationControlPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
[9.0.0+] Now takes an additional 8-bytes of input.&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationHtmlDocumentPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
[9.0.0+] Now takes an additional 8-bytes of input.&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationLegalInformationPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationLegalInformationPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
[9.0.0+] Now takes an additional 8-bytes of input.&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== Refresh ====&lt;br /&gt;
Takes no input. Frees all linked-lists&#039; entries that have &#039;&#039;&#039;flag&#039;&#039;&#039; set to 0.&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationProgramPath ====&lt;br /&gt;
Same as [[#RedirectProgramPath|RedirectProgramPath]], but inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
[9.0.0+] Now takes an additional 8-bytes of input.&lt;br /&gt;
&lt;br /&gt;
==== ClearApplicationRedirection ====&lt;br /&gt;
Takes no input. Frees all linked-lists&#039; entries that have &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
[9.0.0+] Now takes a type-0x5 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
==== EraseProgramRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== EraseApplicationControlRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== EraseApplicationHtmlDocumentRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== EraseApplicationLegalInformationRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== ResolveProgramPathForDebug ====&lt;br /&gt;
Same as [[#ResolveProgramPath|ResolveProgramPath]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
==== RedirectProgramPathForDebug ====&lt;br /&gt;
Same as [[#RedirectProgramPath|RedirectProgramPath]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationProgramPathForDebug ====&lt;br /&gt;
Same as [[#RedirectApplicationProgramPath |RedirectApplicationProgramPath ]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[9.0.0+] Like [[#RedirectApplicationProgramPath]] this now takes an additional 8-bytes of input.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
==== EraseProgramRedirectionForDebug ====&lt;br /&gt;
Same as [[#EraseProgramRedirection |EraseProgramRedirection ]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
=== IRegisteredLocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::IRegisteredLocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This works like [[#ILocationResolver]], but only two types of NCA paths can be gotten/set. In addition, each type has a fallback path that can be set for a single title ID at a time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || ResolveProgramPath || u64 TitleID + C descriptor || Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || RegisterProgramPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] [9.0.0+] Now takes an additional 8-bytes of input. || Sets the Type 0 fallback TID and path to the provided arguments.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || UnregisterProgramPath || u64 TitleID || If the Type 0 fallback TID is == argument TID, unregisters the fallback path. Otherwise, noop.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || RedirectProgramPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] [9.0.0+] Now takes an additional 8-bytes of input. ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [2.0.0+] ResolveHtmlDocumentPath || u64 TitleID + C descriptor ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [2.0.0+] RegisterHtmlDocumentPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] [9.0.0+] Now takes an additional 8-bytes of input. || Sets the Type 1 fallback TID and path to the provided arguments.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [2.0.0+] UnregisterHtmlDocumentPath || u64 TitleID || If the Type 1 fallback TID is == argument TID, unregisters the fallback path. Otherwise, noop.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [2.0.0+] RedirectHtmlDocumentPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] [9.0.0+] Now takes an additional 8-bytes of input. ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [7.0.0+] Refresh || No input/output. || &lt;br /&gt;
|-&lt;br /&gt;
| 9 || [9.0.0+] || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IAddOnContentLocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::IAddOnContentLocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || ResolveAddOnContentPath || u64 TitleID + C descriptor || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || RegisterAddOnContentStorage || [[Filesystem_services#StorageId|StorageID]] + u64 TitleID [9.0.0+] Now takes an additional u64 TitleID for the owner application. || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || UnregisterAllAddOnContentPath || None || Clears all registered titles here.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [9.0.0+] [[#RefreshApplicationAddOnContent]] || Type-5 buffer || Unofficial name&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [9.0.0+] [[#UnregisterApplicationAddOnContent]] || u64 TitleID || Unofficial name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== RefreshApplicationAddOnContent ====&lt;br /&gt;
Takes an type-5 buffer containing application title ids. Unregisters entries with application ids absent from the input buffer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== UnregisterApplicationAddOnContent====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; for the application to unregister add on content entries for.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Location List Entry ===&lt;br /&gt;
Total size is 0x320 bytes. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8|| Pointer to previous entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x8|| Pointer to next entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x8|| TitleID&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x300 || [[Filesystem_services|ContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x318 || 0x4 || Flag&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C || 0x4 || Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Content Manager services =&lt;br /&gt;
== ncm ==&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CreateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CreateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || VerifyContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || VerifyContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || OpenContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], [2.0.0+] Only returns a storage if one has previously been opened globally via OpenIContentStorage.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || OpenContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], [2.0.0+] Only returns a storage if one has previously been opened globally via OpenIContentStorage.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [1.0.0] CloseContentStorageForcibly || Takes a [[Filesystem_services#StorageId|StorageID]]. Calls IContentStorage-&amp;gt;CloseAndFlushStorage().&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [1.0.0] CloseContentMetaDatabaseForcibly || Takes a [[Filesystem_services#StorageId|StorageID]].  Calls IContentMetaDatabase-&amp;gt;CloseMetaDatabase().&lt;br /&gt;
|-&lt;br /&gt;
| 8 || CleanupContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and deletes the associated savedata.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [2.0.0+] ActivateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], and opens an IContentStorage for the StorageID to be gotten with GetIContentStorage. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [2.0.0+] InactivateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], and closes the associated IContentStorage. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [2.0.0+] ActivateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and opens an IContentMetaDatabase for the StorageID to be gotten with GetIContentMetaDatabase. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [2.0.0+] InactivateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and closes the associated IContentMetaDatabase. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [9.0.0+] InvalidateRightsIdCache ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IContentStorage ===&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentStorage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GeneratePlaceHolderId]] || Returns a random UUID for the Content Storage.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CreatePlaceHolder || Takes two [[#NcaID]]s, and a u64 filesize.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DeletePlaceHolder || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || HasPlaceHolder ||  Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || WritePlaceHolder || Takes a [[#NcaID]], a u64-offset, and type 5 buffer. Writes the buffer to the file for the NcaID&#039;s placeholder path at the specified offset.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Register || Takes two [[#NcaID]]s, moves the Placeholder NCA content to the registered NCA path.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Delete || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Has || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || GetPath || Takes a [[#NcaID]]. Returns a [[Filesystem_services#ContentPath|Content Path]].&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetPlaceHolderPath || Takes a [[#NcaID]]. Returns a [[Filesystem_services#ContentPath|Content Path]].&lt;br /&gt;
|-&lt;br /&gt;
| 10 || CleanupAllPlaceHolder || Deletes and re-creates the Placeholder directory.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || ListPlaceHolder || This is like [[#GetNumberOfRegisteredEntries]], but for the Placeholder directory.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#GetContentCount]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#ListContentId]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#GetSizeFromContentId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 15 || DisableForcibly || Closes/Flushes all resources for the storage, and causes all future IPC commands to the current session to return error 0xC805.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [2.0.0+] RevertToPlaceHolder || Takes three 0x10-sized [[#NcaID]]s. Creates the registered directory NCA path, and renames the placeholder path to the registered NCA path.&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [2.0.0+] SetPlaceHolderSize || Takes a [[#NcaID]], and a u64 size&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [2.0.0+] [[#ReadContentIdFile]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [2.0.0+] [[#GetRightsIdFromPlaceHolderId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 20 || [2.0.0+] [[#GetRightsIdFromContentId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 21 || [2.0.0+] WriteContentForDebug || Takes a [[#NcaID]], a u64 offset, and a type 5 buffer. On debug units, writes the buffer to the NCA&#039;s registered path. On retail units, this just aborts.&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [2.0.0+] GetFreeSpaceSize || Gets free space for the storage.&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [2.0.0+] GetTotalSpaceSize || Gets total space for the storage.&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [3.0.0+] FlushPlaceHolder || Flushes resources for the storage without closing it.&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [4.0.0+] GetSizeFromPlaceHolderId || &lt;br /&gt;
|-&lt;br /&gt;
| 26 || [4.0.0+] RepairInvalidFileAttribute || &lt;br /&gt;
|-&lt;br /&gt;
| 27 || [8.0.0+] GetRightsIdFromPlaceHolderIdWithCache || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== GeneratePlaceHolderId ====&lt;br /&gt;
Generates a random [[#NcaID]] for use as a placeholder.&lt;br /&gt;
&lt;br /&gt;
Calls nn::util::GenerateUuid(), which internally calls nn::os::GenerateRandomBytes(16);&lt;br /&gt;
&lt;br /&gt;
==== GetContentCount ====&lt;br /&gt;
Writes the total number of entries which can be read by GetEntries, to cmdreply &amp;lt;SFCO_offset&amp;gt;+0x10.&lt;br /&gt;
&lt;br /&gt;
==== ListContentId====&lt;br /&gt;
Takes an output buffer, u32 offset and gets all entries starting at that offset.&lt;br /&gt;
Returns number of entries read.&lt;br /&gt;
&lt;br /&gt;
Each entry is a [[#NcaID]].&lt;br /&gt;
&lt;br /&gt;
The total read entries is exactly the same as the number of &amp;quot;&amp;lt;hex&amp;gt;.nca&amp;quot; directories in the storage FS(or at least under the &amp;quot;registered&amp;quot; directory?).&lt;br /&gt;
&lt;br /&gt;
==== GetSizeFromContentId ====&lt;br /&gt;
Takes a [[#NcaID]] as input.&lt;br /&gt;
&lt;br /&gt;
Returns the total size readable by [[#ReadContentIdFile]]. This is the same as the size-field in the [[NAX0]] &amp;quot;&amp;lt;NcaID&amp;gt;.nca/00&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
==== ReadContentIdFile ====&lt;br /&gt;
Takes an output buffer, a [[#NcaID]] as input, and a u64 file offset.&lt;br /&gt;
&lt;br /&gt;
Reads plaintext NCA file contents from the Registered path for the NcaID.&lt;br /&gt;
&lt;br /&gt;
==== GetRightsIdFromPlaceHolderId ====&lt;br /&gt;
Takes a total of 0x10-bytes of input, returns a total of 0x10-bytes of output.&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] Returns an additional 8-bytes of output.&lt;br /&gt;
&lt;br /&gt;
Gets the Rights ID for the [[#NcaID]]&#039;s placeholder path.&lt;br /&gt;
&lt;br /&gt;
==== GetRightsIdFromContentId ====&lt;br /&gt;
Takes a total of 0x10-bytes of input, returns a total of 0x10-bytes of output.&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] Returns an additional 8-bytes of output.&lt;br /&gt;
&lt;br /&gt;
Gets the Rights ID for the [[#NcaID]]&#039;s registered path&lt;br /&gt;
&lt;br /&gt;
=== IContentMetaDatabase ===&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentMetaDatabase&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Set || Takes a [[#ContentMetaKey|Content Meta Key]], a type-5 [[CNMT#Content_records|Content Records]] buffer and a u64 size.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Get || Takes a [[#ContentMetaKey|Content Meta Key]], a type-6 buffer to write [[CNMT#Content_records|Content Records]] to and a u64 size. Returns the actual number of bytes read into the buffer. First 8 bytes of the data is header (u16 numExtraDataBytes, numContentRecords, numMetaRecords, padding). After the header is numExtraDataBytes of additional data, after which follow content records and content meta keys. Set takes this same data as input.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Remove || Takes a [[#ContentMetaKey|Content Meta Key]], and removes the associated record.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetContentIdByType || Takes a [[#ContentMetaKey|Content Meta Key]] and a u8 [[#ContentMetaType|Content Meta Type]]. Returns a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || ListContentInfo || Takes a type-6 buffer to write [[CNMT#Content_records|Content Record]] entries to, a [[#ContentMetaKey|Content Meta Key]], and a u32 index into the Content Record entries to start copying from. Returns a u32 entries_read.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || List || Takes a type-6 buffer to write [[#ContentMetaKey|Content Meta Key]]s to, a u32 [[#ContentMetaType|Content Meta Type]], a u64 TID, a u64 TID_LOW, and u64 TID_HIGH. Writes into the buffer all Content Meta Keys with low &amp;lt;= record-&amp;gt;title_id &amp;lt;= high, and record-&amp;gt;type == type. Returns u32 numEntriesTotal, numEntriesWritten. Additionally requires record-&amp;gt;title_id == TID, if record-&amp;gt;type is Application, Patch, Add-On, or Delta, otherwise, you can pass 0 for type to ignore the type and list them all in the range.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || GetLatestContentMetaKey || Takes a u64 title id, and returns the [[#ContentMetaKey|Content Meta Key]] with the highest version field for that title id.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#ListApplication]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Has || Takes a [[#ContentMetaKey|Content Meta Key]] and returns whether that record is present in the database.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || HasAll || Takes a type-5 buffer containing [[#ContentMetaKey|Content Meta Key]] (code assumes there are size/sizeof(meta_record) records in the buffer), and returns whether all of those records are present in the database.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetSize || Takes a [[#ContentMetaKey|Content Meta Key]], and returns the size of the associated [[CNMT#Content_records|Content Records]].&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetRequiredSystemVersion || Takes a [[#ContentMetaKey|Content Meta Key]], and returns u32 from ContentRecords + 16 (only if the content meta key has type Application or Patch).&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetPatchId || Takes a [[#ContentMetaKey|Content Meta Key]], and returns the update title id for that record.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || DisableForcibly ||  Closes the meta database, and causes all future IPC commands to the current session to return error 0xDC05.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#LookupOrphanContent]] || Takes a type-6 byte buffer, and a type-5 buffer of [[#NcaID]]s.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Commit || Flushes the in-memory database to savedata.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || HasContent || Takes a [[#ContentMetaKey|Content Meta Key]] and an [[#NcaID]]. Returns whether the content records for that content meta key contain the NcaID.&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListContentMetaInfo || Takes a type-6 [[#ContentMetaKey|Content Meta Key]] output buffer, a u32 offset into that buffer, and an input [[#ContentMetaKey|Content Meta Key]].&lt;br /&gt;
|-&lt;br /&gt;
| 18 || GetAttributes || Takes a [[#ContentMetaKey|Content Meta Key]], and returns u8 from ContentRecords + 6.&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [2.0.0+] GetRequiredApplicationVersion || Does the same thing as GetEntryUnknownRecordSize, but for AddOnContents.&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [5.0.0+] GetContentIdByTypeAndIdOffset ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== ListApplication ====&lt;br /&gt;
Each 24-byte entry (officially &amp;quot;ApplicationContentMetaKey&amp;quot;) is as follows:&lt;br /&gt;
  [[CNMT#Meta_records|meta_record]] meta_record;&lt;br /&gt;
  u64    base_title_id;&lt;br /&gt;
&lt;br /&gt;
This function takes in a type 6 buffer to write entries to, and a u8 &amp;quot;filter&amp;quot; [[#Title_Types|type]]. If filter is zero, all update records will be copied to to the output buffer (space permitting). Otherwise, only titles with type == filter_type will be copied to the output buffer.&lt;br /&gt;
&lt;br /&gt;
This func returns a u32 num_entries_total, and a u32 num_entries_written.&lt;br /&gt;
&lt;br /&gt;
==== ReadEntryMetaRecords ====&lt;br /&gt;
Takes a type-6 [[#ContentMetaKey|Content Meta Key]] output buffer, a u32 offset into that buffer, and an input [[#ContentMetaKey|Content Meta Key]] entry. Returns a u32 for total_read_entries.&lt;br /&gt;
&lt;br /&gt;
Reads the content meta keys stored in the entry&#039;s content records into the output buffer.&lt;br /&gt;
&lt;br /&gt;
This is used, for example, with System Update title 0100000000000816, which contains content meta keys for all other systitles in its Content Records.&lt;br /&gt;
&lt;br /&gt;
==== LookupOrphanContent ====&lt;br /&gt;
Takes a type-6 byte buffer, and a type-5 buffer containing [[#NcaID]]s.&lt;br /&gt;
&lt;br /&gt;
This function was stubbed to return 0xDC05 in [[2.0.0]].&lt;br /&gt;
&lt;br /&gt;
On 1.0.0: Initialized the output buffer to all 1s. Then, for each [[#NcaID]] in the input buffer, it checks if that NcaID is present anywhere in the database, and if so writes 0 to the corresponding output byte.&lt;br /&gt;
&lt;br /&gt;
In pseudocode, the function basically does the following:&lt;br /&gt;
&lt;br /&gt;
for i in range(len(out_buf)):&lt;br /&gt;
    out_buf[i] = 1&lt;br /&gt;
&lt;br /&gt;
for i, NcaID in NcaIDs:&lt;br /&gt;
    if is_present_in_database(NcaID):&lt;br /&gt;
        out_buf[i] = 0&lt;br /&gt;
&lt;br /&gt;
=== NcaID ===&lt;br /&gt;
This is a 0x10-byte entry. This is originally from the hex portion of &amp;quot;&amp;lt;hex&amp;gt;.nca&amp;quot; directory-names from this storage FS(like [[SD_Filesystem|SD]]). This is also referred to as &amp;quot;ContentId&amp;quot; in the official SDK.&lt;br /&gt;
&lt;br /&gt;
The NcaID is the same as the first 0x10-bytes from the calculated SHA256 hash, from hashing the entire output from [[#ReadContentIdFile]].&lt;br /&gt;
&lt;br /&gt;
== ContentInstallType ==&lt;br /&gt;
This is &amp;quot;nn::ncm::ContentInstallType&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| Full&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| FragmentOnly&lt;br /&gt;
|-&lt;br /&gt;
| 0x7&lt;br /&gt;
| Unknown (Invalid Content Install Type)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ContentMetaType ==&lt;br /&gt;
This is &amp;quot;nn::ncm::ContentMetaType&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| Unknown (Invalid Content Meta Type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| SystemProgram ([[Title_list#System_Modules|System Modules]] or [[Title_list#System_Applets|System Applets]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| SystemData ([[Title_list#System_Data_Archives|System Data Archives]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| SystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| BootImagePackage ([[Title_list|Firmware package A or C]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x05&lt;br /&gt;
| BootImagePackageSafe ([[Title_list|Firmware package B or D]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x80&lt;br /&gt;
| Application&lt;br /&gt;
|-&lt;br /&gt;
| 0x81&lt;br /&gt;
| Patch&lt;br /&gt;
|-&lt;br /&gt;
| 0x82&lt;br /&gt;
| AddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 0x83&lt;br /&gt;
| Delta&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ContentMetaKey ==&lt;br /&gt;
This is &amp;quot;nn::ncm::ContentMetaKey&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 &lt;br /&gt;
| 0x8 &lt;br /&gt;
| Title id&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| 0x4 &lt;br /&gt;
| Version&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| 0x1 &lt;br /&gt;
| [[#ContentMetaType|Content Meta Type]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| 0x1 &lt;br /&gt;
| [[#ContentInstallType|Content Install Type]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| 0x2 &lt;br /&gt;
| Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ncm:v ==&lt;br /&gt;
This service doesn&#039;t normally exist on retail.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=NCM_services&amp;diff=7703</id>
		<title>NCM services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=NCM_services&amp;diff=7703"/>
		<updated>2019-09-09T23:50:20Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: 9.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NCM contains services for internal file path and content management.&lt;br /&gt;
&lt;br /&gt;
= Location Resolver services =&lt;br /&gt;
== lr ==&lt;br /&gt;
This is &amp;quot;nn::lr::ILocationResolverManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || OpenLocationResolver || [[Filesystem_services#StorageId|StorageID]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || OpenRegisteredLocationResolver || None || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || RefreshLocationResolver || [[Filesystem_services#StorageId|StorageID]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [2.0.0+] OpenAddOnContentLocationResolver || None  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The only sysmodules which use this service are [[Filesystem_services|FS]], [[Loader_services|Loader]], and [[NS_Services|NS]]. [[boot2]] has access but doesn&#039;t use it.&lt;br /&gt;
&lt;br /&gt;
=== ILocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::ILocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ResolveProgramPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#RedirectProgramPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#ResolveApplicationControlPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#ResolveApplicationHtmlDocumentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#ResolveDataPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#RedirectApplicationControlPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#RedirectApplicationHtmlDocumentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#ResolveApplicationLegalInformationPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#RedirectApplicationLegalInformationPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#Refresh]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [5.0.0+] [[#RedirectApplicationProgramPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [5.0.0+] [[#ClearApplicationRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [5.0.0+] [[#EraseProgramRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [5.0.0+] [[#EraseApplicationControlRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [5.0.0+] [[#EraseApplicationHtmlDocumentRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [5.0.0+] [[#EraseApplicationLegalInformationRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [7.0.0+] [[#ResolveProgramPathForDebug]] || Unofficial name&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [7.0.0+] [[#RedirectProgramPathForDebug]] || Unofficial name&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [7.0.0+] [[#RedirectApplicationProgramPathForDebug]] || Unofficial name&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [7.0.0+] [[#EraseProgramRedirectionForDebug]] || Unofficial name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If the supplied [[Filesystem_services#StorageId|StorageID]] is 1 (Host), a different set of internal functions is used to handle these commands. In this more restricted set of functions, GetControlNcaPath is stubbed and only returns error 0x608.&lt;br /&gt;
&lt;br /&gt;
The Get* commands load the [[Filesystem_services|ContentPath]] from linked-lists&#039; [[#Location_List_Entry|entries]] in memory using the input TitleID. When the command fails to find an entry for the specified TitleID, 0x408 is returned for GetProgramNcaPath and 0xA08 is returned for the rest.&lt;br /&gt;
&lt;br /&gt;
The Set* commands always return 0 and add a new entry to the list. If a matching entry is found, it&#039;s removed first.&lt;br /&gt;
&lt;br /&gt;
==== ResolveProgramPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectProgramPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 0.&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationControlPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationHtmlDocumentPath====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
==== ResolveDataPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationControlPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationHtmlDocumentPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationLegalInformationPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationLegalInformationPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== Refresh ====&lt;br /&gt;
Takes no input. Frees all linked-lists&#039; entries that have &#039;&#039;&#039;flag&#039;&#039;&#039; set to 0.&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationProgramPath ====&lt;br /&gt;
Same as [[#RedirectProgramPath|RedirectProgramPath]], but inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== ClearApplicationRedirection ====&lt;br /&gt;
Takes no input. Frees all linked-lists&#039; entries that have &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== EraseProgramRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== EraseApplicationControlRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== EraseApplicationHtmlDocumentRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== EraseApplicationLegalInformationRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== ResolveProgramPathForDebug ====&lt;br /&gt;
Same as [[#ResolveProgramPath|ResolveProgramPath]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
==== RedirectProgramPathForDebug ====&lt;br /&gt;
Same as [[#RedirectProgramPath|RedirectProgramPath]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationProgramPathForDebug ====&lt;br /&gt;
Same as [[#RedirectApplicationProgramPath |RedirectApplicationProgramPath ]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
==== EraseProgramRedirectionForDebug ====&lt;br /&gt;
Same as [[#EraseProgramRedirection |EraseProgramRedirection ]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
=== IRegisteredLocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::IRegisteredLocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This works like [[#ILocationResolver]], but only two types of NCA paths can be gotten/set. In addition, each type has a fallback path that can be set for a single title ID at a time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || ResolveProgramPath || u64 TitleID + C descriptor || Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || RegisterProgramPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] || Sets the Type 0 fallback TID and path to the provided arguments.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || UnregisterProgramPath || u64 TitleID || If the Type 0 fallback TID is == argument TID, unregisters the fallback path. Otherwise, noop.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || RedirectProgramPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [2.0.0+] ResolveHtmlDocumentPath || u64 TitleID + C descriptor ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [2.0.0+] RegisterHtmlDocumentPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] || Sets the Type 1 fallback TID and path to the provided arguments.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [2.0.0+] UnregisterHtmlDocumentPath || u64 TitleID || If the Type 1 fallback TID is == argument TID, unregisters the fallback path. Otherwise, noop.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [2.0.0+] RedirectHtmlDocumentPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [7.0.0+] Refresh || No input/output. || &lt;br /&gt;
|-&lt;br /&gt;
| 9 || [9.0.0+] || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IAddOnContentLocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::IAddOnContentLocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || ResolveAddOnContentPath || u64 TitleID + C descriptor || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || RegisterAddOnContentStorage || [[Filesystem_services#StorageId|StorageID]] + u64 TitleID || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || UnregisterAllAddOnContentPath || None || Clears all registered titles here.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [9.0.0+] || ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [9.0.0+] || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Location List Entry ===&lt;br /&gt;
Total size is 0x320 bytes. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8|| Pointer to previous entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x8|| Pointer to next entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x8|| TitleID&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x300 || [[Filesystem_services|ContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x318 || 0x4 || Flag&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C || 0x4 || Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Content Manager services =&lt;br /&gt;
== ncm ==&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CreateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CreateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || VerifyContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || VerifyContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || OpenContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], [2.0.0+] Only returns a storage if one has previously been opened globally via OpenIContentStorage.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || OpenContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], [2.0.0+] Only returns a storage if one has previously been opened globally via OpenIContentStorage.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [1.0.0] CloseContentStorageForcibly || Takes a [[Filesystem_services#StorageId|StorageID]]. Calls IContentStorage-&amp;gt;CloseAndFlushStorage().&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [1.0.0] CloseContentMetaDatabaseForcibly || Takes a [[Filesystem_services#StorageId|StorageID]].  Calls IContentMetaDatabase-&amp;gt;CloseMetaDatabase().&lt;br /&gt;
|-&lt;br /&gt;
| 8 || CleanupContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and deletes the associated savedata.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [2.0.0+] ActivateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], and opens an IContentStorage for the StorageID to be gotten with GetIContentStorage. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [2.0.0+] InactivateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], and closes the associated IContentStorage. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [2.0.0+] ActivateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and opens an IContentMetaDatabase for the StorageID to be gotten with GetIContentMetaDatabase. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [2.0.0+] InactivateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and closes the associated IContentMetaDatabase. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [9.0.0+] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IContentStorage ===&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentStorage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GeneratePlaceHolderId]] || Returns a random UUID for the Content Storage.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CreatePlaceHolder || Takes two [[#NcaID]]s, and a u64 filesize.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DeletePlaceHolder || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || HasPlaceHolder ||  Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || WritePlaceHolder || Takes a [[#NcaID]], a u64-offset, and type 5 buffer. Writes the buffer to the file for the NcaID&#039;s placeholder path at the specified offset.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Register || Takes two [[#NcaID]]s, moves the Placeholder NCA content to the registered NCA path.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Delete || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Has || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || GetPath || Takes a [[#NcaID]]. Returns a [[Filesystem_services#ContentPath|Content Path]].&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetPlaceHolderPath || Takes a [[#NcaID]]. Returns a [[Filesystem_services#ContentPath|Content Path]].&lt;br /&gt;
|-&lt;br /&gt;
| 10 || CleanupAllPlaceHolder || Deletes and re-creates the Placeholder directory.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || ListPlaceHolder || This is like [[#GetNumberOfRegisteredEntries]], but for the Placeholder directory.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#GetContentCount]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#ListContentId]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#GetSizeFromContentId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 15 || DisableForcibly || Closes/Flushes all resources for the storage, and causes all future IPC commands to the current session to return error 0xC805.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [2.0.0+] RevertToPlaceHolder || Takes three 0x10-sized [[#NcaID]]s. Creates the registered directory NCA path, and renames the placeholder path to the registered NCA path.&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [2.0.0+] SetPlaceHolderSize || Takes a [[#NcaID]], and a u64 size&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [2.0.0+] [[#ReadContentIdFile]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [2.0.0+] [[#GetRightsIdFromPlaceHolderId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 20 || [2.0.0+] [[#GetRightsIdFromContentId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 21 || [2.0.0+] WriteContentForDebug || Takes a [[#NcaID]], a u64 offset, and a type 5 buffer. On debug units, writes the buffer to the NCA&#039;s registered path. On retail units, this just aborts.&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [2.0.0+] GetFreeSpaceSize || Gets free space for the storage.&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [2.0.0+] GetTotalSpaceSize || Gets total space for the storage.&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [3.0.0+] FlushPlaceHolder || Flushes resources for the storage without closing it.&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [4.0.0+] GetSizeFromPlaceHolderId || &lt;br /&gt;
|-&lt;br /&gt;
| 26 || [4.0.0+] RepairInvalidFileAttribute || &lt;br /&gt;
|-&lt;br /&gt;
| 27 || [8.0.0+] GetRightsIdFromPlaceHolderIdWithCache || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== GeneratePlaceHolderId ====&lt;br /&gt;
Generates a random [[#NcaID]] for use as a placeholder.&lt;br /&gt;
&lt;br /&gt;
Calls nn::util::GenerateUuid(), which internally calls nn::os::GenerateRandomBytes(16);&lt;br /&gt;
&lt;br /&gt;
==== GetContentCount ====&lt;br /&gt;
Writes the total number of entries which can be read by GetEntries, to cmdreply &amp;lt;SFCO_offset&amp;gt;+0x10.&lt;br /&gt;
&lt;br /&gt;
==== ListContentId====&lt;br /&gt;
Takes an output buffer, u32 offset and gets all entries starting at that offset.&lt;br /&gt;
Returns number of entries read.&lt;br /&gt;
&lt;br /&gt;
Each entry is a [[#NcaID]].&lt;br /&gt;
&lt;br /&gt;
The total read entries is exactly the same as the number of &amp;quot;&amp;lt;hex&amp;gt;.nca&amp;quot; directories in the storage FS(or at least under the &amp;quot;registered&amp;quot; directory?).&lt;br /&gt;
&lt;br /&gt;
==== GetSizeFromContentId ====&lt;br /&gt;
Takes a [[#NcaID]] as input.&lt;br /&gt;
&lt;br /&gt;
Returns the total size readable by [[#ReadContentIdFile]]. This is the same as the size-field in the [[NAX0]] &amp;quot;&amp;lt;NcaID&amp;gt;.nca/00&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
==== ReadContentIdFile ====&lt;br /&gt;
Takes an output buffer, a [[#NcaID]] as input, and a u64 file offset.&lt;br /&gt;
&lt;br /&gt;
Reads plaintext NCA file contents from the Registered path for the NcaID.&lt;br /&gt;
&lt;br /&gt;
==== GetRightsIdFromPlaceHolderId ====&lt;br /&gt;
Takes a total of 0x10-bytes of input, returns a total of 0x10-bytes of output.&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] Returns an additional 8-bytes of output.&lt;br /&gt;
&lt;br /&gt;
Gets the Rights ID for the [[#NcaID]]&#039;s placeholder path.&lt;br /&gt;
&lt;br /&gt;
==== GetRightsIdFromContentId ====&lt;br /&gt;
Takes a total of 0x10-bytes of input, returns a total of 0x10-bytes of output.&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] Returns an additional 8-bytes of output.&lt;br /&gt;
&lt;br /&gt;
Gets the Rights ID for the [[#NcaID]]&#039;s registered path&lt;br /&gt;
&lt;br /&gt;
=== IContentMetaDatabase ===&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentMetaDatabase&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Set || Takes a [[#ContentMetaKey|Content Meta Key]], a type-5 [[CNMT#Content_records|Content Records]] buffer and a u64 size.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Get || Takes a [[#ContentMetaKey|Content Meta Key]], a type-6 buffer to write [[CNMT#Content_records|Content Records]] to and a u64 size. Returns the actual number of bytes read into the buffer. First 8 bytes of the data is header (u16 numExtraDataBytes, numContentRecords, numMetaRecords, padding). After the header is numExtraDataBytes of additional data, after which follow content records and content meta keys. Set takes this same data as input.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Remove || Takes a [[#ContentMetaKey|Content Meta Key]], and removes the associated record.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetContentIdByType || Takes a [[#ContentMetaKey|Content Meta Key]] and a u8 [[#ContentMetaType|Content Meta Type]]. Returns a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || ListContentInfo || Takes a type-6 buffer to write [[CNMT#Content_records|Content Record]] entries to, a [[#ContentMetaKey|Content Meta Key]], and a u32 index into the Content Record entries to start copying from. Returns a u32 entries_read.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || List || Takes a type-6 buffer to write [[#ContentMetaKey|Content Meta Key]]s to, a u32 [[#ContentMetaType|Content Meta Type]], a u64 TID, a u64 TID_LOW, and u64 TID_HIGH. Writes into the buffer all Content Meta Keys with low &amp;lt;= record-&amp;gt;title_id &amp;lt;= high, and record-&amp;gt;type == type. Returns u32 numEntriesTotal, numEntriesWritten. Additionally requires record-&amp;gt;title_id == TID, if record-&amp;gt;type is Application, Patch, Add-On, or Delta, otherwise, you can pass 0 for type to ignore the type and list them all in the range.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || GetLatestContentMetaKey || Takes a u64 title id, and returns the [[#ContentMetaKey|Content Meta Key]] with the highest version field for that title id.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#ListApplication]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Has || Takes a [[#ContentMetaKey|Content Meta Key]] and returns whether that record is present in the database.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || HasAll || Takes a type-5 buffer containing [[#ContentMetaKey|Content Meta Key]] (code assumes there are size/sizeof(meta_record) records in the buffer), and returns whether all of those records are present in the database.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetSize || Takes a [[#ContentMetaKey|Content Meta Key]], and returns the size of the associated [[CNMT#Content_records|Content Records]].&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetRequiredSystemVersion || Takes a [[#ContentMetaKey|Content Meta Key]], and returns u32 from ContentRecords + 16 (only if the content meta key has type Application or Patch).&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetPatchId || Takes a [[#ContentMetaKey|Content Meta Key]], and returns the update title id for that record.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || DisableForcibly ||  Closes the meta database, and causes all future IPC commands to the current session to return error 0xDC05.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#LookupOrphanContent]] || Takes a type-6 byte buffer, and a type-5 buffer of [[#NcaID]]s.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Commit || Flushes the in-memory database to savedata.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || HasContent || Takes a [[#ContentMetaKey|Content Meta Key]] and an [[#NcaID]]. Returns whether the content records for that content meta key contain the NcaID.&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListContentMetaInfo || Takes a type-6 [[#ContentMetaKey|Content Meta Key]] output buffer, a u32 offset into that buffer, and an input [[#ContentMetaKey|Content Meta Key]].&lt;br /&gt;
|-&lt;br /&gt;
| 18 || GetAttributes || Takes a [[#ContentMetaKey|Content Meta Key]], and returns u8 from ContentRecords + 6.&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [2.0.0+] GetRequiredApplicationVersion || Does the same thing as GetEntryUnknownRecordSize, but for AddOnContents.&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [5.0.0+] GetContentIdByTypeAndIdOffset ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== ListApplication ====&lt;br /&gt;
Each 24-byte entry (officially &amp;quot;ApplicationContentMetaKey&amp;quot;) is as follows:&lt;br /&gt;
  [[CNMT#Meta_records|meta_record]] meta_record;&lt;br /&gt;
  u64    base_title_id;&lt;br /&gt;
&lt;br /&gt;
This function takes in a type 6 buffer to write entries to, and a u8 &amp;quot;filter&amp;quot; [[#Title_Types|type]]. If filter is zero, all update records will be copied to to the output buffer (space permitting). Otherwise, only titles with type == filter_type will be copied to the output buffer.&lt;br /&gt;
&lt;br /&gt;
This func returns a u32 num_entries_total, and a u32 num_entries_written.&lt;br /&gt;
&lt;br /&gt;
==== ReadEntryMetaRecords ====&lt;br /&gt;
Takes a type-6 [[#ContentMetaKey|Content Meta Key]] output buffer, a u32 offset into that buffer, and an input [[#ContentMetaKey|Content Meta Key]] entry. Returns a u32 for total_read_entries.&lt;br /&gt;
&lt;br /&gt;
Reads the content meta keys stored in the entry&#039;s content records into the output buffer.&lt;br /&gt;
&lt;br /&gt;
This is used, for example, with System Update title 0100000000000816, which contains content meta keys for all other systitles in its Content Records.&lt;br /&gt;
&lt;br /&gt;
==== LookupOrphanContent ====&lt;br /&gt;
Takes a type-6 byte buffer, and a type-5 buffer containing [[#NcaID]]s.&lt;br /&gt;
&lt;br /&gt;
This function was stubbed to return 0xDC05 in [[2.0.0]].&lt;br /&gt;
&lt;br /&gt;
On 1.0.0: Initialized the output buffer to all 1s. Then, for each [[#NcaID]] in the input buffer, it checks if that NcaID is present anywhere in the database, and if so writes 0 to the corresponding output byte.&lt;br /&gt;
&lt;br /&gt;
In pseudocode, the function basically does the following:&lt;br /&gt;
&lt;br /&gt;
for i in range(len(out_buf)):&lt;br /&gt;
    out_buf[i] = 1&lt;br /&gt;
&lt;br /&gt;
for i, NcaID in NcaIDs:&lt;br /&gt;
    if is_present_in_database(NcaID):&lt;br /&gt;
        out_buf[i] = 0&lt;br /&gt;
&lt;br /&gt;
=== NcaID ===&lt;br /&gt;
This is a 0x10-byte entry. This is originally from the hex portion of &amp;quot;&amp;lt;hex&amp;gt;.nca&amp;quot; directory-names from this storage FS(like [[SD_Filesystem|SD]]). This is also referred to as &amp;quot;ContentId&amp;quot; in the official SDK.&lt;br /&gt;
&lt;br /&gt;
The NcaID is the same as the first 0x10-bytes from the calculated SHA256 hash, from hashing the entire output from [[#ReadContentIdFile]].&lt;br /&gt;
&lt;br /&gt;
== ContentInstallType ==&lt;br /&gt;
This is &amp;quot;nn::ncm::ContentInstallType&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| Full&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| FragmentOnly&lt;br /&gt;
|-&lt;br /&gt;
| 0x7&lt;br /&gt;
| Unknown (Invalid Content Install Type)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ContentMetaType ==&lt;br /&gt;
This is &amp;quot;nn::ncm::ContentMetaType&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| Unknown (Invalid Content Meta Type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| SystemProgram ([[Title_list#System_Modules|System Modules]] or [[Title_list#System_Applets|System Applets]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| SystemData ([[Title_list#System_Data_Archives|System Data Archives]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| SystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| BootImagePackage ([[Title_list|Firmware package A or C]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x05&lt;br /&gt;
| BootImagePackageSafe ([[Title_list|Firmware package B or D]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x80&lt;br /&gt;
| Application&lt;br /&gt;
|-&lt;br /&gt;
| 0x81&lt;br /&gt;
| Patch&lt;br /&gt;
|-&lt;br /&gt;
| 0x82&lt;br /&gt;
| AddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 0x83&lt;br /&gt;
| Delta&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ContentMetaKey ==&lt;br /&gt;
This is &amp;quot;nn::ncm::ContentMetaKey&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 &lt;br /&gt;
| 0x8 &lt;br /&gt;
| Title id&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| 0x4 &lt;br /&gt;
| Version&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| 0x1 &lt;br /&gt;
| [[#ContentMetaType|Content Meta Type]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| 0x1 &lt;br /&gt;
| [[#ContentInstallType|Content Install Type]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| 0x2 &lt;br /&gt;
| Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ncm:v ==&lt;br /&gt;
This service doesn&#039;t normally exist on retail.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=NCM_services&amp;diff=7613</id>
		<title>NCM services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=NCM_services&amp;diff=7613"/>
		<updated>2019-08-31T08:05:26Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Use official struct names&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NCM contains services for internal file path and content management.&lt;br /&gt;
&lt;br /&gt;
= Location Resolver services =&lt;br /&gt;
== lr ==&lt;br /&gt;
This is &amp;quot;nn::lr::ILocationResolverManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || OpenLocationResolver || [[Filesystem_services#StorageId|StorageID]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || OpenRegisteredLocationResolver || None || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || RefreshLocationResolver || [[Filesystem_services#StorageId|StorageID]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [2.0.0+] OpenAddOnContentLocationResolver || None  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The only sysmodules which use this service are [[Filesystem_services|FS]], [[Loader_services|Loader]], and [[NS_Services|NS]]. [[boot2]] has access but doesn&#039;t use it.&lt;br /&gt;
&lt;br /&gt;
=== ILocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::ILocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ResolveProgramPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#RedirectProgramPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#ResolveApplicationControlPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#ResolveApplicationHtmlDocumentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#ResolveDataPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#RedirectApplicationControlPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#RedirectApplicationHtmlDocumentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#ResolveApplicationLegalInformationPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#RedirectApplicationLegalInformationPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#Refresh]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [5.0.0+] [[#RedirectApplicationProgramPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [5.0.0+] [[#ClearApplicationRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [5.0.0+] [[#EraseProgramRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [5.0.0+] [[#EraseApplicationControlRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [5.0.0+] [[#EraseApplicationHtmlDocumentRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [5.0.0+] [[#EraseApplicationLegalInformationRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [7.0.0+] [[#ResolveProgramPathForDebug]] || Unofficial name&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [7.0.0+] [[#RedirectProgramPathForDebug]] || Unofficial name&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [7.0.0+] [[#RedirectApplicationProgramPathForDebug]] || Unofficial name&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [7.0.0+] [[#EraseProgramRedirectionForDebug]] || Unofficial name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If the supplied [[Filesystem_services#StorageId|StorageID]] is 1 (Host), a different set of internal functions is used to handle these commands. In this more restricted set of functions, GetControlNcaPath is stubbed and only returns error 0x608.&lt;br /&gt;
&lt;br /&gt;
The Get* commands load the [[Filesystem_services|ContentPath]] from linked-lists&#039; [[#Location_List_Entry|entries]] in memory using the input TitleID. When the command fails to find an entry for the specified TitleID, 0x408 is returned for GetProgramNcaPath and 0xA08 is returned for the rest.&lt;br /&gt;
&lt;br /&gt;
The Set* commands always return 0 and add a new entry to the list. If a matching entry is found, it&#039;s removed first.&lt;br /&gt;
&lt;br /&gt;
==== ResolveProgramPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectProgramPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 0.&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationControlPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationHtmlDocumentPath====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
==== ResolveDataPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationControlPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationHtmlDocumentPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationLegalInformationPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationLegalInformationPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== Refresh ====&lt;br /&gt;
Takes no input. Frees all linked-lists&#039; entries that have &#039;&#039;&#039;flag&#039;&#039;&#039; set to 0.&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationProgramPath ====&lt;br /&gt;
Same as [[#RedirectProgramPath|RedirectProgramPath]], but inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== ClearApplicationRedirection ====&lt;br /&gt;
Takes no input. Frees all linked-lists&#039; entries that have &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== EraseProgramRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== EraseApplicationControlRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== EraseApplicationHtmlDocumentRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== EraseApplicationLegalInformationRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== ResolveProgramPathForDebug ====&lt;br /&gt;
Same as [[#ResolveProgramPath|ResolveProgramPath]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
==== RedirectProgramPathForDebug ====&lt;br /&gt;
Same as [[#RedirectProgramPath|RedirectProgramPath]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationProgramPathForDebug ====&lt;br /&gt;
Same as [[#RedirectApplicationProgramPath |RedirectApplicationProgramPath ]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
==== EraseProgramRedirectionForDebug ====&lt;br /&gt;
Same as [[#EraseProgramRedirection |EraseProgramRedirection ]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
=== IRegisteredLocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::IRegisteredLocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This works like [[#ILocationResolver]], but only two types of NCA paths can be gotten/set. In addition, each type has a fallback path that can be set for a single title ID at a time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || ResolveProgramPath || u64 TitleID + C descriptor || Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || RegisterProgramPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] || Sets the Type 0 fallback TID and path to the provided arguments.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || UnregisterProgramPath || u64 TitleID || If the Type 0 fallback TID is == argument TID, unregisters the fallback path. Otherwise, noop.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || RedirectProgramPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [2.0.0+] ResolveHtmlDocumentPath || u64 TitleID + C descriptor ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [2.0.0+] RegisterHtmlDocumentPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] || Sets the Type 1 fallback TID and path to the provided arguments.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [2.0.0+] UnregisterHtmlDocumentPath || u64 TitleID || If the Type 1 fallback TID is == argument TID, unregisters the fallback path. Otherwise, noop.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [2.0.0+] RedirectHtmlDocumentPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [7.0.0+] Refresh || No input/output. || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IAddOnContentLocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::IAddOnContentLocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || ResolveAddOnContentPath || u64 TitleID + C descriptor || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || RegisterAddOnContentStorage || [[Filesystem_services#StorageId|StorageID]] + u64 TitleID || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || UnregisterAllAddOnContentPath || None || Clears all registered titles here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Location List Entry ===&lt;br /&gt;
Total size is 0x320 bytes. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8|| Pointer to previous entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x8|| Pointer to next entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x8|| TitleID&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x300 || [[Filesystem_services|ContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x318 || 0x4 || Flag&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C || 0x4 || Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Content Manager services =&lt;br /&gt;
== ncm ==&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CreateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CreateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || VerifyContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || VerifyContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || OpenContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], [2.0.0+] Only returns a storage if one has previously been opened globally via OpenIContentStorage.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || OpenContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], [2.0.0+] Only returns a storage if one has previously been opened globally via OpenIContentStorage.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [1.0.0] CloseContentStorageForcibly || Takes a [[Filesystem_services#StorageId|StorageID]]. Calls IContentStorage-&amp;gt;CloseAndFlushStorage().&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [1.0.0] CloseContentMetaDatabaseForcibly || Takes a [[Filesystem_services#StorageId|StorageID]].  Calls IContentMetaDatabase-&amp;gt;CloseMetaDatabase().&lt;br /&gt;
|-&lt;br /&gt;
| 8 || CleanupContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and deletes the associated savedata.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [2.0.0+] ActivateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], and opens an IContentStorage for the StorageID to be gotten with GetIContentStorage. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [2.0.0+] InactivateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], and closes the associated IContentStorage. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [2.0.0+] ActivateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and opens an IContentMetaDatabase for the StorageID to be gotten with GetIContentMetaDatabase. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [2.0.0+] InactivateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and closes the associated IContentMetaDatabase. Note: Name is not official.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IContentStorage ===&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentStorage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GeneratePlaceHolderId]] || Returns a random UUID for the Content Storage.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CreatePlaceHolder || Takes two [[#NcaID]]s, and a u64 filesize.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DeletePlaceHolder || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || HasPlaceHolder ||  Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || WritePlaceHolder || Takes a [[#NcaID]], a u64-offset, and type 5 buffer. Writes the buffer to the file for the NcaID&#039;s placeholder path at the specified offset.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Register || Takes two [[#NcaID]]s, moves the Placeholder NCA content to the registered NCA path.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Delete || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Has || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || GetPath || Takes a [[#NcaID]]. Returns a [[Filesystem_services#ContentPath|Content Path]].&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetPlaceHolderPath || Takes a [[#NcaID]]. Returns a [[Filesystem_services#ContentPath|Content Path]].&lt;br /&gt;
|-&lt;br /&gt;
| 10 || CleanupAllPlaceHolder || Deletes and re-creates the Placeholder directory.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || ListPlaceHolder || This is like [[#GetNumberOfRegisteredEntries]], but for the Placeholder directory.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#GetContentCount]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#ListContentId]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#GetSizeFromContentId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 15 || DisableForcibly || Closes/Flushes all resources for the storage, and causes all future IPC commands to the current session to return error 0xC805.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [2.0.0+] RevertToPlaceHolder || Takes three 0x10-sized [[#NcaID]]s. Creates the registered directory NCA path, and renames the placeholder path to the registered NCA path.&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [2.0.0+] SetPlaceHolderSize || Takes a [[#NcaID]], and a u64 size&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [2.0.0+] [[#ReadContentIdFile]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [2.0.0+] [[#GetRightsIdFromPlaceHolderId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 20 || [2.0.0+] [[#GetRightsIdFromContentId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 21 || [2.0.0+] WriteContentForDebug || Takes a [[#NcaID]], a u64 offset, and a type 5 buffer. On debug units, writes the buffer to the NCA&#039;s registered path. On retail units, this just aborts.&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [2.0.0+] GetFreeSpaceSize || Gets free space for the storage.&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [2.0.0+] GetTotalSpaceSize || Gets total space for the storage.&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [3.0.0+] FlushPlaceHolder || Flushes resources for the storage without closing it.&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [4.0.0+] GetSizeFromPlaceHolderId || &lt;br /&gt;
|-&lt;br /&gt;
| 26 || [4.0.0+] RepairInvalidFileAttribute || &lt;br /&gt;
|-&lt;br /&gt;
| 27 || [8.0.0+] GetRightsIdFromPlaceHolderIdWithCache || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== GeneratePlaceHolderId ====&lt;br /&gt;
Generates a random [[#NcaID]] for use as a placeholder.&lt;br /&gt;
&lt;br /&gt;
Calls nn::util::GenerateUuid(), which internally calls nn::os::GenerateRandomBytes(16);&lt;br /&gt;
&lt;br /&gt;
==== GetContentCount ====&lt;br /&gt;
Writes the total number of entries which can be read by GetEntries, to cmdreply &amp;lt;SFCO_offset&amp;gt;+0x10.&lt;br /&gt;
&lt;br /&gt;
==== ListContentId====&lt;br /&gt;
Takes an output buffer, u32 offset and gets all entries starting at that offset.&lt;br /&gt;
Returns number of entries read.&lt;br /&gt;
&lt;br /&gt;
Each entry is a [[#NcaID]].&lt;br /&gt;
&lt;br /&gt;
The total read entries is exactly the same as the number of &amp;quot;&amp;lt;hex&amp;gt;.nca&amp;quot; directories in the storage FS(or at least under the &amp;quot;registered&amp;quot; directory?).&lt;br /&gt;
&lt;br /&gt;
==== GetSizeFromContentId ====&lt;br /&gt;
Takes a [[#NcaID]] as input.&lt;br /&gt;
&lt;br /&gt;
Returns the total size readable by [[#ReadContentIdFile]]. This is the same as the size-field in the [[NAX0]] &amp;quot;&amp;lt;NcaID&amp;gt;.nca/00&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
==== ReadContentIdFile ====&lt;br /&gt;
Takes an output buffer, a [[#NcaID]] as input, and a u64 file offset.&lt;br /&gt;
&lt;br /&gt;
Reads plaintext NCA file contents from the Registered path for the NcaID.&lt;br /&gt;
&lt;br /&gt;
==== GetRightsIdFromPlaceHolderId ====&lt;br /&gt;
Takes a total of 0x10-bytes of input, returns a total of 0x10-bytes of output.&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] Returns an additional 8-bytes of output.&lt;br /&gt;
&lt;br /&gt;
Gets the Rights ID for the [[#NcaID]]&#039;s placeholder path.&lt;br /&gt;
&lt;br /&gt;
==== GetRightsIdFromContentId ====&lt;br /&gt;
Takes a total of 0x10-bytes of input, returns a total of 0x10-bytes of output.&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] Returns an additional 8-bytes of output.&lt;br /&gt;
&lt;br /&gt;
Gets the Rights ID for the [[#NcaID]]&#039;s registered path&lt;br /&gt;
&lt;br /&gt;
=== IContentMetaDatabase ===&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentMetaDatabase&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Set || Takes a [[#ContentMetaKey|Content Meta Key]], a type-5 [[CNMT#Content_records|Content Records]] buffer and a u64 size.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Get || Takes a [[#ContentMetaKey|Content Meta Key]], a type-6 buffer to write [[CNMT#Content_records|Content Records]] to and a u64 size. Returns the actual number of bytes read into the buffer. First 8 bytes of the data is header (u16 numExtraDataBytes, numContentRecords, numMetaRecords, padding). After the header is numExtraDataBytes of additional data, after which follow content records and content meta keys. Set takes this same data as input.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Remove || Takes a [[#ContentMetaKey|Content Meta Key]], and removes the associated record.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetContentIdByType || Takes a [[#ContentMetaKey|Content Meta Key]] and a u8 [[#ContentMetaType|Content Meta Type]]. Returns a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || ListContentInfo || Takes a type-6 buffer to write [[CNMT#Content_records|Content Record]] entries to, a [[#ContentMetaKey|Content Meta Key]], and a u32 index into the Content Record entries to start copying from. Returns a u32 entries_read.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || List || Takes a type-6 buffer to write [[#ContentMetaKey|Content Meta Key]]s to, a u32 [[#ContentMetaType|Content Meta Type]], a u64 TID, a u64 TID_LOW, and u64 TID_HIGH. Writes into the buffer all Content Meta Keys with low &amp;lt;= record-&amp;gt;title_id &amp;lt;= high, and record-&amp;gt;type == type. Returns u32 numEntriesTotal, numEntriesWritten. Additionally requires record-&amp;gt;title_id == TID, if record-&amp;gt;type is Application, Patch, Add-On, or Delta, otherwise, you can pass 0 for type to ignore the type and list them all in the range.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || GetLatestContentMetaKey || Takes a u64 title id, and returns the [[#ContentMetaKey|Content Meta Key]] with the highest version field for that title id.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#ListApplication]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Has || Takes a [[#ContentMetaKey|Content Meta Key]] and returns whether that record is present in the database.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || HasAll || Takes a type-5 buffer containing [[#ContentMetaKey|Content Meta Key]] (code assumes there are size/sizeof(meta_record) records in the buffer), and returns whether all of those records are present in the database.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetSize || Takes a [[#ContentMetaKey|Content Meta Key]], and returns the size of the associated [[CNMT#Content_records|Content Records]].&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetRequiredSystemVersion || Takes a [[#ContentMetaKey|Content Meta Key]], and returns u32 from ContentRecords + 16 (only if the content meta key has type Application or Patch).&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetPatchId || Takes a [[#ContentMetaKey|Content Meta Key]], and returns the update title id for that record.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || DisableForcibly ||  Closes the meta database, and causes all future IPC commands to the current session to return error 0xDC05.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#LookupOrphanContent]] || Takes a type-6 byte buffer, and a type-5 buffer of [[#NcaID]]s.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Commit || Flushes the in-memory database to savedata.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || HasContent || Takes a [[#ContentMetaKey|Content Meta Key]] and an [[#NcaID]]. Returns whether the content records for that content meta key contain the NcaID.&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListContentMetaInfo || Takes a type-6 [[#ContentMetaKey|Content Meta Key]] output buffer, a u32 offset into that buffer, and an input [[#ContentMetaKey|Content Meta Key]].&lt;br /&gt;
|-&lt;br /&gt;
| 18 || GetAttributes || Takes a [[#ContentMetaKey|Content Meta Key]], and returns u8 from ContentRecords + 6.&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [2.0.0+] GetRequiredApplicationVersion || Does the same thing as GetEntryUnknownRecordSize, but for AddOnContents.&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [5.0.0+] GetContentIdByTypeAndIdOffset ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== ListApplication ====&lt;br /&gt;
Each 24-byte entry (officially &amp;quot;ApplicationContentMetaKey&amp;quot;) is as follows:&lt;br /&gt;
  [[CNMT#Meta_records|meta_record]] meta_record;&lt;br /&gt;
  u64    base_title_id;&lt;br /&gt;
&lt;br /&gt;
This function takes in a type 6 buffer to write entries to, and a u8 &amp;quot;filter&amp;quot; [[#Title_Types|type]]. If filter is zero, all update records will be copied to to the output buffer (space permitting). Otherwise, only titles with type == filter_type will be copied to the output buffer.&lt;br /&gt;
&lt;br /&gt;
This func returns a u32 num_entries_total, and a u32 num_entries_written.&lt;br /&gt;
&lt;br /&gt;
==== ReadEntryMetaRecords ====&lt;br /&gt;
Takes a type-6 [[#ContentMetaKey|Content Meta Key]] output buffer, a u32 offset into that buffer, and an input [[#ContentMetaKey|Content Meta Key]] entry. Returns a u32 for total_read_entries.&lt;br /&gt;
&lt;br /&gt;
Reads the content meta keys stored in the entry&#039;s content records into the output buffer.&lt;br /&gt;
&lt;br /&gt;
This is used, for example, with System Update title 0100000000000816, which contains content meta keys for all other systitles in its Content Records.&lt;br /&gt;
&lt;br /&gt;
==== LookupOrphanContent ====&lt;br /&gt;
Takes a type-6 byte buffer, and a type-5 buffer containing [[#NcaID]]s.&lt;br /&gt;
&lt;br /&gt;
This function was stubbed to return 0xDC05 in [[2.0.0]].&lt;br /&gt;
&lt;br /&gt;
On 1.0.0: Initialized the output buffer to all 1s. Then, for each [[#NcaID]] in the input buffer, it checks if that NcaID is present anywhere in the database, and if so writes 0 to the corresponding output byte.&lt;br /&gt;
&lt;br /&gt;
In pseudocode, the function basically does the following:&lt;br /&gt;
&lt;br /&gt;
for i in range(len(out_buf)):&lt;br /&gt;
    out_buf[i] = 1&lt;br /&gt;
&lt;br /&gt;
for i, NcaID in NcaIDs:&lt;br /&gt;
    if is_present_in_database(NcaID):&lt;br /&gt;
        out_buf[i] = 0&lt;br /&gt;
&lt;br /&gt;
=== NcaID ===&lt;br /&gt;
This is a 0x10-byte entry. This is originally from the hex portion of &amp;quot;&amp;lt;hex&amp;gt;.nca&amp;quot; directory-names from this storage FS(like [[SD_Filesystem|SD]]). This is also referred to as &amp;quot;ContentId&amp;quot; in the official SDK.&lt;br /&gt;
&lt;br /&gt;
The NcaID is the same as the first 0x10-bytes from the calculated SHA256 hash, from hashing the entire output from [[#ReadContentIdFile]].&lt;br /&gt;
&lt;br /&gt;
== ContentInstallType ==&lt;br /&gt;
This is &amp;quot;nn::ncm::ContentInstallType&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| Full&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| FragmentOnly&lt;br /&gt;
|-&lt;br /&gt;
| 0x7&lt;br /&gt;
| Unknown (Invalid Content Install Type)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ContentMetaType ==&lt;br /&gt;
This is &amp;quot;nn::ncm::ContentMetaType&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| Unknown (Invalid Content Meta Type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| SystemProgram ([[Title_list#System_Modules|System Modules]] or [[Title_list#System_Applets|System Applets]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| SystemData ([[Title_list#System_Data_Archives|System Data Archives]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| SystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| BootImagePackage ([[Title_list|Firmware package A or C]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x05&lt;br /&gt;
| BootImagePackageSafe ([[Title_list|Firmware package B or D]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x80&lt;br /&gt;
| Application&lt;br /&gt;
|-&lt;br /&gt;
| 0x81&lt;br /&gt;
| Patch&lt;br /&gt;
|-&lt;br /&gt;
| 0x82&lt;br /&gt;
| AddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 0x83&lt;br /&gt;
| Delta&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ContentMetaKey ==&lt;br /&gt;
This is &amp;quot;nn::ncm::ContentMetaKey&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 &lt;br /&gt;
| 0x8 &lt;br /&gt;
| Title id&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| 0x4 &lt;br /&gt;
| Version&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| 0x1 &lt;br /&gt;
| [[#ContentMetaType|Content Meta Type]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| 0x1 &lt;br /&gt;
| [[#ContentInstallType|Content Install Type]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| 0x2 &lt;br /&gt;
| Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ncm:v ==&lt;br /&gt;
This service doesn&#039;t normally exist on retail.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=NCM_services&amp;diff=7612</id>
		<title>NCM services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=NCM_services&amp;diff=7612"/>
		<updated>2019-08-31T07:27:58Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Namez&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NCM contains services for internal file path and content management.&lt;br /&gt;
&lt;br /&gt;
= Location Resolver services =&lt;br /&gt;
== lr ==&lt;br /&gt;
This is &amp;quot;nn::lr::ILocationResolverManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || OpenLocationResolver || [[Filesystem_services#StorageId|StorageID]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || OpenRegisteredLocationResolver || None || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || RefreshLocationResolver || [[Filesystem_services#StorageId|StorageID]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [2.0.0+] OpenAddOnContentLocationResolver || None  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The only sysmodules which use this service are [[Filesystem_services|FS]], [[Loader_services|Loader]], and [[NS_Services|NS]]. [[boot2]] has access but doesn&#039;t use it.&lt;br /&gt;
&lt;br /&gt;
=== ILocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::ILocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ResolveProgramPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#RedirectProgramPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#ResolveApplicationControlPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#ResolveApplicationHtmlDocumentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#ResolveDataPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#RedirectApplicationControlPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#RedirectApplicationHtmlDocumentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#ResolveApplicationLegalInformationPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#RedirectApplicationLegalInformationPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#Refresh]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [5.0.0+] [[#RedirectApplicationProgramPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [5.0.0+] [[#ClearApplicationRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [5.0.0+] [[#EraseProgramRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [5.0.0+] [[#EraseApplicationControlRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [5.0.0+] [[#EraseApplicationHtmlDocumentRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [5.0.0+] [[#EraseApplicationLegalInformationRedirection]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [7.0.0+] [[#ResolveProgramPathForDebug]] || Unofficial name&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [7.0.0+] [[#RedirectProgramPathForDebug]] || Unofficial name&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [7.0.0+] [[#RedirectApplicationProgramPathForDebug]] || Unofficial name&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [7.0.0+] [[#EraseProgramRedirectionForDebug]] || Unofficial name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If the supplied [[Filesystem_services#StorageId|StorageID]] is 1 (Host), a different set of internal functions is used to handle these commands. In this more restricted set of functions, GetControlNcaPath is stubbed and only returns error 0x608.&lt;br /&gt;
&lt;br /&gt;
The Get* commands load the [[Filesystem_services|ContentPath]] from linked-lists&#039; [[#Location_List_Entry|entries]] in memory using the input TitleID. When the command fails to find an entry for the specified TitleID, 0x408 is returned for GetProgramNcaPath and 0xA08 is returned for the rest.&lt;br /&gt;
&lt;br /&gt;
The Set* commands always return 0 and add a new entry to the list. If a matching entry is found, it&#039;s removed first.&lt;br /&gt;
&lt;br /&gt;
==== ResolveProgramPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectProgramPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 0.&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationControlPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationHtmlDocumentPath====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
==== ResolveDataPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationControlPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationHtmlDocumentPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationLegalInformationPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationLegalInformationPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== Refresh ====&lt;br /&gt;
Takes no input. Frees all linked-lists&#039; entries that have &#039;&#039;&#039;flag&#039;&#039;&#039; set to 0.&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationProgramPath ====&lt;br /&gt;
Same as [[#RedirectProgramPath|RedirectProgramPath]], but inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== ClearApplicationRedirection ====&lt;br /&gt;
Takes no input. Frees all linked-lists&#039; entries that have &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== EraseProgramRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== EraseApplicationControlRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== EraseApplicationHtmlDocumentRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== EraseApplicationLegalInformationRedirection ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== ResolveProgramPathForDebug ====&lt;br /&gt;
Same as [[#ResolveProgramPath|ResolveProgramPath]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
==== RedirectProgramPathForDebug ====&lt;br /&gt;
Same as [[#RedirectProgramPath|RedirectProgramPath]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationProgramPathForDebug ====&lt;br /&gt;
Same as [[#RedirectApplicationProgramPath |RedirectApplicationProgramPath ]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
==== EraseProgramRedirectionForDebug ====&lt;br /&gt;
Same as [[#EraseProgramRedirection |EraseProgramRedirection ]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
=== IRegisteredLocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::IRegisteredLocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This works like [[#ILocationResolver]], but only two types of NCA paths can be gotten/set. In addition, each type has a fallback path that can be set for a single title ID at a time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || ResolveProgramPath || u64 TitleID + C descriptor || Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || RegisterProgramPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] || Sets the Type 0 fallback TID and path to the provided arguments.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || UnregisterProgramPath || u64 TitleID || If the Type 0 fallback TID is == argument TID, unregisters the fallback path. Otherwise, noop.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || RedirectProgramPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [2.0.0+] ResolveHtmlDocumentPath || u64 TitleID + C descriptor ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [2.0.0+] RegisterHtmlDocumentPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] || Sets the Type 1 fallback TID and path to the provided arguments.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [2.0.0+] UnregisterHtmlDocumentPath || u64 TitleID || If the Type 1 fallback TID is == argument TID, unregisters the fallback path. Otherwise, noop.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [2.0.0+] RedirectHtmlDocumentPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [7.0.0+] Refresh || No input/output. || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IAddOnContentLocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::IAddOnContentLocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || ResolveAddOnContentPath || u64 TitleID + C descriptor || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || RegisterAddOnContentStorage || [[Filesystem_services#StorageId|StorageID]] + u64 TitleID || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || UnregisterAllAddOnContentPath || None || Clears all registered titles here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Location List Entry ===&lt;br /&gt;
Total size is 0x320 bytes. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8|| Pointer to previous entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x8|| Pointer to next entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x8|| TitleID&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x300 || [[Filesystem_services|ContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x318 || 0x4 || Flag&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C || 0x4 || Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Content Manager services =&lt;br /&gt;
== ncm ==&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CreateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CreateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || VerifyContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || VerifyContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || OpenContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], [2.0.0+] Only returns a storage if one has previously been opened globally via OpenIContentStorage.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || OpenContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], [2.0.0+] Only returns a storage if one has previously been opened globally via OpenIContentStorage.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [1.0.0] CloseContentStorageForcibly || Takes a [[Filesystem_services#StorageId|StorageID]]. Calls IContentStorage-&amp;gt;CloseAndFlushStorage().&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [1.0.0] CloseContentMetaDatabaseForcibly || Takes a [[Filesystem_services#StorageId|StorageID]].  Calls IContentMetaDatabase-&amp;gt;CloseMetaDatabase().&lt;br /&gt;
|-&lt;br /&gt;
| 8 || CleanupContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and deletes the associated savedata.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [2.0.0+] ActivateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], and opens an IContentStorage for the StorageID to be gotten with GetIContentStorage. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [2.0.0+] InactivateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], and closes the associated IContentStorage. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [2.0.0+] ActivateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and opens an IContentMetaDatabase for the StorageID to be gotten with GetIContentMetaDatabase. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [2.0.0+] InactivateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and closes the associated IContentMetaDatabase. Note: Name is not official.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IContentStorage ===&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentStorage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GeneratePlaceHolderId]] || Returns a random UUID for the Content Storage.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CreatePlaceHolder || Takes two [[#NcaID]]s, and a u64 filesize.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DeletePlaceHolder || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || HasPlaceHolder ||  Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || WritePlaceHolder || Takes a [[#NcaID]], a u64-offset, and type 5 buffer. Writes the buffer to the file for the NcaID&#039;s placeholder path at the specified offset.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Register || Takes two [[#NcaID]]s, moves the Placeholder NCA content to the registered NCA path.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Delete || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Has || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || GetPath || Takes a [[#NcaID]]. Returns a [[Filesystem_services#ContentPath|Content Path]].&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetPlaceHolderPath || Takes a [[#NcaID]]. Returns a [[Filesystem_services#ContentPath|Content Path]].&lt;br /&gt;
|-&lt;br /&gt;
| 10 || CleanupAllPlaceHolder || Deletes and re-creates the Placeholder directory.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || ListPlaceHolder || This is like [[#GetNumberOfRegisteredEntries]], but for the Placeholder directory.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#GetContentCount]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#ListContentId]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#GetSizeFromContentId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 15 || DisableForcibly || Closes/Flushes all resources for the storage, and causes all future IPC commands to the current session to return error 0xC805.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [2.0.0+] RevertToPlaceHolder || Takes three 0x10-sized [[#NcaID]]s. Creates the registered directory NCA path, and renames the placeholder path to the registered NCA path.&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [2.0.0+] SetPlaceHolderSize || Takes a [[#NcaID]], and a u64 size&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [2.0.0+] [[#ReadContentIdFile]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [2.0.0+] [[#GetRightsIdFromPlaceHolderId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 20 || [2.0.0+] [[#GetRightsIdFromContentId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 21 || [2.0.0+] WriteContentForDebug || Takes a [[#NcaID]], a u64 offset, and a type 5 buffer. On debug units, writes the buffer to the NCA&#039;s registered path. On retail units, this just aborts.&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [2.0.0+] GetFreeSpaceSize || Gets free space for the storage.&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [2.0.0+] GetTotalSpaceSize || Gets total space for the storage.&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [3.0.0+] FlushPlaceHolder || Flushes resources for the storage without closing it.&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [4.0.0+] GetSizeFromPlaceHolderId || &lt;br /&gt;
|-&lt;br /&gt;
| 26 || [4.0.0+] RepairInvalidFileAttribute || &lt;br /&gt;
|-&lt;br /&gt;
| 27 || [8.0.0+] GetRightsIdFromPlaceHolderIdWithCache || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== GeneratePlaceHolderId ====&lt;br /&gt;
Generates a random [[#NcaID]] for use as a placeholder.&lt;br /&gt;
&lt;br /&gt;
Calls nn::util::GenerateUuid(), which internally calls nn::os::GenerateRandomBytes(16);&lt;br /&gt;
&lt;br /&gt;
==== GetContentCount ====&lt;br /&gt;
Writes the total number of entries which can be read by GetEntries, to cmdreply &amp;lt;SFCO_offset&amp;gt;+0x10.&lt;br /&gt;
&lt;br /&gt;
==== ListContentId====&lt;br /&gt;
Takes an output buffer, u32 offset and gets all entries starting at that offset.&lt;br /&gt;
Returns number of entries read.&lt;br /&gt;
&lt;br /&gt;
Each entry is a [[#NcaID]].&lt;br /&gt;
&lt;br /&gt;
The total read entries is exactly the same as the number of &amp;quot;&amp;lt;hex&amp;gt;.nca&amp;quot; directories in the storage FS(or at least under the &amp;quot;registered&amp;quot; directory?).&lt;br /&gt;
&lt;br /&gt;
==== GetSizeFromContentId ====&lt;br /&gt;
Takes a [[#NcaID]] as input.&lt;br /&gt;
&lt;br /&gt;
Returns the total size readable by [[#ReadContentIdFile]]. This is the same as the size-field in the [[NAX0]] &amp;quot;&amp;lt;NcaID&amp;gt;.nca/00&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
==== ReadContentIdFile ====&lt;br /&gt;
Takes an output buffer, a [[#NcaID]] as input, and a u64 file offset.&lt;br /&gt;
&lt;br /&gt;
Reads plaintext NCA file contents from the Registered path for the NcaID.&lt;br /&gt;
&lt;br /&gt;
==== GetRightsIdFromPlaceHolderId ====&lt;br /&gt;
Takes a total of 0x10-bytes of input, returns a total of 0x10-bytes of output.&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] Returns an additional 8-bytes of output.&lt;br /&gt;
&lt;br /&gt;
Gets the Rights ID for the [[#NcaID]]&#039;s placeholder path.&lt;br /&gt;
&lt;br /&gt;
==== GetRightsIdFromContentId ====&lt;br /&gt;
Takes a total of 0x10-bytes of input, returns a total of 0x10-bytes of output.&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] Returns an additional 8-bytes of output.&lt;br /&gt;
&lt;br /&gt;
Gets the Rights ID for the [[#NcaID]]&#039;s registered path&lt;br /&gt;
&lt;br /&gt;
=== IContentMetaDatabase ===&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentMetaDatabase&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the official name for Meta Record is &amp;quot;ContentMetaKey&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Set || Takes a [[CNMT#Meta_records|Meta Record]], a type-5 [[CNMT#Content_records|Content Records]] buffer and a u64 size.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Get || Takes a [[CNMT#Meta_records|Meta Record]], a type-6 buffer to write [[CNMT#Content_records|Content Records]] to and a u64 size. Returns the actual number of bytes read into the buffer. First 8 bytes of the data is header (u16 numExtraDataBytes, numContentRecords, numMetaRecords, padding). After the header is numExtraDataBytes of additional data, after which follow content records and meta records. Set takes this same data as input.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Remove || Takes a [[CNMT#Meta_records|Meta Record]], and removes the associated record.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetContentIdByType || Takes a [[CNMT#Meta_records|Meta Record]] and a u8 [[#Title_Types|Title Type]]. Returns a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || ListContentInfo || Takes a type-6 buffer to write [[CNMT#Content_records|Content Record]] entries to, a [[CNMT#Meta_records|Meta Record]], and a u32 index into the Content Record entries to start copying from. Returns a u32 entries_read.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || List || Takes a type-6 buffer to write [[CNMT#Meta_records|Meta Record]]s to, a u32 [[#Title_Types|Title Type]], a u64 TID, a u64 TID_LOW, and u64 TID_HIGH. Writes into the buffer all Meta Records with low &amp;lt;= record-&amp;gt;title_id &amp;lt;= high, and record-&amp;gt;type == type. Returns u32 numEntriesTotal, numEntriesWritten. Additionally requires record-&amp;gt;title_id == TID, if record-&amp;gt;type is Application, Patch, Add-On, or Delta, otherwise, you can pass 0 for type to ignore the type and list them all in the range.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || GetLatestContentMetaKey || Takes a u64 title id, and returns the [[CNMT#Meta_records|Meta Record]] with the highest version field for that title id.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#ListApplication]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Has || Takes a [[CNMT#Meta_records|Meta Record]] and returns whether that record is present in the database.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || HasAll || Takes a type-5 buffer containing [[CNMT#Meta_records|Meta Records]] (code assumes there are size/sizeof(meta_record) records in the buffer), and returns whether all of those records are present in the database.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetSize || Takes a [[CNMT#Meta_records|Meta Record]], and returns the size of the associated [[CNMT#Content_records|Content Records]].&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetRequiredSystemVersion || Takes a [[CNMT#Meta_records|Meta Record]], and returns u32 from ContentRecords + 16 (only if the Meta record has type Application or Patch).&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetPatchId || Takes a [[CNMT#Meta_records|Meta Record]], and returns the update title id for that record.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || DisableForcibly ||  Closes the meta database, and causes all future IPC commands to the current session to return error 0xDC05.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#LookupOrphanContent]] || Takes a type-6 byte buffer, and a type-5 buffer of [[#NcaID]]s.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Commit || Flushes the in-memory database to savedata.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || HasContent || Takes a [[CNMT#Meta_records|Meta Record]] and an [[#NcaID]]. Returns whether the content records for that meta record contain the NcaID.&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListContentMetaInfo || Takes a type-6 [[CNMT#Meta_records|Meta Record]] output buffer, a u32 offset into that buffer, and an input [[CNMT#Meta_records|Meta Record]].&lt;br /&gt;
|-&lt;br /&gt;
| 18 || GetAttributes || Takes a [[CNMT#Meta_records|Meta Record]], and returns u8 from ContentRecords + 6.&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [2.0.0+] GetRequiredApplicationVersion || Does the same thing as GetEntryUnknownRecordSize, but for AddOnContents.&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [5.0.0+] GetContentIdByTypeAndIdOffset ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== ListApplication ====&lt;br /&gt;
Each 24-byte entry (officially &amp;quot;ApplicationContentMetaKey&amp;quot;) is as follows:&lt;br /&gt;
  [[CNMT#Meta_records|meta_record]] meta_record;&lt;br /&gt;
  u64    base_title_id;&lt;br /&gt;
&lt;br /&gt;
This function takes in a type 6 buffer to write entries to, and a u8 &amp;quot;filter&amp;quot; [[#Title_Types|type]]. If filter is zero, all update records will be copied to to the output buffer (space permitting). Otherwise, only titles with type == filter_type will be copied to the output buffer.&lt;br /&gt;
&lt;br /&gt;
This func returns a u32 num_entries_total, and a u32 num_entries_written.&lt;br /&gt;
&lt;br /&gt;
==== ReadEntryMetaRecords ====&lt;br /&gt;
Takes a type-6 [[CNMT#Meta_records|Meta Record]] output buffer, a u32 offset into that buffer, and an input [[CNMT#Meta_records|Meta Record]] entry. Returns a u32 for total_read_entries.&lt;br /&gt;
&lt;br /&gt;
Reads the meta records stored in the entry&#039;s content records into the output buffer.&lt;br /&gt;
&lt;br /&gt;
This is used, for example, with System Update title 0100000000000816, which contains Meta Records for all other systitles in its Content Records.&lt;br /&gt;
&lt;br /&gt;
==== LookupOrphanContent ====&lt;br /&gt;
Takes a type-6 byte buffer, and a type-5 buffer containing [[#NcaID]]s.&lt;br /&gt;
&lt;br /&gt;
This function was stubbed to return 0xDC05 in [[2.0.0]].&lt;br /&gt;
&lt;br /&gt;
On 1.0.0: Initialized the output buffer to all 1s. Then, for each [[#NcaID]] in the input buffer, it checks if that NcaID is present anywhere in the database, and if so writes 0 to the corresponding output byte.&lt;br /&gt;
&lt;br /&gt;
In pseudocode, the function basically does the following:&lt;br /&gt;
&lt;br /&gt;
for i in range(len(out_buf)):&lt;br /&gt;
    out_buf[i] = 1&lt;br /&gt;
&lt;br /&gt;
for i, NcaID in NcaIDs:&lt;br /&gt;
    if is_present_in_database(NcaID):&lt;br /&gt;
        out_buf[i] = 0&lt;br /&gt;
&lt;br /&gt;
=== NcaID ===&lt;br /&gt;
This is a 0x10-byte entry. This is originally from the hex portion of &amp;quot;&amp;lt;hex&amp;gt;.nca&amp;quot; directory-names from this storage FS(like [[SD_Filesystem|SD]]). This is also referred to as &amp;quot;ContentId&amp;quot; in the official SDK.&lt;br /&gt;
&lt;br /&gt;
The NcaID is the same as the first 0x10-bytes from the calculated SHA256 hash, from hashing the entire output from [[#ReadContentIdFile]].&lt;br /&gt;
&lt;br /&gt;
=== Enums ===&lt;br /&gt;
==== Title Types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| SystemProgram ([[Title_list#System_Modules|System Modules]] or [[Title_list#System_Applets|System Applets]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| SystemData ([[Title_list#System_Data_Archives|System Data Archives]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| SystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| BootImagePackage ([[Title_list|Firmware package A or C]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x05&lt;br /&gt;
| BootImagePackageSafe ([[Title_list|Firmware package B or D]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x80&lt;br /&gt;
| Application&lt;br /&gt;
|-&lt;br /&gt;
| 0x81&lt;br /&gt;
| Patch&lt;br /&gt;
|-&lt;br /&gt;
| 0x82&lt;br /&gt;
| AddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 0x83&lt;br /&gt;
| Delta&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ncm:v ==&lt;br /&gt;
This service doesn&#039;t normally exist on retail.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=NS_services&amp;diff=7442</id>
		<title>NS services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=NS_services&amp;diff=7442"/>
		<updated>2019-08-18T04:06:26Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: IAsyncValue/Result&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= aoc:u =&lt;br /&gt;
This is &amp;quot;nn::aocsrv::detail::IAddOnContentManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [1.0.0-6.2.0] CountAddOnContentByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [1.0.0-6.2.0] ListAddOnContentByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 2 || CountAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 3 || ListAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [1.0.0-6.2.0] GetAddOnContentBaseIdByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 5 || GetAddOnContentBaseId&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [1.0.0-6.2.0] PrepareAddOnContentByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 7 || PrepareAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [4.0.0+] GetAddOnContentListChangedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [7.0.0+] [[#IPurchaseEventManager|CreateEcPurchasedEventManager]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== IPurchaseEventManager ==&lt;br /&gt;
This is &amp;quot;nn::ec::IPurchaseEventManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || SetDefaultDeliveryTarget&lt;br /&gt;
|-&lt;br /&gt;
| 1 || SetDeliveryTarget&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetPurchasedEventReadableHandle&lt;br /&gt;
|-&lt;br /&gt;
| 3 || PopPurchasedProductInfo&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:am =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IApplicationManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] This service was replaced by [[#ns:am2, ns:ec, ns:rid, ns:rt, ns:web|ns:am2]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ListApplicationRecord]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GenerateApplicationRecordCount&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetApplicationRecordUpdateSystemEvent&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetApplicationViewDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeleteApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeleteApplicationCompletely&lt;br /&gt;
|-&lt;br /&gt;
| 6 || IsAnyApplicationEntityRedundant&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeleteRedundantApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 8 || IsApplicationEntityMovable&lt;br /&gt;
|-&lt;br /&gt;
| 9 || MoveApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 11 || CalculateApplicationOccupiedSize&lt;br /&gt;
|-&lt;br /&gt;
| 16 || PushApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListApplicationRecordContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 18 || &lt;br /&gt;
|-&lt;br /&gt;
| 19 || [[#LaunchApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#GetApplicationContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || TerminateApplication&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [2.0.0+] ResolveApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
| 26 || BeginInstallApplication&lt;br /&gt;
|-&lt;br /&gt;
| 27 || DeleteApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 30 || RequestApplicationUpdateInfo&lt;br /&gt;
|-&lt;br /&gt;
| 31 || RequestUpdateApplication&lt;br /&gt;
|-&lt;br /&gt;
| 32 || CancelApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 33 || ResumeApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 34 || &lt;br /&gt;
|-&lt;br /&gt;
| 35 || UpdateVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 36 || PushLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 37 || ListRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 38 || CheckApplicationLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 39 || CheckApplicationLaunchRights&lt;br /&gt;
|-&lt;br /&gt;
| 40 || GetApplicationLogoData&lt;br /&gt;
|-&lt;br /&gt;
| 41 || CalculateApplicationDownloadRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 42 || CleanupSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 43 || CheckSdCardMountStatus&lt;br /&gt;
|-&lt;br /&gt;
| 44 || GetSdCardMountStatusChangedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 45 || GetGameCardAttachmentEvent&lt;br /&gt;
|-&lt;br /&gt;
| 46 || GetGameCardAttachmentInfo&lt;br /&gt;
|-&lt;br /&gt;
| 47 || [[#GetTotalSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 48 || [[#GetFreeSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 49 || GetSdCardRemovedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 52 || GetGameCardUpdateDetectionEvent&lt;br /&gt;
|-&lt;br /&gt;
| 53 || DisableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 54 || EnableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 55 || [[#GetApplicationDesiredLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 56 || SetApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 57 || ClearApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 58 || GetLastSdCardMountUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 59 || ConvertApplicationLanguageToLanguageCode&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [[#ConvertLanguageCodeToApplicationLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || GetBackgroundDownloadStressTaskInfo&lt;br /&gt;
|-&lt;br /&gt;
| 62 || GetGameCardStopper&lt;br /&gt;
|-&lt;br /&gt;
| 63 || IsSystemProgramInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 64 || [2.0.0+] StartApplyDeltaTask&lt;br /&gt;
|-&lt;br /&gt;
| 65 || [2.0.0+] GetRequestServerStopper&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ResetToFactorySettings&lt;br /&gt;
|-&lt;br /&gt;
| 101 || ResetToFactorySettingsWithoutUserSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [2.0.0+] ResetToFactorySettingsForRefurbishment&lt;br /&gt;
|-&lt;br /&gt;
| 200 || CalculateUserSaveDataStatistics&lt;br /&gt;
|-&lt;br /&gt;
| 201 || DeleteUserSaveDataAll&lt;br /&gt;
|-&lt;br /&gt;
| 210 || DeleteUserSystemSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 220 || UnregisterNetworkServiceAccount&lt;br /&gt;
|-&lt;br /&gt;
| 300 || GetApplicationShellEvent&lt;br /&gt;
|-&lt;br /&gt;
| 301 || PopApplicationShellEventInfo&lt;br /&gt;
|-&lt;br /&gt;
| 302 || LaunchLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 303 || TerminateLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 304 || LaunchSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 305 || TerminateSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 306 || LaunchOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 307 || TerminateOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#GetApplicationControlData]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || InvalidateAllApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 402 || RequestDownloadApplicationControlData&lt;br /&gt;
|-&lt;br /&gt;
| 403 || GetMaxApplicationControlCacheCount&lt;br /&gt;
|-&lt;br /&gt;
| 404 || [2.0.0+] InvalidateApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 405 || [2.0.0+] ListApplicationControlCacheEntryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 502 || [2.0.0+] RequestCheckGameCardRegistration&lt;br /&gt;
|-&lt;br /&gt;
| 503 || [2.0.0+] RequestGameCardRegistrationGoldPoint&lt;br /&gt;
|-&lt;br /&gt;
| 504 || [2.0.0+] RequestRegisterGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 600 || [2.0.0+] CountApplicationContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 601 || [2.0.0+] [[#ListApplicationContentMetaStatus]]&lt;br /&gt;
|-&lt;br /&gt;
| 602 || [2.0.0+] ListAvailableAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 603 || [2.0.0+] GetOwnedApplicationContentMetaStatus&lt;br /&gt;
|-&lt;br /&gt;
| 604 || [2.0.0+] RegisterContentsExternalKey&lt;br /&gt;
|-&lt;br /&gt;
| 605 || [2.0.0+] ListApplicationContentMetaStatusWithRightsCheck&lt;br /&gt;
|-&lt;br /&gt;
| 700 || [2.0.0+] PushDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 701 || [2.0.0+] ClearTaskStatusList&lt;br /&gt;
|-&lt;br /&gt;
| 702 || [2.0.0+] RequestDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 703 || [2.0.0+] RequestEnsureDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 704 || [2.0.0+] ListDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 705 || [2.0.0+] RequestDownloadTaskListData&lt;br /&gt;
|-&lt;br /&gt;
| 800 || [2.0.0+] RequestVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 801 || [2.0.0+] ListVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 900 || [2.0.0+] GetApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 901 || [2.0.0+] GetApplicationRecordProperty&lt;br /&gt;
|-&lt;br /&gt;
| 902 || [2.0.0+] EnableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 903 || [2.0.0+] DisableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 904 || [2.0.0+] TouchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 905 || [2.0.0+] RequestApplicationUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 906 || [2.0.0+] IsApplicationUpdateRequested&lt;br /&gt;
|-&lt;br /&gt;
| 907 || [2.0.0+] WithdrawApplicationUpdateRequest&lt;br /&gt;
|-&lt;br /&gt;
| 908 || [2.0.0+] ListApplicationRecordInstalledContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || [2.0.0+] RequestVerifyApplicationDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || [2.0.0+] CorruptApplicationForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1200 || [2.0.0+] [[#NeedsUpdateVulnerability]]&lt;br /&gt;
|-&lt;br /&gt;
| 1300 || [2.0.0+] IsAnyApplicationEntityInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 1301 || [2.0.0+] DeleteApplicationContentEntities&lt;br /&gt;
|-&lt;br /&gt;
| 1302 || [2.0.0+] CleanupUnrecordedApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1400 || [2.0.0+] PrepareShutdown&lt;br /&gt;
|-&lt;br /&gt;
| 1500 || [2.0.0+] FormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1501 || [2.0.0+] NeedsSystemUpdateToFormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1502 || [2.0.0+] GetLastSdCardFormatUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 1503 || [2.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1600 || [2.0.0+] GetSystemSeedForPseudoDeviceId&lt;br /&gt;
|-&lt;br /&gt;
| 1700 || [2.0.0+] ListApplicationDownloadingContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 1800 || [2.0.0+] IsNotificationSetupCompleted&lt;br /&gt;
|-&lt;br /&gt;
| 1801 || [2.0.0+] GetLastNotificationInfoCount&lt;br /&gt;
|-&lt;br /&gt;
| 1802 || [2.0.0+] ListLastNotificationInfo&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ListApplicationRecord ==&lt;br /&gt;
Takes a type-6 output buffer and an u32 entry_offset.&lt;br /&gt;
&lt;br /&gt;
Returns an array of title-info entries using the specified offset and size. No input titleID is passed to this.&lt;br /&gt;
&lt;br /&gt;
=== Application Record Format ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| Title ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x1&lt;br /&gt;
| Type? (Known values: 2=Installing?, 3=Gamecard?, 4=Installed?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown, usually 0x02&lt;br /&gt;
|-&lt;br /&gt;
| 0xA&lt;br /&gt;
| 0x6&lt;br /&gt;
| Unknown, usually zeros?&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown, seems to change between reboots and removing/reinserting gamecards&lt;br /&gt;
|-&lt;br /&gt;
| 0x11&lt;br /&gt;
| 0x7&lt;br /&gt;
| Unknown, usually zeros?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LaunchApplication ==&lt;br /&gt;
Takes an input u64 titleID, returns an output u64 PID.&lt;br /&gt;
&lt;br /&gt;
Launches an application title which is registered with NS.&lt;br /&gt;
&lt;br /&gt;
== GetApplicationContentPath ==&lt;br /&gt;
Takes a 0x16-type output buffer, an u8 [[NCM_services#Title_Types|title type]], and an u64 titleID.&lt;br /&gt;
&lt;br /&gt;
The input titleID is used with the application-title table like various other cmds, anything not in that table can&#039;t be used with this.&lt;br /&gt;
&lt;br /&gt;
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&#039;t exist for this title. Starts with &amp;quot;@{SdCardContent,UserContent}://&amp;quot; and ends in &amp;quot;.nca&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For gamecard content, the output path is: &amp;quot;@GcSXXXXXXXX:/&amp;lt;NcaId&amp;gt;.nca&amp;quot;. NCA-type0 with gamecard returns 0 with an empty output string.&lt;br /&gt;
&lt;br /&gt;
The output string is then used by the user-process with [[Filesystem_services|FS]] to mount the content.&lt;br /&gt;
&lt;br /&gt;
== GetTotalSpaceSize ==&lt;br /&gt;
Takes an input media-id that must be 5.&lt;br /&gt;
&lt;br /&gt;
Returns the u64 from [[Content_Manager_services#IContentStorage]] cmd22.&lt;br /&gt;
&lt;br /&gt;
== GetFreeSpaceSize ==&lt;br /&gt;
Takes an input media-id that must be 5.&lt;br /&gt;
&lt;br /&gt;
Returns the u64 from [[Content_Manager_services#IContentStorage]] cmd23.&lt;br /&gt;
&lt;br /&gt;
== GetApplicationDesiredLanguage ==&lt;br /&gt;
Takes an input u8 language-bitmask, returns an output u8 [[control.nacp]] langentry index.&lt;br /&gt;
&lt;br /&gt;
User-processes generate the language-bitmask with the following for all 16 lang-entries: &amp;lt;code&amp;gt;if(&amp;lt;either string in langentry[i] is non-empty&amp;gt;)bitmask |= 1&amp;lt;&amp;lt;i&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ConvertLanguageCodeToApplicationLanguage ==&lt;br /&gt;
Takes an input u8 pointer for the resulting Id to be written to and a string represented as a u64 (i.e 0x53552D6E65 for &#039;en-US&#039;).&lt;br /&gt;
&lt;br /&gt;
Returns 0 if an ID was successfully found, otherwise returns 0x25810.&lt;br /&gt;
&lt;br /&gt;
== GetApplicationControlData ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Loads cached [[control.nacp]] to buf+0 and the cached icon to buf+0x4000. Returns an error if the buffer is too small.&lt;br /&gt;
&lt;br /&gt;
== ListApplicationContentMetaStatus ==&lt;br /&gt;
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 &amp;gt;= totalentries, this will return 0 with out_entrycount=0.&lt;br /&gt;
&lt;br /&gt;
Entry structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| u8 &amp;quot;type&amp;quot;. [[Content_Manager_services|Title type]] (String is from web-applet)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| u8 &amp;quot;installedStorage&amp;quot; / [[Filesystem_services|StorageId]] (String is from web-applet)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown. Non-zero with output from cmd 605, differs for app/update titles.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| u32 Title-version&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| u64 titleID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:am2, ns:ec, ns:rid, ns:rt, ns:web =&lt;br /&gt;
These services are all, at the top level, &amp;quot;nn::ns::detail::IServiceGetterInterface&amp;quot;. 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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 7988 || [6.0.0+] Returns an output [[#IDynamicRightsInterface]].&lt;br /&gt;
|-&lt;br /&gt;
| 7989 || [5.1.0+] Returns an output [[#IReadOnlyApplicationControlDataInterface]].&lt;br /&gt;
|-&lt;br /&gt;
| 7991 || [5.0.0+] Returns an output [[#IReadOnlyApplicationRecordInterface]].&lt;br /&gt;
|-&lt;br /&gt;
| 7992 || [4.0.0+] [[#IECommerceInterface|GetECommerceInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7993 || [4.0.0+] [[#IApplicationVersionInterface|GetApplicationVersionInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7994 || [[#IFactoryResetInterface|GetFactoryResetInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7995 || [[#IAccountProxyInterface|GetAccountProxyInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7996 || [[#IApplicationManagerInterface|GetApplicationManagerInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7997 || [[#IDownloadTaskInterface|GetDownloadTaskInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7998 || [[#IContentManagementInterface|GetContentManagementInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7999 || [[#IDocumentInterface|GetDocumentInterface]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IAccountProxyInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IAccountProxyInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CreateUserAccount&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IApplicationManagerInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IApplicationManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ListApplicationRecord]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GenerateApplicationRecordCount&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetApplicationRecordUpdateSystemEvent&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetApplicationViewDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeleteApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeleteApplicationCompletely&lt;br /&gt;
|-&lt;br /&gt;
| 6 || IsAnyApplicationEntityRedundant&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeleteRedundantApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 8 || IsApplicationEntityMovable&lt;br /&gt;
|-&lt;br /&gt;
| 9 || MoveApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 11 || CalculateApplicationOccupiedSize&lt;br /&gt;
|-&lt;br /&gt;
| 16 || PushApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListApplicationRecordContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [1.0.0-5.1.0] LaunchApplicationOld&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#GetApplicationContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || TerminateApplication&lt;br /&gt;
|-&lt;br /&gt;
| 23 || ResolveApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
| 26 || BeginInstallApplication&lt;br /&gt;
|-&lt;br /&gt;
| 27 || DeleteApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 30 || RequestApplicationUpdateInfo&lt;br /&gt;
|-&lt;br /&gt;
| [1.0.0-3.0.2] 31 || &lt;br /&gt;
|-&lt;br /&gt;
| 32 || CancelApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 33 || ResumeApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 35 || UpdateVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 36 || PushLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 37 || ListRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 38 || CheckApplicationLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| [1.0.0-6.2.0] 39 || CheckApplicationLaunchRights&lt;br /&gt;
|-&lt;br /&gt;
| 40 || GetApplicationLogoData&lt;br /&gt;
|-&lt;br /&gt;
| 41 || CalculateApplicationDownloadRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 42 || CleanupSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 43 || CheckSdCardMountStatus&lt;br /&gt;
|-&lt;br /&gt;
| 44 || GetSdCardMountStatusChangedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 45 || GetGameCardAttachmentEvent&lt;br /&gt;
|-&lt;br /&gt;
| 46 || GetGameCardAttachmentInfo&lt;br /&gt;
|-&lt;br /&gt;
| 47 || [[#GetTotalSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 48 || [[#GetFreeSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 49 || GetSdCardRemovedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 52 || GetGameCardUpdateDetectionEvent&lt;br /&gt;
|-&lt;br /&gt;
| 53 || DisableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 54 || EnableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 55 || GetApplicationDesiredLanguage&lt;br /&gt;
|-&lt;br /&gt;
| 56 || SetApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 57 || ClearApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 58 || GetLastSdCardMountUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 59 || ConvertApplicationLanguageToLanguageCode&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [[#ConvertLanguageCodeToApplicationLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || GetBackgroundDownloadStressTaskInfo&lt;br /&gt;
|-&lt;br /&gt;
| 62 || GetGameCardStopper&lt;br /&gt;
|-&lt;br /&gt;
| 63 || IsSystemProgramInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 64 || StartApplyDeltaTask&lt;br /&gt;
|-&lt;br /&gt;
| 65 || GetRequestServerStopper&lt;br /&gt;
|-&lt;br /&gt;
| 66 || [3.0.0+] GetBackgroundApplyDeltaStressTaskInfo&lt;br /&gt;
|-&lt;br /&gt;
| 67 || [3.0.0+] CancelApplicationApplyDelta&lt;br /&gt;
|-&lt;br /&gt;
| 68 || [3.0.0+] ResumeApplicationApplyDelta&lt;br /&gt;
|-&lt;br /&gt;
| 69 || [3.0.0+] CalculateApplicationApplyDeltaRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 70 || [3.0.0+] ResumeAll&lt;br /&gt;
|-&lt;br /&gt;
| 71 || [3.0.0+] GetStorageSize&lt;br /&gt;
|-&lt;br /&gt;
| 80 || [3.0.0+] RequestDownloadApplication&lt;br /&gt;
|-&lt;br /&gt;
| 81 || [3.0.0+] RequestDownloadAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 82 || [3.0.0+] DownloadApplication&lt;br /&gt;
|-&lt;br /&gt;
| [4.0.0-6.2.0] 83 || CheckApplicationResumeRights&lt;br /&gt;
|-&lt;br /&gt;
| 84 || [4.0.0+] GetDynamicCommitEvent&lt;br /&gt;
|-&lt;br /&gt;
| 85 || [4.0.0+] RequestUpdateApplication2&lt;br /&gt;
|-&lt;br /&gt;
| 86 || [4.0.0+] EnableApplicationCrashReport&lt;br /&gt;
|-&lt;br /&gt;
| 87 || [4.0.0+] IsApplicationCrashReportEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 90 || [4.0.0+] BoostSystemMemoryResourceLimit&lt;br /&gt;
|-&lt;br /&gt;
| 91 || [5.0.0+] DeprecatedLaunchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 92 || [5.0.0+] GetRunningApplicationProgramId&lt;br /&gt;
|-&lt;br /&gt;
| 93 || [5.0.0+] GetMainApplicationProgramIndex&lt;br /&gt;
|-&lt;br /&gt;
| 94 || [6.0.0+] LaunchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 95 || [6.0.0+] GetApplicationLaunchInfo&lt;br /&gt;
|-&lt;br /&gt;
| 96 || [6.0.0+] AcquireApplicationLaunchInfo&lt;br /&gt;
|-&lt;br /&gt;
| 97 || [6.0.0+] GetMainApplicationProgramIndexByApplicationLaunchInfo&lt;br /&gt;
|-&lt;br /&gt;
| 98 || [6.0.0+] EnableApplicationAllThreadDumpOnCrash&lt;br /&gt;
|-&lt;br /&gt;
| 99 || [8.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ResetToFactorySettings&lt;br /&gt;
|-&lt;br /&gt;
| 101 || ResetToFactorySettingsWithoutUserSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 102 || ResetToFactorySettingsForRefurbishment&lt;br /&gt;
|-&lt;br /&gt;
| 200 || CalculateUserSaveDataStatistics&lt;br /&gt;
|-&lt;br /&gt;
| 201 || DeleteUserSaveDataAll&lt;br /&gt;
|-&lt;br /&gt;
| 210 || DeleteUserSystemSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 211 || [6.0.0+] DeleteSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 220 || UnregisterNetworkServiceAccount&lt;br /&gt;
|-&lt;br /&gt;
| 221 || [6.0.0+] UnregisterNetworkServiceAccountWithUserSaveDataDeletion&lt;br /&gt;
|-&lt;br /&gt;
| 300 || GetApplicationShellEvent&lt;br /&gt;
|-&lt;br /&gt;
| 301 || PopApplicationShellEventInfo&lt;br /&gt;
|-&lt;br /&gt;
| 302 || LaunchLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 303 || TerminateLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 304 || LaunchSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 305 || TerminateSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 306 || LaunchOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 307 || TerminateOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 400 || GetApplicationControlData&lt;br /&gt;
|-&lt;br /&gt;
| 401 || InvalidateAllApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 402 || RequestDownloadApplicationControlData&lt;br /&gt;
|-&lt;br /&gt;
| 403 || GetMaxApplicationControlCacheCount&lt;br /&gt;
|-&lt;br /&gt;
| 404 || InvalidateApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 405 || ListApplicationControlCacheEntryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 406 || [6.0.0+] GetApplicationControlProperty&lt;br /&gt;
|-&lt;br /&gt;
| 407 || [8.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 408 || [8.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 502 || RequestCheckGameCardRegistration&lt;br /&gt;
|-&lt;br /&gt;
| 503 || RequestGameCardRegistrationGoldPoint&lt;br /&gt;
|-&lt;br /&gt;
| 504 || RequestRegisterGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 505 || [3.0.0+] GetGameCardMountFailureEvent&lt;br /&gt;
|-&lt;br /&gt;
| 506 || [3.0.0+] IsGameCardInserted&lt;br /&gt;
|-&lt;br /&gt;
| 507 || [3.0.0+] EnsureGameCardAccess&lt;br /&gt;
|-&lt;br /&gt;
| 508 || [3.0.0+] GetLastGameCardMountFailureResult&lt;br /&gt;
|-&lt;br /&gt;
| 509 || [5.0.0+] ListApplicationIdOnGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 600 || CountApplicationContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 601 || [[#ListApplicationContentMetaStatus]]&lt;br /&gt;
|-&lt;br /&gt;
| 602 || [2.0.0-5.1.0] ListAvailableAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 603 || GetOwnedApplicationContentMetaStatus&lt;br /&gt;
|-&lt;br /&gt;
| 604 || RegisterContentsExternalKey&lt;br /&gt;
|-&lt;br /&gt;
| 605 || ListApplicationContentMetaStatusWithRightsCheck&lt;br /&gt;
|-&lt;br /&gt;
| 606 || [3.0.0+] GetContentMetaStorage&lt;br /&gt;
|-&lt;br /&gt;
| 607 || [6.0.0+] ListAvailableAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 700 || PushDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 701 || ClearTaskStatusList&lt;br /&gt;
|-&lt;br /&gt;
| 702 || RequestDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 703 || RequestEnsureDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 704 || ListDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 705 || RequestDownloadTaskListData&lt;br /&gt;
|-&lt;br /&gt;
| 800 || RequestVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 801 || ListVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 802 || [3.0.0+] RequestVersionListData&lt;br /&gt;
|-&lt;br /&gt;
| 900 || GetApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 901 || GetApplicationRecordProperty&lt;br /&gt;
|-&lt;br /&gt;
| 902 || EnableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 903 || DisableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 904 || TouchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 905 || RequestApplicationUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 906 || IsApplicationUpdateRequested&lt;br /&gt;
|-&lt;br /&gt;
| 907 || WithdrawApplicationUpdateRequest&lt;br /&gt;
|-&lt;br /&gt;
| 908 || ListApplicationRecordInstalledContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 909 || [3.0.0+] WithdrawCleanupAddOnContentsWithNoRightsRecommendation&lt;br /&gt;
|-&lt;br /&gt;
| 910 || [5.0.0+] HasApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 911 || [5.1.0+] SetPreInstalledApplication&lt;br /&gt;
|-&lt;br /&gt;
| 912 || [5.1.0+] ClearPreInstalledApplicationFlag&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || RequestVerifyApplicationDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || CorruptApplicationForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1002 || [3.0.0+] RequestVerifyAddOnContentsRights&lt;br /&gt;
|-&lt;br /&gt;
| 1003 || [5.0.0+] RequestVerifyApplication&lt;br /&gt;
|-&lt;br /&gt;
| 1004 || [5.0.0+] CorruptContentForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1200 || [[#NeedsUpdateVulnerability]]&lt;br /&gt;
|-&lt;br /&gt;
| 1300 || IsAnyApplicationEntityInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 1301 || DeleteApplicationContentEntities&lt;br /&gt;
|-&lt;br /&gt;
| 1302 || CleanupUnrecordedApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1303 || [3.0.0+] CleanupAddOnContentsWithNoRights&lt;br /&gt;
|-&lt;br /&gt;
| 1304 || [3.0.0+] DeleteApplicationContentEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1308 || [5.0.0+] DeleteApplicationCompletelyForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1309 || [6.0.0+] CleanupUnavailableAddOnContents&lt;br /&gt;
|-&lt;br /&gt;
| 1400 || PrepareShutdown&lt;br /&gt;
|-&lt;br /&gt;
| 1500 || FormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1501 || NeedsSystemUpdateToFormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1502 || GetLastSdCardFormatUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 1504 || [3.0.0+] InsertSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1505 || [3.0.0+] RemoveSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1600 || GetSystemSeedForPseudoDeviceId&lt;br /&gt;
|-&lt;br /&gt;
| 1601 || [3.0.0+] ResetSystemSeedForPseudoDeviceId&lt;br /&gt;
|-&lt;br /&gt;
| 1700 || ListApplicationDownloadingContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 1701 || [3.0.0+] GetApplicationView&lt;br /&gt;
|-&lt;br /&gt;
| 1702 || [3.0.0+] GetApplicationDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 1703 || [4.0.0+] GetApplicationViewDownloadErrorContext&lt;br /&gt;
|-&lt;br /&gt;
| 1704 || [8.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1800 || IsNotificationSetupCompleted&lt;br /&gt;
|-&lt;br /&gt;
| 1801 || GetLastNotificationInfoCount&lt;br /&gt;
|-&lt;br /&gt;
| 1802 || ListLastNotificationInfo&lt;br /&gt;
|-&lt;br /&gt;
| 1803 || [3.0.0+] ListNotificationTask&lt;br /&gt;
|-&lt;br /&gt;
| 1900 || [3.0.0+] IsActiveAccount&lt;br /&gt;
|-&lt;br /&gt;
| 1901 || [4.0.0+] RequestDownloadApplicationPrepurchasedRights&lt;br /&gt;
|-&lt;br /&gt;
| 1902 || [5.0.0+] GetApplicationTicketInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2000 || [4.0.0+] GetSystemDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2001 || [4.0.0+] SelectLatestSystemDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2002 || [4.0.0+] VerifyDeliveryProtocolVersion&lt;br /&gt;
|-&lt;br /&gt;
| 2003 || [4.0.0+] GetApplicationDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2004 || [4.0.0+] HasAllContentsToDeliver&lt;br /&gt;
|-&lt;br /&gt;
| 2005 || [4.0.0+] CompareApplicationDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2006 || [4.0.0+] CanDeliverApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2007 || [4.0.0+] ListContentMetaKeyToDeliverApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2008 || [4.0.0+] NeedsSystemUpdateToDeliverApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2009 || [4.0.0+] EstimateRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 2010 || [4.0.0+] RequestReceiveApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2011 || [4.0.0+] CommitReceiveApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2012 || [4.0.0+] GetReceiveApplicationProgress&lt;br /&gt;
|-&lt;br /&gt;
| 2013 || [4.0.0+] RequestSendApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2014 || [4.0.0+] GetSendApplicationProgress&lt;br /&gt;
|-&lt;br /&gt;
| 2015 || [4.0.0+] CompareSystemDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2016 || [4.0.0+] ListNotCommittedContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 2017 || [4.0.0+] RecoverDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 2018 || [5.0.0+] GetApplicationDeliveryInfoHash&lt;br /&gt;
|-&lt;br /&gt;
| 2050 || [6.0.0+] GetApplicationRightsOnClient&lt;br /&gt;
|-&lt;br /&gt;
| 2100 || [6.0.0+] GetApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 2101 || [6.0.0+] GetRawApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 2150 || [6.0.0+] CreateRightsEnvironment&lt;br /&gt;
|-&lt;br /&gt;
| 2151 || [6.0.0+] DestroyRightsEnvironment&lt;br /&gt;
|-&lt;br /&gt;
| 2152 || [6.0.0+] ActivateRightsEnvironment&lt;br /&gt;
|-&lt;br /&gt;
| 2153 || [6.0.0+] DeactivateRightsEnvironment&lt;br /&gt;
|-&lt;br /&gt;
| 2154 || [6.0.0+] ForceActivateRightsContextForExit&lt;br /&gt;
|-&lt;br /&gt;
| 2155 || [7.0.0+] UpdateRightsEnvironmentStatus&lt;br /&gt;
|-&lt;br /&gt;
| 2160 || [6.0.0+] AddTargetApplicationToRightsEnvironment&lt;br /&gt;
|-&lt;br /&gt;
| 2161 || [6.0.0+] SetUsersToRightsEnvironment&lt;br /&gt;
|-&lt;br /&gt;
| 2170 || [6.0.0+] GetRightsEnvironmentStatus&lt;br /&gt;
|-&lt;br /&gt;
| 2171 || [6.0.0+] GetRightsEnvironmentStatusChangedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 2180 || [6.0.0+] RequestExtendExpirationInRightsEnvironment&lt;br /&gt;
|-&lt;br /&gt;
| 2181 || [6.0.0+] GetResultOfExtendExpirationInRightsEnvironment&lt;br /&gt;
|-&lt;br /&gt;
| 2182 || [6.0.0+] SetActiveRightsContextUsingStateToRightsEnvironment&lt;br /&gt;
|-&lt;br /&gt;
| 2190 || [6.0.0+] GetRightsEnvironmentHandleForApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2199 || [6.0.0+] GetRightsEnvironmentCountForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 2200 || [6.0.0+] GetGameCardApplicationCopyIdentifier&lt;br /&gt;
|-&lt;br /&gt;
| 2201 || [6.0.0+] GetInstalledApplicationCopyIdentifier&lt;br /&gt;
|-&lt;br /&gt;
| [6.0.0-6.2.0] 2250 || RequestReportActiveELicence&lt;br /&gt;
|-&lt;br /&gt;
| 2300 || [6.0.0+] ListEventLog&lt;br /&gt;
|-&lt;br /&gt;
| 2350 || [7.0.0+] &lt;br /&gt;
|-&lt;br /&gt;
| 2400 || [8.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2401 || [8.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2402 || [8.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2403 || [8.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2404 || [8.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2500 || [8.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[4.0.0+] RequestDownloadAddOnContent now takes an additional 8-bytes of input.&lt;br /&gt;
&lt;br /&gt;
==== Cmd99 ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used by AM cmd [[Applet_Manager_services#LaunchDevMenu|LaunchDevMenu]].&lt;br /&gt;
&lt;br /&gt;
This uses [[System_Settings|system-settings]] &amp;lt;code&amp;gt;ns.applet!devmenu_id&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ns.applet!devoverlaydisp_id&amp;lt;/code&amp;gt;, which only exists on devunits.&lt;br /&gt;
&lt;br /&gt;
=== IApplicationVersionInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IApplicationVersionInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [4.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetLaunchRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 1 || UpgradeLaunchRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 35 || UpdateVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 36 || PushLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 37 || ListRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 800 || RequestVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 801 || ListVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 802 || RequestVersionListData&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || PerformAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IContentManagerInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IContentManagementInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 11 || CalculateApplicationOccupiedSize&lt;br /&gt;
|-&lt;br /&gt;
| 43 || CheckSdCardMountStatus&lt;br /&gt;
|-&lt;br /&gt;
| 47 || GetTotalSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| 48 || GetFreeSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| 600 || CountApplicationContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 601 || ListApplicationContentMetaStatus&lt;br /&gt;
|-&lt;br /&gt;
| 605 || ListApplicationContentMetaStatusWithRightsCheck&lt;br /&gt;
|-&lt;br /&gt;
| 607 || IsAnyApplicationRunning&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IDocumentInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IDocumentInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 21 || GetApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
| 23 || ResolveApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
| 92 || [5.0.0+] GetRunningApplicationProgramId&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IDownloadTaskInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IDownloadTaskInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 701 || ClearTaskStatusList&lt;br /&gt;
|-&lt;br /&gt;
| 702 || RequestDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 703 || RequestEnsureDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 704 || ListDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 705 || RequestDownloadTaskListData&lt;br /&gt;
|-&lt;br /&gt;
| 706 || [4.0.0+] TryCommitCurrentApplicationDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 707 || [4.0.0+] EnableAutoCommit&lt;br /&gt;
|-&lt;br /&gt;
| 708 || [4.0.0+] DisableAutoCommit&lt;br /&gt;
|-&lt;br /&gt;
| 709 || [4.0.0+] TriggerDynamicCommitEvent&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IReadOnlyApplicationRecordInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IReadOnlyApplicationRecordInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [5.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || HasApplicationRecord || Same as [[#IApplicationManagerInterface]] cmd 910&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IReadOnlyApplicationControlDataInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IReadOnlyApplicationControlDataInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [5.1.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetApplicationControlData]] || Same as [[#IApplicationManagerInterface]] cmd 400&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetApplicationDesiredLanguage]] || Same as [[#IApplicationManagerInterface]] cmd 55&lt;br /&gt;
|-&lt;br /&gt;
| 2 || ConvertApplicationLanguageToLanguageCode || Same as [[#IApplicationManagerInterface]] cmd 59&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#ConvertLanguageCodeToApplicationLanguage]] || Same as [[#IApplicationManagerInterface]] cmd 60&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IDynamicRightsInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IDynamicRightsInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [6.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || || &lt;br /&gt;
|-&lt;br /&gt;
| 4 || || &lt;br /&gt;
|-&lt;br /&gt;
| 5 || || &lt;br /&gt;
|-&lt;br /&gt;
| 6 || || &lt;br /&gt;
|-&lt;br /&gt;
| 7 || || &lt;br /&gt;
|-&lt;br /&gt;
| 8 || || &lt;br /&gt;
|-&lt;br /&gt;
| 9 || [7.0.0+] || &lt;br /&gt;
|-&lt;br /&gt;
| 10 || [7.0.0+] || &lt;br /&gt;
|-&lt;br /&gt;
| 11 || [7.0.0+] || &lt;br /&gt;
|-&lt;br /&gt;
| 12 || [8.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [8.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IECommerceInterface===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IECommerceInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [4.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || RequestLinkDevice || Takes a total of 0x10-bytes of input, returns an [[#IAsyncResult]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [6.0.0+] RequestCleanupAllPreInstalledApplications || No input, returns an [[#IAsyncResult]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [6.0.0+] RequestCleanupPreInstalledApplication || Takes a total of 0x8-bytes of input, returns an [[#IAsyncResult]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [6.0.0+] RequestSyncRights || No input, returns an [[#IAsyncResult]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [6.0.0+] RequestUnlinkDevice || Takes a total of 0x10-bytes of input, returns an [[#IAsyncResult]].&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [6.1.0+] RequestRevokeAllELicense || Takes a total of 0x10-bytes of input, returns an [[#IAsyncResult]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IFactoryResetInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IFactoryResetInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ResetToFactorySettings&lt;br /&gt;
|-&lt;br /&gt;
| 101 || ResetToFactorySettingsWithoutUserSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 102 || ResetToFactorySettingsForRefurbishment&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:vm =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IVulnerabilityManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1200 || [3.0.0+] [[#NeedsUpdateVulnerability]]&lt;br /&gt;
|-&lt;br /&gt;
| 1201 || [4.0.0+] [[#UpdateSafeSystemVersionForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 1202 || [4.0.0+] [[#GetSafeSystemVersion]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== NeedsUpdateVulnerability ==&lt;br /&gt;
No input, returns an output u8 bool flag.&lt;br /&gt;
&lt;br /&gt;
Web-applets use this command to check if the system needs an update.&lt;br /&gt;
&lt;br /&gt;
== UpdateSafeSystemVersionForDebug ==&lt;br /&gt;
Takes an input u64 &#039;&#039;&#039;titleID&#039;&#039;&#039; and an u32 &#039;&#039;&#039;version&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This command is not available for retail units. On a debug unit, if the [[System_Settings|system setting]] &amp;lt;code&amp;gt;vulnerability!enable_debug&amp;lt;/code&amp;gt; is set, this mounts the system savegame [[Flash_Filesystem#System_Savegames|0x8000000000000049]] as &amp;quot;ns_ssversion:/&amp;quot;, opens the file &amp;quot;ns_ssversion:/entry&amp;quot; and writes the supplied &#039;&#039;&#039;titleID&#039;&#039;&#039; and &#039;&#039;&#039;version&#039;&#039;&#039; in it.&lt;br /&gt;
&lt;br /&gt;
Finally, it calls [[NCM_services#ncm|OpenContentMetaDatabase]] with [[Filesystem_services#StorageId|StorageID]] 3, then calls [[NCM_services#IContentMetaDatabase|GetLatestContentMetaKey]] with the supplied &#039;&#039;&#039;titleID&#039;&#039;&#039; and compares the version field from the returned [[CNMT#Content_Meta_Records|Content Meta Record]] with the supplied &#039;&#039;&#039;version&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the supplied &#039;&#039;&#039;version&#039;&#039;&#039; is higher than the one in NCM&#039;s database, the value returned by [[NS_Services#NeedsUpdateVulnerability|NeedsUpdateVulnerability]] is set to &amp;quot;true&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== GetSafeSystemVersion ==&lt;br /&gt;
No input, returns a 0x10 byte array with the cached contents of &amp;quot;ns_ssversion:/entry&amp;quot; (u64 &#039;&#039;&#039;titleID&#039;&#039;&#039;, u32 &#039;&#039;&#039;version&#039;&#039;&#039; and u32 &#039;&#039;&#039;policy&#039;&#039;&#039; from &amp;lt;code&amp;gt;vulnerability!needs_update_vulnerability_policy&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
= ns:su =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::ISystemUpdateInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetBackgroundNetworkUpdateState&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#ISystemUpdateControl|OpenSystemUpdateControl]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NotifyExFatDriverRequired&lt;br /&gt;
|-&lt;br /&gt;
| 3 || ClearExFatDriverStatusForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 4 || RequestBackgroundNetworkUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 5 || NotifyBackgroundNetworkUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 6 || NotifyExFatDriverDownloadedForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetSystemUpdateNotificationEventForContentDelivery&lt;br /&gt;
|-&lt;br /&gt;
| 10 || NotifySystemUpdateForContentDelivery&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [3.0.0+] PrepareShutdown&lt;br /&gt;
|-&lt;br /&gt;
| [3.0.0-3.0.2] 12 || &lt;br /&gt;
|-&lt;br /&gt;
| [3.0.0-3.0.2] 13 || &lt;br /&gt;
|-&lt;br /&gt;
| [3.0.0-3.0.2] 14 || &lt;br /&gt;
|-&lt;br /&gt;
| [3.0.0-3.0.2] 15 || &lt;br /&gt;
|-&lt;br /&gt;
| 16 || [4.0.0+] DestroySystemUpdateTask&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [4.0.0+] RequestSendSystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [4.0.0+] GetSendSystemUpdateProgress&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ISystemUpdateControl ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#HasDownloaded]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || RequestCheckLatestUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 2 || RequestDownloadLatestUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetDownloadProgress]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#ApplyDownloadedUpdate]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || RequestPrepareCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 6 || GetPrepareCardUpdateProgress&lt;br /&gt;
|-&lt;br /&gt;
| 7 || HasPreparedCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 8 || ApplyCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#GetDownloadedEulaDataSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#GetDownloadedEulaData]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || SetupCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetPreparedCardUpdateEulaDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 13 || GetPreparedCardUpdateEulaData&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [4.0.0+] SetupCardUpdateViaSystemUpdater&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [4.0.0+] HasReceived&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [4.0.0+] RequestReceiveSystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [4.0.0+] GetReceiveProgress&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [4.0.0+] ApplyReceivedUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [4.0.0+] GetReceivedEulaDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [4.0.0+] GetReceivedEulaData&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [4.0.0+] SetupToReceiveSystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [6.0.0+] RequestCheckLatestUpdateIncludesRebootlessUpdate&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== HasDownloaded ===&lt;br /&gt;
No input, returns an output u8 bool flag.&lt;br /&gt;
&lt;br /&gt;
Gets whether a network sysupdate was downloaded, with install pending.&lt;br /&gt;
&lt;br /&gt;
Uses [[NIM_services|nim]] ListSystemUpdateTask and [[NIM_services|nim]] GetSystemUpdateTaskInfo. When ListSystemUpdateTask successfully returns a task and GetSystemUpdateTaskInfo is successful, the output flag is set to: &amp;lt;code&amp;gt;*((u8*)(taskinfo+0) == 0x3&amp;lt;/code&amp;gt;. Otherwise, flag=0.&lt;br /&gt;
&lt;br /&gt;
This always returns 0, however this will assert if GetSystemUpdateTaskInfo fails with ret!=0x3C89.&lt;br /&gt;
&lt;br /&gt;
=== GetDownloadProgress ===&lt;br /&gt;
No input, returns a 0x10-byte output struct.&lt;br /&gt;
&lt;br /&gt;
Similar to [[#HasDownloaded]] except instead of a flag, this returns the 0x10-bytes from taskinfo+8. The output struct is cleared when the task(info) isn&#039;t available.&lt;br /&gt;
&lt;br /&gt;
=== ApplyDownloadedUpdate ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Runs code similar to [[#HasDownloaded]], throwing an error if a network sysupdate isn&#039;t ready for install. Then the sysupdate is installed:&lt;br /&gt;
&lt;br /&gt;
* Uses ListSystemUpdateTask again, then [[NIM_services|nim]] IsExFatDriverIncluded. Runs ExFat handling when the output flag is set.&lt;br /&gt;
* The two flags in [[Flash_Filesystem#System_Update_Control]] are set to 1.&lt;br /&gt;
* Uses [[NIM_services|nim]] CommitSystemUpdateTask and [[NIM_services|nim]] DestroySystemUpdateTask.&lt;br /&gt;
* Installs FIRM.&lt;br /&gt;
&lt;br /&gt;
=== GetDownloadedEulaDataSize ===&lt;br /&gt;
Takes a type-0x15 input buffer &#039;&#039;&#039;path&#039;&#039;&#039;, returns an output u64 &#039;&#039;&#039;filesize&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Runs code similar to [[#HasDownloaded]], throwing an error if a network sysupdate isn&#039;t ready for install.&lt;br /&gt;
&lt;br /&gt;
Uses ListSystemUpdateTask again. Then [[NIM_services|nim]] GetDownloadedSystemDataPath, with the output ContentPath being used to mount the EULA title with FS.&lt;br /&gt;
&lt;br /&gt;
Then &amp;quot;&amp;lt;mountname&amp;gt;:/&amp;lt;&#039;&#039;&#039;path&#039;&#039;&#039;&amp;gt;&amp;quot; is opened, gets the &#039;&#039;&#039;filesize&#039;&#039;&#039;, then runs cleanup.&lt;br /&gt;
&lt;br /&gt;
=== GetDownloadedEulaData ===&lt;br /&gt;
Takes a type-0x15 input buffer &#039;&#039;&#039;path&#039;&#039;&#039; and a type-0x6 output buffer, returns an output u64 &#039;&#039;&#039;filesize&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Similar to [[#GetDownloadedEulaDataSize]] except this reads the file instead, using the specified output buffer with size=filesize. This will throw an error if the filesize is larger than the buffer size.&lt;br /&gt;
&lt;br /&gt;
= IAsyncValue =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IAsyncValue&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetSize&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Get&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Cancel&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [4.0.0+] GetErrorContext&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Cmd3: No input/output, takes a type-0x16 output buffer.&lt;br /&gt;
&lt;br /&gt;
= IAsyncResult =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IAsyncResult&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Get&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Cancel&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [4.0.0+] GetErrorContext&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Cmd2: No input/output, takes a type-0x16 output buffer.&lt;br /&gt;
&lt;br /&gt;
= ns:dev =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IDevelopInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#LaunchProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#TerminateProcess]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#TerminateProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetShellEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetShellEventInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#TerminateApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#PrepareLaunchProgramFromHost]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#LaunchApplicationForDevelop]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#LaunchApplicationWithStorageIdForDevelop]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [6.0.0+] TerminateApplication2&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [6.0.0+] GetRunningApplicationProcessIdForDevelop&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [6.0.0+] SetCurrentApplicationRightsEnvironmentCanBeActiveForDevelop&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LaunchProgram ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#LaunchProcess|LaunchProcess]].&lt;br /&gt;
&lt;br /&gt;
== TerminateProcess ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#TerminateTitleByPid|TerminateTitleByPid]].&lt;br /&gt;
&lt;br /&gt;
== TerminateProgram ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#TerminateTitleByTitleId|TerminateTitleByTitleId]].&lt;br /&gt;
&lt;br /&gt;
== GetShellEvent ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#GetProcessEventWaiter|GetProcessEventWaiter]].&lt;br /&gt;
&lt;br /&gt;
== GetShellEventInfo ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#GetProcessEventType|GetProcessEventType]].&lt;br /&gt;
&lt;br /&gt;
== TerminateApplication ==&lt;br /&gt;
Calls &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#GetCrashingProcessPid|GetCrashingProcessPid]] and sends PID to [[Process_Manager_services#TerminateTitleByPid|TerminateTitleByPid]].&lt;br /&gt;
&lt;br /&gt;
== PrepareLaunchProgramFromHost ==&lt;br /&gt;
Takes a type-0x5 input buffer containing the [[Filesystem_services|ContentPath]], returns an output 0x10-byte struct.&lt;br /&gt;
&lt;br /&gt;
Calls [[NCM_services#IPathResolverForStorage|IPathResolverForStorage]] Set...NcaPath functions.&lt;br /&gt;
&lt;br /&gt;
== LaunchApplicationForDevelop ==&lt;br /&gt;
Takes an input u32 [[Process_Manager_services#LaunchFlags|LaunchFlags]] and u64 titleID, returns an output u64 PID.&lt;br /&gt;
&lt;br /&gt;
Same as LaunchApplicationWithStorageId except the last two params passed to the internal vtable funcptr call are value 0x6, instead of from the command input.&lt;br /&gt;
&lt;br /&gt;
== LaunchApplicationWithStorageIdForDevelop ==&lt;br /&gt;
Takes 2 input u8s, an u32 [[Process_Manager_services#LaunchFlags|LaunchFlags]], and an u64 titleID. Returns an output u64 PID.&lt;br /&gt;
&lt;br /&gt;
Launches an application title which is registered with NS. &lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Filesystem_services&amp;diff=7136</id>
		<title>Filesystem services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Filesystem_services&amp;diff=7136"/>
		<updated>2019-07-04T03:19:20Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Update SaveCreate Struct&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= fsp-ldr =&lt;br /&gt;
This is &amp;quot;nn::fssrv::sf::IFileSystemProxyForLoader&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || OpenCodeFileSystem || u64 TitleId + X descriptor [[#ContentPath]] || Returns an [[#IFileSystem]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || IsArchivedProgram || u64 ProcessId || Returns a bool (1 if the process id&#039;s [[#ContentPath]] ends in &amp;quot;.nca&amp;quot;).&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [4.0.0+] SetCurrentProcess || PID descriptor ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= fsp-pr =&lt;br /&gt;
This is &amp;quot;nn::fssrv::sf::IProgramRegistry&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#RegisterProgram]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#UnregisterProgram]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [4.0.0+] SetCurrentProcess ||&lt;br /&gt;
|-&lt;br /&gt;
| 256 || [[#SetEnabledProgramVerification]] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== RegisterProgram ==&lt;br /&gt;
Takes a storageID, a pid, a titleID, a 0x1C type-A buffer for the [[NPDM#FS_Access_Header| FS Access Header]], and a 0x2C type-A buffer for the [[NPDM#FS_Access_Control| FS Access Control]]&lt;br /&gt;
&lt;br /&gt;
Final FS permissions are stored as (ACI0_perms &amp;amp; ACID_perms). Will panic(svcBreak) when buffer sizes from ipc-rawdata are invalid.&lt;br /&gt;
&lt;br /&gt;
== UnregisterProgram ==&lt;br /&gt;
Takes a pid. Removes registered FS permissions for that PID.&lt;br /&gt;
&lt;br /&gt;
== SetEnabledProgramVerification ==&lt;br /&gt;
Seems to sets a global flag to inputval &amp;amp; 1.&lt;br /&gt;
&lt;br /&gt;
When the flag is zero, it will set ret=0 instead of ret={error} when verifying the fixed-key [[NPDM]] ACID signature fails. This also skips verifying the [[NCA_Format|NCA Header]] signature using the ACID key. Note that if verifying the fixed-key ACID signature is successful, and verifying the ACID-key NCA header signature fails, it will throw an error and abort.&lt;br /&gt;
&lt;br /&gt;
= fsp-srv =&lt;br /&gt;
This is &amp;quot;nn::fssrv::sf::IFileSystemProxy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [1.0.0] [[#OpenFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#SetCurrentProcess]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || OpenDataFileSystemByCurrentProcess&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [2.0.0+] [[#OpenFileSystemWithPatch]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [2.0.0+] [[#OpenFileSystemWithId]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [3.0.0+] OpenDataFileSystemByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#OpenBisFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#OpenBisStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || InvalidateBisCache&lt;br /&gt;
|-&lt;br /&gt;
| 17 || OpenHostFileSystem&lt;br /&gt;
|-&lt;br /&gt;
| 18 || OpenSdCardFileSystem&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [2.0.0+] FormatSdCardFileSystem&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#DeleteSaveDataFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [[#CreateSaveDataFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [[#CreateSaveDataFileSystemBySystemSaveDataId]]&lt;br /&gt;
|-&lt;br /&gt;
| 24 || RegisterSaveDataFileSystemAtomicDeletion&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [2.0.0+] DeleteSaveDataFileSystemBySaveDataSpaceId&lt;br /&gt;
|-&lt;br /&gt;
| 26 || [2.0.0+] FormatSdCardDryRun&lt;br /&gt;
|-&lt;br /&gt;
| 27 || [2.0.0+] IsExFatSupported&lt;br /&gt;
|-&lt;br /&gt;
| 28 || [4.0.0+] DeleteSaveDataFileSystemBySaveDataAttribute&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [[#OpenGameCardStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [[#OpenGameCardFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 32 || [3.0.0+] ExtendSaveDataFileSystem&lt;br /&gt;
|-&lt;br /&gt;
| 33 || [5.0.0+] DeleteCacheStorage&lt;br /&gt;
|-&lt;br /&gt;
| 34 || [5.0.0+] GetCacheStorageSize&lt;br /&gt;
|-&lt;br /&gt;
| 35 || [6.0.0+] CreateSaveDataFileSystemByHashSalt (Unofficial name, takes a total of 0xB0-bytes of input, no output)&lt;br /&gt;
|-&lt;br /&gt;
| 51 || [[#OpenSaveDataFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 52 || [[#OpenSaveDataFileSystemBySystemSaveDataId]]&lt;br /&gt;
|-&lt;br /&gt;
| 53 || [2.0.0+] OpenReadOnlySaveDataFileSystem&lt;br /&gt;
|-&lt;br /&gt;
| 57 || [3.0.0+] [[#ReadSaveDataFileSystemExtraDataBySaveDataSpaceId]]&lt;br /&gt;
|-&lt;br /&gt;
| 58 || [[#ReadSaveDataFileSystemExtraData]]&lt;br /&gt;
|-&lt;br /&gt;
| 59 || [2.0.0+] WriteSaveDataFileSystemExtraData&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [[#OpenSaveDataInfoReader]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || [[#OpenSaveDataInfoReaderBySaveDataSpaceId]]&lt;br /&gt;
|-&lt;br /&gt;
| 62 || [5.0.0+] OpenCacheStorageList&lt;br /&gt;
|-&lt;br /&gt;
| 64 || [5.0.0+] OpenSaveDataInternalStorageFileSystem&lt;br /&gt;
|-&lt;br /&gt;
| 65 || [5.0.0+] UpdateSaveDataMacForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 66 || [5.0.0+] WriteSaveDataFileSystemExtraData2&lt;br /&gt;
|-&lt;br /&gt;
| 67 || [6.0.0+] FindSaveDataWithFilter (Takes a total of 0x50-bytes of input, returns 8-bytes of output, and a type-0x6 output buffer)&lt;br /&gt;
|-&lt;br /&gt;
| 68 || [6.0.0+] OpenSaveDataIterator (Takes a total of 0x50-bytes of input, returns an #ISaveDataInfoReader)&lt;br /&gt;
|-&lt;br /&gt;
| 69 || [8.0.0+] ReadSaveDataFileSystemExtraDataBySaveDataAttribute&lt;br /&gt;
|-&lt;br /&gt;
| 70 || [8.0.0+] WriteSaveDataFileSystemExtraDataBySaveDataAttribute&lt;br /&gt;
|-&lt;br /&gt;
| 80 || OpenSaveDataMetaFile&lt;br /&gt;
|-&lt;br /&gt;
| 81 || [4.0.0+] OpenSaveDataTransferManager (No input, returns an [[#ISaveDataTransferManager]])&lt;br /&gt;
|-&lt;br /&gt;
| 82 || [5.0.0+] OpenSaveDataTransferManagerVersion2 (No input, returns an [[#ISaveDataTransferManagerWithDivision]])&lt;br /&gt;
|-&lt;br /&gt;
| 83 || [6.0.0+] OpenSaveDataTransferProhibiterForCloudBackUp (Takes an input u64, returns an [[#ISaveDataTransferProhibiter]])&lt;br /&gt;
|-&lt;br /&gt;
| 84 || [6.0.0+] ListApplicationAccessibleSaveDataOwnerId (Takes a total of 0x10-bytes of input, returns 4-bytes of output, and a type-0x6 output buffer)&lt;br /&gt;
|-&lt;br /&gt;
| 100 || OpenImageDirectoryFileSystem&lt;br /&gt;
|-&lt;br /&gt;
| 110 || [[#OpenContentStorageFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 120 || [6.0.0+] OpenCloudBackupWorkStorageFileSystem (Takes 4-bytes of input, returns an [[#IFileSystem]])&lt;br /&gt;
|-&lt;br /&gt;
| 130 || [7.0.0+] OpenCustomStorageFileSystem (Takes 4-bytes of input, returns an [[#IFileSystem]])&lt;br /&gt;
|-&lt;br /&gt;
| 200 || OpenDataStorageByCurrentProcess&lt;br /&gt;
|-&lt;br /&gt;
| 201 || [3.0.0+] OpenDataStorageByProgramId&lt;br /&gt;
|-&lt;br /&gt;
| 202 || [[#OpenDataStorageByDataId]]&lt;br /&gt;
|-&lt;br /&gt;
| 203 || OpenPatchDataStorageByCurrentProcess&lt;br /&gt;
|-&lt;br /&gt;
| 204 || [7.0.0+] OpenDataFileSystemByProgramIndex (Takes an input u8, returns an [[#IFileSystem]])&lt;br /&gt;
|-&lt;br /&gt;
| 205 || [7.0.0+] OpenDataStorageByProgramIndex (Takes an input u8, returns an [[#IStorage]])&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#OpenDeviceOperator]]&lt;br /&gt;
|-&lt;br /&gt;
| 500 || [[#OpenSdCardDetectionEventNotifier]]&lt;br /&gt;
|-&lt;br /&gt;
| 501 || [[#OpenGameCardDetectionEventNotifier]]&lt;br /&gt;
|-&lt;br /&gt;
| 510 || [5.0.0+] OpenSystemDataUpdateEventNotifier&lt;br /&gt;
|-&lt;br /&gt;
| 511 || [5.0.0+] NotifySystemDataUpdateEvent&lt;br /&gt;
|-&lt;br /&gt;
| 520 || [6.0.0+] SimulateGameCardDetectionEvent (Takes a total of 0xC-bytes of input, no output)&lt;br /&gt;
|-&lt;br /&gt;
| 600 || [1.0.0-3.0.2] SetCurrentPosixTime&lt;br /&gt;
|-&lt;br /&gt;
| 601 || QuerySaveDataTotalSize&lt;br /&gt;
|-&lt;br /&gt;
| 602 || [[#VerifySaveDataFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 603 || CorruptSaveDataFileSystem&lt;br /&gt;
|-&lt;br /&gt;
| 604 || CreatePaddingFile&lt;br /&gt;
|-&lt;br /&gt;
| 605 || DeleteAllPaddingFiles&lt;br /&gt;
|-&lt;br /&gt;
| 606 || [2.0.0+] GetRightsId&lt;br /&gt;
|-&lt;br /&gt;
| 607 || [2.0.0+] RegisterExternalKey&lt;br /&gt;
|-&lt;br /&gt;
| 608 || [2.0.0+] UnregisterAllExternalKey&lt;br /&gt;
|-&lt;br /&gt;
| 609 || [2.0.0+] GetRightsIdByPath&lt;br /&gt;
|-&lt;br /&gt;
| 610 || [3.0.0+] GetRightsIdAndKeyGenerationByPath&lt;br /&gt;
|-&lt;br /&gt;
| 611 || [4.0.0+] SetCurrentPosixTimeWithTimeDifference&lt;br /&gt;
|-&lt;br /&gt;
| 612 || [4.0.0+] GetFreeSpaceSizeForSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 613 || [4.0.0+] VerifySaveDataFileSystemBySaveDataSpaceId&lt;br /&gt;
|-&lt;br /&gt;
| 614 || [4.0.0+] CorruptSaveDataFileSystemBySaveDataSpaceId&lt;br /&gt;
|-&lt;br /&gt;
| 615 || [5.0.0+] QuerySaveDataInternalStorageTotalSize&lt;br /&gt;
|-&lt;br /&gt;
| 616 || [6.0.0+] [[#GetSaveDataCommitId]]&lt;br /&gt;
|-&lt;br /&gt;
| 617 || [7.0.0+] UnregisterExternalKey&lt;br /&gt;
|-&lt;br /&gt;
| 620 || [2.0.0+] [[#SetSdCardEncryptionSeed]]&lt;br /&gt;
|-&lt;br /&gt;
| 630 || [4.0.0+] SetSdCardAccessibility&lt;br /&gt;
|-&lt;br /&gt;
| 631 || [4.0.0+] IsSdCardAccessible&lt;br /&gt;
|-&lt;br /&gt;
| 640 || [4.0.0-7.0.1] IsSignedSystemPartitionOnSdCardValid&lt;br /&gt;
|-&lt;br /&gt;
| 700 || [5.0.0+] [[#OpenAccessFailureResolver]]&lt;br /&gt;
|-&lt;br /&gt;
| 701 || [5.0.0+] GetAccessFailureDetectionEvent&lt;br /&gt;
|-&lt;br /&gt;
| 702 || [5.0.0+] IsAccessFailureDetected&lt;br /&gt;
|-&lt;br /&gt;
| 710 || [5.0.0+] ResolveAccessFailure&lt;br /&gt;
|-&lt;br /&gt;
| 720 || [5.0.0+] AbandonAccessFailure&lt;br /&gt;
|-&lt;br /&gt;
| 800 || [2.0.0+] GetAndClearFileSystemProxyErrorInfo&lt;br /&gt;
|-&lt;br /&gt;
| 810 || [7.0.0+] RegisterProgramIndexMapInfo&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || SetBisRootForHost&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || [[#SetSaveDataSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 1002 || [[#SetSaveDataRootPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 1003 || DisableAutoSaveDataCreation&lt;br /&gt;
|-&lt;br /&gt;
| 1004 || [[#SetGlobalAccessLogMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 1005 || [[#GetGlobalAccessLogMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 1006 || [[#OutputAccessLogToSdCard]]&lt;br /&gt;
|-&lt;br /&gt;
| 1007 || [4.0.0+] RegisterUpdatePartition&lt;br /&gt;
|-&lt;br /&gt;
| 1008 || [4.0.0+] OpenRegisteredUpdatePartition&lt;br /&gt;
|-&lt;br /&gt;
| 1009 || [4.0.0+] GetAndClearMemoryReportInfo&lt;br /&gt;
|-&lt;br /&gt;
| 1010 || [5.1.0-6.2.0] SetDataStorageRedirectTarget&lt;br /&gt;
|-&lt;br /&gt;
| 1011 || [7.0.0+] GetAccessLogVersionInfo (Unofficial name, no input, returns two 32-bit values &amp;quot;version&amp;quot; and &amp;quot;program_index&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| 1100 || [4.0.0+] OverrideSaveDataTransferTokenSignVerificationKey&lt;br /&gt;
|-&lt;br /&gt;
| 1110 || [6.0.0+] CorruptSaveDataFileSystemBySaveDataSpaceId2&lt;br /&gt;
|-&lt;br /&gt;
| 1200 || [6.0.0+] OpenMultiCommitManager (No input, returns an output #IMultiCommitManager)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Permissions ==&lt;br /&gt;
Every time permissions are checked, the process registration [[#fsp-pr]] is loaded using the session processID. The permission data is populated with data from the [[NPDM]].&lt;br /&gt;
&lt;br /&gt;
If the processID is &amp;lt;= 6 (which happens only for built-in sysmodules), it will use a hardcoded registration data. The default mask in this case is 0x8000000000000000.&lt;br /&gt;
&lt;br /&gt;
Note that the functions check whether or not at least one bit is set in the mask. This means that, you don&#039;t need to set 0xFFFFFFFFFFFFFFFF to get all permissions: it suffices to set 0x8000000000000000.&lt;br /&gt;
&lt;br /&gt;
If the code were to request an invalid input type, panic. But this never happens.&lt;br /&gt;
&lt;br /&gt;
=== RwPermissions ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type(s) || Mask || Name || Value || Used by&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8000000000000801 || CanMountLogo || 1 || [[#OpenFileSystem]], [[#OpenFileSystemWithPatch]], [[#OpenFileSystemWithId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x8000000000000801 || CanMountContentMeta || 1 || [[#OpenFileSystem]], [[#OpenFileSystemWithPatch]], [[#OpenFileSystemWithId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x8000000000000801 || CanMountContentControl || 1 || [[#OpenFileSystem]], [[#OpenFileSystemWithPatch]], [[#OpenFileSystemWithId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 || 0x8000000000000801 || CanMountContentManual || 1 || [[#OpenFileSystem]], [[#OpenFileSystemWithPatch]], [[#OpenFileSystemWithId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x8000000000000801 || CanMountContentData || 1 || [[#OpenFileSystem]], [[#OpenFileSystemWithPatch]], [[#OpenFileSystemWithId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 || 0x8000000000000801 || CanMountApplicationPackage || 1 || [[#OpenFileSystem]], [[#OpenFileSystemWithPatch]], [[#OpenFileSystemWithId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 || 0x8000000000000000 || CanMountSaveDataStorage || 3 ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 || 0x8000000000000800 || CanMountContentStorage || 3 || [[#OpenContentStorageFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x8000000000001000 || CanMountImageAndVideoStorage || 3 || [[#OpenImageDirectoryFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x9 || 0x8000000200000000&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000000000084) || CanMountCloudBackupWorkStorage || 3 || OpenCloudBackupWorkStorageFileSystem&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x8000000000000000&amp;lt;br/&amp;gt;([7.0.0-7.0.1] 0x4000000000000000)&amp;lt;br/&amp;gt;([6.0.0-6.2.0] 0x8000000000000084)&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000000000080) || CanMountCustomStorage || 3 || OpenCustomStorageFileSystem&lt;br /&gt;
|-&lt;br /&gt;
| 0xB || 0x8000000000000084&amp;lt;br/&amp;gt;([6.0.0-6.2.0] 0x8000000000000080)&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000000008080) || CanMountBisCalibrationFile || 3 || [[#OpenBisFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x8000000000000080&amp;lt;br/&amp;gt;([1.0.0-6.2.0] 0x8000000000008080) || CanMountBisSafeMode || 3 || [[#OpenBisFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xD || 0x8000000000008080&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000000000080) || CanMountBisUser || 3 || [[#OpenBisFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xE || 0x8000000000008080&amp;lt;br/&amp;gt;([3.0.0-6.2.0] 0x8000000000000080)&amp;lt;br/&amp;gt;([1.0.0-2.3.0] 0xC000000000200000) || CanMountBisSystem || 3 || [[#OpenBisFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xF || 0x8000000000000080&amp;lt;br/&amp;gt;([3.0.0-5.1.0] 0xC000000000200000)&amp;lt;br/&amp;gt;([1.0.0-2.3.0] 0x8000000000000010) || CanMountBisSystemProperEncryption || 3 || [[#OpenBisFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x8000000000000080&amp;lt;br/&amp;gt;([6.0.0-6.2.0] 0xC000000000200000&amp;lt;br/&amp;gt;([3.0.0-5.1.0] 0x8000000000000010)&amp;lt;br/&amp;gt;([1.0.0-2.3.0] 0x8000000000040020) || CanMountBisSystemProperPartition || 3 || [[#OpenBisFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 || 0xC000000000200000&amp;lt;br/&amp;gt;([6.0.0-6.2.0] 0x8000000000000010)&amp;lt;br/&amp;gt;([3.0.0-5.1.0] 0x8000000000040020)&amp;lt;br/&amp;gt;([1.0.0-2.3.0] 0x8000000000000028) || CanMountSdCard || 3 || [[#OpenSdCardFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || 0x8000000000000010&amp;lt;br/&amp;gt;([6.0.0-6.2.0] 0x8000000000040020)&amp;lt;br/&amp;gt;([3.0.0-5.1.0] 0x8000000000000028)&amp;lt;br/&amp;gt;([1.0.0-2.3.0] 0x8000000000000020) || CanMountGameCard || 3 || [[#OpenGameCardFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || 0x8000000000040020&amp;lt;br/&amp;gt;([6.0.0-6.2.0] 0x8000000000000028)&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000000000020) || CanMountDeviceSaveData || 3 || [[#OpenSaveDataFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || 0x8000000000000028&amp;lt;br/&amp;gt;([3.0.0-6.2.0] 0x8000000000000020)&amp;lt;br/&amp;gt;([1.0.0-2.3.0] 0x8000000000010082) || CanMountSystemSaveData || 3 || [[#OpenSaveDataFileSystemBySystemSaveDataId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 || 0x8000000000000020&amp;lt;br/&amp;gt;([3.0.0-5.1.0] 0x8000000000010082)&amp;lt;br/&amp;gt;([1.0.0-2.3.0] 0x8000000000010080) || CanMountOthersSaveData || 3 || [[#OpenSaveDataFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || 0x8000000000000020&amp;lt;br/&amp;gt;([6.0.0-6.2.0] 0x8000000000010082)&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000000010080) || CanMountOthersSystemSaveData || 3 || [[#OpenSaveDataFileSystemBySystemSaveDataId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 || 0x8000000000010082&amp;lt;br/&amp;gt;([6.0.0-6.2.0] 0x8000000000010080)&amp;lt;br/&amp;gt;([3.0.0-5.1.0] 0x8000000000000080)&amp;lt;br/&amp;gt;([1.0.0-2.3.0] 0x8000000000010080) || CanOpenBisPartitionBootPartition1Root || 3 || [[#OpenBisStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x8000000000010080&amp;lt;br/&amp;gt;([6.0.0-6.2.0] 0x8000000000000080)&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000000010080) || CanOpenBisPartitionBootPartition2Root || 3 || [[#OpenBisStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 || 0x8000000000000080&amp;lt;br/&amp;gt;([6.0.0-6.2.0] 0x8000000000010080) || CanOpenBisPartitionUserDataRoot || 3 || [[#OpenBisStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A || 0x8000000000010080 || CanOpenBisPartitionBootConfigAndPackage2Part1 || 3 || [[#OpenBisStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B || 0x8000000000010080 || CanOpenBisPartitionBootConfigAndPackage2Part2 || 3 || [[#OpenBisStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || 0x8000000000010080 || CanOpenBisPartitionBootConfigAndPackage2Part3 || 3 || [[#OpenBisStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D || 0x8000000000010080&amp;lt;br/&amp;gt;([1.0.0-2.3.0] 0x8000000000000084) || CanOpenBisPartitionBootConfigAndPackage2Part4 || 3 || [[#OpenBisStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E || 0x8000000000010080&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000000000084) || CanOpenBisPartitionBootConfigAndPackage2Part5 || 3 || [[#OpenBisStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F || 0x8000000000010080&amp;lt;br/&amp;gt;([6.0.0-6.2.0] 0x8000000000000084)&amp;lt;br/&amp;gt;([1.0.0-2.3.0] 0x8000000000000080) || CanOpenBisPartitionBootConfigAndPackage2Part6 || 3 || [[#OpenBisStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x8000000000000084&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000000000080) || CanOpenBisPartitionCalibrationBinary || 3 || [[#OpenBisStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || 0x8000000000000084&amp;lt;br/&amp;gt;([6.0.0-6.2.0] 0x8000000000000080) || CanOpenBisPartitionCalibrationFile || 3 || [[#OpenBisStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 || 0x8000000000000080 || CanOpenBisPartitionSafeMode || 3 || [[#OpenBisStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 || 0x8000000000000080&amp;lt;br/&amp;gt;([1.0.0-2.3.0] 0xC000000000200000) || CanOpenBisPartitionUser || 3 || [[#OpenBisStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x8000000000000080&amp;lt;br/&amp;gt;([1.0.0-2.3.0] 0x8000000000000100) || CanOpenBisPartitionSystem || 3 || [[#OpenBisStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 || 0x8000000000000080&amp;lt;br/&amp;gt;([3.0.0-5.1.0] 0xC000000000200000)&amp;lt;br/&amp;gt;([1.0.0-2.3.0] 0x8000000000100008) || CanOpenBisPartitionSystemProperEncryption || 3 || [[#OpenBisStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 || 0x8000000000000080&amp;lt;br/&amp;gt;([6.0.0-6.2.0] 0xC000000000200000)&amp;lt;br/&amp;gt;([3.0.0-5.1.0] 0x8000000000000100)&amp;lt;br/&amp;gt;([1.0.0-2.3.0] 0xC000000000400000) || CanOpenBisPartitionSystemProperPartition || 3 || [[#OpenBisStorage]]&lt;br /&gt;
|-&lt;br /&gt;
| [3.0.0+] 0x27 || 0xC000000000200000&amp;lt;br/&amp;gt;([6.0.0-6.2.0] 0x8000000000000100)&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000000100008) || CanOpenSdCardStorage || ||&lt;br /&gt;
|-&lt;br /&gt;
| [3.0.0+] 0x28 || 0x8000000000000100&amp;lt;br/&amp;gt;([6.0.0-6.2.0] 0x8000000000100008)&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0xC000000000400000) || CanOpenGameCardStorage || 3 || [[#OpenGameCardStorage]], [[#EraseGameCard]] (bit1), [[#WriteToGameCard]] (bit1), [[#GetGameCardErrorInfo]] (bit1), [[#EraseAndWriteParamDirectly]] (bit1), [[#ReadParamDirectly]] (bit1), [[#ForceEraseGameCard]] (bit1) &lt;br /&gt;
|-&lt;br /&gt;
| [4.0.0+] 0x29 || 0x8000000000100008&amp;lt;br/&amp;gt;([6.0.0-6.2.0] 0xC000000000400000)&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000000010000) || CanMountSystemDataPrivate || 1 || [[#OpenFileSystem]], [[#OpenDataStorageByDataId]]&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 0x2A || 0xC000000000400000&amp;lt;br/&amp;gt;([6.0.0-6.2.0] 0x8000000000010000)&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000000000000) || CanMountHost || 3 || [[#OpenHostFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| [6.0.0+] 0x2B || 0x8000000000010000&amp;lt;br/&amp;gt;([1.0.0-6.2.0]0x8000000000000000) || CanMountRegisteredUpdatePartition || 1 || [[#OpenRegisteredUpdatePartition]]&lt;br /&gt;
|-&lt;br /&gt;
| [7.0.0+] 0x2C || 0x8000000000000000 || CanOpenSaveDataInternalStorage || 3 || [[#OpenSaveDataInternalStorageFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| [7.0.0+] 0x2D || 0x0000000000000000 || CanNotMountCustomStorage || 3 || OpenCustomStorageFileSystem&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== BoolPermissions ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type(s) || Mask || Name || Used by&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8000000000000080 || CanInvalidateBisCache || [[#InvalidateBisCache]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x8000000000000080 || CanEraseMmc || [[#EraseMmc]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x8000000000000010 || CanGetGameCardDeviceCertificate || [[#GetGameCardDeviceCertificate]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 || 0x8000000000000010 || CanGetGameCardIdSet || [[#GetGameCardIdSet]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x8000000000000200 || CanFinalizeGameCardDriver || [[#FinalizeGameCardDriver]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 || 0x8000000000000200 || CanGetGameCardAsicInfo || [[#GetGameCardAsicInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 || 0x8000000000002020 || CanCreateSaveData || [[#CreateSaveDataFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 || 0x8000000000000060 || CanDeleteSaveData || [[#DeleteSaveDataFileSystem]], [[#RegisterSaveDataFileSystemAtomicDeletion]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x8000000000000028 || CanCreateSystemSaveData || [[#CreateSaveDataFileSystemBySystemSaveDataId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x9 || 0x8000000000000020 || CanCreateOthersSystemSaveData || [[#CreateSaveDataFileSystemBySystemSaveDataId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x8000000000004028 || CanDeleteSystemSaveData || [[#DeleteSaveDataFileSystem]], [[#RegisterSaveDataFileSystemAtomicDeletion]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xB || 0x8000000000000060 || CanOpenSaveDataInfoReader || [[#OpenSaveDataInfoReaderBySaveDataSpaceId]], [[#OpenSaveDataInfoReader]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x8000000000004020 || CanOpenSaveDataInfoReaderForSystem || [[#OpenSaveDataInfoReaderBySaveDataSpaceId]], [[#OpenSaveDataInfoReader]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xD || 0x8000000000000040&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000000020000) || CanOpenSaveDataIterator || OpenSaveDataIterator&lt;br /&gt;
|-&lt;br /&gt;
| 0xE || 0x8000000000020000&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000000000400) || CanOpenSaveDataMetaFile || [[#OpenSaveDataMetaFile]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xF || 0x8000000000000400&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000000004060) || CanSetCurrentPosixTime || [[#SetCurrentPosixTime]], [[#SetCurrentPosixTimeWithTimeDifference]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x8000000000004060&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000000080000) || CanReadSaveDataFileSystemExtraData || [[#ReadSaveDataFileSystemExtraData]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 || 0x8000000000080000 || CanSetGlobalAccessLogMode || [[#SetGlobalAccessMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || 0x8000000000080000&amp;lt;br/&amp;gt;([1.0.0-5.1.0] Invalid) || CanSetSpeedEmulationMode || [[#SetSpeedEmulationMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || Invalid&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0xC000000000800000) || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || 0xC000000000800000&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0xC000000001000000) || CanFillBis || [[#CreatePaddingFile]], [[#DeleteAllPaddingFiles]] &lt;br /&gt;
|-&lt;br /&gt;
| 0x15 || 0xC000000001000000&amp;lt;br/&amp;gt;([5.0.0-5.1.0] 0x8000000001000060)&amp;lt;br/&amp;gt;([1.0.0-4.1.0] 0xC000000002000000) || CanCorruptSaveData || [[#CorruptSaveDataFileSystem]], [[#CorruptSaveDataFileSystemBySaveDataSpaceId]]&lt;br /&gt;
|-&lt;br /&gt;
| [2.0.0+] 0x16 || 0x8000000001000060&amp;lt;br/&amp;gt;([5.0.0-5.1.0] 0x8000000000000060)&amp;lt;br/&amp;gt;([1.0.0-4.1.0] 0x8000000004000000) || CanCorruptSystemSaveData || [[#CorruptSaveDataFileSystem]], [[#CorruptSaveDataFileSystemBySaveDataSpaceId]]&lt;br /&gt;
|-&lt;br /&gt;
| [2.0.0+] 0x17 || 0x8000000000000060&amp;lt;br/&amp;gt;([5.0.0-5.1.0] 0xC000000002000000)&amp;lt;br/&amp;gt;([1.0.0-4.1.0] 0x8000000008000000) || CanVerifySaveData || [[#VerifySaveDataFileSystem]], [[#VerifySaveDataFileSystemBySaveDataSpaceId]]&lt;br /&gt;
|-&lt;br /&gt;
| [2.0.0+] 0x18 || 0xC000000002000000&amp;lt;br/&amp;gt;([5.0.0-5.1.0] 0x8000000004000000)&amp;lt;br/&amp;gt;([1.0.0-4.1.0] 0x8000000010000000) || CanDebugSaveData || [[#CreateSaveDataFileSystem]], [[#OpenSaveDataFileSystem]], [[#SetSaveDataRootPath]]&lt;br /&gt;
|-&lt;br /&gt;
| [2.0.0+] 0x19 || 0x8000000004000000&amp;lt;br/&amp;gt;([5.0.0-5.1.0] 0x8000000008000000)&amp;lt;br/&amp;gt;([1.0.0-4.1.0] 0x8000000000000800) || CanFormatSdCard || [[#FormatSdCardFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| [2.0.0+] 0x1A || 0x8000000008000000&amp;lt;br/&amp;gt;([5.0.0-5.1.0] 0x8000000010000000)&amp;lt;br/&amp;gt;([1.0.0-4.1.0] 0x8000000000004020) || CanGetRightsId || [[#GetRightsId]], [[#GetRightsIdAndKeyGenerationByPath]], [[#GetRightsIdByPath]]&lt;br /&gt;
|-&lt;br /&gt;
| [3.0.0+] 0x1B || 0x8000000010000000&amp;lt;br/&amp;gt;([5.0.0-5.1.0] 0x8000000000000800)&amp;lt;br/&amp;gt;([1.0.0-4.1.0] 0x8000000000002020) || CanRegisterExternalKey || [[#RegisterExternalKey]], [[#UnregisterAllExternalKey]]&lt;br /&gt;
|-&lt;br /&gt;
| [3.0.0+] 0x1C || 0x8000000000000800&amp;lt;br/&amp;gt;([5.0.0-5.1.0] 0x8000000000004020)&amp;lt;br/&amp;gt;([1.0.0-4.1.0] 0x8000000000000028) || CanSetEncryptionSeed || [[#SetSdCardEncryptionSeed]]&lt;br /&gt;
|-&lt;br /&gt;
| [4.0.0+] 0x1D || 0x8000000000000020&amp;lt;br/&amp;gt;([5.0.0-5.1.0] 0x8000000000000000)&amp;lt;br/&amp;gt;([1.0.0-4.1.0] 0x8000000020000000) || SaveDataExtraData_Write0 || [[#WriteSaveDataFileSystemExtraData]], [[#WriteSaveDataFileSystemExtraData2]]&lt;br /&gt;
|-&lt;br /&gt;
| [4.0.0+] 0x1E || 0x8000000000004020&amp;lt;br/&amp;gt;([5.0.0-5.1.0] 0x8000000000002020)&amp;lt;br/&amp;gt;([1.0.0-4.1.0] 0x8000000040000000) || CanWriteSaveDataFileSystemExtraDataFlags || [[#WriteSaveDataFileSystemExtraData]], [[#WriteSaveDataFileSystemExtraData2]]&lt;br /&gt;
|-&lt;br /&gt;
| [4.0.0+] 0x1F || 0x8000000000000020&amp;lt;br/&amp;gt;([5.0.0-5.1.0] 0x8000000000000028)&amp;lt;br/&amp;gt;([1.0.0-4.1.0] 0x8000000000000000) || SaveDataExtraData_Write1 || [[#WriteSaveDataFileSystemExtraData]], [[#WriteSaveDataFileSystemExtraData2]]&lt;br /&gt;
|-&lt;br /&gt;
| [4.0.0+] 0x20 || 0x8000000000000000&amp;lt;br/&amp;gt;([5.0.0-5.1.0] 0x8000000020000000)&amp;lt;br/&amp;gt;([1.0.0-4.1.0] 0x8000000000000000) || CanWriteSaveDataFileSystemExtraDataAll || [[#WriteSaveDataFileSystemExtraData]], [[#WriteSaveDataFileSystemExtraData2]]&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 0x21 || 0x8000000000002020&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000040000000) || CanExtendSaveData || [[#ExtendSaveDataFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 0x22 || 0x8000000000000028&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x0000000080000002) || CanExtendSystemSaveData || [[#ExtendSaveDataFileSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 0x23 || 0x8000000020000000&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000000000000) || CanRegisterUpdatePartition || [[#RegisterUpdatePartition]]&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 0x24 || 0x8000000040000000&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000000000000) || CanOpenSaveDataTransferManager || [[#OpenSaveDataTransferManager]]&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 0x25 || 0x8000000200000000&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000080200000) || CanOpenSaveDataTransferManagerVersion2 || [[#OpenSaveDataTransferManagerVersion2]]&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 0x26 || 0x8000000200002000&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000080000110) || CanOpenSaveDataTransferProhibiterForCloudBackUp || [[#OpenSaveDataTransferProhibiterForCloudBackUp]]&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 0x27 || 0x8000000240002000 &amp;lt;br/&amp;gt;([6.0.0-7.0.1] 0x8000000200002000)&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000000100008) || CanListApplicationAccessibleSaveDataOwnerId || ListApplicationAccessibleSaveDataOwnerId&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 0x28 || 0x8000000000000000&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000080010000) || CanControlMmcPatrol || [[#SuspendMmcPatrol]], [[#ResumeMmcPatrol]]&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 0x29 || 0x8000000000000000&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x0000000080000001) || CanOverrideSaveDataTransferTokenSignVerificationKey || [[#OverrideSaveDataTransferTokenSignVerificationKey]]&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 0x2A || 0x8000000080200000&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x0000000080000001) || CanOpenSdCardDetectionEventNotifier || [[#OpenSdCardDetectionEventNotifier]]&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 0x2B || 0x8000000080000110&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x0000000080000001) || CanOpenGameCardDetectionEventNotifier || [[#OpenGameCardDetectionEventNotifier]]&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 0x2C || 0x8000000000100008&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x0000000080000001) || CanOpenSystemDataUpdateEventNotifier || [[#OpenSystemDataUpdateEventNotifier]]&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 0x2D || 0x8000000000010000&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x0000000080000001) || CanNotifySystemDataUpdateEvent || [[#NotifySystemDataUpdateEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 0x2E || 0x8000000100000000&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000040000000) || CanOpenAccessFailureDetectionEventNotifier || [[#OpenAccessFailureResolver]]&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 0x2F || 0x8000000100000000&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000080200000) || CanGetAccessFailureDetectionEvent || [[#GetAccessFailureDetectionEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| [5.1.0+] 0x30 || 0x8000000100000000&amp;lt;br/&amp;gt;([1.0.0-5.1.0] 0x8000000080080000) || CanIsAccessFailureDetected || [[#IsAccessFailureDetected]] &lt;br /&gt;
|-&lt;br /&gt;
| [6.0.0+] 0x31 || 0x8000000100000000 || CanResolveAccessFailure || [[#ResolveAccessFailure]]&lt;br /&gt;
|-&lt;br /&gt;
| [6.0.0+] 0x32 || 0x8000000100000000 || CanAbandonAccessFailure || [[#AbandonAccessFailure]]&lt;br /&gt;
|-&lt;br /&gt;
| [6.0.0+] 0x33 || 0x8000000040000000 || CanQuerySaveDataInternalStorageTotalSize || [[#QuerySaveDataInternalStorageTotalSize]]&lt;br /&gt;
|-&lt;br /&gt;
| [6.0.0+] 0x34 || 0x8000000200000020 || CanGetSaveDataCommitId || [[#GetSaveDataCommitId]]&lt;br /&gt;
|-&lt;br /&gt;
| [6.0.0+] 0x35 || 0x8000000000200000 || CanSetSdCardAccessibility || [[#SetSdCardAccessibility]]&lt;br /&gt;
|-&lt;br /&gt;
| [6.0.0+] 0x36 || 0x4000000000000000 || CanSimulateGameCardDetectionEvent || SimulateGameCardDetectionEvent, SetSimulationEvent, ClearSimulationEvent&lt;br /&gt;
|-&lt;br /&gt;
| [6.0.0+] 0x37 || 0x8000000000000000&amp;lt;br/&amp;gt;([6.0.0-6.2.0] 0x8000000000080000) || CanSetDataStorageRedirectTarget || SetDataStorageRedirectTarget&lt;br /&gt;
|-&lt;br /&gt;
| [6.0.0+] 0x38 || 0x8000000400000000&amp;lt;br/&amp;gt;([6.0.0-6.2.0] 0x8000000000000000) || || [[#CreateSaveDataFileSystem]], CreateSaveDataFileSystemByHashSalt&lt;br /&gt;
|-&lt;br /&gt;
| [8.0.0+] 0x39 || 0x8000000000000010 || CanChallengeCardExistence || ChallengeCardExistence&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== OpenFileSystem ==&lt;br /&gt;
Takes a type-0x19 input buffer (ContentPath) and a [[#FileSystemType]] as parameters. Returns an [[#IFileSystem]].&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] This function was removed.&lt;br /&gt;
&lt;br /&gt;
== SetCurrentProcess ==&lt;br /&gt;
Takes a pid-descriptor.&lt;br /&gt;
&lt;br /&gt;
== OpenFileSystemWithPatch ==&lt;br /&gt;
Takes an input [[#FileSystemType]] and an u64 title-id. Returns an [[#IFileSystem]].&lt;br /&gt;
&lt;br /&gt;
Web-applet loads the [[#FileSystemType]] (which must be &#039;&#039;&#039;ContentManual&#039;&#039;&#039;) from u32_table[inparam].&lt;br /&gt;
&lt;br /&gt;
Note: web-applet strings refer to both this cmd and [[#OpenFileSystemWithId]] as &amp;quot;MountContent&amp;quot;, but official nn_sf_sync symbols use &amp;quot;OpenXX&amp;quot; names.&lt;br /&gt;
&lt;br /&gt;
== OpenFileSystemWithId ==&lt;br /&gt;
Takes a type-0x19 input buffer, an [[#FileSystemType]] and an u64 title-id. Returns an [[#IFileSystem]].&lt;br /&gt;
&lt;br /&gt;
The [[#IFileSystem]] must be &#039;&#039;&#039;ContentMeta&#039;&#039;&#039; if the NCA type is 0 (control).&lt;br /&gt;
&lt;br /&gt;
The input buffer is the output string path from [[NS_Services#GetApplicationContentPath|GetApplicationContentPath]].&lt;br /&gt;
&lt;br /&gt;
May return errors when attempting to access NCA-paths for an update-title with a gamecard, when the gamecard isn&#039;t inserted. May return error 0x7D402 in some cases with update-titles. Non-val2 in32 values with NCA-type1 are unusable, even for normal titles.&lt;br /&gt;
&lt;br /&gt;
The official &amp;quot;MountApplicationPackage&amp;quot; func uses this with in64=0 and [[#FileSystemType]] &#039;&#039;&#039;ApplicationPackage&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the [[#FileSystemType]] specific permissions are checked, it then gets the func retval for permissions-type 0x25 and func0.&lt;br /&gt;
&lt;br /&gt;
When [[#FileSystemType]] is &#039;&#039;&#039;ContentMeta&#039;&#039;&#039;, it uses in64=0xffffffffffffffff internally, otherwise it checks if in64 is set to 0xffffffffffffffff then throws an error if so. When the in64 used internally is not 0xffffffffffffffff, it&#039;s compared with the NCA titleID, then an error is thrown on mismatch.&lt;br /&gt;
&lt;br /&gt;
== OpenBisFileSystem ==&lt;br /&gt;
Takes a type-0x19 input buffer string and a u32 [[Flash_Filesystem|Bis partitionID]]. Official user-process code sets instr[0] = 0 normally. Returns an [[#IFileSystem]].&lt;br /&gt;
&lt;br /&gt;
Only partitionIDs for FAT partitions are usable with this, otherwise error 0x2EE202 is returned. Seems to be about the same as [[#OpenBisStorage]] except this mounts the partition filesystem instead of allowing direct access to the partition sectors.&lt;br /&gt;
&lt;br /&gt;
== OpenBisStorage ==&lt;br /&gt;
Takes a u32 partition ID, returns 0x2EE202 for partitions which do not exist, 0x320002 for partitions which cannot be opened and a valid [[#IStorage]] handle otherwise.&lt;br /&gt;
&lt;br /&gt;
== InvalidateBisCache ==&lt;br /&gt;
Seems to invalidate the Bis cache for MBR/GPT after overwriting that data via the OpenBisStorage IStorage. Used by [[SystemInitializer]].&lt;br /&gt;
&lt;br /&gt;
== DeleteSaveDataFileSystem ==&lt;br /&gt;
Takes an input u64.&lt;br /&gt;
&lt;br /&gt;
== CreateSaveDataFileSystem ==&lt;br /&gt;
Takes a 0x40-byte Save-struct entry, a 0x40-byte SaveCreate-struct entry, and a 0x10-byte input struct.&lt;br /&gt;
&lt;br /&gt;
Only the first 0x5-bytes in the 0x10-byte struct are initialized: all-zero when automatically creating savedata during savecommon mount by official user-processes. In the dedicated save-creation code in official user-processes: +0 u32 = 0x40060, +4 u8 = 1.&lt;br /&gt;
&lt;br /&gt;
Creates regular savedata.&lt;br /&gt;
&lt;br /&gt;
== CreateSaveDataFileSystemBySystemSaveDataId ==&lt;br /&gt;
Takes a 0x40-byte Save-struct entry and a 0x40-byte SaveCreate-struct entry.&lt;br /&gt;
&lt;br /&gt;
Creates savedata in the SYSTEM [[Flash_Filesystem|NAND]] partition.&lt;br /&gt;
&lt;br /&gt;
== OpenGameCardStorage ==&lt;br /&gt;
Takes two input u32s (gamecard handle, partition ID), and returns an [[#IStorage]] for the [[Gamecard_Format|partition]].&lt;br /&gt;
&lt;br /&gt;
== OpenGameCardFileSystem ==&lt;br /&gt;
Takes two input u32s, with the second u32 located at +4 in rawdata after the first u32. Returns an [[#IFileSystem]].&lt;br /&gt;
&lt;br /&gt;
Mounts a [[Gamecard_Partition|gamecard partition]].&lt;br /&gt;
&lt;br /&gt;
== OpenSaveDataFileSystem ==&lt;br /&gt;
Takes an input u8 [[#SaveDataSpaceId]] and a 0x40-byte Save-struct entry. Official user-process code is only known to use value 1 for the u8.&lt;br /&gt;
&lt;br /&gt;
Returns an [[#IFileSystem]].&lt;br /&gt;
&lt;br /&gt;
Permissions aren&#039;t checked until the specified save is successfully found.&lt;br /&gt;
&lt;br /&gt;
Only one process (specifically only one [[#IFileSystem]] session) can mount a given savedata at any given time (this includes SystemSaveData).&lt;br /&gt;
&lt;br /&gt;
== OpenSaveDataFileSystemBySystemSaveDataId ==&lt;br /&gt;
Takes an input u8 [[#SaveDataSpaceId]] and a 0x40-byte Save-struct entry. Web-applet only uses value0 for the input u8.&lt;br /&gt;
&lt;br /&gt;
Returns an [[#IFileSystem]].&lt;br /&gt;
&lt;br /&gt;
Mounts savedata in the SYSTEM [[Flash_Filesystem|NAND]] partition.&lt;br /&gt;
&lt;br /&gt;
== ReadSaveDataFileSystemExtraDataBySaveDataSpaceId ==&lt;br /&gt;
Takes an input u8 [[#SaveDataSpaceId]], an input u64 saveID, and a type-0x6 output buffer containing the [[#SaveDataFileSystemExtraData]].&lt;br /&gt;
&lt;br /&gt;
== ReadSaveDataFileSystemExtraData ==&lt;br /&gt;
Takes an input u64 saveID and a type-0x6 output buffer containing the [[#SaveDataFileSystemExtraData]].&lt;br /&gt;
&lt;br /&gt;
== OpenSaveDataInfoReader ==&lt;br /&gt;
No input, returns an output [[#ISaveDataInfoReader]].&lt;br /&gt;
&lt;br /&gt;
== OpenSaveDataInfoReaderBySaveDataSpaceId ==&lt;br /&gt;
Takes an input u8 [[#SaveDataSpaceId]], returns an output [[#ISaveDataInfoReader]].&lt;br /&gt;
&lt;br /&gt;
== OpenContentStorageFileSystem ==&lt;br /&gt;
Takes a [[#ContentStorageId]]. Invalid values return 0x2EE202.&lt;br /&gt;
&lt;br /&gt;
Returns an [[#IFileSystem]] with NCA files. The read data from these files is identical to the data read by [[NCM_services#ReadContentIdFile]].&lt;br /&gt;
&lt;br /&gt;
== OpenDataStorageByDataId ==&lt;br /&gt;
Takes a [[#StorageId]] and a TitleID.&lt;br /&gt;
&lt;br /&gt;
Returns a [[IPC_Marshalling#Domain_message|domain object ID]] implementing the [[#IStorage]] interface for data archives.&lt;br /&gt;
&lt;br /&gt;
== OpenDeviceOperator ==&lt;br /&gt;
This command returns a session to a port implementing the [[#IDeviceOperator]] interface.&lt;br /&gt;
&lt;br /&gt;
== OpenSdCardDetectionEventNotifier ==&lt;br /&gt;
This command returns a session to a port implementing the [[#IEventNotifier]] interface.&lt;br /&gt;
&lt;br /&gt;
== OpenGameCardDetectionEventNotifier ==&lt;br /&gt;
This command returns a session to a port implementing the [[#IEventNotifier]] interface.&lt;br /&gt;
&lt;br /&gt;
== VerifySaveDataFileSystem ==&lt;br /&gt;
Takes an unknown input u64 and a type-0x6 output buffer.&lt;br /&gt;
&lt;br /&gt;
The input u64 high-byte must be non-zero, otherwise an [[Error_codes|error]] is returned(0xE02).&lt;br /&gt;
&lt;br /&gt;
== GetSaveDataCommitId ==&lt;br /&gt;
Takes an input u8 and u64, returns an output u64.&lt;br /&gt;
&lt;br /&gt;
== SetSdCardEncryptionSeed ==&lt;br /&gt;
Takes in the 0x10 byte SD card encryption seed, and loads it into FS-module state.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]]-module reads the 0x10 bytes from SdCard:/Nintendo/Contents/private, and compares them to the first 0x10 bytes of the ns_appman:/private (in [[Flash_Filesystem#System_Savegames|system savedata]] 0x8000000000000043). If they match, NS calls this command using bytes 0x10-0x20 from ns_appman:/private. The rest of this file (0x1F0 bytes total) is (usually/always?) all-zero (however in some cases the byte at offset 0x20 is value 0x1).&lt;br /&gt;
&lt;br /&gt;
== OpenAccessFailureResolver ==&lt;br /&gt;
Takes 8-bytes of input and returns an [[#IEventNotifier]].&lt;br /&gt;
&lt;br /&gt;
[8.0.0+] Now takes an additional 8-bytes of input.&lt;br /&gt;
&lt;br /&gt;
== SetSaveDataSize ==&lt;br /&gt;
Takes two input u64s &amp;quot;size&amp;quot; and &amp;quot;journal_size&amp;quot;, and writes them to fsp-srv object member variables.&lt;br /&gt;
&lt;br /&gt;
These variables are normally initialized with 32 MiB (0x2000000) and 16 MiB (0x1000000), respectively.&lt;br /&gt;
&lt;br /&gt;
These variables don&#039;t seem to be actually used anywhere else (?)&lt;br /&gt;
&lt;br /&gt;
== SetSaveDataRootPath ==&lt;br /&gt;
Takes an input path, and does snprintf(&amp;lt;fsp-srv object&amp;gt;-&amp;gt;m_save_data_root_path, FS_MAX_PATH-1, &amp;quot;/%s&amp;quot;, input_path);&lt;br /&gt;
&lt;br /&gt;
This path is normally all-zero. When this path is non-zero, the internal OpenSaveDataFileSystem function will create a DirectorySaveDataFileSystem if the target save is a user-save + a directory exists, instead of the normal savedata filesystem object.&lt;br /&gt;
&lt;br /&gt;
== SetGlobalAccessLogMode ==&lt;br /&gt;
Takes an input u32.&lt;br /&gt;
&lt;br /&gt;
== SetGlobalAccessLogMode ==&lt;br /&gt;
Takes an input u32.&lt;br /&gt;
&lt;br /&gt;
== GetGlobalAccessLogMode ==&lt;br /&gt;
Returns an output u32.&lt;br /&gt;
&lt;br /&gt;
GlobalAccessLogMode is normally 0.&lt;br /&gt;
&lt;br /&gt;
== OutputAccessLogToSdCard ==&lt;br /&gt;
Takes a type-0x5 input buffer.&lt;br /&gt;
&lt;br /&gt;
The input buffer is the string to output to the log. User-processes normally include a newline at the end.&lt;br /&gt;
&lt;br /&gt;
User-processes only use this when the value previously loaded from [[#GetGlobalAccessLogMode]] has bit1 set.&lt;br /&gt;
&lt;br /&gt;
When bit1 in GlobalAccessLogMode is clear, FS-module will just return 0 for OutputAccessLogToSdCard. However even with that set the log doesn&#039;t show up SD, unknown why.&lt;br /&gt;
&lt;br /&gt;
The input buffer is written to the &amp;quot;$FsAccessLog:/FsAccessLog.txt&amp;quot; file, where &amp;quot;$FsAccessLog&amp;quot; is the SD-card mount-name. It&#039;s written to the current end of the file(appended).&lt;br /&gt;
&lt;br /&gt;
= IStorage =&lt;br /&gt;
This is &amp;quot;nn::fssrv::sf::IStorage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This is the interface for a raw device, usually a block device.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Read || Takes a type-0x46 buffer, an offset and length &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Write || Takes a type-0x45 buffer, an offset and length &lt;br /&gt;
|-&lt;br /&gt;
| 2 || Flush || None&lt;br /&gt;
|-&lt;br /&gt;
| 3 || SetSize || Takes a size&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetSize || None&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [4.0.0+] OperateRange ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= IFileSystem =&lt;br /&gt;
This is &amp;quot;nn::fssrv::sf::IFileSystem&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
There are two main implementations of this interface:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;RomFS&#039;&#039;&#039;: Filesystem implementation statically linked in the binary. Uses an [[#IStorage]] interface as underlying raw device.&lt;br /&gt;
* &#039;&#039;&#039;IPC proxy&#039;&#039;&#039;: Used for all non-RomFS filesystems. In this case, actual filesystem implementation is in the FS process.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CreateFile&lt;br /&gt;
|-&lt;br /&gt;
| 1 || DeleteFile&lt;br /&gt;
|-&lt;br /&gt;
| 2 || CreateDirectory&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DeleteDirectory&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeleteDirectoryRecursively&lt;br /&gt;
|-&lt;br /&gt;
| 5 || RenameFile&lt;br /&gt;
|-&lt;br /&gt;
| 6 || RenameDirectory&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#GetEntryType]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#OpenFile]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#OpenDirectory]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#Commit]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#GetFreeSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#GetTotalSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [3.0.0+] [[#CleanDirectoryRecursively]]&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [3.0.0+] [[#GetFileTimeStampRaw]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [4.0.0+] QueryEntry&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== GetEntryType ==&lt;br /&gt;
Takes a type-0x9 input buffer for the path and returns [[#DirectoryEntryType]] as an output u32.&lt;br /&gt;
&lt;br /&gt;
== OpenFile ==&lt;br /&gt;
Takes a type-0x19 input buffer for the path, and an u32 &#039;&#039;&#039;mode&#039;&#039;&#039;. &#039;&#039;&#039;mode&#039;&#039;&#039; controls how the file is opened, based on which bits are set:&lt;br /&gt;
&lt;br /&gt;
* When bit 0 is set, the file is Readable: you can use the Read operation.&lt;br /&gt;
* When bit 1 is set, the file is Writable: you can use the Write operation.&lt;br /&gt;
* When bit 2 is set, the file is Appendable: unless this bit is set, you will not be able to write beyond the end of a file (such writes will result in an error 0x307202)&lt;br /&gt;
&lt;br /&gt;
== OpenDirectory ==&lt;br /&gt;
Takes a type-0x9 input buffer for the path and an u64 &#039;&#039;&#039;filter_flags&#039;&#039;&#039;. &#039;&#039;&#039;filter_flags&#039;&#039;&#039; controls what type of entries are read by the [[#IDirectory]]: bitmask 0x1 = directories, bitmask 0x2 = files.&lt;br /&gt;
&lt;br /&gt;
== Commit ==&lt;br /&gt;
Like [https://3dbrew.org/wiki/FS:ControlArchive 3DS], this has to be used after writing to savedata for the changes to take affect.&lt;br /&gt;
&lt;br /&gt;
== GetFreeSpaceSize ==&lt;br /&gt;
Takes a type-0x9 input buffer for the path and returns an output byte-size u64 for the total free space with this FS.&lt;br /&gt;
&lt;br /&gt;
== GetTotalSpaceSize ==&lt;br /&gt;
Takes a type-0x9 input buffer for the path and returns an output byte-size u64 for the total space available with this FS(free+used).&lt;br /&gt;
&lt;br /&gt;
== CleanDirectoryRecursively ==&lt;br /&gt;
Takes a type-0x9 input buffer for the path and clears the contents of the directory specified in the path.&lt;br /&gt;
&lt;br /&gt;
== GetFileTimeStampRaw ==&lt;br /&gt;
Takes a type-0x19 input buffer for the path and returns a 0x20-byte struct. This contains 3 u64s and an u8.&lt;br /&gt;
&lt;br /&gt;
= IDirectory =&lt;br /&gt;
This is &amp;quot;nn::fssrv::sf::IDirectory&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Read]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetEntryCount]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Read ==&lt;br /&gt;
Takes a type-0x6 output buffer. Returns an output u64(?) for the total number of read entries, this is 0 when no more entries are available.&lt;br /&gt;
&lt;br /&gt;
The output buffer contains the read array of [[#DirectoryEntry]]. This doesn&#039;t include entries for &amp;quot;.&amp;quot; and &amp;quot;..&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== GetEntryCount ==&lt;br /&gt;
Returns an u64 for the total number of readable entries.&lt;br /&gt;
&lt;br /&gt;
= DirectoryEntry =&lt;br /&gt;
This is &amp;quot;nn::fs::DirectoryEntry&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x301 || Path&lt;br /&gt;
|-&lt;br /&gt;
| 0x301 || 0x1 || File attributes (bit 0 = is directory; bit 1 = archive bit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x302 || 0x2 || Padding?&lt;br /&gt;
|-&lt;br /&gt;
| 0x304 || 0x1 || [[#DirectoryEntryType]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x305 || 0x3 || Padding?&lt;br /&gt;
|-&lt;br /&gt;
| 0x308 || 0x8 || Filesize, 0 for directories.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= DirectoryEntryType =&lt;br /&gt;
This is &amp;quot;nn::fs::DirectoryEntryType&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
An s8 value indicating a directory entry type. The current values are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Directory&lt;br /&gt;
|-&lt;br /&gt;
| 1 || File&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= IFile =&lt;br /&gt;
This is &amp;quot;nn::fssrv::sf::IFile&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Read&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Write&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Flush&lt;br /&gt;
|-&lt;br /&gt;
| 3 || SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetSize&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [4.0.0+] OperateRange&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ISaveDataInfoReader =&lt;br /&gt;
This is &amp;quot;nn::fssrv::sf::ISaveDataInfoReader&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ReadSaveDataInfo]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ReadSaveDataInfo ==&lt;br /&gt;
Takes a type-0x6 output buffer. Returns an output u64 for total output entries. This buffer contains an array of [[#SaveDataInfo]].&lt;br /&gt;
&lt;br /&gt;
This is used to get [[#SaveDataInfo]] for all savedata on the system (or all savedata for the current [[#SaveDataSpaceId]]). When used multiple times, it will resume reading where it left off, until no more entries are available (in that case the out u64 is value 0).&lt;br /&gt;
&lt;br /&gt;
= IDeviceOperator =&lt;br /&gt;
This is &amp;quot;nn::fssrv::sf::IDeviceOperator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IsSdCardInserted&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetSdCardSpeedMode&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [2.0.0+] GetSdCardCid&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [2.0.0+] GetSdCardUserAreaSize&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [2.0.0+] GetSdCardProtectedAreaSize&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [2.0.0+] GetAndClearSdCardErrorInfo&lt;br /&gt;
|-&lt;br /&gt;
| 100 || GetMmcCid&lt;br /&gt;
|-&lt;br /&gt;
| 101 || GetMmcSpeedMode&lt;br /&gt;
|-&lt;br /&gt;
| 110 || EraseMmc&lt;br /&gt;
|-&lt;br /&gt;
| 111 || GetMmcPartitionSize&lt;br /&gt;
|-&lt;br /&gt;
| 112 || [2.0.0+] GetMmcPatrolCount&lt;br /&gt;
|-&lt;br /&gt;
| 113 || [2.0.0+] GetAndClearMmcErrorInfo&lt;br /&gt;
|-&lt;br /&gt;
| 114 || [2.0.0+] GetMmcExtendedCsd&lt;br /&gt;
|-&lt;br /&gt;
| 115 || [4.0.0+] SuspendMmcPatrol&lt;br /&gt;
|-&lt;br /&gt;
| 116 || [4.0.0+] ResumeMmcPatrol&lt;br /&gt;
|-&lt;br /&gt;
| 200 || IsGameCardInserted&lt;br /&gt;
|-&lt;br /&gt;
| 201 || EraseGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 202 || GetGameCardHandle&lt;br /&gt;
|-&lt;br /&gt;
| 203 || [[#GetGameCardUpdatePartitionInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 204 || FinalizeGameCardDriver&lt;br /&gt;
|-&lt;br /&gt;
| 205 || GetGameCardAttribute&lt;br /&gt;
|-&lt;br /&gt;
| 206 || GetGameCardDeviceCertificate&lt;br /&gt;
|-&lt;br /&gt;
| 207 || GetGameCardAsicInfo&lt;br /&gt;
|-&lt;br /&gt;
| 208 || GetGameCardIdSet&lt;br /&gt;
|-&lt;br /&gt;
| 209 || WriteToGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 210 || SetVerifyWriteEnalbleFlag&lt;br /&gt;
|-&lt;br /&gt;
| 211 || GetGameCardImageHash&lt;br /&gt;
|-&lt;br /&gt;
| 212 || [2.0.0+] GetGameCardDeviceIdForProdCard&lt;br /&gt;
|-&lt;br /&gt;
| 213 || [2.0.0+] EraseAndWriteParamDirectly&lt;br /&gt;
|-&lt;br /&gt;
| 214 || [2.0.0+] ReadParamDirectly&lt;br /&gt;
|-&lt;br /&gt;
| 215 || [2.0.0+] ForceEraseGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 216 || [2.0.0+] GetGameCardErrorInfo&lt;br /&gt;
|-&lt;br /&gt;
| 217 || [2.1.0+] GetGameCardErrorReportInfo&lt;br /&gt;
|-&lt;br /&gt;
| 218 || [3.0.0+] GetGameCardDeviceId&lt;br /&gt;
|-&lt;br /&gt;
| 219 || [8.0.0+] ChallengeCardExistence&lt;br /&gt;
|-&lt;br /&gt;
| 300 || SetSpeedEmulationMode&lt;br /&gt;
|-&lt;br /&gt;
| 301 || GetSpeedEmulationMode&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [5.0.0+] SuspendSdmmcControl&lt;br /&gt;
|-&lt;br /&gt;
| 401 || [5.0.0+] ResumeSdmmcControl&lt;br /&gt;
|-&lt;br /&gt;
| 402 || [6.0.0+] GetSdmmcConnectionStatus (Takes a total of 4-bytes of input, returns a total of 8-bytes of output)&lt;br /&gt;
|-&lt;br /&gt;
| 500 || [6.0.0+] SetSimulationEvent (Takes a total of 0x14-bytes of input, no output)&lt;br /&gt;
|-&lt;br /&gt;
| 501 || [6.0.0+] ClearSimulationEvent (Takes a total of 4-bytes of input, no output)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== GetGameCardUpdatePartitionInfo ==&lt;br /&gt;
Returns a titleID and the title-version for it.&lt;br /&gt;
&lt;br /&gt;
* Output u32 with ARMS-gamecard: title-version v131162. This is the title-version for [[2.1.0]], which is the sysupdate included with this gamecard. Launch-day gamecards return title-version v450.&lt;br /&gt;
* Output u64 with ARMS-gamecard: titleID 0100000000000816.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] appears to only use this with [[Content_Manager_services#GetTitleIdInfo]] and [[Content_Manager_services#GetUpdateTitleList]] with storageid=nandsys, for checking whether a sysupdate is required.&lt;br /&gt;
&lt;br /&gt;
= IEventNotifier =&lt;br /&gt;
This is &amp;quot;nn::fssrv::sf::IEventNotifier&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetEventHandle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ISaveDataTransferManager =&lt;br /&gt;
This is &amp;quot;nn::fssrv::sf::ISaveDataTransferManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetChallenge]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [[#SetToken]]&lt;br /&gt;
|-&lt;br /&gt;
| 32 || [[#OpenSaveDataExporter]]&lt;br /&gt;
|-&lt;br /&gt;
| 64 || [[#OpenSaveDataImporter]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This was added with [[4.0.0]].&lt;br /&gt;
&lt;br /&gt;
== GetChallenge ==&lt;br /&gt;
No input/output, takes a type-0x6 output buffer.&lt;br /&gt;
&lt;br /&gt;
== SetToken ==&lt;br /&gt;
No input/output, takes a type-0x5 input buffer.&lt;br /&gt;
&lt;br /&gt;
== OpenSaveDataExporter ==&lt;br /&gt;
Takes an input u8 [[#SaveDataSpaceId]] and u64, returns an [[#ISaveDataExporter]].&lt;br /&gt;
&lt;br /&gt;
== OpenSaveDataImporter ==&lt;br /&gt;
Takes an input u8 [[#SaveDataSpaceId]] and a 0x10-byte userID, and a type-0x5 input buffer. Returns an output u64 and an [[#ISaveDataImporter]].&lt;br /&gt;
&lt;br /&gt;
= ISaveDataExporter =&lt;br /&gt;
This is &amp;quot;nn::fssrv::sf::ISaveDataExporter&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetRestSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [[#Pull]]&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [[#PullInitialData]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This was added with [[4.0.0]].&lt;br /&gt;
&lt;br /&gt;
== Initialize ==&lt;br /&gt;
No input/output, takes a type-0x1A [[#SaveDataInfo]] output buffer.&lt;br /&gt;
&lt;br /&gt;
The actual name for this is the SaveDataExporter constructor. This is used automatically after [[#OpenSaveDataExporter]] by official sw.&lt;br /&gt;
&lt;br /&gt;
== GetRestSize ==&lt;br /&gt;
No input, returns an output u64.&lt;br /&gt;
&lt;br /&gt;
== Pull ==&lt;br /&gt;
Takes a type-0x6 output buffer, returns an output u64.&lt;br /&gt;
&lt;br /&gt;
== PullInitialData ==&lt;br /&gt;
No input/output, takes a type-0x6 output buffer.&lt;br /&gt;
&lt;br /&gt;
= ISaveDataImporter =&lt;br /&gt;
This is &amp;quot;nn::fssrv::sf::ISaveDataImporter&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetRestSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [[#Push]]&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [[#Finalize]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This was added with [[4.0.0]].&lt;br /&gt;
&lt;br /&gt;
== Initialize ==&lt;br /&gt;
No input/output, takes a type-0x1A [[#SaveDataInfo]] output buffer.&lt;br /&gt;
&lt;br /&gt;
The actual name for this is the SaveDataImporter constructor. This is used automatically after [[#OpenSaveDataImporter]] by official sw.&lt;br /&gt;
&lt;br /&gt;
== GetRestSize ==&lt;br /&gt;
No input, returns an output u64.&lt;br /&gt;
&lt;br /&gt;
== Push ==&lt;br /&gt;
No input/output, takes a type-0x5 input buffer.&lt;br /&gt;
&lt;br /&gt;
== Finalize ==&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
= ISaveDataTransferManagerWithDivision =&lt;br /&gt;
This is &amp;quot;nn::fssrv::sf::ISaveDataTransferManagerWithDivision&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetChallenge]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [[#SetKeySeedPackage]]&lt;br /&gt;
|-&lt;br /&gt;
| 32 || [[#OpenSaveDataFullExporter]]&lt;br /&gt;
|-&lt;br /&gt;
| 33 || [[#OpenSaveDataDiffExporter]]&lt;br /&gt;
|-&lt;br /&gt;
| 34 || [6.0.0+] [[#OpenSaveDataExporterByContext]]&lt;br /&gt;
|-&lt;br /&gt;
| 64 || [[#OpenSaveDataFullImporter]]&lt;br /&gt;
|-&lt;br /&gt;
| 65 || [[#OpenSaveDataDiffImporter]]&lt;br /&gt;
|-&lt;br /&gt;
| 66 || [6.0.0+] [[#OpenSaveDataDuplicateDiffImporter]]&lt;br /&gt;
|-&lt;br /&gt;
| 67 || [6.0.0+] [[#OpenSaveDataImporter]]&lt;br /&gt;
|-&lt;br /&gt;
| 68 || [6.0.0+] [[#OpenSaveDataImporterByContext]]&lt;br /&gt;
|-&lt;br /&gt;
| 69 || [6.0.0+] [[#CancelSuspendingImport]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This was added with [[5.0.0]].&lt;br /&gt;
&lt;br /&gt;
== GetChallenge ==&lt;br /&gt;
No input/output, takes a type-0x6 output buffer containing the &#039;&#039;&#039;Challenge&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== SetKeySeedPackage ==&lt;br /&gt;
No input/output, takes a type-0x5 input buffer containing the &#039;&#039;&#039;KeySeedPackage&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== OpenSaveDataFullExporter ==&lt;br /&gt;
Takes an input u8 [[#SaveDataSpaceId]] and u64. Returns an [[#ISaveDataDivisionExporter]].&lt;br /&gt;
&lt;br /&gt;
== OpenSaveDataDiffExporter ==&lt;br /&gt;
Takes an input u8 [[#SaveDataSpaceId]], an u64, and a type-0x5 input buffer [[#InitialDataVersion2]]. Returns an [[#ISaveDataDivisionExporter]].&lt;br /&gt;
&lt;br /&gt;
== OpenSaveDataExporterByContext ==&lt;br /&gt;
No input/output, takes a type-0x5 input buffer, returns an [[#ISaveDataDivisionExporter]].&lt;br /&gt;
&lt;br /&gt;
== OpenSaveDataFullImporter ==&lt;br /&gt;
Takes an input u8 [[#SaveDataSpaceId]], a 0x10-byte userID, and a type-0x5 input buffer [[#InitialDataVersion2]]. Returns an [[#ISaveDataDivisionImporter]].&lt;br /&gt;
&lt;br /&gt;
== OpenSaveDataDiffImporter ==&lt;br /&gt;
Takes an input u8 [[#SaveDataSpaceId]], an u64, and a type-0x5 input buffer [[#InitialDataVersion2]], returns an [[#ISaveDataDivisionImporter]].&lt;br /&gt;
&lt;br /&gt;
== OpenSaveDataDuplicateDiffImporter ==&lt;br /&gt;
Takes an input u8 and an u64, and a type-0x5 input buffer, returns an [[#ISaveDataDivisionImporter]].&lt;br /&gt;
&lt;br /&gt;
== OpenSaveDataImporter ==&lt;br /&gt;
Takes an input u8, an u8(bool), a 0x10-byte struct, and a type-0x5 input buffer, returns an [[#ISaveDataDivisionImporter]].&lt;br /&gt;
&lt;br /&gt;
== OpenSaveDataImporterByContext ==&lt;br /&gt;
No input/output, takes a type-0x5 input buffer, returns an [[#ISaveDataDivisionImporter]].&lt;br /&gt;
&lt;br /&gt;
== CancelSuspendingImport ==&lt;br /&gt;
Takes an input u64 and a 0x10-byte struct, no output.&lt;br /&gt;
&lt;br /&gt;
= ISaveDataDivisionExporter =&lt;br /&gt;
This is &amp;quot;nn::fssrv::sf::ISaveDataDivisionExporter&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || SetDivisionCount (Takes an input u32, no output)&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [6.0.0+] GetSaveDataInfo (No input/output, takes a type-0x6 output buffer)&lt;br /&gt;
|-&lt;br /&gt;
| 16 || OpenSaveDataDiffChunkIterator (No input, returns an [[#ISaveDataChunkIterator]])&lt;br /&gt;
|-&lt;br /&gt;
| 48 || OpenSaveDataChunkExporter (Takes an input u32, returns an [[#ISaveDataChunkExporter]])&lt;br /&gt;
|-&lt;br /&gt;
| 64 || [6.0.0+] FinalizeFullExport (No input, returns two 0x10-byte output structs)&lt;br /&gt;
|-&lt;br /&gt;
| 65 || [6.0.0+] FinalizeDiffExport (No input, returns an output 0x10-byte struct)&lt;br /&gt;
|-&lt;br /&gt;
| 66 || [6.0.0+] CancelExport (No input/output)&lt;br /&gt;
|-&lt;br /&gt;
| 67 || [6.0.0+] SuspendExport (No input/output, takes a type-0x6 output buffer)&lt;br /&gt;
|-&lt;br /&gt;
| 70 || [6.0.0+] GetKeySeed (No input, returns an output 0x10-byte struct)&lt;br /&gt;
|-&lt;br /&gt;
| 71 || [6.0.0+] GetInitialDataMac (No input, returns an output 0x10-byte struct)&lt;br /&gt;
|-&lt;br /&gt;
| 72 || [6.0.0+] FinalizeExport (No input/output)&lt;br /&gt;
|-&lt;br /&gt;
| 80 || [6.0.0+] GetImportInitialDataAad (No input, returns an output 0x20-byte struct)&lt;br /&gt;
|-&lt;br /&gt;
| 81 || [6.0.0+] SetExportInitialDataAad (Takes an input 0x20-byte struct, no output)&lt;br /&gt;
|-&lt;br /&gt;
| 96 || [6.0.0+] GetReportInfo (No input, returns an output 0x20-byte struct)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This was added with [[5.0.0]].&lt;br /&gt;
&lt;br /&gt;
= ISaveDataDivisionImporter =&lt;br /&gt;
This is &amp;quot;nn::fssrv::sf::ISaveDataDivisionImporter&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [6.0.0+] GetSaveDataInfo (No input/output, takes a type-0x6 output buffer)&lt;br /&gt;
|-&lt;br /&gt;
| 16 || OpenSaveDataDiffChunkIterator (No input, returns an [[#ISaveDataChunkIterator]])&lt;br /&gt;
|-&lt;br /&gt;
| 32 || InitializeImport (No input, returns an output u64)&lt;br /&gt;
|-&lt;br /&gt;
| 33 || FinalizeImport (No input/output)&lt;br /&gt;
|-&lt;br /&gt;
| 34 || [6.0.0+] CancelImport (No input/output)&lt;br /&gt;
|-&lt;br /&gt;
| 35 || [6.0.0+] GetImportContext (No input/output, takes a type-0x6 output buffer)&lt;br /&gt;
|-&lt;br /&gt;
| 36 || [6.0.0+] SuspendImport (No input/output)&lt;br /&gt;
|-&lt;br /&gt;
| 48 || OpenSaveDataChunkImporter (Takes an input u32, returns an [[#ISaveDataChunkImporter]])&lt;br /&gt;
|-&lt;br /&gt;
| 64 || [6.0.0+] GetImportInitialDataAad (No input, returns an output 0x20-byte struct)&lt;br /&gt;
|-&lt;br /&gt;
| 80 || [6.0.0+] GetReportInfo (No input, returns an output 0x20-byte struct)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This was added with [[5.0.0]].&lt;br /&gt;
&lt;br /&gt;
= ISaveDataChunkIterator =&lt;br /&gt;
This is &amp;quot;nn::fssrv::sf::ISaveDataChunkIterator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Next (No input/output)&lt;br /&gt;
|-&lt;br /&gt;
| 1 || IsEnd (No input, returns an output u8)&lt;br /&gt;
|-&lt;br /&gt;
| 16 || GetId (No input, returns an output u32)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This was added with [[5.0.0]].&lt;br /&gt;
&lt;br /&gt;
= ISaveDataChunkExporter =&lt;br /&gt;
This is &amp;quot;nn::fssrv::sf::ISaveDataChunkExporter&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Pull (Takes an input u64 and a type-0x6 output buffer, returns an output u64)&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [6.0.0+] GetRestRawDataSize (No input, returns an output u64)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This was added with [[5.0.0]].&lt;br /&gt;
&lt;br /&gt;
= ISaveDataChunkImporter =&lt;br /&gt;
This is &amp;quot;nn::fssrv::sf::ISaveDataChunkImporter&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Push (Takes an input u64 and a type-0x5 input buffer, no output)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This was added with [[5.0.0]].&lt;br /&gt;
&lt;br /&gt;
= ISaveDataTransferProhibiter =&lt;br /&gt;
This was added with [[6.0.0]].&lt;br /&gt;
&lt;br /&gt;
This doesn&#039;t seem to handle any commands (?).&lt;br /&gt;
&lt;br /&gt;
= IMultiCommitManager =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ? (Takes an input [[#IFilesystem]], no output)&lt;br /&gt;
|-&lt;br /&gt;
| 2 || ? (No input/output)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This was added with [[6.0.0]].&lt;br /&gt;
&lt;br /&gt;
= FileSystemType =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Code&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Data&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Logo&lt;br /&gt;
|-&lt;br /&gt;
| 3 || ContentControl&lt;br /&gt;
|-&lt;br /&gt;
| 4 || ContentManual&lt;br /&gt;
|-&lt;br /&gt;
| 5 || ContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 6 || ContentData&lt;br /&gt;
|-&lt;br /&gt;
| 7 || ApplicationPackage&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= StorageId =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Host&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GameCard&lt;br /&gt;
|-&lt;br /&gt;
| 3 || NandSystem&lt;br /&gt;
|-&lt;br /&gt;
| 4 || NandUser&lt;br /&gt;
|-&lt;br /&gt;
| 5 || SdCard&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ContentStorageId =&lt;br /&gt;
This is &amp;quot;nn::fs::ContentStorageId&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || System&lt;br /&gt;
|-&lt;br /&gt;
| 1 || User&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SdCard&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= SaveDataSpaceId =&lt;br /&gt;
This is &amp;quot;nn::fs::SaveDataSpaceId&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || System&lt;br /&gt;
|-&lt;br /&gt;
| 1 || User&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SdSystem&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [3.0.0+] ProperSystem&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Determines the storage where the savedata is stored.&lt;br /&gt;
&lt;br /&gt;
= SaveDataType =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || SystemSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 1 || SaveData&lt;br /&gt;
|-&lt;br /&gt;
| 2 || BcatDeliveryCacheStorage&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DeviceSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [3.0.0+] TemporaryStorage&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [3.0.0+] CacheStorage&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ImageDirectoryId =&lt;br /&gt;
This is &amp;quot;nn::fs::ImageDirectoryId&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Nand&lt;br /&gt;
|-&lt;br /&gt;
| 1 || SdCard&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= CloudBackupWorkStorageId =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Nand&lt;br /&gt;
|-&lt;br /&gt;
| 1 || SdCard&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ContentPath =&lt;br /&gt;
These are the 0x300 paths to NCA files for the various filesystems FS can access, beginning with @. They&#039;re passed via X descriptors, and returned via various [[Location Resolver services|ncm/lr]] commands.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Path || Notes&lt;br /&gt;
|-&lt;br /&gt;
| @SystemContent ||&lt;br /&gt;
|- &lt;br /&gt;
| @UserContent ||&lt;br /&gt;
|-&lt;br /&gt;
| @SdCardContent ||&lt;br /&gt;
|-&lt;br /&gt;
| @CalibFile ||&lt;br /&gt;
|-&lt;br /&gt;
| @Safe ||&lt;br /&gt;
|-&lt;br /&gt;
| @User ||&lt;br /&gt;
|-&lt;br /&gt;
| @System ||&lt;br /&gt;
|-&lt;br /&gt;
| @Sdcard ||&lt;br /&gt;
|-&lt;br /&gt;
| @Host ||&lt;br /&gt;
|-&lt;br /&gt;
| @GcApp || Gamecard App partition (Partition 2)&lt;br /&gt;
|-&lt;br /&gt;
| @GcS00000001 || Gamecard Contents.&lt;br /&gt;
|-&lt;br /&gt;
| @upp || Gamecard update partition (Partition 0)&lt;br /&gt;
|-&lt;br /&gt;
| [4.0.0+] @RegUpdate || Registered update partition&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Save Struct =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0 for SystemSaveData. SaveData: 0 can be used for accessing the savedata associated with the current FS session titleID, otherwise when set this is the titleID associated with the savedata to access.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x10&lt;br /&gt;
| userID for user-specific savedata(saveuser) when set, otherwise when zero this indicates the common savedata(savecommon). This is loaded from [[Account_services]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x8&lt;br /&gt;
| u64 [[Flash_Filesystem|saveID]]. 0 for SaveData.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x1&lt;br /&gt;
| [[#SaveDataType]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x21&lt;br /&gt;
| 0x1&lt;br /&gt;
| Save data &#039;rank&#039; or &#039;precedence&#039;. 0 if this save data is considered the primary save data. 1 if it&#039;s considered the secondary save data.&lt;br /&gt;
|-&lt;br /&gt;
| 0x22&lt;br /&gt;
| 0x2&lt;br /&gt;
| Save data index&lt;br /&gt;
|-&lt;br /&gt;
| 0x24&lt;br /&gt;
| 0x4&lt;br /&gt;
| Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x28&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0 for SystemSaveData/SaveData.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0 for SystemSaveData/SaveData.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0 for SystemSaveData/SaveData.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Total size is 0x40-bytes.&lt;br /&gt;
&lt;br /&gt;
For DeviceSaveData, this struct is all-zero except for the [[#SaveDataType]] field.&lt;br /&gt;
&lt;br /&gt;
= SaveCreate Struct =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| Save data size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Save data journal size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x8&lt;br /&gt;
| Save data block size. 0x4000 for SystemSaveData/SaveData/DeviceSaveData/BcatSaveData.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x8&lt;br /&gt;
| Save data owner id. Official user-processes only uses 0 here for SystemSaveData/SaveData. For the dedicated save-creation code with SaveData/DeviceSaveData, this value comes from an input param with official user-processes. For BcatSaveData, this is the hard-coded [[Title_list|titleID]] of the bcat-sysmodule.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x4&lt;br /&gt;
| Save data flags. Written using an input param for official user-processes. Hard-coded 0 for BcatSaveData.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24&lt;br /&gt;
| 0x1&lt;br /&gt;
| [[#SaveDataSpaceId]]. Official user-processes only uses 0 here for SystemSaveData, 1 for SaveData/DeviceSaveData/BcatSaveData.&lt;br /&gt;
|-&lt;br /&gt;
| 0x25&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown. 0 for SystemSaveData/SaveData.&lt;br /&gt;
|-&lt;br /&gt;
| 0x26&lt;br /&gt;
| 0x1A&lt;br /&gt;
| Not initialized for SystemSaveData/SaveData.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Total size is 0x40-bytes.&lt;br /&gt;
&lt;br /&gt;
= DeviceSaveData =&lt;br /&gt;
This is accessed using the same commands for SaveData with the same input u8, the only difference compared to SaveData is the Save-struct.&lt;br /&gt;
&lt;br /&gt;
= BcatSaveData =&lt;br /&gt;
This is accessed using the same commands for SaveData with the same input u8. The Save-struct is the same as DeviceSaveData, except that the titleID field is set to &amp;lt;input titleID&amp;gt;. See above regarding SaveCreate-struct.&lt;br /&gt;
&lt;br /&gt;
The 0x10-byte struct passed to [[#CreateSaveDataFileSystem]] has the first 0x5-bytes set to all-zero.&lt;br /&gt;
&lt;br /&gt;
= SaveDataInfo =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| Unknown saveID&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x1&lt;br /&gt;
| [[#SaveDataSpaceId]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x9&lt;br /&gt;
| 0x1&lt;br /&gt;
| [[#SaveDataType]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA&lt;br /&gt;
| 0x6&lt;br /&gt;
| Padding?&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x10&lt;br /&gt;
| userID&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x8&lt;br /&gt;
| saveID, 0 for regular SaveData.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28&lt;br /&gt;
| 0x8&lt;br /&gt;
| Application titleID, for regular SaveData.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30&lt;br /&gt;
| 0x8&lt;br /&gt;
| Raw saveimage size&lt;br /&gt;
|-&lt;br /&gt;
| 0x38&lt;br /&gt;
| 0x2&lt;br /&gt;
| Save data index&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A&lt;br /&gt;
| 0x1&lt;br /&gt;
| Save data &#039;rank&#039; or &#039;precedence&#039;. 0 if this save data is considered the primary save data. 1 if it&#039;s considered the secondary save data.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B&lt;br /&gt;
| 0x25&lt;br /&gt;
| Unknown. Usually zeros?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a 0x60-byte struct.&lt;br /&gt;
&lt;br /&gt;
= SaveDataFileSystemExtraData =&lt;br /&gt;
This is a 0x200-byte struct. Appears to match [[Savegames#Extra_data]].&lt;br /&gt;
&lt;br /&gt;
= InitialDataVersion2 =&lt;br /&gt;
This is a 0x8210-byte struct used by [[#ISaveDataTransferManagerWithDivision]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=NCM_services&amp;diff=6833</id>
		<title>NCM services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=NCM_services&amp;diff=6833"/>
		<updated>2019-05-07T03:06:57Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: 8.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NCM contains services for internal file path and content management.&lt;br /&gt;
&lt;br /&gt;
= Location Resolver services =&lt;br /&gt;
== lr ==&lt;br /&gt;
This is &amp;quot;nn::lr::ILocationResolverManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || OpenLocationResolver || [[Filesystem_services#StorageId|StorageID]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || OpenRegisteredLocationResolver || None || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || RefreshLocationResolver || [[Filesystem_services#StorageId|StorageID]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [2.0.0+] OpenAddOnContentLocationResolver || None  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The only sysmodules which use this service are [[Filesystem_services|FS]], [[Loader_services|Loader]], and [[NS_Services|NS]]. [[boot2]] has access but doesn&#039;t use it.&lt;br /&gt;
&lt;br /&gt;
=== ILocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::ILocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ResolveProgramPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#RedirectProgramPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#ResolveApplicationControlPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#ResolveApplicationHtmlDocumentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#ResolveDataPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#RedirectApplicationControlPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#RedirectApplicationHtmlDocumentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#ResolveApplicationLegalInformationPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#RedirectApplicationLegalInformationPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#Refresh]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [5.0.0+] [[#RedirectProgramPath2]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [5.0.0+] [[#Refresh2]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [5.0.0+] [[#DeleteProgramPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [5.0.0+] [[#DeleteApplicationControlPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [5.0.0+] [[#DeleteApplicationHtmlDocumentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [5.0.0+] [[#DeleteApplicationLegalInformationPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [7.0.0+] [[#ResolveProgramPathForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [7.0.0+] [[#RedirectProgramPathForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [7.0.0+] [[#RedirectProgramPath2ForDebug]]&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [7.0.0+] [[#DeleteProgramPathForDebug]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If the supplied [[Filesystem_services#StorageId|StorageID]] is 1 (Host), a different set of internal functions is used to handle these commands. In this more restricted set of functions, GetControlNcaPath is stubbed and only returns error 0x608.&lt;br /&gt;
&lt;br /&gt;
The Get* commands load the [[Filesystem_services|ContentPath]] from linked-lists&#039; [[#Location_List_Entry|entries]] in memory using the input TitleID. When the command fails to find an entry for the specified TitleID, 0x408 is returned for GetProgramNcaPath and 0xA08 is returned for the rest.&lt;br /&gt;
&lt;br /&gt;
The Set* commands always return 0 and add a new entry to the list. If a matching entry is found, it&#039;s removed first.&lt;br /&gt;
&lt;br /&gt;
==== ResolveProgramPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectProgramPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 0.&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationControlPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationHtmlDocumentPath====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
==== ResolveDataPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationControlPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationHtmlDocumentPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationLegalInformationPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationLegalInformationPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== Refresh ====&lt;br /&gt;
Takes no input. Frees all linked-lists&#039; entries that have &#039;&#039;&#039;flag&#039;&#039;&#039; set to 0.&lt;br /&gt;
&lt;br /&gt;
==== RedirectProgramPath2 ====&lt;br /&gt;
Same as [[#RedirectProgramPath|RedirectProgramPath]], but inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== Refresh2 ====&lt;br /&gt;
Takes no input. Frees all linked-lists&#039; entries that have &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== DeleteProgramPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== DeleteApplicationControlPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== DeleteApplicationHtmlDocumentPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== DeleteApplicationLegalInformationPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== ResolveProgramPathForDebug ====&lt;br /&gt;
Same as [[#ResolveProgramPath|ResolveProgramPath]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
==== RedirectProgramPathForDebug ====&lt;br /&gt;
Same as [[#RedirectProgramPath|RedirectProgramPath]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
==== RedirectProgramPath2ForDebug ====&lt;br /&gt;
Same as [[#RedirectProgramPath2|RedirectProgramPath2]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
==== DeleteProgramPathForDebug ====&lt;br /&gt;
Same as [[#DeleteProgramPath|DeleteProgramPath]], but uses a redirection shim on top of the real program path.&lt;br /&gt;
&lt;br /&gt;
[[NS_Services|NS]] uses this command if [[System_Settings#ns.application|ns.application!redirected_rom_storage_id_for_debug]] is different than 0x00.&lt;br /&gt;
&lt;br /&gt;
=== IRegisteredLocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::IRegisteredLocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This works like [[#ILocationResolver]], but only two types of NCA paths can be gotten/set. In addition, each type has a fallback path that can be set for a single title ID at a time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || ResolveProgramPath || u64 TitleID + C descriptor || Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || RegisterProgramPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] || Sets the Type 0 fallback TID and path to the provided arguments.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || UnregisterProgramPath || u64 TitleID || If the Type 0 fallback TID is == argument TID, unregisters the fallback path. Otherwise, noop.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || RedirectProgramPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [2.0.0+] ResolveHtmlDocumentPath || u64 TitleID + C descriptor ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [2.0.0+] RegisterHtmlDocumentPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] || Sets the Type 1 fallback TID and path to the provided arguments.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [2.0.0+] UnregisterHtmlDocumentPath || u64 TitleID || If the Type 1 fallback TID is == argument TID, unregisters the fallback path. Otherwise, noop.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [2.0.0+] RedirectHtmlDocumentPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [7.0.0+] Refresh || No input/output. || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IAddOnContentLocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::IAddOnContentLocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || ResolveAddOnContentPath || u64 TitleID + C descriptor || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || RegisterAddOnContentStorage || [[Filesystem_services#StorageId|StorageID]] + u64 TitleID || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || UnregisterAllAddOnContentPath || None || Clears all registered titles here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Location List Entry ===&lt;br /&gt;
Total size is 0x320 bytes. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8|| Pointer to previous entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x8|| Pointer to next entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x8|| TitleID&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x300 || [[Filesystem_services|ContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x318 || 0x4 || Flag&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C || 0x4 || Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Content Manager services =&lt;br /&gt;
== ncm ==&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CreateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CreateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || VerifyContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || VerifyContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || OpenContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], [2.0.0+] Only returns a storage if one has previously been opened globally via OpenIContentStorage.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || OpenContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], [2.0.0+] Only returns a storage if one has previously been opened globally via OpenIContentStorage.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [1.0.0] CloseContentStorageForcibly || Takes a [[Filesystem_services#StorageId|StorageID]]. Calls IContentStorage-&amp;gt;CloseAndFlushStorage().&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [1.0.0] CloseContentMetaDatabaseForcibly || Takes a [[Filesystem_services#StorageId|StorageID]].  Calls IContentMetaDatabase-&amp;gt;CloseMetaDatabase().&lt;br /&gt;
|-&lt;br /&gt;
| 8 || CleanupContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and deletes the associated savedata.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [2.0.0+] ActivateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], and opens an IContentStorage for the StorageID to be gotten with GetIContentStorage. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [2.0.0+] InactivateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], and closes the associated IContentStorage. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [2.0.0+] ActivateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and opens an IContentMetaDatabase for the StorageID to be gotten with GetIContentMetaDatabase. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [2.0.0+] InactivateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and closes the associated IContentMetaDatabase. Note: Name is not official.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IContentStorage ===&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentStorage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GeneratePlaceHolderId]] || Returns a random UUID for the Content Storage.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CreatePlaceHolder || Takes two [[#NcaID]]s, and a u64 filesize.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DeletePlaceHolder || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || HasPlaceHolder ||  Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || WritePlaceHolder || Takes a [[#NcaID]], a u64-offset, and type 5 buffer. Writes the buffer to the file for the NcaID&#039;s placeholder path at the specified offset.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Register || Takes two [[#NcaID]]s, moves the Placeholder NCA content to the registered NCA path.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Delete || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Has || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || GetPath || Takes a [[#NcaID]]. Returns a [[Filesystem_services#ContentPath|Content Path]].&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetPlaceHolderPath || Takes a [[#NcaID]]. Returns a [[Filesystem_services#ContentPath|Content Path]].&lt;br /&gt;
|-&lt;br /&gt;
| 10 || CleanupAllPlaceHolder || Deletes and re-creates the Placeholder directory.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || ListPlaceHolder || This is like [[#GetNumberOfRegisteredEntries]], but for the Placeholder directory.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#GetContentCount]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#ListContentId]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#GetSizeFromContentId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 15 || DisableForcibly || Closes/Flushes all resources for the storage, and causes all future IPC commands to the current session to return error 0xC805.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [2.0.0+] RevertToPlaceHolder || Takes three 0x10-sized [[#NcaID]]s. Creates the registered directory NCA path, and renames the placeholder path to the registered NCA path.&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [2.0.0+] SetPlaceHolderSize || Takes a [[#NcaID]], and a u64 size&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [2.0.0+] [[#ReadContentIdFile]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [2.0.0+] [[#GetRightsIdFromPlaceHolderId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 20 || [2.0.0+] [[#GetRightsIdFromContentId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 21 || [2.0.0+] WriteContentForDebug || Takes a [[#NcaID]], a u64 offset, and a type 5 buffer. On debug units, writes the buffer to the NCA&#039;s registered path. On retail units, this just aborts.&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [2.0.0+] GetFreeSpaceSize || Gets free space for the storage.&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [2.0.0+] GetTotalSpaceSize || Gets total space for the storage.&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [3.0.0+] FlushPlaceHolder || Flushes resources for the storage without closing it.&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [4.0.0+] GetSizeFromPlaceHolderId || &lt;br /&gt;
|-&lt;br /&gt;
| 26 || [4.0.0+] RepairInvalidFileAttribute || &lt;br /&gt;
|-&lt;br /&gt;
| 27 || [8.0.0+] GetRightsIdFromPlaceHolderIdWithCache || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== GeneratePlaceHolderId ====&lt;br /&gt;
Generates a random [[#NcaID]] for use as a placeholder.&lt;br /&gt;
&lt;br /&gt;
Calls nn::util::GenerateUuid(), which internally calls nn::os::GenerateRandomBytes(16);&lt;br /&gt;
&lt;br /&gt;
==== GetContentCount ====&lt;br /&gt;
Writes the total number of entries which can be read by GetEntries, to cmdreply &amp;lt;SFCO_offset&amp;gt;+0x10.&lt;br /&gt;
&lt;br /&gt;
==== ListContentId====&lt;br /&gt;
Takes an output buffer, u32 offset and gets all entries starting at that offset.&lt;br /&gt;
Returns number of entries read.&lt;br /&gt;
&lt;br /&gt;
Each entry is a [[#NcaID]].&lt;br /&gt;
&lt;br /&gt;
The total read entries is exactly the same as the number of &amp;quot;&amp;lt;hex&amp;gt;.nca&amp;quot; directories in the storage FS(or at least under the &amp;quot;registered&amp;quot; directory?).&lt;br /&gt;
&lt;br /&gt;
==== GetSizeFromContentId ====&lt;br /&gt;
Takes a [[#NcaID]] as input.&lt;br /&gt;
&lt;br /&gt;
Returns the total size readable by [[#ReadContentIdFile]]. This is the same as the size-field in the [[NAX0]] &amp;quot;&amp;lt;NcaID&amp;gt;.nca/00&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
==== ReadContentIdFile ====&lt;br /&gt;
Takes an output buffer, a [[#NcaID]] as input, and a u64 file offset.&lt;br /&gt;
&lt;br /&gt;
Reads plaintext NCA file contents from the Registered path for the NcaID.&lt;br /&gt;
&lt;br /&gt;
==== GetRightsIdFromPlaceHolderId ====&lt;br /&gt;
Takes a total of 0x10-bytes of input, returns a total of 0x10-bytes of output.&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] Returns an additional 8-bytes of output.&lt;br /&gt;
&lt;br /&gt;
Gets the Rights ID for the [[#NcaID]]&#039;s placeholder path.&lt;br /&gt;
&lt;br /&gt;
==== GetRightsIdFromContentId ====&lt;br /&gt;
Takes a total of 0x10-bytes of input, returns a total of 0x10-bytes of output.&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] Returns an additional 8-bytes of output.&lt;br /&gt;
&lt;br /&gt;
Gets the Rights ID for the [[#NcaID]]&#039;s registered path&lt;br /&gt;
&lt;br /&gt;
=== IContentMetaDatabase ===&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentMetaDatabase&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the official name for Meta Record is &amp;quot;ContentMetaKey&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Set || Takes a [[CNMT#Meta_records|Meta Record]], a type-5 [[CNMT#Content_records|Content Records]] buffer and a u64 size.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Get || Takes a [[CNMT#Meta_records|Meta Record]], a type-6 buffer to write [[CNMT#Content_records|Content Records]] to and a u64 size. Returns the actual number of bytes read into the buffer. First 8 bytes of the data is header (u16 numExtraDataBytes, numContentRecords, numMetaRecords, padding). After the header is numExtraDataBytes of additional data, after which follow content records and meta records. Set takes this same data as input.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Remove || Takes a [[CNMT#Meta_records|Meta Record]], and removes the associated record.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetContentIdByType || Takes a [[CNMT#Meta_records|Meta Record]] and a u8 [[#Title_Types|Title Type]]. Returns a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || ListContentInfo || Takes a type-6 buffer to write [[CNMT#Content_records|Content Record]] entries to, a [[CNMT#Meta_records|Meta Record]], and a u32 index into the Content Record entries to start copying from. Returns a u32 entries_read.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || List || Takes a type-6 buffer to write [[CNMT#Meta_records|Meta Record]]s to, a u32 [[#Title_Types|Title Type]], a u64 TID, a u64 TID_LOW, and u64 TID_HIGH. Writes into the buffer all Meta Records with low &amp;lt;= record-&amp;gt;title_id &amp;lt;= high, and record-&amp;gt;type == type. Returns u32 numEntriesTotal, numEntriesWritten. Additionally requires record-&amp;gt;title_id == TID, if record-&amp;gt;type is Application, Patch, Add-On, or Delta, otherwise, you can pass 0 for type to ignore the type and list them all in the range.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || GetLatestContentMetaKey || Takes a u64 title id, and returns the [[CNMT#Meta_records|Meta Record]] with the highest version field for that title id.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#ListApplication]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Has || Takes a [[CNMT#Meta_records|Meta Record]] and returns whether that record is present in the database.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || HasAll || Takes a type-5 buffer containing [[CNMT#Meta_records|Meta Records]] (code assumes there are size/sizeof(meta_record) records in the buffer), and returns whether all of those records are present in the database.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetSize || Takes a [[CNMT#Meta_records|Meta Record]], and returns the size of the associated [[CNMT#Content_records|Content Records]].&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetRequiredSystemVersion || Takes a [[CNMT#Meta_records|Meta Record]], and returns u32 from ContentRecords + 16 (only if the Meta record has type Application or Patch).&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetPatchId || Takes a [[CNMT#Meta_records|Meta Record]], and returns the update title id for that record.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || DisableForcibly ||  Closes the meta database, and causes all future IPC commands to the current session to return error 0xDC05.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#LookupOrphanContent]] || Takes a type-6 byte buffer, and a type-5 buffer of [[#NcaID]]s.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Commit || Flushes the in-memory database to savedata.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || HasContent || Takes a [[CNMT#Meta_records|Meta Record]] and an [[#NcaID]]. Returns whether the content records for that meta record contain the NcaID.&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListContentMetaInfo || Takes a type-6 [[CNMT#Meta_records|Meta Record]] output buffer, a u32 offset into that buffer, and an input [[CNMT#Meta_records|Meta Record]].&lt;br /&gt;
|-&lt;br /&gt;
| 18 || GetAttributes || Takes a [[CNMT#Meta_records|Meta Record]], and returns u8 from ContentRecords + 6.&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [2.0.0+] GetRequiredApplicationVersion || Does the same thing as GetEntryUnknownRecordSize, but for AddOnContents.&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [5.0.0+] GetContentIdByTypeAndIdOffset ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== ListApplication ====&lt;br /&gt;
Each 24-byte entry (officially &amp;quot;ApplicationContentMetaKey&amp;quot;) is as follows:&lt;br /&gt;
  [[CNMT#Meta_records|meta_record]] meta_record;&lt;br /&gt;
  u64    base_title_id;&lt;br /&gt;
&lt;br /&gt;
This function takes in a type 6 buffer to write entries to, and a u8 &amp;quot;filter&amp;quot; [[#Title_Types|type]]. If filter is zero, all update records will be copied to to the output buffer (space permitting). Otherwise, only titles with type == filter_type will be copied to the output buffer.&lt;br /&gt;
&lt;br /&gt;
This func returns a u32 num_entries_total, and a u32 num_entries_written.&lt;br /&gt;
&lt;br /&gt;
==== ReadEntryMetaRecords ====&lt;br /&gt;
Takes a type-6 [[CNMT#Meta_records|Meta Record]] output buffer, a u32 offset into that buffer, and an input [[CNMT#Meta_records|Meta Record]] entry. Returns a u32 for total_read_entries.&lt;br /&gt;
&lt;br /&gt;
Reads the meta records stored in the entry&#039;s content records into the output buffer.&lt;br /&gt;
&lt;br /&gt;
This is used, for example, with System Update title 0100000000000816, which contains Meta Records for all other systitles in its Content Records.&lt;br /&gt;
&lt;br /&gt;
==== LookupOrphanContent ====&lt;br /&gt;
Takes a type-6 byte buffer, and a type-5 buffer containing [[#NcaID]]s.&lt;br /&gt;
&lt;br /&gt;
This function was stubbed to return 0xDC05 in [[2.0.0]].&lt;br /&gt;
&lt;br /&gt;
On 1.0.0: Initialized the output buffer to all 1s. Then, for each [[#NcaID]] in the input buffer, it checks if that NcaID is present anywhere in the database, and if so writes 0 to the corresponding output byte.&lt;br /&gt;
&lt;br /&gt;
In pseudocode, the function basically does the following:&lt;br /&gt;
&lt;br /&gt;
for i in range(len(out_buf)):&lt;br /&gt;
    out_buf[i] = 1&lt;br /&gt;
&lt;br /&gt;
for i, NcaID in NcaIDs:&lt;br /&gt;
    if is_present_in_database(NcaID):&lt;br /&gt;
        out_buf[i] = 0&lt;br /&gt;
&lt;br /&gt;
=== NcaID ===&lt;br /&gt;
This is a 0x10-byte entry. This is originally from the hex portion of &amp;quot;&amp;lt;hex&amp;gt;.nca&amp;quot; directory-names from this storage FS(like [[SD_Filesystem|SD]]). This is also referred to as &amp;quot;ContentId&amp;quot; in the official SDK.&lt;br /&gt;
&lt;br /&gt;
The NcaID is the same as the first 0x10-bytes from the calculated SHA256 hash, from hashing the entire output from [[#ReadContentIdFile]].&lt;br /&gt;
&lt;br /&gt;
=== Enums ===&lt;br /&gt;
==== Title Types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| SystemProgram ([[Title_list#System_Modules|System Modules]] or [[Title_list#System_Applets|System Applets]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| SystemData ([[Title_list#System_Data_Archives|System Data Archives]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| SystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| BootImagePackage ([[Title_list|Firmware package A or C]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x05&lt;br /&gt;
| BootImagePackageSafe ([[Title_list|Firmware package B or D]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x80&lt;br /&gt;
| Application&lt;br /&gt;
|-&lt;br /&gt;
| 0x81&lt;br /&gt;
| Patch&lt;br /&gt;
|-&lt;br /&gt;
| 0x82&lt;br /&gt;
| AddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 0x83&lt;br /&gt;
| Delta&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ncm:v ==&lt;br /&gt;
This service doesn&#039;t normally exist on retail.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=RO_services&amp;diff=6709</id>
		<title>RO services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=RO_services&amp;diff=6709"/>
		<updated>2019-04-22T07:17:00Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Fixed capitalisation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Prior to 3.0.0, ro was included as part of [[Loader services]]. Despite the separation, the service name ldr:ro is retained to maintain compatibility with old games.&lt;br /&gt;
&lt;br /&gt;
= ldr:ro, ro:1 =&lt;br /&gt;
[1.0.0-2.3.0] This is &amp;quot;nn::ldr::detail::IRoInterface&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] This is &amp;quot;nn::ro::detail::IRoInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[7.0.0+] ro:1 was added, and also creates nn::ro::detail::IRoInterface objects.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#LoadNro]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || UnloadNro&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#LoadNrr]] &lt;br /&gt;
|-&lt;br /&gt;
| 3 || UnloadNrr&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [7.0.0+] [[#LoadNrrEx]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LoadNro ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Word || Value&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0x00000004&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0x80000012&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 0x00000001&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0-1 || Pid&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0 || &amp;quot;SCFI&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0x00000000&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Always 0.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Nro heap address&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Nro size&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Bss backing heap address&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Bss size&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LoadNrr ==&lt;br /&gt;
[7.0.0+] A new 8-bit field at NRR + 0x33C (previously padding) must be 0 for this function to succeed.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Word || Value&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0x00000004&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0x8000000E&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 0x00000001&lt;br /&gt;
|-&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0-1 || Pid&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0 || &amp;quot;SFCI&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0x00000002&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Always 0.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Nrr address&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Nrr size&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Initialize ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Word || Value&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0x00000004&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0x8000000A&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 0x00000003&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0-1 || Pid&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Process handle (0xFFFF8001)&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0 || &amp;quot;SFCI&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0x00000004&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Always 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LoadNrrEx ==&lt;br /&gt;
Takes in a u64 nrr_address, a u64 nrr_size, a pid descriptor, and a process handle. &lt;br /&gt;
&lt;br /&gt;
First, this validates that the pid descriptor matches the pid for the process handle sent to this-&amp;gt;Initialize() earlier.&lt;br /&gt;
&lt;br /&gt;
Then, this calls the same function as LoadNrr, except using the passed process handle instead of the one sent to Initialize. &lt;br /&gt;
&lt;br /&gt;
When called from an ro:1 session, the field at NRR header + 0x33C must be 0x1. When called from ldr:ro session, the field at NRR header + 0x33C must be 0x0.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Services_API&amp;diff=6707</id>
		<title>Services API</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Services_API&amp;diff=6707"/>
		<updated>2019-04-22T07:13:24Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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).&lt;br /&gt;
&lt;br /&gt;
Handles for services are retrieved from the service manager port, &amp;quot;sm:&amp;quot;, and are released via svcCloseHandle or when a process is terminated or crashes. Manager service &amp;quot;sm:m&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
= sm: =&lt;br /&gt;
This is &amp;quot;nn::sm::detail::IUserInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetService]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#RegisterService]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#UnregisterService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Initialize ==&lt;br /&gt;
Takes a pid descriptor and a reserved input u64.&lt;br /&gt;
&lt;br /&gt;
== GetService ==&lt;br /&gt;
Takes a zero-padded service name encoded as an u64 integer. Returns a handle.&lt;br /&gt;
&lt;br /&gt;
== RegisterService ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== UnregisterService ==&lt;br /&gt;
Takes a zero-padded service name encoded as an u64 integer.&lt;br /&gt;
&lt;br /&gt;
= sm:m =&lt;br /&gt;
This is &amp;quot;nn::sm::detail::IManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#RegisterProcess]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#UnregisterProcess]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== RegisterProcess ==&lt;br /&gt;
Takes a pid and two A descriptors with the ACID and ACI0 service lists. That data originates from [[NPDM]].&lt;br /&gt;
&lt;br /&gt;
== UnregisterProcess ==&lt;br /&gt;
Takes a pid.&lt;br /&gt;
&lt;br /&gt;
= Service List =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Service names&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;200&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;200&amp;quot; | Notes&lt;br /&gt;
|-&lt;br /&gt;
| acc:u0, acc:u1, acc:aa, acc:su, [5.0.0+] dauth:0&lt;br /&gt;
| [[Account services]]&lt;br /&gt;
| u0: System, u1: User, su: Admin, aa: Baas&lt;br /&gt;
|-&lt;br /&gt;
| ahid:cd, ahid:hdr, hid, hid:dbg, hid:sys, irs, irs:sys, xcd:sys, [4.0.0-7.0.1] hid:tmp, [5.0.0+] hidbus&lt;br /&gt;
| [[HID services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| appletAE, appletOE, idle:sys, omm, spsm, [5.0.0+] tcap, [6.0.0+] caps:su, [8.0.0+] apm &lt;br /&gt;
| [[AM services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [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&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] aoc:u, ns:am2, ns:dev, ns:ec, ns:rid, ns:rt, ns:su, ns:vm, ns:web, [1.0.0-7.0.1] ovln:rcv, [1.0.0-7.0.1] ovln:snd&lt;br /&gt;
| [[NS Services]]&lt;br /&gt;
| am: Application Manager, su: System Update&lt;br /&gt;
|-&lt;br /&gt;
| apm:dbg, apm:sys, fgm, fgm:0, fgm:9, fgm:dbg, [1.0.0-7.0.1] apm, [1.0.0-7.0.1] apm:p, [8.0.0+] apm:am&lt;br /&gt;
| [[PPC services]]&lt;br /&gt;
| fgm:1, fgm:2, fgm:3, fgm:4, fgm:5, fgm:6 and fgm:7 used to exist, but are now deprecated.&lt;br /&gt;
|-&lt;br /&gt;
| arp:r, arp:w, [2.0.0+] bgtc:t, [2.0.0+] bgtc:sc&lt;br /&gt;
| [[Glue services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 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&lt;br /&gt;
| [[Audio services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;banana&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| [[Profiler services]]&lt;br /&gt;
| Not currently available on retail units.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;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&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| [[BCAT services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [1.0.0] bpc:c, bpc:b, bpc:r, bpc:w, pcv, pcv:arb, pcv:imm, time:u, time:a, time:s&lt;br /&gt;
[2.0.0+] bpc, bpc:r, pcv, time:u, time:a, time:s, [1.0.0-7.0.1] pcv:arb, [1.0.0-7.0.1] pcv:imm, [8.0.0+] clkrst, [8.0.0+] clkrst:a, [8.0.0+] clkrst:i, [8.0.0+] rgltr, [8.0.0+] rtc&lt;br /&gt;
| [[PCV services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| bsd:u, bsd:s, bsdcfg, ethc:c, ethc:i, nsd:u, nsd:a, sfdnsres&lt;br /&gt;
| [[Sockets services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| btdrv, [5.0.0+] bt&lt;br /&gt;
| [[Bluetooth Driver services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| btm, btm:dbg, btm:sys, [5.0.0+] btm:u&lt;br /&gt;
| [[BTM services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| caps:a, caps:c, [1.0.0] mm:u, [5.0.0+] caps:u&lt;br /&gt;
| [[Capture services]]&lt;br /&gt;
| a: AlbumAccessor, c: AlbumControl&lt;br /&gt;
|-&lt;br /&gt;
| [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&lt;br /&gt;
| [[Display services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| dispdrv&lt;br /&gt;
| [[Nvnflinger services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dmnt:-&lt;br /&gt;
| [[Debug Monitor services]]&lt;br /&gt;
| Not currently available on retail units.&lt;br /&gt;
|-&lt;br /&gt;
| erpt:c, erpt:r&lt;br /&gt;
| [[Error Report services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| eupld:c, eupld:r&lt;br /&gt;
| [[Error Upload services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| es&lt;br /&gt;
| [[ETicket services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| fan, psm, tc, ts, &amp;lt;nowiki&amp;gt;pcm&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| [[PTM services]]&lt;br /&gt;
| pcm is not available on retail units.&lt;br /&gt;
|-&lt;br /&gt;
| fatal:u, fatal:p&lt;br /&gt;
| [[Fatal services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| friend:u, friend:v, friend:m, friend:s, friend:a, [5.0.0+] nd:app, nd:sys&lt;br /&gt;
| [[Friend services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| fsp-srv, fsp-ldr, fsp-pr&lt;br /&gt;
| [[Filesystem services]]&lt;br /&gt;
| srv: Main, ldr: Loader, pr: Program Registry&lt;br /&gt;
|-&lt;br /&gt;
| gpio, i2c, i2c:pcv, pinmux, pwm, uart, [3.0.0+] sasbus&lt;br /&gt;
| [[Bus services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| htc, htcs, htc:tenv, file_io, gds, tma_log, tmagent&lt;br /&gt;
| [[TMA services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| jit:u&lt;br /&gt;
| [[JIT services]]&lt;br /&gt;
| Not currently available on retail units.&lt;br /&gt;
|-&lt;br /&gt;
| lbl&lt;br /&gt;
| [[Backlight services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| ldn:m, ldn:s, ldn:u, [5.0.0+] ndd&lt;br /&gt;
| [[LDN services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [1.0.0+] ldr:pm, ldr:ro, ldr:shel, ldr:dmnt&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] ldr:pm, ldr:shel, ldr:dmnt&lt;br /&gt;
| [[Loader services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lm, lm:get&lt;br /&gt;
| [[Log services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| manu&lt;br /&gt;
| [[Manu Services]]&lt;br /&gt;
| &amp;quot;Manufacturing&amp;quot;, present in factory firmware but not installed on retail systems.&lt;br /&gt;
|-&lt;br /&gt;
| lr, ncm, ncm:v&lt;br /&gt;
| [[NCM services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| nfc:am, nfc:mf:u, nfc:user, nfc:sys, nfp:user, nfp:dbg, nfp:sys&lt;br /&gt;
| [[NFC services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| nifm:u, nifm:a, nifm:s&lt;br /&gt;
| [[Network Interface services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| nim, nim:shp, ntc, [5.0.0+] nim:eca, [7.0.0+] nim:ecas&lt;br /&gt;
| [[NIM services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| npns:u, npns:s&lt;br /&gt;
| [[NPNS services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| nvdrv:a, nvdrv:s, nvdrv:t, nvdrv, nvdrvdbg, nvgem:c, nvgem:cd, nvmemp&lt;br /&gt;
| [[NV services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| pcie, [6.0.0+] pcie:log&lt;br /&gt;
| [[PCIe services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| pctl, pctl:a, pctl:s, pctl:r&lt;br /&gt;
| [[Parental Control services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| pm:bm, pm:info, pm:shell&lt;br /&gt;
| [[Process Manager services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| psc:c, psc:m, [5.0.0+] srepo:u, srepo:a, [8.0.0+] ovln:rcv, [8.0.0+] ovln:snd&lt;br /&gt;
| [[PSC services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [3.0.0+] ldr:ro, ro:dmnt, [7.0.0+] ro:1&lt;br /&gt;
| [[RO services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| set, set:fd, set:cal, set:sys&lt;br /&gt;
| [[Settings services]]&lt;br /&gt;
| cal: calibration, sys: System Settings&lt;br /&gt;
|-&lt;br /&gt;
| [3.0.0+] mii:u, mii:e, pdm:ntfy, pdm:qry, pl:u, [5.0.0+] miiimg, [6.0.0+] avm&lt;br /&gt;
| [[Shared Database services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ssl&lt;br /&gt;
| [[SSL services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| csrng, spl:, [4.0.0+] spl:mig, spl:fs, spl:ssl, spl:es, [5.0.0+] spl:manu&lt;br /&gt;
| [[SPL services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| sf-uds&lt;br /&gt;
| ?&lt;br /&gt;
| System debug applet &amp;quot;recovery&amp;quot; has access to this service, but it doesn&#039;t appear to exist.&lt;br /&gt;
|-&lt;br /&gt;
| tspm&lt;br /&gt;
| ?&lt;br /&gt;
| Applications on [1.0.0] used to have access to this service, but it doesn&#039;t appear to be present on retail devices.&lt;br /&gt;
|-&lt;br /&gt;
| usb:ds, usb:hs, usb:pd, usb:pd:c, [1.0.0] usb:pd:m, usb:pm, [7.0.0+] usb:hs:a, [7.0.0+] usb:qdb, [8.0.0+] usb:obsv&lt;br /&gt;
| [[USB services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| wlan:inf, wlan:lcl, wlan:lg, wlan:lga, wlan:sg, wlan:soc, [6.0.0+] wlan:dtc&lt;br /&gt;
| [[WLAN services]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [4.0.0+] grc:c, [6.0.0+] grc:d&lt;br /&gt;
| [[GRC services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [4.0.0+] mig:usr&lt;br /&gt;
| [[Migration services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [4.0.0+] caps:dc&lt;br /&gt;
| [[Jpegdec services]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [6.0.0+] olsc:s&lt;br /&gt;
| [[OLSC services]]&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Loader_services&amp;diff=6706</id>
		<title>Loader services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Loader_services&amp;diff=6706"/>
		<updated>2019-04-22T07:11:45Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Removed ro info as it is now on its own page.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= ldr:dmnt =&lt;br /&gt;
This is &amp;quot;nn::ldr::detail::IDebugMonitorInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[Loader_services#AddProcessToDebugLaunchQueue|AddProcessToDebugLaunchQueue]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[Loader_services#ClearDebugLaunchQueue|ClearDebugLaunchQueue]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[Loader_services#GetNsoInfos|GetNsoInfos]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== AddProcessToDebugLaunchQueue ==&lt;br /&gt;
Same as [[Loader_services#AddProcessToLaunchQueue|AddProcessToLaunchQueue]] but for processes marked as debug.&lt;br /&gt;
&lt;br /&gt;
== ClearDebugLaunchQueue ==&lt;br /&gt;
Same as [[Loader_services#ClearLaunchQueue|ClearLaunchQueue]].&lt;br /&gt;
&lt;br /&gt;
== GetNsoInfos ==&lt;br /&gt;
Takes in a u64 ProcessID, and a C descriptor. Returns the number of NsoInfos copied to output.&lt;br /&gt;
&lt;br /&gt;
NsoInfo has the following layout:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x20&lt;br /&gt;
| &amp;quot;Build ID&amp;quot;, from NSO header+0x40.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x8&lt;br /&gt;
| Mapped address for this NSO&lt;br /&gt;
|-&lt;br /&gt;
| 0x28&lt;br /&gt;
| 0x8&lt;br /&gt;
| Mapped size for this NSO&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= ldr:pm =&lt;br /&gt;
This is &amp;quot;nn::ldr::detail::IProcessManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CreateProcess&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetProgramInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#RegisterTitle]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#UnregisterTitle]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== GetProgramInfo ==&lt;br /&gt;
Takes a TitleId + StorageId, parses the NPDM, and writes output to a C descriptor buffer as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| MainThreadPrio. Arg1 to svcStartProcess&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| DefaultCpuId. Arg2 to svcStartProcess&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| ApplicationType, see [[Process Manager services|here]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| MainThreadStackSize. Arg3 to svcStartProcess&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| TitleIdRange_Min&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x4&lt;br /&gt;
| ACID [[NPDM#Service Access Control|Service Access Control]] list size&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x4&lt;br /&gt;
| ACI0 [[NPDM#Service Access Control|Service Access Control]] list size&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0x4&lt;br /&gt;
| ACID [[NPDM#FS Access Control|FS Access Control]] buffer size&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C&lt;br /&gt;
| 0x4&lt;br /&gt;
| ACI0 [[NPDM#FS Access Control|FS Access Control]] buffer size&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| &amp;lt;Varies&amp;gt;&lt;br /&gt;
| ACID [[NPDM#Service Access Control|Service Access Control]] list&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;Varies&amp;gt;&lt;br /&gt;
| &amp;lt;Varies&amp;gt;&lt;br /&gt;
| ACI0 [[NPDM#Service Access Control|Service Access Control]] list&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;Varies&amp;gt;&lt;br /&gt;
| &amp;lt;Varies&amp;gt;&lt;br /&gt;
| ACID [[NPDM#FS Access Control|FS Access Control]] buffer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;Varies&amp;gt;&lt;br /&gt;
| &amp;lt;Varies&amp;gt;&lt;br /&gt;
| ACI0 [[NPDM#FS Access Control|FS Access Control]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== RegisterTitle ==&lt;br /&gt;
Takes a TitleId + StorageId, returns an index.&lt;br /&gt;
&lt;br /&gt;
== UnregisterTitle ==&lt;br /&gt;
Takes the index from [[#RegisterTitle]].&lt;br /&gt;
&lt;br /&gt;
= ldr:shel =&lt;br /&gt;
This is &amp;quot;nn::ldr::detail::IShellInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#AddProcessToLaunchQueue]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#ClearLaunchQueue]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== AddProcessToLaunchQueue ==&lt;br /&gt;
Takes a type-0x19 input buffer with launch arguments (as string), an u32 (size of arguments string), and an input title-id.&lt;br /&gt;
&lt;br /&gt;
Loads a process for the specified title-id and passes along the supplied arguments.&lt;br /&gt;
Loaded processes are kept in a queue waiting for PM to launch them. The maximum number of waiting processes in this list is 10.&lt;br /&gt;
&lt;br /&gt;
== ClearLaunchQueue ==&lt;br /&gt;
Clears the loaded processes waiting queue.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Fuses&amp;diff=6244</id>
		<title>Fuses</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Fuses&amp;diff=6244"/>
		<updated>2019-02-19T00:19:37Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Updated for 7.0.1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Nintendo Switch makes use of Tegra&#039;s fuse driver for a number of operations. This driver is mapped to physical address 0x7000F800 with a total size of 0x400 bytes and exposes several registers for fuse programming.&lt;br /&gt;
&lt;br /&gt;
Registers from 0x7000F800 to 0x7000F800 + 0xFF can be used to directly program the hardware fuse array, while registers from 0x7000F800 + 0x100 (FUSE_CHIP_REG_START_OFFSET) to 0x7000F800 + 0x3FC (FUSE_CHIP_REG_END_OFFSET) represent cached values read from certain fuses.&lt;br /&gt;
&lt;br /&gt;
== Registers ==&lt;br /&gt;
Below is a list of fuse driver registers used by the Switch&#039;s bootloaders.&lt;br /&gt;
&lt;br /&gt;
=== Driver registers ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Name&lt;br /&gt;
!  Address&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_CTRL|FUSE_CTRL]]&lt;br /&gt;
| 0x7000F800&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_REG_ADDR|FUSE_REG_ADDR]]&lt;br /&gt;
| 0x7000F804&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_REG_READ|FUSE_REG_READ]]&lt;br /&gt;
| 0x7000F808&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_REG_WRITE|FUSE_REG_WRITE]]&lt;br /&gt;
| 0x7000F80C&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_TIME_RD1&lt;br /&gt;
| 0x7000F810&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_TIME_RD2&lt;br /&gt;
| 0x7000F814&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_TIME_PGM1&lt;br /&gt;
| 0x7000F818&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_TIME_PGM2|FUSE_TIME_PGM2]]&lt;br /&gt;
| 0x7000F81C&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_PRIV2INTFC|FUSE_PRIV2INTFC]]&lt;br /&gt;
| 0x7000F820&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_FUSEBYPASS&lt;br /&gt;
| 0x7000F824&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_PRIVATEKEYDISABLE&lt;br /&gt;
| 0x7000F828&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_DIS_PGM|FUSE_DIS_PGM]]&lt;br /&gt;
| 0x7000F82C&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_WRITE_ACCESS|FUSE_WRITE_ACCESS]]&lt;br /&gt;
| 0x7000F830&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_PWR_GOOD_SW&lt;br /&gt;
| 0x7000F834&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_PRIVATE_KEY0_NONZERO&lt;br /&gt;
| 0x7000F880&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_PRIVATE_KEY1_NONZERO&lt;br /&gt;
| 0x7000F884&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_PRIVATE_KEY2_NONZERO&lt;br /&gt;
| 0x7000F888&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_PRIVATE_KEY3_NONZERO&lt;br /&gt;
| 0x7000F88C&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_PRIVATE_KEY4_NONZERO&lt;br /&gt;
| 0x7000F890&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== FUSE_CTRL ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bits&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0-1&lt;br /&gt;
| Fuse command (1 = FUSE_READ; 2 = FUSE_WRITE; 3 = FUSE_SENSE)&lt;br /&gt;
|-&lt;br /&gt;
| 16-20&lt;br /&gt;
| Fuse state (4 = STATE_IDLE)&lt;br /&gt;
|-&lt;br /&gt;
| 26&lt;br /&gt;
| Fuse power down mode flag (FUSE_CTRL_PD)&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Fuse sense status (FUSE_CTRL_SENSE_DONE)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Before fuse reading/writing the power down mode must be disabled.&lt;br /&gt;
FUSE_SENSE mode flushes programmed values into the [[Fuses#Cache_registers|cache registers]].&lt;br /&gt;
&lt;br /&gt;
==== FUSE_REG_ADDR ====&lt;br /&gt;
This register takes the address of the fuse to be read/written/sensed.&lt;br /&gt;
&lt;br /&gt;
==== FUSE_REG_READ ====&lt;br /&gt;
This register receives the value read from the fuse.&lt;br /&gt;
&lt;br /&gt;
==== FUSE_REG_WRITE ====&lt;br /&gt;
This register takes the value to be written to the fuse.&lt;br /&gt;
&lt;br /&gt;
==== FUSE_TIME_PGM2 ====&lt;br /&gt;
This register takes the fuse programming pulse (0xC0 == 19200 kHz).&lt;br /&gt;
&lt;br /&gt;
==== FUSE_PRIV2INTFC ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bits&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| FUSE_PRIV2INTFC_SDATA&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| FUSE_PRIV2INTFC_SKIP_RECORDS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== FUSE_DIS_PGM ====&lt;br /&gt;
If set to 0x01, this register disables fuse programming.&lt;br /&gt;
&lt;br /&gt;
==== FUSE_WRITE_ACCESS ====&lt;br /&gt;
If set to 0x01, this register disables software writes to the fuse driver registers.&lt;br /&gt;
&lt;br /&gt;
=== Cache registers ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Name&lt;br /&gt;
!  Address&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_PRODUCTION_MODE&lt;br /&gt;
| 0x7000F900&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_JTAG_SECUREID_VALID&lt;br /&gt;
| 0x7000F904&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_ODM_LOCK&lt;br /&gt;
| 0x7000F908&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_SKU_INFO|FUSE_SKU_INFO]]&lt;br /&gt;
| 0x7000F910&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_CPU_SPEEDO_0&lt;br /&gt;
| 0x7000F914&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_CPU_IDDQ&lt;br /&gt;
| 0x7000F918&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_DAC_CRT_CALIB&lt;br /&gt;
| 0x7000F91C&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_DAC_HDTV_CALIB&lt;br /&gt;
| 0x7000F920&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_DAC_SDTV_CALIB&lt;br /&gt;
| 0x7000F924&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_FT_REV&lt;br /&gt;
| 0x7000F928&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_CPU_SPEEDO_1&lt;br /&gt;
| 0x7000F92C&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_CPU_SPEEDO_2&lt;br /&gt;
| 0x7000F930&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SOC_SPEEDO_0&lt;br /&gt;
| 0x7000F934&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_SOC_SPEEDO_1|FUSE_SOC_SPEEDO_1]]&lt;br /&gt;
| 0x7000F938&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SOC_SPEEDO_2&lt;br /&gt;
| 0x7000F93C&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SOC_IDDQ&lt;br /&gt;
| 0x7000F940&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_RESERVED_PRODUCTION_WP&lt;br /&gt;
| 0x7000F944&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_FA|FUSE_FA]]&lt;br /&gt;
| 0x7000F948&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_RESERVED_PRODUCTION&lt;br /&gt;
| 0x7000F94C&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_HDMI_LANE0_CALIB&lt;br /&gt;
| 0x7000F950&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_HDMI_LANE1_CALIB&lt;br /&gt;
| 0x7000F954&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_HDMI_LANE2_CALIB&lt;br /&gt;
| 0x7000F958&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_HDMI_LANE3_CALIB&lt;br /&gt;
| 0x7000F95C&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_ENCRYPTION_RATE&lt;br /&gt;
| 0x7000F960&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_PUBLIC_KEY|FUSE_PUBLIC_KEY0]]&lt;br /&gt;
| 0x7000F964&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_PUBLIC_KEY|FUSE_PUBLIC_KEY1]]&lt;br /&gt;
| 0x7000F968&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_PUBLIC_KEY|FUSE_PUBLIC_KEY2]]&lt;br /&gt;
| 0x7000F96C&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_PUBLIC_KEY|FUSE_PUBLIC_KEY3]]&lt;br /&gt;
| 0x7000F970&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_PUBLIC_KEY|FUSE_PUBLIC_KEY4]]&lt;br /&gt;
| 0x7000F974&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_PUBLIC_KEY|FUSE_PUBLIC_KEY5]]&lt;br /&gt;
| 0x7000F978&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_PUBLIC_KEY|FUSE_PUBLIC_KEY6]]&lt;br /&gt;
| 0x7000F97C&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_PUBLIC_KEY|FUSE_PUBLIC_KEY7]]&lt;br /&gt;
| 0x7000F980&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_TSENSOR_1&lt;br /&gt;
| 0x7000F984&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_TSENSOR_2&lt;br /&gt;
| 0x7000F988&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_VSENSOR_CALIB&lt;br /&gt;
| 0x7000F98C&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_CP_REV&lt;br /&gt;
| 0x7000F990&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_OPT_PFG&lt;br /&gt;
| 0x7000F994&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_TSENSOR_0&lt;br /&gt;
| 0x7000F998&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_FIRST_BOOTROM_PATCH_SIZE_REG&lt;br /&gt;
| 0x7000F99C&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SECURITY_MODE&lt;br /&gt;
| 0x7000F9A0&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_PRIVATE_KEY|FUSE_PRIVATE_KEY0]]&lt;br /&gt;
| 0x7000F9A4&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_PRIVATE_KEY|FUSE_PRIVATE_KEY1]]&lt;br /&gt;
| 0x7000F9A8&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_PRIVATE_KEY|FUSE_PRIVATE_KEY2]]&lt;br /&gt;
| 0x7000F9AC&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_PRIVATE_KEY|FUSE_PRIVATE_KEY3]]&lt;br /&gt;
| 0x7000F9B0&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_PRIVATE_KEY|FUSE_PRIVATE_KEY4]]&lt;br /&gt;
| 0x7000F9B4&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_ARM_JTAG_DISABLE&lt;br /&gt;
| 0x7000F9B8&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_BOOT_DEVICE_INFO&lt;br /&gt;
| 0x7000F9BC&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_RESERVED_SW|FUSE_RESERVED_SW]]&lt;br /&gt;
| 0x7000F9C0&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_VP8_ENABLE&lt;br /&gt;
| 0x7000F9C4&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_RESERVED_ODM0|FUSE_RESERVED_ODM0]]&lt;br /&gt;
| 0x7000F9C8&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_RESERVED_ODM1|FUSE_RESERVED_ODM1]]&lt;br /&gt;
| 0x7000F9CC&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_RESERVED_ODM2|FUSE_RESERVED_ODM2]]&lt;br /&gt;
| 0x7000F9D0&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_RESERVED_ODM3|FUSE_RESERVED_ODM3]]&lt;br /&gt;
| 0x7000F9D4&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_RESERVED_ODM4|FUSE_RESERVED_ODM4]]&lt;br /&gt;
| 0x7000F9D8&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_RESERVED_ODM5&lt;br /&gt;
| 0x7000F9DC&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_RESERVED_ODM6|FUSE_RESERVED_ODM6]]&lt;br /&gt;
| 0x7000F9E0&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_RESERVED_ODM7|FUSE_RESERVED_ODM7]]&lt;br /&gt;
| 0x7000F9E4&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_OBS_DIS&lt;br /&gt;
| 0x7000F9E8&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_NOR_INFO&lt;br /&gt;
| 0x7000F9EC&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SKU_USB_CALIB&lt;br /&gt;
| 0x7000F9F0&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SKU_DIRECT_CONFIG&lt;br /&gt;
| 0x7000F9F4&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_KFUSE_PRIVKEY_CTRL&lt;br /&gt;
| 0x7000F9F8&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_PACKAGE_INFO&lt;br /&gt;
| 0x7000F9FC&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_VENDOR_CODE&lt;br /&gt;
| 0x7000FA00&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_FAB_CODE&lt;br /&gt;
| 0x7000FA04&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_LOT_CODE_0&lt;br /&gt;
| 0x7000FA08&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_LOT_CODE_1&lt;br /&gt;
| 0x7000FA0C&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_WAFER_ID&lt;br /&gt;
| 0x7000FA10&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_X_COORDINATE&lt;br /&gt;
| 0x7000FA14&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_Y_COORDINATE&lt;br /&gt;
| 0x7000FA18&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_OPS_RESERVED&lt;br /&gt;
| 0x7000FA20&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SATA_CALIB&lt;br /&gt;
| 0x7000FA24&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_GPU_IDDQ&lt;br /&gt;
| 0x7000FA28&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_TSENSOR_3&lt;br /&gt;
| 0x7000FA2C&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SKU_BOND_OUT_L&lt;br /&gt;
| 0x7000FA30&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SKU_BOND_OUT_H&lt;br /&gt;
| 0x7000FA34&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SKU_BOND_OUT_U&lt;br /&gt;
| 0x7000FA38&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SKU_BOND_OUT_V&lt;br /&gt;
| 0x7000FA3C&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SKU_BOND_OUT_W&lt;br /&gt;
| 0x7000FA40&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_OPT_SUBREVISION&lt;br /&gt;
| 0x7000FA48&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_TSENSOR_4&lt;br /&gt;
| 0x7000FA54&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_TSENSOR_5&lt;br /&gt;
| 0x7000FA58&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_TSENSOR_6&lt;br /&gt;
| 0x7000FA5C&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_TSENSOR_7&lt;br /&gt;
| 0x7000FA60&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_OPT_PRIV_SEC_DIS&lt;br /&gt;
| 0x7000FA64&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_PKC_DISABLE|FUSE_PKC_DISABLE]]&lt;br /&gt;
| 0x7000FA68&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_FALCON_DEBUG_DISABLE&lt;br /&gt;
| 0x7000FA7C&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_TSENSOR_COMMON&lt;br /&gt;
| 0x7000FA80&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_DEBUG_AUTH_OVERRIDE&lt;br /&gt;
| 0x7000FA9C&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_GCPLEX_CONFIG_FUSE&lt;br /&gt;
| 0x7000FAC8&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_TSENSOR_8&lt;br /&gt;
| 0x7000FAD4&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_DEBUG_AUTHENTICATION&lt;br /&gt;
| 0x7000FAE4&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SECURE_PROVISION_INDEX&lt;br /&gt;
| 0x7000FAE8&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_AID&lt;br /&gt;
| 0x7000FAF8&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_REALIGNMENT_REG&lt;br /&gt;
| 0x7000FAFC&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_RESERVED_CALIB0&lt;br /&gt;
| 0x7000FB04&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_OPT_GPU_TPC0_DISABLE&lt;br /&gt;
| 0x7000FB0C&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_TSENSOR_9&lt;br /&gt;
| 0x7000FB1C&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_OPT_GPU_TPC1_DISABLE&lt;br /&gt;
| 0x7000FB3C&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_USB_CALIB_EXT&lt;br /&gt;
| 0x7000FB50&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_OPT_ECC_EN&lt;br /&gt;
| 0x7000FB58&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_0&lt;br /&gt;
| 0x7000FB80&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_1&lt;br /&gt;
| 0x7000FB84&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_SPARE_BIT_2|FUSE_SPARE_BIT_2]]&lt;br /&gt;
| 0x7000FB88&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_SPARE_BIT_3|FUSE_SPARE_BIT_3]]&lt;br /&gt;
| 0x7000FB8C&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_SPARE_BIT_4|FUSE_SPARE_BIT_4]]&lt;br /&gt;
| 0x7000FB90&lt;br /&gt;
|-&lt;br /&gt;
| [[#FUSE_SPARE_BIT_5|FUSE_SPARE_BIT_5]]&lt;br /&gt;
| 0x7000FB94&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_6&lt;br /&gt;
| 0x7000FB98&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_7&lt;br /&gt;
| 0x7000FB9C&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_8&lt;br /&gt;
| 0x7000FBA0&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_9&lt;br /&gt;
| 0x7000FBA4&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_10&lt;br /&gt;
| 0x7000FBA8&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_11&lt;br /&gt;
| 0x7000FBAC&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_12&lt;br /&gt;
| 0x7000FBB0&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_13&lt;br /&gt;
| 0x7000FBB4&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_14&lt;br /&gt;
| 0x7000FBB8&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_15&lt;br /&gt;
| 0x7000FBBC&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_16&lt;br /&gt;
| 0x7000FBC0&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_17&lt;br /&gt;
| 0x7000FBC4&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_18&lt;br /&gt;
| 0x7000FBC8&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_19&lt;br /&gt;
| 0x7000FBCC&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_20&lt;br /&gt;
| 0x7000FBD0&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_21&lt;br /&gt;
| 0x7000FBD4&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_22&lt;br /&gt;
| 0x7000FBD8&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_23&lt;br /&gt;
| 0x7000FBDC&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_24&lt;br /&gt;
| 0x7000FBE0&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_25&lt;br /&gt;
| 0x7000FBE4&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_26&lt;br /&gt;
| 0x7000FBE8&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_27&lt;br /&gt;
| 0x7000FBEC&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_28&lt;br /&gt;
| 0x7000FBF0&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_29&lt;br /&gt;
| 0x7000FBF4&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_30&lt;br /&gt;
| 0x7000FBF8&lt;br /&gt;
|-&lt;br /&gt;
| FUSE_SPARE_BIT_31&lt;br /&gt;
| 0x7000FBFC&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== FUSE_SKU_INFO ====&lt;br /&gt;
Stores the SKU ID (must be 0x83).&lt;br /&gt;
&lt;br /&gt;
==== FUSE_FA ====&lt;br /&gt;
Stores failure analysis mode.&lt;br /&gt;
&lt;br /&gt;
==== FUSE_SOC_SPEEDO_1 ====&lt;br /&gt;
Stores the bootrom patch version.&lt;br /&gt;
&lt;br /&gt;
==== FUSE_RESERVED_ODM0 ====&lt;br /&gt;
This appears to store a hardware ID.&lt;br /&gt;
&lt;br /&gt;
==== FUSE_RESERVED_ODM1 ====&lt;br /&gt;
This appears to store a hardware ID.&lt;br /&gt;
&lt;br /&gt;
==== FUSE_RESERVED_ODM2 ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bits&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0-4&lt;br /&gt;
| [5.0.0+] Used as key generation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This appears to store a hardware ID.&lt;br /&gt;
&lt;br /&gt;
==== FUSE_RESERVED_ODM3 ====&lt;br /&gt;
This appears to store a hardware ID.&lt;br /&gt;
&lt;br /&gt;
==== FUSE_RESERVED_ODM4 ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bits&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0-1&lt;br /&gt;
| Unit type (3 = debug; 0 = retail)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Unknown config (must be 1 on retail)&lt;br /&gt;
|-&lt;br /&gt;
| [1.0.0-3.0.2] 3-5&lt;br /&gt;
[4.0.0+] 3-7&lt;br /&gt;
| DRAM id&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| Unknown config mask (must be 0 on retail)&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| Unit type mask (0 = debug; 1 = retail)&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| [3.0.0+] Kiosk mode (0 = retail; 1 = kiosk)&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| [5.0.0+] SoC variant (0 = T210; 1 = T214)&lt;br /&gt;
|-&lt;br /&gt;
| 16-19&lt;br /&gt;
| [4.0.0+] New unit type&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This stores some device configuration parameters.&lt;br /&gt;
&lt;br /&gt;
==== FUSE_RESERVED_ODM6 ====&lt;br /&gt;
This register returns the value programmed into index 0x3A of the fuse array. &lt;br /&gt;
&lt;br /&gt;
==== FUSE_RESERVED_ODM7 ====&lt;br /&gt;
This register returns the value programmed into index 0x3C of the fuse array.&lt;br /&gt;
&lt;br /&gt;
==== FUSE_SPARE_BIT_2 ====&lt;br /&gt;
Stores part of the speedo fusing revision.&lt;br /&gt;
&lt;br /&gt;
==== FUSE_SPARE_BIT_3 ====&lt;br /&gt;
Stores part of the speedo fusing revision.&lt;br /&gt;
&lt;br /&gt;
==== FUSE_SPARE_BIT_4 ====&lt;br /&gt;
Stores part of the speedo fusing revision.&lt;br /&gt;
&lt;br /&gt;
==== FUSE_SPARE_BIT_5 ====&lt;br /&gt;
Must be non-zero on retail units, otherwise the first bootloader panics.&lt;br /&gt;
On debug units it can be zero, which tells the bootloader to choose from two debug master key seeds. If set to non-zero on a debug unit, it tells the bootloader to choose from two retail master key seeds (only the last one matches the retail master key seed).&lt;br /&gt;
&lt;br /&gt;
==== FUSE_PRIVATE_KEY ====&lt;br /&gt;
This stores the 160-bit private key (128 bit SBK + 32-bit device key).&lt;br /&gt;
Reads to these registers after the SBK is locked out produce all-FF output.&lt;br /&gt;
&lt;br /&gt;
==== FUSE_PUBLIC_KEY ====&lt;br /&gt;
This stores the SHA256 hash of the 2048-bit RSA key expected at BCT+0x210.&lt;br /&gt;
&lt;br /&gt;
==== FUSE_RESERVED_SW ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bits&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0-2&lt;br /&gt;
| Boot device&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Skip device selection straps (0 = don&#039;t skip; 1 = skip)&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| ENABLE_CHARGER_DETECT&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| ENABLE_WATCHDOG&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Forced RCM two button mode (0 = Only VOLUME_UP; 1 = VOLUME_UP + HOME)&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| RCM USB controller mode (0 = USB 2.0; 1 = XUSB)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This caches the value of the sw_reserved fuse from the hardware array.&lt;br /&gt;
&lt;br /&gt;
==== FUSE_PKC_DISABLE ====&lt;br /&gt;
This caches the value of the pkc_disable fuse from the hardware array.&lt;br /&gt;
&lt;br /&gt;
== eFuses ==&lt;br /&gt;
The actual hardware fuses can be programmed through the fuse driver after enabling fuse programming.&lt;br /&gt;
&lt;br /&gt;
Below is a list of common fuse indexes used by Tegra devices (and applicable to the Switch).&lt;br /&gt;
Note that the indexes are relative to the start of the fuse array and each element is a 4 byte word. A single fuse write operation always writes the same word at both fuse_array + 0 (PRIMARY_ALIAS) and fuse_array + 1 (REDUNDANT_ALIAS).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Name&lt;br /&gt;
!  Index&lt;br /&gt;
!  Bits&lt;br /&gt;
|-&lt;br /&gt;
| jtag_disable&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| odm_production_mode&lt;br /&gt;
| 0x00&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| odm_lock&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| public_key&lt;br /&gt;
| 0x0C&lt;br /&gt;
| 256&lt;br /&gt;
|-&lt;br /&gt;
| secure_boot_key&lt;br /&gt;
| 0x22&lt;br /&gt;
| 128&lt;br /&gt;
|-&lt;br /&gt;
| device_key&lt;br /&gt;
| 0x2A&lt;br /&gt;
| 32&lt;br /&gt;
|-&lt;br /&gt;
| sec_boot_dev_cfg&lt;br /&gt;
| 0x2C&lt;br /&gt;
| 16&lt;br /&gt;
|-&lt;br /&gt;
| sec_boot_dev_sel&lt;br /&gt;
| 0x2C&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| sw_reserved&lt;br /&gt;
| 0x2E&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| ignore_dev_sel_straps&lt;br /&gt;
| 0x2E&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| [[#odm_reserved|odm_reserved]]&lt;br /&gt;
| 0x2E&lt;br /&gt;
| 256&lt;br /&gt;
|-&lt;br /&gt;
| pkc_disable&lt;br /&gt;
| 0x52&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| debug_authentication&lt;br /&gt;
| 0x5A&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| aid&lt;br /&gt;
| 0x67&lt;br /&gt;
| 32&lt;br /&gt;
|-&lt;br /&gt;
| [[#bootrom_ipatch|bootrom_ipatch]]&lt;br /&gt;
| 0x72&lt;br /&gt;
| 624&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== odm_reserved ===&lt;br /&gt;
The first bootloader only burns fuses in this region.&lt;br /&gt;
Both fuse indexes 0x3A (odm_reserved + 0x0C) and 0x3C (odm_reserved + 0x0E) are used for anti-downgrade control. These fuses will have their values cached into [[#FUSE_RESERVED_ODM6|FUSE_RESERVED_ODM6]] and [[#FUSE_RESERVED_ODM7|FUSE_RESERVED_ODM7]].&lt;br /&gt;
&lt;br /&gt;
=== bootrom_ipatch ===&lt;br /&gt;
Tegra210 based hardware such as the Switch provides support for bootrom patches. The patch data is burned to the hardware fuse array using a specific format (see [https://gist.github.com/shuffle2/f8728159da100e9df2606d43925de0af shuffle2&#039;s ipatch decoder]). The bootrom reads these fuses in order to initialize the IPATCH hardware, which allows overriding data returned for code and data fetches done by BPMP. The revision stored in FUSE_CP_REV indicates the unique set of values stored in ipatch fuses.&lt;br /&gt;
&lt;br /&gt;
The following represents the patch data dumped from a Switch console:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
RAM:00000000 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:00000000&lt;br /&gt;
RAM:00000000&lt;br /&gt;
RAM:00000000 irom_svc_dispatch&lt;br /&gt;
RAM:00000000   STMFD   SP!, {R0-R2}                  ; ipatches:&lt;br /&gt;
RAM:00000000                                         ;  0  b57df00     16ae     df00 : svc #0x00 (offset 0x48)&lt;br /&gt;
RAM:00000000                                         ;  1 1820df22     3040     df22 : svc #0x22 (offset 0x8c)&lt;br /&gt;
RAM:00000000                                         ;  2 3797df26     6f2e     df26 : svc #0x26 (offset 0x94)&lt;br /&gt;
RAM:00000000                                         ;  3 7d9e2000     fb3c     2000 : movs r0, #0x00&lt;br /&gt;
RAM:00000000                                         ;  4  42bdf2c      856     df2c : svc #0x2c (offset 0xa0)&lt;br /&gt;
RAM:00000000                                         ;  5 37aadf42     6f54     df42 : svc #0x42 (offset 0xcc)&lt;br /&gt;
RAM:00000000                                         ;  6  972df4b     12e4     df4b : svc #0x4b (offset 0xde)&lt;br /&gt;
RAM:00000000                                         ;  7 2293df54     4526     df54 : svc #0x54 (offset 0xf0)&lt;br /&gt;
RAM:00000000                                         ;  8 21fadf5d     43f4     df5d : svc #0x5d (offset 0x102)&lt;br /&gt;
RAM:00000000                                         ;  9 bba2ac57    17744     ac57 : data&lt;br /&gt;
RAM:00000000                                         ; 10 bbac3d19    17758     3d19 : data&lt;br /&gt;
RAM:00000000                                         ; 11 1e952001     3d2a     2001 : movs r0, #0x01&lt;br /&gt;
RAM:00000004   MOV     R2, LR&lt;br /&gt;
RAM:00000008   SUB     R2, R2, #2&lt;br /&gt;
RAM:0000000C   LDR     R2, [R2]&lt;br /&gt;
RAM:00000010   AND     R2, R2, #0xFF&lt;br /&gt;
RAM:00000014   MOV     R2, R2,LSL#1&lt;br /&gt;
RAM:00000018   LDR     R0, =0x1007B0&lt;br /&gt;
RAM:0000001C   LDR     R1, =0x1007F8&lt;br /&gt;
RAM:00000020   SUB     R1, R1, R0&lt;br /&gt;
RAM:00000024   LDR     R0, =0x40004C30&lt;br /&gt;
RAM:00000028   ADD     R0, R0, R1&lt;br /&gt;
RAM:0000002C   ADD     R2, R2, R0&lt;br /&gt;
RAM:00000030   ORR     R2, R2, #1&lt;br /&gt;
RAM:00000034   LDMFD   SP!, {R0,R1}&lt;br /&gt;
RAM:00000038   BX      R2&lt;br /&gt;
RAM:00000038 ; End of function irom_svc_dispatch&lt;br /&gt;
RAM:00000038&lt;br /&gt;
RAM:00000038 ; ---------------------------------------------------------------------------&lt;br /&gt;
RAM:0000003C dword_3C DCD 0x1007B0                   ; DATA XREF: irom_svc_dispatch+18↑r&lt;br /&gt;
RAM:00000040 dword_40 DCD 0x1007F8                   ; DATA XREF: irom_svc_dispatch+1C↑r&lt;br /&gt;
RAM:00000044 dword_44 DCD 0x40004C30                 ; DATA XREF: irom_svc_dispatch+24↑r&lt;br /&gt;
RAM:00000048   CODE16&lt;br /&gt;
RAM:00000048&lt;br /&gt;
RAM:00000048 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:00000048&lt;br /&gt;
RAM:00000048&lt;br /&gt;
RAM:00000048 sub_48&lt;br /&gt;
RAM:00000048   MOVS    R2, #0                        ; 0  b57df00     16ae     df00 : svc #0x00 (offset 0x48)&lt;br /&gt;
RAM:0000004A   MVNS    R2, R2&lt;br /&gt;
RAM:0000004C   LDR     R1, =0x60006410&lt;br /&gt;
RAM:0000004E   STR     R2, [R1,#0x30]&lt;br /&gt;
RAM:00000050   STR     R2, [R1,#0x38]&lt;br /&gt;
RAM:00000052   LDR     R1, =0x600060F8&lt;br /&gt;
RAM:00000054   STR     R2, [R1]&lt;br /&gt;
RAM:00000056   STR     R2, [R1,#4]&lt;br /&gt;
RAM:00000058   LDR     R1, =0x60006284&lt;br /&gt;
RAM:0000005A   STR     R2, [R1]&lt;br /&gt;
RAM:0000005C   STR     R2, [R1,#0x18]&lt;br /&gt;
RAM:0000005E   ADDS    R1, #0x80&lt;br /&gt;
RAM:00000060   ADDS    R1, #0x1C&lt;br /&gt;
RAM:00000062   STR     R2, [R1]&lt;br /&gt;
RAM:00000064   STR     R2, [R1,#8]&lt;br /&gt;
RAM:00000066   STR     R2, [R1,#0x10]&lt;br /&gt;
RAM:00000068   ADDS    R1, #0x80&lt;br /&gt;
RAM:0000006A   STR     R2, [R1]&lt;br /&gt;
RAM:0000006C   STR     R2, [R1,#4]&lt;br /&gt;
RAM:0000006E   LDR     R1, =0x60006554&lt;br /&gt;
RAM:00000070   STR     R2, [R1]&lt;br /&gt;
RAM:00000072   MOVS    R2, #0xA0000000&lt;br /&gt;
RAM:00000076   LDR     R1, =0x60006148&lt;br /&gt;
RAM:00000078   STR     R2, [R1]&lt;br /&gt;
RAM:0000007A   ADDS    R1, #0x38 ; &#039;8&#039;&lt;br /&gt;
RAM:0000007C   STR     R2, [R1]&lt;br /&gt;
RAM:0000007E   MOVS    R2, #0xE0000000&lt;br /&gt;
RAM:00000082   LDR     R1, =0x600066A0&lt;br /&gt;
RAM:00000084   STR     R2, [R1]&lt;br /&gt;
RAM:00000086   MOVS    R1, #0&lt;br /&gt;
RAM:00000088   MOVS    R0, #0xE&lt;br /&gt;
RAM:0000008A   B       pop_r2_mov_pc_lr&lt;br /&gt;
RAM:0000008A ; End of function sub_48&lt;br /&gt;
RAM:0000008A&lt;br /&gt;
RAM:0000008C&lt;br /&gt;
RAM:0000008C ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:0000008C&lt;br /&gt;
RAM:0000008C&lt;br /&gt;
RAM:0000008C sub_8C&lt;br /&gt;
RAM:0000008C   LDR     R0, [R1,#0x18]                ; 1 1820df22     3040     df22 : svc #0x22 (offset 0x8c)&lt;br /&gt;
RAM:0000008E   MOVS    R2, #1&lt;br /&gt;
RAM:00000090   ORRS    R0, R2&lt;br /&gt;
RAM:00000092   B       pop_r2_mov_pc_lr&lt;br /&gt;
RAM:00000092 ; End of function sub_8C&lt;br /&gt;
RAM:00000092&lt;br /&gt;
RAM:00000094&lt;br /&gt;
RAM:00000094 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:00000094&lt;br /&gt;
RAM:00000094&lt;br /&gt;
RAM:00000094 sub_94&lt;br /&gt;
RAM:00000094   LDR     R2, [R4,#0x50]                ; 2 3797df26     6f2e     df26 : svc #0x26 (offset 0x94)&lt;br /&gt;
RAM:00000096   ADDS    R2, R2, #2&lt;br /&gt;
RAM:00000098   STR     R2, [R4,#0x50]&lt;br /&gt;
RAM:0000009A   SUBS    R1, #0x80&lt;br /&gt;
RAM:0000009C   STR     R1, [R4,#0x34]&lt;br /&gt;
RAM:0000009E   B       pop_r2_mov_pc_lr&lt;br /&gt;
RAM:0000009E ; End of function sub_94&lt;br /&gt;
RAM:0000009E&lt;br /&gt;
RAM:000000A0&lt;br /&gt;
RAM:000000A0 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:000000A0&lt;br /&gt;
RAM:000000A0&lt;br /&gt;
RAM:000000A0 sub_A0&lt;br /&gt;
RAM:000000A0&lt;br /&gt;
RAM:000000A0 ; FUNCTION CHUNK AT RAM:00000148 SIZE 00000004 BYTES&lt;br /&gt;
RAM:000000A0&lt;br /&gt;
RAM:000000A0   MOVS    R0, #0x70000000               ; 4  42bdf2c      856     df2c : svc #0x2c (offset 0xa0)&lt;br /&gt;
RAM:000000A4   LDR     R6, =dword_7000EF14&lt;br /&gt;
RAM:000000A6   LDR     R2, =dword_7000E5B4&lt;br /&gt;
RAM:000000A8   LDR     R2, [R2]&lt;br /&gt;
RAM:000000AA   CMP     R2, #0&lt;br /&gt;
RAM:000000AC   BEQ     loc_B4&lt;br /&gt;
RAM:000000AE   LDR     R2, [R6]&lt;br /&gt;
RAM:000000B0   STR     R2, [R0,#8]&lt;br /&gt;
RAM:000000B2   B       loc_BC&lt;br /&gt;
RAM:000000B4 ; ---------------------------------------------------------------------------&lt;br /&gt;
RAM:000000B4&lt;br /&gt;
RAM:000000B4 loc_B4                                  ; CODE XREF: sub_A0+C↑j&lt;br /&gt;
RAM:000000B4   LDR     R2, [R0,#8]&lt;br /&gt;
RAM:000000B6   LSRS    R0, R0, #0x12&lt;br /&gt;
RAM:000000B8   ORRS    R2, R0&lt;br /&gt;
RAM:000000BA   STR     R2, [R6]&lt;br /&gt;
RAM:000000BC&lt;br /&gt;
RAM:000000BC loc_BC                                  ; CODE XREF: sub_A0+12↑j&lt;br /&gt;
RAM:000000BC   LDR     R6, =dword_7000E9C0&lt;br /&gt;
RAM:000000BE   LDR     R0, [R6]&lt;br /&gt;
RAM:000000C0   MOVS    R2, #0x4000&lt;br /&gt;
RAM:000000C4   ORRS    R2, R0&lt;br /&gt;
RAM:000000C6   STR     R2, [R6]&lt;br /&gt;
RAM:000000C8   LDR     R0, [R5,#0x10]&lt;br /&gt;
RAM:000000CA   B       pop_r2_mov_pc_lr&lt;br /&gt;
RAM:000000CA ; End of function sub_A0&lt;br /&gt;
RAM:000000CA&lt;br /&gt;
RAM:000000CC&lt;br /&gt;
RAM:000000CC ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:000000CC&lt;br /&gt;
RAM:000000CC&lt;br /&gt;
RAM:000000CC sub_CC&lt;br /&gt;
RAM:000000CC   MOVS    R2, #0xF000000                ; 5 37aadf42     6f54     df42 : svc #0x42 (offset 0xcc)&lt;br /&gt;
RAM:000000D0   BICS    R1, R2&lt;br /&gt;
RAM:000000D2   STR     R1, [R4,#0x10]&lt;br /&gt;
RAM:000000D4   LDR     R1, [R4,#0x50]&lt;br /&gt;
RAM:000000D6   MOVS    R2, #7&lt;br /&gt;
RAM:000000D8   BICS    R1, R2&lt;br /&gt;
RAM:000000DA   STR     R1, [R4,#0x50]&lt;br /&gt;
RAM:000000DC   B       pop_r2_mov_pc_lr&lt;br /&gt;
RAM:000000DC ; End of function sub_CC&lt;br /&gt;
RAM:000000DC&lt;br /&gt;
RAM:000000DE&lt;br /&gt;
RAM:000000DE ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:000000DE&lt;br /&gt;
RAM:000000DE&lt;br /&gt;
RAM:000000DE sub_DE&lt;br /&gt;
RAM:000000DE   LDR     R2, =dword_7000FA9C           ; 6  972df4b     12e4     df4b : svc #0x4b (offset 0xde)&lt;br /&gt;
RAM:000000E0   LDR     R2, [R2]&lt;br /&gt;
RAM:000000E2   LSRS    R2, R2, #8&lt;br /&gt;
RAM:000000E4   LSLS    R2, R2, #1&lt;br /&gt;
RAM:000000E6   LDR     R1, [R4]&lt;br /&gt;
RAM:000000E8   BICS    R1, R2&lt;br /&gt;
RAM:000000EA   STR     R1, [R4]&lt;br /&gt;
RAM:000000EC   CMP     R0, #0&lt;br /&gt;
RAM:000000EE   B       pop_r2_mov_pc_lr&lt;br /&gt;
RAM:000000EE ; End of function sub_DE&lt;br /&gt;
RAM:000000EE&lt;br /&gt;
RAM:000000F0&lt;br /&gt;
RAM:000000F0 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:000000F0&lt;br /&gt;
RAM:000000F0&lt;br /&gt;
RAM:000000F0 sub_F0&lt;br /&gt;
RAM:000000F0&lt;br /&gt;
RAM:000000F0 arg_0=  0&lt;br /&gt;
RAM:000000F0&lt;br /&gt;
RAM:000000F0   LDR     R0, =0x400049F0               ; 7 2293df54     4526     df54 : svc #0x54 (offset 0xf0)&lt;br /&gt;
RAM:000000F2   LDR     R2, [R0]&lt;br /&gt;
RAM:000000F4   STR     R2, [SP,#arg_0]&lt;br /&gt;
RAM:000000F6   LDR     R0, =0x40010000&lt;br /&gt;
RAM:000000F8   LSRS    R2, R2, #17&lt;br /&gt;
RAM:000000FA   BEQ     pop_r2_mov_pc_lr              ; if ([0x400049F0] &amp;gt;&amp;gt; 17) == 0) {&lt;br /&gt;
RAM:000000FA                                         ;   r2 = [0x400049F0];&lt;br /&gt;
RAM:000000FA                                         ; } else {&lt;br /&gt;
RAM:000000FC   LDR     R0, =APBDEV_PMC_CNTRL_0&lt;br /&gt;
RAM:000000FE   STR     R4, [R0]                      ;  write APBDEV_PMC_CNTRL&lt;br /&gt;
RAM:00000100&lt;br /&gt;
RAM:00000100 loc_100                                 ; CODE XREF: sub_F0:loc_100↓j&lt;br /&gt;
RAM:00000100   B       loc_100                       ;  hang&lt;br /&gt;
RAM:00000100 ; End of function sub_F0                ; }&lt;br /&gt;
RAM:00000100&lt;br /&gt;
RAM:00000102&lt;br /&gt;
RAM:00000102 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;
RAM:00000102&lt;br /&gt;
RAM:00000102&lt;br /&gt;
RAM:00000102 sub_102&lt;br /&gt;
RAM:00000102&lt;br /&gt;
RAM:00000102 arg_0=  0&lt;br /&gt;
RAM:00000102&lt;br /&gt;
RAM:00000102   LDR     R2, =0x40010220               ; 8 21fadf5d     43f4     df5d : svc #0x5d (offset 0x102)&lt;br /&gt;
RAM:00000104   STR     R2, [SP,#arg_0]               ; set r2 retval = [0x40010220]&lt;br /&gt;
RAM:00000106   LDR     R2, [R2,#0x18]&lt;br /&gt;
RAM:00000108   ADDS    R0, #0xFC&lt;br /&gt;
RAM:0000010A   STR     R2, [R0,#0x1C]                ; [r0+0x118] = [0x40010220 + 0x18]&lt;br /&gt;
RAM:0000010C   B       pop_r2_mov_pc_lr&lt;br /&gt;
RAM:0000010C ; End of function sub_102&lt;br /&gt;
RAM:0000010C&lt;br /&gt;
RAM:0000010C ; ---------------------------------------------------------------------------&lt;br /&gt;
RAM:0000010E   DCB    0&lt;br /&gt;
RAM:0000010F   DCB    0&lt;br /&gt;
RAM:00000110 off_110 DCD 0x60006410                  ; DATA XREF: sub_48+4↑r&lt;br /&gt;
RAM:00000114 off_114 DCD 0x600060F8                  ; DATA XREF: sub_48+A↑r&lt;br /&gt;
RAM:00000118 off_118 DCD 0x60006284                  ; DATA XREF: sub_48+10↑r&lt;br /&gt;
RAM:0000011C off_11C DCD 0x60006554                  ; DATA XREF: sub_48+26↑r&lt;br /&gt;
RAM:00000120 off_120 DCD 0x60006148                  ; DATA XREF: sub_48+2E↑r&lt;br /&gt;
RAM:00000124 off_124 DCD 0x600066A0                  ; DATA XREF: sub_48+3A↑r&lt;br /&gt;
RAM:00000128 off_128 DCD dword_7000EF14              ; DATA XREF: sub_A0+4↑r&lt;br /&gt;
RAM:0000012C off_12C DCD dword_7000E5B4              ; DATA XREF: sub_A0+6↑r&lt;br /&gt;
RAM:00000130 off_130 DCD dword_7000E9C0              ; DATA XREF: sub_A0:loc_BC↑r&lt;br /&gt;
RAM:00000134 off_134 DCD dword_7000FA9C              ; DATA XREF: sub_DE↑r&lt;br /&gt;
RAM:00000138 off_138 DCD 0x400049F0                  ; DATA XREF: sub_F0↑r&lt;br /&gt;
RAM:0000013C dword_13C DCD 0x40010000                ; DATA XREF: sub_F0+6↑r&lt;br /&gt;
RAM:00000140 off_140 DCD APBDEV_PMC_CNTRL_0          ; DATA XREF: sub_F0+C↑r&lt;br /&gt;
RAM:00000144 off_144 DCD 0x40010220                  ; DATA XREF: sub_102↑r&lt;br /&gt;
RAM:00000148 ; ---------------------------------------------------------------------------&lt;br /&gt;
RAM:00000148 ; START OF FUNCTION CHUNK FOR sub_A0&lt;br /&gt;
RAM:00000148&lt;br /&gt;
RAM:00000148 pop_r2_mov_pc_lr                        ; CODE XREF: sub_48+42↑j&lt;br /&gt;
RAM:00000148                                         ; sub_8C+6↑j ...&lt;br /&gt;
RAM:00000148   POP     {R2}&lt;br /&gt;
RAM:0000014A   MOV     PC, LR&lt;br /&gt;
RAM:0000014A ; END OF FUNCTION CHUNK FOR sub_A0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last 4 patches are exclusive to the Switch, while the remaining ones are often included in most Tegra210 based devices.&lt;br /&gt;
&lt;br /&gt;
==== ipatch 0 ====&lt;br /&gt;
This patch configures clock enables and clock gate overrides for new hardware.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
 u32 CLK_ENB_H_SET = 0x60006328;&lt;br /&gt;
 u32 CLK_ENB_L_SET = 0x60006320;&lt;br /&gt;
 u32 CLK_ENB_U_SET = 0x60006330; &lt;br /&gt;
 u32 CLK_ENB_V_SET = 0x60006440;&lt;br /&gt;
 u32 CLK_ENB_W_SET = 0x60006448;&lt;br /&gt;
 u32 CLK_ENB_X_SET = 0x60006284;&lt;br /&gt;
 u32 CLK_ENB_Y_SET = 0x6000629C;&lt;br /&gt;
 u32 LVL2_CLK_GATE_OVRA = 0x600060F8;&lt;br /&gt;
 u32 LVL2_CLK_GATE_OVRB = 0x600060FC;&lt;br /&gt;
 u32 LVL2_CLK_GATE_OVRC = 0x600063A0;&lt;br /&gt;
 u32 LVL2_CLK_GATE_OVRD = 0x600063A4;&lt;br /&gt;
 u32 LVL2_CLK_GATE_OVRE = 0x60006554;&lt;br /&gt;
 u32 CLK_SOURCE_VI = 0x60006148;&lt;br /&gt;
 u32 CLK_SOURCE_HOST1X = 0x60006180;&lt;br /&gt;
 u32 CLK_SOURCE_NVENC = 0x600066A0; &lt;br /&gt;
&lt;br /&gt;
 // Set all clock enables and overrides&lt;br /&gt;
 *(u32 *)CLK_ENB_V_SET = 0xFFFFFFFF;&lt;br /&gt;
 *(u32 *)CLK_ENB_W_SET = 0xFFFFFFFF;&lt;br /&gt;
 *(u32 *)LVL2_CLK_GATE_OVRA = 0xFFFFFFFF;&lt;br /&gt;
 *(u32 *)LVL2_CLK_GATE_OVRB = 0xFFFFFFFF;&lt;br /&gt;
 *(u32 *)CLK_ENB_X_SET = 0xFFFFFFFF;&lt;br /&gt;
 *(u32 *)CLK_ENB_Y_SET = 0xFFFFFFFF;&lt;br /&gt;
 *(u32 *)CLK_ENB_L_SET = 0xFFFFFFFF;&lt;br /&gt;
 *(u32 *)CLK_ENB_H_SET = 0xFFFFFFFF;&lt;br /&gt;
 *(u32 *)CLK_ENB_U_SET = 0xFFFFFFFF;&lt;br /&gt;
 *(u32 *)LVL2_CLK_GATE_OVRC = 0xFFFFFFFF;&lt;br /&gt;
 *(u32 *)LVL2_CLK_GATE_OVRD = 0xFFFFFFFF;&lt;br /&gt;
 *(u32 *)LVL2_CLK_GATE_OVRE = 0xFFFFFFFF;&lt;br /&gt;
&lt;br /&gt;
 // Set VI, HOST1X and NVENC clock sources to CLK_M&lt;br /&gt;
 *(u32 *)CLK_SOURCE_VI = 0xA0000000;&lt;br /&gt;
 *(u32 *)CLK_SOURCE_HOST1X = 0xA0000000;&lt;br /&gt;
 *(u32 *)CLK_SOURCE_NVENC = 0xE0000000;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
     Untranslated instructions:&lt;br /&gt;
&lt;br /&gt;
     MOVS    R1, #0&lt;br /&gt;
     MOVS    R0, #0xE&lt;br /&gt;
 */&lt;br /&gt;
 &lt;br /&gt;
 return;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== ipatch 1 ====&lt;br /&gt;
This patch is a bugfix.&lt;br /&gt;
&lt;br /&gt;
LP0 resume code expects APBDEV_PMC_SCRATCH190_0 to be set to 0x01, but the bootrom didn&#039;t set it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
 u32 APBDEV_PMC_SCRATCH190_0 = 0x7000EC18;&lt;br /&gt;
 u32 pmc_scratch190_val = *(u32 *)APBDEV_PMC_SCRATCH190_0;&lt;br /&gt;
 &lt;br /&gt;
 return (pmc_scratch190_val | 0x01);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== ipatch 2 ====&lt;br /&gt;
This patch adjusts USB configurations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
 u32 USB1_UTMIP_SPARE_CFG0_0 = 0x7D000834;&lt;br /&gt;
 u32 USB1_UTMIP_BIAS_CFG2_0 = 0x7D000850;&lt;br /&gt;
 &lt;br /&gt;
 // Increase UTMIP_HSSQUELCH_LEVEL_NEW by 0x02&lt;br /&gt;
 *(u32 *)USB1_UTMIP_BIAS_CFG2_0 += 0x02;&lt;br /&gt;
&lt;br /&gt;
 // Clear FUSE_HS_IREF_CAP_CFG&lt;br /&gt;
 *(u32 *)USB1_UTMIP_SPARE_CFG0_0 = ((*(u32 *)USB1_UTMIP_SPARE_CFG0_0 &amp;amp; ~(0x118)) - 0x80);&lt;br /&gt;
 &lt;br /&gt;
 return;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== ipatch 3 ====&lt;br /&gt;
This patch pertains to XHCI IRQ clearing checks and forces a result code to be 0.&lt;br /&gt;
&lt;br /&gt;
==== ipatch 4 ====&lt;br /&gt;
This patch allows backing up and restoring strapping options for warmboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
 u32 APBDEV_PMC_SCRATCH0_0 = 0x7000E450;&lt;br /&gt;
 u32 APBDEV_PMC_RST_STATUS_0 = 0x7000E5B4;&lt;br /&gt;
 u32 APBDEV_PMC_SEC_DISABLE8_0 = 0x7000E9C0;&lt;br /&gt;
 u32 APBDEV_PMC_SECURE_SCRATCH111_0 = 0x7000EF14;&lt;br /&gt;
 u32 APB_MISC_PP_STRAPPING_OPT_A_0 = 0x70000008; &lt;br /&gt;
&lt;br /&gt;
 u32 reset_status = *(u32 *)APBDEV_PMC_RST_STATUS_0;&lt;br /&gt;
&lt;br /&gt;
 // Check for regular power on&lt;br /&gt;
 if (reset_status == 0)&lt;br /&gt;
 {    &lt;br /&gt;
     // Set all buttons in RCM_STRAPS and backup to PMC scratch&lt;br /&gt;
     *(u32 *)APBDEV_PMC_SECURE_SCRATCH111_0 = (*(u32 *)APB_MISC_PP_STRAPPING_OPT_A_0 | 0x1C00);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
     // Restore strapping options from PMC scratch&lt;br /&gt;
     *(u32 *)APB_MISC_PP_STRAPPING_OPT_A_0 = *(u32 *)APBDEV_PMC_SECURE_SCRATCH111_0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 // Disable write access to APBDEV_PMC_SECURE_SCRATCH111_0&lt;br /&gt;
 *(u32 *)APBDEV_PMC_SEC_DISABLE8_0 |= 0x4000;&lt;br /&gt;
 &lt;br /&gt;
 return *(u32 *)APBDEV_PMC_SCRATCH0_0;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== ipatch 5 ====&lt;br /&gt;
This patch adjusts USB configurations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
 u32 USB1_UTMIP_HSRX_CFG0_0 = 0x7D000810;&lt;br /&gt;
 u32 USB1_UTMIP_BIAS_CFG2_0 = 0x7D000850;&lt;br /&gt;
&lt;br /&gt;
 // Clear UTMIP_IDLE_WAIT, UTMIP_ELASTIC_LIMIT and UTMIP_PCOUNT_UPDN_DIV,&lt;br /&gt;
 // and set UTMIP_IDLE_WAIT to 0x11 and UTMIP_ELASTIC_LIMIT to 0x10 &lt;br /&gt;
 *(u32 *)USB1_UTMIP_HSRX_CFG0_0 = ((*(u32 *)USB1_UTMIP_HSRX_CFG0_0 &amp;amp; ~(0xF8000) + 0x88000 &amp;amp; ~(0x7C00) + 0x4000) &amp;amp; ~(0xF000000));&lt;br /&gt;
 &lt;br /&gt;
 // Clear UTMIP_HSSQUELCH_LEVEL_NEW&lt;br /&gt;
 *(u32 *)USB1_UTMIP_BIAS_CFG2_0 &amp;amp;= ~(0x07);&lt;br /&gt;
 &lt;br /&gt;
 return;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== ipatch 6 ====&lt;br /&gt;
This patch is a factory backdoor.&lt;br /&gt;
&lt;br /&gt;
It allows controlling the debug authentication configuration using a fuse.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
 u32 FUSE_DEBUG_AUTH_OVERRIDE = 0x7000FA9C;&lt;br /&gt;
&lt;br /&gt;
 u32 debug_auth_override_val = *(u32 *)FUSE_DEBUG_AUTH_OVERRIDE;&lt;br /&gt;
 debug_auth_override_val = ((debug_auth_override_val &amp;gt;&amp;gt; 0x08) &amp;lt;&amp;lt; 0x01);&lt;br /&gt;
&lt;br /&gt;
 // Override debug authentication value stored in IRAM&lt;br /&gt;
 *(u32 *)0x400028E4 &amp;amp;= ~(debug_auth_override_val);&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
     Untranslated instructions:&lt;br /&gt;
 &lt;br /&gt;
     CMP     R0, #0&lt;br /&gt;
 */&lt;br /&gt;
 &lt;br /&gt;
 return;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== ipatch 7 ====&lt;br /&gt;
This patch is a bugfix.&lt;br /&gt;
&lt;br /&gt;
It prevents overflowing IRAM (0x40010000) when copying the warmboot binary from DRAM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
 u32 APBDEV_PMC_CNTRL_0 = 0x7000E400;&lt;br /&gt;
 &lt;br /&gt;
 u32 warmboot_header_addr = 0x400049F0;&lt;br /&gt;
 u32 warmboot_bin_size = *(u32 *)warmboot_bin_header_addr;&lt;br /&gt;
 &lt;br /&gt;
 // Invalid warmboot binary size&lt;br /&gt;
 if (warmboot_size &amp;gt;&amp;gt; 0x11)&lt;br /&gt;
 {&lt;br /&gt;
     // Assert MAIN_RST&lt;br /&gt;
     // 0x40004BF0 comes from R4 and the bootrom doesn&#039;t bother to change it&lt;br /&gt;
     *(u32 *)APBDEV_PMC_CNTRL_0 = 0x40004BF0;&lt;br /&gt;
&lt;br /&gt;
     // Deadlock&lt;br /&gt;
     while(1);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 /*&lt;br /&gt;
     Untranslated instructions:&lt;br /&gt;
 &lt;br /&gt;
     LDR     R0, =0x40010000&lt;br /&gt;
     LDR     R2, [warmboot_bin_header_addr]&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
 return;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== ipatch 8 ====&lt;br /&gt;
This patch is a bugfix.&lt;br /&gt;
&lt;br /&gt;
It sets the correct warmboot binary entrypoint address for RSA signature verification, which would be done in DRAM instead of IRAM without this patch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
 u32 warmboot_addr_ptr = 0x40010238;&lt;br /&gt;
 u32 warmboot_entry_addr_ptr = 0x40004C28;&lt;br /&gt;
&lt;br /&gt;
 *(u32 *)warmboot_entry_addr_ptr = *(u32 *)warmboot_addr_ptr;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
     Untranslated instructions:&lt;br /&gt;
 &lt;br /&gt;
     LDR     R2, [warmboot_addr_ptr]&lt;br /&gt;
 */&lt;br /&gt;
 &lt;br /&gt;
 return;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== ipatches 9 and 10 ====&lt;br /&gt;
These patches modify the 256-bit Secure Provisioning AES key with index 0x3A.&lt;br /&gt;
&lt;br /&gt;
==== ipatch 11 ====&lt;br /&gt;
This patch pertains to the [[Security_Engine|Security Engine]] context restore process and forces SE_OPERATION_UNK1 to be 0x01.&lt;br /&gt;
&lt;br /&gt;
== Anti-downgrade ==&lt;br /&gt;
The first bootloader verifies [[#FUSE_RESERVED_ODM7|FUSE_RESERVED_ODM7]] to prevent downgrading.&lt;br /&gt;
How many fuses are expected to be burnt depends the device&#039;s unit type as below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! System version&lt;br /&gt;
! Expected number of burnt fuses (retail)&lt;br /&gt;
! Expected number of burnt fuses (non-retail)&lt;br /&gt;
|-&lt;br /&gt;
| 1.0.0&lt;br /&gt;
| 1&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| 2.0.0-2.3.0&lt;br /&gt;
| 2&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| 3.0.0&lt;br /&gt;
| 3&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 3.0.1-3.0.2&lt;br /&gt;
| 4&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 4.0.0-4.1.0&lt;br /&gt;
| 5&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 5.0.0-5.1.0&lt;br /&gt;
| 6&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 6.0.0-6.1.0&lt;br /&gt;
| 7&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 6.2.0&lt;br /&gt;
| 8&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 7.0.0-7.0.1&lt;br /&gt;
| 9&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If too many fuses are burnt the bootloader will panic immediately.&lt;br /&gt;
&lt;br /&gt;
If too few are burnt, the bootloader will enable fuse programming and write the expected value to fuse indexes 0x3A and 0x3C. Afterwards, fuse programming is disabled and the panic value 0x21 is written to PMC_SCRATCH200 register (0x7000EC40). Finally, the watchdog timer is initialized and programmed to force a reset.&lt;br /&gt;
&lt;br /&gt;
On a subsequent boot, after the anti-downgrade fuses are checked again, the PMC_RST_STATUS register (0x7000E5B4) is checked and if set to 0x01 (watchdog reset) the PMC_SCRATCH200 register (0x7000EC40) will be checked for the panic value 0x21.&lt;br /&gt;
PMC_RST_STATUS will only be set back to 0 (power on reset) if the fuse count matches the new expected value, otherwise the system will panic.&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=TRM&amp;diff=6213</id>
		<title>TRM</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=TRM&amp;diff=6213"/>
		<updated>2019-02-13T01:04:27Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Added TRM redirect, so it shows up in search results properly&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Tegra-X1]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=NCM_services&amp;diff=6201</id>
		<title>NCM services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=NCM_services&amp;diff=6201"/>
		<updated>2019-02-11T07:03:30Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Make unofficial ILocationResolver names consistent with official names&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NCM contains services for internal file path and content management.&lt;br /&gt;
&lt;br /&gt;
= Location Resolver services =&lt;br /&gt;
== lr ==&lt;br /&gt;
This is &amp;quot;nn::lr::ILocationResolverManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || OpenLocationResolver || [[Filesystem_services#StorageId|StorageID]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || OpenRegisteredLocationResolver || None || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || RefreshLocationResolver || [[Filesystem_services#StorageId|StorageID]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [2.0.0+] OpenAddOnContentLocationResolver || None  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The only sysmodules which use this service are [[Filesystem_services|FS]], [[Loader_services|Loader]], and [[NS_Services|NS]]. [[boot2]] has access but doesn&#039;t use it.&lt;br /&gt;
&lt;br /&gt;
=== ILocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::ILocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ResolveProgramPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#RedirectProgramPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#ResolveApplicationControlPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#ResolveApplicationHtmlDocumentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#ResolveDataPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#RedirectApplicationControlPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#RedirectApplicationHtmlDocumentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#ResolveApplicationLegalInformationPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#RedirectApplicationLegalInformationPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#Refresh]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [5.0.0+] [[#RedirectProgramPath2]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [5.0.0+] [[#Refresh2]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [5.0.0+] [[#DeleteProgramPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [5.0.0+] [[#DeleteApplicationControlPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [5.0.0+] [[#DeleteApplicationHtmlDocumentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [5.0.0+] [[#DeleteApplicationLegalInformationPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [7.0.0+] ? (Takes a total of 8-bytes of input and a type-0x1A output buffer, no output)&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [7.0.0+] ? (Takes a total of 8-bytes of input and a type-0x19 input buffer, no output)&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [7.0.0+] ? (Takes a total of 8-bytes of input and a type-0x19 input buffer, no output)&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [7.0.0+] ? (Takes a total of 8-bytes of input, no output)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If the supplied [[Filesystem_services#StorageId|StorageID]] is 1 (Host), a different set of internal functions is used to handle these commands. In this more restricted set of functions, GetControlNcaPath is stubbed and only returns error 0x608.&lt;br /&gt;
&lt;br /&gt;
The Get* commands load the [[Filesystem_services|ContentPath]] from linked-lists&#039; [[#Location_List_Entry|entries]] in memory using the input TitleID. When the command fails to find an entry for the specified TitleID, 0x408 is returned for GetProgramNcaPath and 0xA08 is returned for the rest.&lt;br /&gt;
&lt;br /&gt;
The Set* commands always return 0 and add a new entry to the list. If a matching entry is found, it&#039;s removed first.&lt;br /&gt;
&lt;br /&gt;
==== ResolveProgramPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectProgramPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 0.&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationControlPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationHtmlDocumentPath====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
==== ResolveDataPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationControlPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationHtmlDocumentPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationLegalInformationPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationLegalInformationPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== Refresh ====&lt;br /&gt;
Takes no input. Frees all linked-lists&#039; entries that have &#039;&#039;&#039;flag&#039;&#039;&#039; set to 0.&lt;br /&gt;
&lt;br /&gt;
==== RedirectProgramPath2 ====&lt;br /&gt;
Same as [[#RedirectProgramPath|RedirectProgramPath]], but inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== Refresh2 ====&lt;br /&gt;
Takes no input. Frees all linked-lists&#039; entries that have &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== DeleteProgramPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== DeleteApplicationControlPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== DeleteApplicationHtmlDocumentPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== DeleteApplicationLegalInformationPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
=== IRegisteredLocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::IRegisteredLocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This works like [[#ILocationResolver]], but only two types of NCA paths can be gotten/set. In addition, each type has a fallback path that can be set for a single title ID at a time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || ResolveProgramPath || u64 TitleID + C descriptor || Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || RegisterProgramPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] || Sets the Type 0 fallback TID and path to the provided arguments.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || UnregisterProgramPath || u64 TitleID || If the Type 0 fallback TID is == argument TID, unregisters the fallback path. Otherwise, noop.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || RedirectProgramPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [2.0.0+] ResolveHtmlDocumentPath || u64 TitleID + C descriptor ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [2.0.0+] RegisterHtmlDocumentPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] || Sets the Type 1 fallback TID and path to the provided arguments.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [2.0.0+] UnregisterHtmlDocumentPath || u64 TitleID || If the Type 1 fallback TID is == argument TID, unregisters the fallback path. Otherwise, noop.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [2.0.0+] RedirectHtmlDocumentPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [7.0.0+] ? || No input/output. || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IAddOnContentLocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::IAddOnContentLocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || ResolveAddOnContentPath || u64 TitleID + C descriptor || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || RegisterAddOnContentStorage || [[Filesystem_services#StorageId|StorageID]] + u64 TitleID || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || UnregisterAllAddOnContentPath || None || Clears all registered titles here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Location List Entry ===&lt;br /&gt;
Total size is 0x320 bytes. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8|| Pointer to previous entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x8|| Pointer to next entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x8|| TitleID&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x300 || [[Filesystem_services|ContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x318 || 0x4 || Flag&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C || 0x4 || Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Content Manager services =&lt;br /&gt;
== ncm ==&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CreateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CreateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || VerifyContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || VerifyContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || OpenContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], [2.0.0+] Only returns a storage if one has previously been opened globally via OpenIContentStorage.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || OpenContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], [2.0.0+] Only returns a storage if one has previously been opened globally via OpenIContentStorage.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [1.0.0] CloseContentStorageForcibly || Takes a [[Filesystem_services#StorageId|StorageID]]. Calls IContentStorage-&amp;gt;CloseAndFlushStorage().&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [1.0.0] CloseContentMetaDatabaseForcibly || Takes a [[Filesystem_services#StorageId|StorageID]].  Calls IContentMetaDatabase-&amp;gt;CloseMetaDatabase().&lt;br /&gt;
|-&lt;br /&gt;
| 8 || CleanupContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and deletes the associated savedata.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [2.0.0+] ActivateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], and opens an IContentStorage for the StorageID to be gotten with GetIContentStorage. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [2.0.0+] InactivateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], and closes the associated IContentStorage. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [2.0.0+] ActivateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and opens an IContentMetaDatabase for the StorageID to be gotten with GetIContentMetaDatabase. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [2.0.0+] InactivateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and closes the associated IContentMetaDatabase. Note: Name is not official.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IContentStorage ===&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentStorage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GeneratePlaceHolderId]] || Returns a random UUID for the Content Storage.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CreatePlaceHolder || Takes two [[#NcaID]]s, and a u64 filesize.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DeletePlaceHolder || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || HasPlaceHolder ||  Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || WritePlaceHolder || Takes a [[#NcaID]], a u64-offset, and type 5 buffer. Writes the buffer to the file for the NcaID&#039;s placeholder path at the specified offset.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Register || Takes two [[#NcaID]]s, moves the Placeholder NCA content to the registered NCA path.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Delete || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Has || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || GetPath || Takes a [[#NcaID]]. Returns a [[Filesystem_services#ContentPath|Content Path]].&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetPlaceHolderPath || Takes a [[#NcaID]]. Returns a [[Filesystem_services#ContentPath|Content Path]].&lt;br /&gt;
|-&lt;br /&gt;
| 10 || CleanupAllPlaceHolder || Deletes and re-creates the Placeholder directory.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || ListPlaceHolder || This is like [[#GetNumberOfRegisteredEntries]], but for the Placeholder directory.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#GetContentCount]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#ListContentId]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#GetSizeFromContentId]] || &lt;br /&gt;
|-&lt;br /&gt;
| 15 || DisableForcibly || Closes/Flushes all resources for the storage, and causes all future IPC commands to the current session to return error 0xC805.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [2.0.0+] RevertToPlaceHolder || Takes three 0x10-sized [[#NcaID]]s. Creates the registered directory NCA path, and renames the placeholder path to the registered NCA path.&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [2.0.0+] SetPlaceHolderSize || Takes a [[#NcaID]], and a u64 size&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [2.0.0+] [[#ReadContentIdFile]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [2.0.0+] GetRightsIdFromPlaceHolderId || Gets the Rights ID for the [[#NcaID]]&#039;s placeholder path.&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [2.0.0+] GetRightsIdFromContentId || Gets the Rights ID for the [[#NcaID]]&#039;s registered path&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [2.0.0+] WriteContentForDebug || Takes a [[#NcaID]], a u64 offset, and a type 5 buffer. On debug units, writes the buffer to the NCA&#039;s registered path. On retail units, this just aborts.&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [2.0.0+] GetFreeSpaceSize || Gets free space for the storage.&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [2.0.0+] GetTotalSpaceSize || Gets total space for the storage.&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [3.0.0+] FlushPlaceHolder || Flushes resources for the storage without closing it.&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [4.0.0+] GetSizeFromPlaceHolderId || &lt;br /&gt;
|-&lt;br /&gt;
| 26 || [4.0.0+] RepairInvalidFileAttribute || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== GeneratePlaceHolderId ====&lt;br /&gt;
Generates a random [[#NcaID]] for use as a placeholder.&lt;br /&gt;
&lt;br /&gt;
Calls nn::util::GenerateUuid(), which internally calls nn::os::GenerateRandomBytes(16);&lt;br /&gt;
&lt;br /&gt;
==== GetContentCount ====&lt;br /&gt;
Writes the total number of entries which can be read by GetEntries, to cmdreply &amp;lt;SFCO_offset&amp;gt;+0x10.&lt;br /&gt;
&lt;br /&gt;
==== ListContentId====&lt;br /&gt;
Takes an output buffer, u32 offset and gets all entries starting at that offset.&lt;br /&gt;
Returns number of entries read.&lt;br /&gt;
&lt;br /&gt;
Each entry is a [[#NcaID]].&lt;br /&gt;
&lt;br /&gt;
The total read entries is exactly the same as the number of &amp;quot;&amp;lt;hex&amp;gt;.nca&amp;quot; directories in the storage FS(or at least under the &amp;quot;registered&amp;quot; directory?).&lt;br /&gt;
&lt;br /&gt;
==== GetSizeFromContentId ====&lt;br /&gt;
Takes a [[#NcaID]] as input.&lt;br /&gt;
&lt;br /&gt;
Returns the total size readable by [[#ReadContentIdFile]]. This is the same as the size-field in the [[NAX0]] &amp;quot;&amp;lt;NcaID&amp;gt;.nca/00&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
==== ReadContentIdFile ====&lt;br /&gt;
Takes an output buffer, a [[#NcaID]] as input, and a u64 file offset.&lt;br /&gt;
&lt;br /&gt;
Reads plaintext NCA file contents from the Registered path for the NcaID.&lt;br /&gt;
&lt;br /&gt;
=== IContentMetaDatabase ===&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentMetaDatabase&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the official name for Meta Record is &amp;quot;ContentMetaKey&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Set || Takes a [[NCA#Meta_records|Meta Record]], a type-5 [[NCA#Content_records|Content Records]] buffer and a u64 size.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Get || Takes a [[NCA#Meta_records|Meta Record]], a type-6 buffer to write [[NCA#Content_records|Content Records]] to and a u64 size. Returns the actual number of bytes read into the buffer. First 8 bytes of the data is header (u16 numExtraDataBytes, numContentRecords, numMetaRecords, padding). After the header is numExtraDataBytes of additional data, after which follow content records and meta records. Set takes this same data as input.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Remove || Takes a [[NCA#Meta_records|Meta Record]], and removes the associated record.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetContentIdByType || Takes a [[NCA#Meta_records|Meta Record]] and a u8 [[#Title_Types|Title Type]]. Returns a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || ListContentInfo || Takes a type-6 buffer to write [[NCA#Content_records|Content Record]] entries to, a [[NCA#Meta_records|Meta Record]], and a u32 index into the Content Record entries to start copying from. Returns a u32 entries_read.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || List || Takes a type-6 buffer to write [[NCA#Meta_records|Meta Record]]s to, a u32 [[#Title_Types|Title Type]], a u64 TID, a u64 TID_LOW, and u64 TID_HIGH. Writes into the buffer all Meta Records with low &amp;lt;= record-&amp;gt;title_id &amp;lt;= high, and record-&amp;gt;type == type. Returns u32 numEntriesTotal, numEntriesWritten. Additionally requires record-&amp;gt;title_id == TID, if record-&amp;gt;type is Application, Patch, Add-On, or Delta, otherwise, you can pass 0 for type to ignore the type and list them all in the range.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || GetLatestContentMetaKey || Takes a u64 title id, and returns the [[NCA#Meta_records|Meta Record]] with the highest version field for that title id.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#ListApplication]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Has || Takes a [[NCA#Meta_records|Meta Record]] and returns whether that record is present in the database.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || HasAll || Takes a type-5 buffer containing [[NCA#Meta_records|Meta Records]] (code assumes there are size/sizeof(meta_record) records in the buffer), and returns whether all of those records are present in the database.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetSize || Takes a [[NCA#Meta_records|Meta Record]], and returns the size of the associated [[NCA#Content_records|Content Records]].&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetRequiredSystemVersion || Takes a [[NCA#Meta_records|Meta Record]], and returns u32 from ContentRecords + 16 (only if the Meta record has type Application or Patch).&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetPatchId || Takes a [[NCA#Meta_records|Meta Record]], and returns the update title id for that record.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || DisableForcibly ||  Closes the meta database, and causes all future IPC commands to the current session to return error 0xDC05.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#LookupOrphanContent]] || Takes a type-6 byte buffer, and a type-5 buffer of [[#NcaID]]s.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Commit || Flushes the in-memory database to savedata.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || HasContent || Takes a [[NCA#Meta_records|Meta Record]] and an [[#NcaID]]. Returns whether the content records for that meta record contain the NcaID.&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListContentMetaInfo || Takes a type-6 [[NCA#Meta_records|Meta Record]] output buffer, a u32 eoffset into that buffer, and an input [[NCA#Meta_records|Meta Record]].&lt;br /&gt;
|-&lt;br /&gt;
| 18 || GetAttributes || Takes a [[NCA#Meta_records|Meta Record]], and returns u8 from ContentRecords + 6.&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [2.0.0+] GetRequiredApplicationVersion || Does the same thing as GetEntryUnknownRecordSize, but for AddOnContents.&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [5.0.0+] GetContentIdByTypeAndIdOffset ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== ListApplication ====&lt;br /&gt;
Each 24-byte entry (officially &amp;quot;ApplicationContentMetaKey&amp;quot;) is as follows:&lt;br /&gt;
  [[NCA#Meta_records|meta_record]] meta_record;&lt;br /&gt;
  u64    base_title_id;&lt;br /&gt;
&lt;br /&gt;
This function takes in a type 6 buffer to write entries to, and a u8 &amp;quot;filter&amp;quot; [[#Title_Types|type]]. If filter is zero, all update records will be copied to to the output buffer (space permitting). Otherwise, only titles with type == filter_type will be copied to the output buffer.&lt;br /&gt;
&lt;br /&gt;
This func returns a u32 num_entries_total, and a u32 num_entries_written.&lt;br /&gt;
&lt;br /&gt;
==== ReadEntryMetaRecords ====&lt;br /&gt;
Takes a type-6 [[NCA#Meta_records|Meta Record]] output buffer, a u32 eoffset into that buffer, and an input [[NCA#Meta_records|Meta Record]] entry. Returns a u32 for total_read_entries.&lt;br /&gt;
&lt;br /&gt;
Reads the meta records stored in the entry&#039;s content records into the output buffer.&lt;br /&gt;
&lt;br /&gt;
This is used, for example, with System Update title 0100000000000816, which contains Meta Records for all other systitles in its Content Records.&lt;br /&gt;
&lt;br /&gt;
==== LookupOrphanContent ====&lt;br /&gt;
Takes a type-6 byte buffer, and a type-5 buffer containing [[#NcaID]]s.&lt;br /&gt;
&lt;br /&gt;
This function was stubbed to return 0xDC05 in [[2.0.0]].&lt;br /&gt;
&lt;br /&gt;
On 1.0.0: Initialized the output buffer to all 1s. Then, for each [[#NcaID]] in the input buffer, it checks if that NcaID is present anywhere in the database, and if so writes 0 to the corresponding output byte.&lt;br /&gt;
&lt;br /&gt;
In pseudocode, the function basically does the following:&lt;br /&gt;
&lt;br /&gt;
for i in range(len(out_buf)):&lt;br /&gt;
    out_buf[i] = 1&lt;br /&gt;
&lt;br /&gt;
for i, NcaID in NcaIDs:&lt;br /&gt;
    if is_present_in_database(NcaID):&lt;br /&gt;
        out_buf[i] = 0&lt;br /&gt;
&lt;br /&gt;
=== NcaID ===&lt;br /&gt;
This is a 0x10-byte entry. This is originally from the hex portion of &amp;quot;&amp;lt;hex&amp;gt;.nca&amp;quot; directory-names from this storage FS(like [[SD_Filesystem|SD]]). This is also referred to as &amp;quot;ContentId&amp;quot; in the official SDK.&lt;br /&gt;
&lt;br /&gt;
The NcaID is the same as the first 0x10-bytes from the calculated SHA256 hash, from hashing the entire output from [[#ReadContentIdFile]].&lt;br /&gt;
&lt;br /&gt;
=== Enums ===&lt;br /&gt;
==== Title Types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| SystemProgram ([[Title_list#System_Modules|System Modules]] or [[Title_list#System_Applets|System Applets]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| SystemData ([[Title_list#System_Data_Archives|System Data Archives]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| SystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| BootImagePackage ([[Title_list|Firmware package A or C]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x05&lt;br /&gt;
| BootImagePackageSafe ([[Title_list|Firmware package B or D]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x80&lt;br /&gt;
| Application&lt;br /&gt;
|-&lt;br /&gt;
| 0x81&lt;br /&gt;
| Patch&lt;br /&gt;
|-&lt;br /&gt;
| 0x82&lt;br /&gt;
| AddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 0x83&lt;br /&gt;
| Delta&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ncm:v ==&lt;br /&gt;
This service doesn&#039;t normally exist on retail.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=USB_services&amp;diff=5355</id>
		<title>USB services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=USB_services&amp;diff=5355"/>
		<updated>2018-10-27T04:09:44Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: This shouldn&amp;#039;t have been changed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;One symbol in USB-sysmodule is: &amp;quot;vtable for nn::usb::detail::UsbComplexTegra21x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= usb:ds =&lt;br /&gt;
This is &amp;quot;nn::usb::ds::IDsService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Used for Switch&amp;lt;&amp;gt;PC USB comms, aka Switch-as-device. This seems to only be usable in handheld-mode with the Switch directly connected to a host via an USB cable, not(?) in docked-mode.&lt;br /&gt;
This service is used during [[Factory Setup|factory setup]] by [[Manu Services|manu]].&lt;br /&gt;
&lt;br /&gt;
This service session is used as an IPC [[IPC_Marshalling|domain]] by [[Manu Services|manu]]. All of these {get-session} commands also return an output u8 and the u32 [[IPC_Marshalling|domainID]], for using those sessions as domains.&lt;br /&gt;
&lt;br /&gt;
This service can be used by multiple processes at the same time, with separate interfaces. However, if one process does usbds shutdown, usbds will reset to defaults even if there&#039;s a process still using it. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#BindDevice]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#BindClientProcess]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetDsInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetState]]&lt;br /&gt;
|-&lt;br /&gt;
| [2.0.0-4.1.0] 5 || [[#SetVidPidBcd]]&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 5 || ClearDeviceData&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [5.0.0+] AddUsbStringDescriptor&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [5.0.0+] DeleteUsbStringDescriptor&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [5.0.0+] SetUsbDeviceDescriptor&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [5.0.0+] SetBinaryObjectStore&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [5.0.0+] Enable&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [5.0.0+] Disable&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Initialization done by [[Manu Services|manu]]:&lt;br /&gt;
* Initial service init:&lt;br /&gt;
** Get service/etc.&lt;br /&gt;
** Uses [[#BindDevice]].&lt;br /&gt;
** Uses [[#BindClientProcess]].&lt;br /&gt;
** Uses [[#GetStateChangeEvent]].&lt;br /&gt;
** Uses [[#SetVidPidBcd]].&lt;br /&gt;
* Interface init:&lt;br /&gt;
** Uses [[#GetDsInterface]], then uses commands from that with the rest of the following.&lt;br /&gt;
** Uses [[#GetSetupEvent]].&lt;br /&gt;
** Uses [[#GetCtrlInCompletionEvent]].&lt;br /&gt;
** Uses [[#GetCtrlOutCompletionEvent]].&lt;br /&gt;
* Initializes two endpoints via using [[#GetDsEndpoint]] twice.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
The following is the default USB config strings, while the usbds service isn&#039;t being used. All of the below configuration will reset to the defaults when all usbds-related sessions are closed. These can be set with [[#SetVidPidBcd]]. The default string for Product is loaded from [[Settings_services|settings]] config. The default is referred to by usb-sysmodule as &amp;quot;Dummy&amp;quot;.&lt;br /&gt;
  Product: Nintendo Switch&lt;br /&gt;
  Manufacturer: Nintendo&lt;br /&gt;
  SerialNumber: SerialNumber&lt;br /&gt;
&lt;br /&gt;
The following is the default &amp;lt;code&amp;gt;lsusb -v {...}&amp;lt;/code&amp;gt; output when the usbds service wasn&#039;t used.&lt;br /&gt;
&lt;br /&gt;
The endpoints are configured using [[#GetDsEndpoint]], the total number of endpoints is the number of open [[#IDsEndpoint]] sessions. bInterfaceNumber is {0-based index for the enabled [[#IDsInterface]] session.} Some of the interface fields are configured using [[#GetDsInterface]].&lt;br /&gt;
&lt;br /&gt;
Additional descriptors for use with interfaces and endpoints can&#039;t be configured with usbds, even though the former is used for the default HID interface. This seems to be the main(?) restriction with using usbds for Switch-as-arbitrary-devices. The device class fields can&#039;t be configured, interface class fields are set instead.&lt;br /&gt;
&lt;br /&gt;
When usbds is in use where [[#SetVidPidBcd]] wasn&#039;t used, the VID/PID is 057e:3000.&lt;br /&gt;
&lt;br /&gt;
  Bus 003 Device 006: ID 057e:2000 Nintendo Co., Ltd &lt;br /&gt;
  Couldn&#039;t open device, some information will be missing&lt;br /&gt;
  Device Descriptor:&lt;br /&gt;
    bLength                18&lt;br /&gt;
    bDescriptorType         1&lt;br /&gt;
    bcdUSB               2.00&lt;br /&gt;
    bDeviceClass            0 (Defined at Interface level)&lt;br /&gt;
    bDeviceSubClass         0 &lt;br /&gt;
    bDeviceProtocol         0 &lt;br /&gt;
    bMaxPacketSize0        64&lt;br /&gt;
    idVendor           0x057e Nintendo Co., Ltd&lt;br /&gt;
    idProduct          0x2000 &lt;br /&gt;
    bcdDevice            1.00&lt;br /&gt;
    iManufacturer           1 &lt;br /&gt;
    iProduct                2 &lt;br /&gt;
    iSerial                 3 &lt;br /&gt;
    bNumConfigurations      1&lt;br /&gt;
    Configuration Descriptor:&lt;br /&gt;
      bLength                 9&lt;br /&gt;
      bDescriptorType         2&lt;br /&gt;
      wTotalLength           34&lt;br /&gt;
      bNumInterfaces          1&lt;br /&gt;
      bConfigurationValue     1&lt;br /&gt;
      iConfiguration          0 &lt;br /&gt;
      bmAttributes         0xc0&lt;br /&gt;
        Self Powered&lt;br /&gt;
      MaxPower              {...}&lt;br /&gt;
      Interface Descriptor:&lt;br /&gt;
        bLength                 9&lt;br /&gt;
        bDescriptorType         4&lt;br /&gt;
        bInterfaceNumber        0&lt;br /&gt;
        bAlternateSetting       0&lt;br /&gt;
        bNumEndpoints           1&lt;br /&gt;
        bInterfaceClass         3 Human Interface Device&lt;br /&gt;
        bInterfaceSubClass      0 No Subclass&lt;br /&gt;
        bInterfaceProtocol      0 None&lt;br /&gt;
        iInterface              0 &lt;br /&gt;
          HID Device Descriptor:&lt;br /&gt;
            bLength                 9&lt;br /&gt;
            bDescriptorType        33&lt;br /&gt;
            bcdHID               2.00&lt;br /&gt;
            bCountryCode            0 Not supported&lt;br /&gt;
            bNumDescriptors         1&lt;br /&gt;
            bDescriptorType        34 Report&lt;br /&gt;
            wDescriptorLength      26&lt;br /&gt;
           Report Descriptors: &lt;br /&gt;
             ** UNAVAILABLE **&lt;br /&gt;
        Endpoint Descriptor:&lt;br /&gt;
          bLength                 7&lt;br /&gt;
          bDescriptorType         5&lt;br /&gt;
          bEndpointAddress     0x81  EP 1 IN&lt;br /&gt;
          bmAttributes            3&lt;br /&gt;
            Transfer Type            Interrupt&lt;br /&gt;
            Synch Type               None&lt;br /&gt;
            Usage Type               Data&lt;br /&gt;
          wMaxPacketSize     0x0001  1x 1 bytes&lt;br /&gt;
          bInterval              16&lt;br /&gt;
&lt;br /&gt;
== BindDevice ==&lt;br /&gt;
Takes an u32 (&#039;&#039;&#039;complexId&#039;&#039;&#039;). [[Manu_Services|Manu]] sends 0x02.&lt;br /&gt;
&lt;br /&gt;
Binding more than once with the current session is not allowed. Once this command is used, the USB device will not be listed with &amp;lt;code&amp;gt;lsusb&amp;lt;/code&amp;gt; until [[#EnableInterface]] is used.&lt;br /&gt;
&lt;br /&gt;
Returns a not-found error when complexId isn&#039;t 0x02, for values 0x0-0x4 at least.&lt;br /&gt;
&lt;br /&gt;
== BindClientProcess ==&lt;br /&gt;
Takes 1 copy-handle for the current process (0xFFFF8001).&lt;br /&gt;
&lt;br /&gt;
== GetDsInterface ==&lt;br /&gt;
Takes 2 type-5 buffers and returns an [[#IDsInterface]]. [[Manu_Services|Manu]] sends a 0x09-byte command (e.g.: 0x09, 0x04, 0x04, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00) in the first buffer and a string (&amp;quot;usb&amp;quot;) in the second buffer.&lt;br /&gt;
&lt;br /&gt;
When the strlen output for the second buffer is &amp;gt;=0x40, size 0x40 is used instead for copying the string. This is the interface name, it&#039;s not sent over USB.&lt;br /&gt;
&lt;br /&gt;
Returns an error when [[#BindDevice]] wasn&#039;t used.&lt;br /&gt;
&lt;br /&gt;
Up to 4 interfaces can be used+[[#EnableInterface|enabled]].&lt;br /&gt;
&lt;br /&gt;
Structure of the first buffer(this is the same as [http://libusb.sourceforge.net/api-1.0/structlibusb__interface__descriptor.html libusb__interface__descriptor]):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || bLength. Must match 0x9.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x1 || bDescriptorType. Must match 0x4.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x1 || bInterfaceNumber. When 0x4, the bInterfaceNumber is automatically allocated(error will be thrown if no space). Otherwise, it&#039;s used directly and must be &amp;lt;=3.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 || 0x1 || bAlternateSetting. Must match 0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x1 || bNumEndpoints. Ignored.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 || 0x1 || bInterfaceClass&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 || 0x1 || bInterfaceSubClass&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 || 0x1 || bInterfaceProtocol&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x1 || iInterface. Ignored.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Only the first 0x9-bytes are used.&lt;br /&gt;
&lt;br /&gt;
== GetStateChangeEvent ==&lt;br /&gt;
Returns an event handle for when the state returned by [[#GetState]] changes. Signalled when Switch&amp;lt;-&amp;gt;host USB comms change between started/stopped. USB cable connected/disconnected while at least 1 interface was enabled, or interface enabled/disabled while the USB cable was connected which then caused USB-comms state to change.&lt;br /&gt;
&lt;br /&gt;
== GetState ==&lt;br /&gt;
No input. Returns an output u32. Returns an error when [[#BindDevice]] wasn&#039;t used.&lt;br /&gt;
&lt;br /&gt;
Returns the current state. Values: &lt;br /&gt;
* 0: Initial state.&lt;br /&gt;
* 6: Device init starting.&lt;br /&gt;
* 3: {Initialization}, previous state is 6.&lt;br /&gt;
* 4: {Initialization}, previous state is 3.&lt;br /&gt;
* 5: Initialization done, data-transfer is now available.&lt;br /&gt;
&lt;br /&gt;
== SetVidPidBcd ==&lt;br /&gt;
Takes a type-5 buffer with 0x66 bytes of USB descriptor data (see [[Manu_Services#manu|manu]]).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || VID (idVendor)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || PID (idProduct)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x2 || bcdDevice&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 || 0x20 || Manufacturer&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 || 0x20 || Product&lt;br /&gt;
|-&lt;br /&gt;
| 0x46 || 0x20 || SerialNumber&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The last 3 blocks are ASCII strings. The data following each string is all-zero, for padding to size 0x20.&lt;br /&gt;
&lt;br /&gt;
== IDsInterface ==&lt;br /&gt;
This is &amp;quot;nn::usb::ds::IDsInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetDsEndpoint]] || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetSetupEvent]] || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || || Takes a type-0x6 output buffer, no other output. Memcpys data to outbuf with outsize, uses size 0x8 if outsize is too large.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#EnableInterface]] || &lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#DisableInterface]] || &lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#CtrlInPostBufferAsync]] || &lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#CtrlOutPostBufferAsync]] || &lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#GetCtrlInCompletionEvent]] || &lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#GetCtrlInReportData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#GetCtrlOutCompletionEvent]] || &lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#GetCtrlOutReportData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#StallCtrl]] || &lt;br /&gt;
|-&lt;br /&gt;
| 12 || [5.0.0+] AppendConfigurationData || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Commands cmd2, [[#CtrlInPostBufferAsync]], [[#CtrlOutPostBufferAsync]], and [[#StallCtrl]], will throw an error if the interface is not [[#EnableInterface|enabled]]. [[#GetDsEndpoint]] will throw an error if the interface is [[#EnableInterface|enabled]].&lt;br /&gt;
&lt;br /&gt;
=== GetDsEndpoint ===&lt;br /&gt;
Takes a type-5 buffer and returns an [[#IDsEndpoint]]. [[Manu_Services|Manu]] uses this twice for getting two endpoint sessions, with the following 0x7-byte buffer data:&lt;br /&gt;
* First endpoint: 0x07, 0x05, 0x80, 0x02, 0x00, 0x02, 0x00&lt;br /&gt;
** bLength=0x7&lt;br /&gt;
** bDescriptorType=LIBUSB_DT_ENDPOINT&lt;br /&gt;
** bEndpointAddress=LIBUSB_ENDPOINT_IN&lt;br /&gt;
** bmAttributes=LIBUSB_TRANSFER_TYPE_BULK&lt;br /&gt;
** wMaxPacketSize=0x200&lt;br /&gt;
** bInterval=0&lt;br /&gt;
* Second endpoint: Same as above except byte2 is 0x00(bEndpointAddress=LIBUSB_ENDPOINT_OUT).&lt;br /&gt;
&lt;br /&gt;
Each field is an u8, except for offset 0x4-0x5 which is an u16.&lt;br /&gt;
&lt;br /&gt;
This structure matches [http://libusb.sourceforge.net/api-1.0/structlibusb__endpoint__descriptor.html libusb_endpoint_descriptor], with audio-only-devices fields bRefresh and bSynchAddress removed.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;gt;=0x7. Only the first 0x7-bytes from the buffer are used.&lt;br /&gt;
* Byte0(bLength) must match 0x7.&lt;br /&gt;
* Byte1(bDescriptorType) must match 0x5.&lt;br /&gt;
* Byte2(bEndpointAddress) is only compared with 0x80 to determine whether to use an input or output endpoint, the actual endpoint-number is allocated automatically by checking state. Hence, all input endpoints must use bEndpointAddress==0x80. Up to endpoint-number 0xF can be allocated for each endpoint-direction, for a total of 16 endpoints including control, and 15 for non-control endpoints([[#IDsEndpoint]] sessions for each direction). This matches the Tegra maximum.&lt;br /&gt;
&lt;br /&gt;
From the Tegra datasheet: &amp;quot;The maximum packet size supported on any endpoint is 1024 bytes in high-speed mode, for both device and host modes.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== GetSetupEvent ===&lt;br /&gt;
Returns an event handle. Unknown what triggers signalling, not signalled during interface-enable / device&amp;lt;&amp;gt;host USB-comms init.&lt;br /&gt;
&lt;br /&gt;
=== EnableInterface ===&lt;br /&gt;
Takes no arguments. Enables the current interface.&lt;br /&gt;
&lt;br /&gt;
Only one interface can be enabled at a time per bInterfaceNumber. When bInterfaceNumber is auto-allocate(0x4) for [[#GetDsEndpoint]] this isn&#039;t an issue since the final bInterfaceNumber will be unique.&lt;br /&gt;
&lt;br /&gt;
Once enabled, the device/interface can then actually be used over USB.&lt;br /&gt;
&lt;br /&gt;
=== DisableInterface ===&lt;br /&gt;
Takes no arguments. Disables the current interface.&lt;br /&gt;
&lt;br /&gt;
=== CtrlInPostBufferAsync ===&lt;br /&gt;
Same as [[#PostBufferAsync]](with same input/output), except this uses control input endpoint 0x80.&lt;br /&gt;
&lt;br /&gt;
=== CtrlOutPostBufferAsync ===&lt;br /&gt;
Same as [[#PostBufferAsync]](with same input/output), except this uses control output endpoint 0x00.&lt;br /&gt;
&lt;br /&gt;
=== GetCtrlInCompletionEvent ===&lt;br /&gt;
Returns an event handle for polling the completion of input control commands. Same as [[#GetCompletionEvent]], except this uses control input endpoint 0x80.&lt;br /&gt;
&lt;br /&gt;
=== GetCtrlInReportData ===&lt;br /&gt;
Same as [[#GetReportData]](with same input/output), except this uses control input endpoint 0x80.&lt;br /&gt;
&lt;br /&gt;
=== GetCtrlOutCompletionEvent ===&lt;br /&gt;
Returns an event handle for polling the completion of output control commands. Same as [[#GetCompletionEvent]], except this uses control output endpoint 0x00.&lt;br /&gt;
&lt;br /&gt;
=== GetCtrlOutReportData ===&lt;br /&gt;
Same as [[#GetReportData]](with same input/output), except this uses control output endpoint 0x00.&lt;br /&gt;
&lt;br /&gt;
=== StallCtrl ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Calls a function with both control endpoints(0x80 and 0x00) with the same function. From strings: &amp;quot;m_pProtocol-&amp;gt;Stall(0x80)&amp;quot; &amp;quot;m_pProtocol-&amp;gt;Stall(0x00)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== IDsEndpoint ===&lt;br /&gt;
This is &amp;quot;nn::usb::ds::IDsEndpoint&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#PostBufferAsync]] || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || || No input/output.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetCompletionEvent]] || &lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetReportData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#Stall]] || &lt;br /&gt;
|-&lt;br /&gt;
| 5 || || Takes an input u8, no output.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== PostBufferAsync ====&lt;br /&gt;
Takes an u32 (&#039;&#039;&#039;size&#039;&#039;&#039;) and an u64 (&#039;&#039;&#039;buffer&#039;&#039;&#039;). Returns an output u32 (&#039;&#039;&#039;urbId&#039;&#039;&#039;). The output urbId can then be used while parsing the output of [[#GetReportData]], after waiting for the CompletionEvent to be signalled.&lt;br /&gt;
&lt;br /&gt;
The buffer address must be 0x1000-byte aligned. The input size doesn&#039;t matter. It helps to use svcSetMemoryAttribute to turn off caching on the buffer.&lt;br /&gt;
&lt;br /&gt;
Used for data-transfer with input/output endpoints.&lt;br /&gt;
&lt;br /&gt;
The user-process must flush dcache for the buffer before using this command.&lt;br /&gt;
&lt;br /&gt;
When sending data where size is larger than wMaxPacketSize, it will automatically send multiple USB packets where last packet size = {remaining size}. Every {wMaxPacketSize}-bytes is a different packet. This only occurs in some cases. When &#039;&#039;&#039;size&#039;&#039;&#039; is ~0x1000000(exact size unknown), Switch-side silently hangs, while host-side will timeout(no traffic on USB bus indicating failure).&lt;br /&gt;
&lt;br /&gt;
For receiving data, if size is less than {actual received USB packet size} the rest of the packet will be discarded. Later PostBufferAsync cmd(s) will only return data from new packets, not the remainder of the earlier packet(s).&lt;br /&gt;
&lt;br /&gt;
==== GetCompletionEvent ====&lt;br /&gt;
No input. Returns an output event handle for polling the completion of [[#PostBufferAsync]], even when it finished via [[#Stall]].&lt;br /&gt;
&lt;br /&gt;
==== GetReportData ====&lt;br /&gt;
No input. Returns 0x84 bytes of report data from the endpoint. Seems to be eventually loaded from state, since this doesn&#039;t trigger any USB bus activity. All-zero before PostBufferAsync was used at least once.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10*0x8(0x80) || 0x8 entries 0x10-bytes each for each report.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80 || 0x4 || u32 report count&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entry data:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || u32 id (urbId from post-buffer commands)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || u32 requestedSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x4 || u32 transferredSize&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || u32 urb status, converted to error-codes. 0x3 = success, 0x4 = 0x828c, 0x5 = 0x748c. All other values are invalid.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Stall ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Calls the same function used by [[#StallCtrl]], except this uses the endpoint associated with the current session.&lt;br /&gt;
&lt;br /&gt;
Stops in-progress data-transfer done by [[#PostBufferAsync]].&lt;br /&gt;
&lt;br /&gt;
= usb:hs =&lt;br /&gt;
This is &amp;quot;nn::usb::hs::IClientRootSession&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#BindClientProcess_2|#BindClientProcess]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#QueryAllInterfaces]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#QueryAvailableInterfaces]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#QueryAcquiredInterfaces]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#CreateInterfaceAvailableEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#DestroyInterfaceAvailableEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#GetInterfaceStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#AcquireUsbIf]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [6.0.0+]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
General USB devices usage, used by [[Audio_services|audio]], [[HID_services|hid]] and [[Sockets_services|bsdsockets]].&lt;br /&gt;
&lt;br /&gt;
== BindClientProcess ==&lt;br /&gt;
Takes 1 copy-handle for the current process (0xFFFF8001).&lt;br /&gt;
&lt;br /&gt;
== QueryAllInterfaces ==&lt;br /&gt;
Takes a 0x10-byte input struct and a type-0x6 output buffer, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
== QueryAvailableInterfaces ==&lt;br /&gt;
Takes a 0x10-byte input struct and a type-0x6 output buffer, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
== QueryAcquiredInterfaces ==&lt;br /&gt;
Takes a type-0x6 output buffer and returns an output u32.&lt;br /&gt;
&lt;br /&gt;
== CreateInterfaceAvailableEvent ==&lt;br /&gt;
Takes an input u8 and returns an output handle.&lt;br /&gt;
&lt;br /&gt;
== DestroyInterfaceAvailableEvent ==&lt;br /&gt;
Takes an input u8, no output.&lt;br /&gt;
&lt;br /&gt;
== GetInterfaceStateChangeEvent ==&lt;br /&gt;
No input, returns an output handle.&lt;br /&gt;
&lt;br /&gt;
== AcquireUsbIf ==&lt;br /&gt;
Takes an input u32 and a type-0x6 output buffer, returns an [[#IClientIfSession]].&lt;br /&gt;
&lt;br /&gt;
== IClientIfSession ==&lt;br /&gt;
This is &amp;quot;nn::usb::hs::IClientIfSession&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || || No input, returns an output handle.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#SetInterface]] || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetInterface]] || &lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetAlternateInterface]] || &lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetCurrentFrame]] || &lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#CtrlXferAsync]] || &lt;br /&gt;
|-&lt;br /&gt;
| 6 || || No input, returns an output handle.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#GetCtrlXferReport]] || &lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#ResetDevice]] || &lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#OpenUsbEp]] || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SetInterface ===&lt;br /&gt;
Takes an input u8 and a type-0x6 output buffer, no output.&lt;br /&gt;
&lt;br /&gt;
=== GetInterface ===&lt;br /&gt;
Takes a type-0x6 output buffer, no output.&lt;br /&gt;
&lt;br /&gt;
=== GetAlternateInterface ===&lt;br /&gt;
Takes an input u8 and a type-0x6 output buffer, no output.&lt;br /&gt;
&lt;br /&gt;
=== GetCurrentFrame ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
=== CtrlXferAsync ===&lt;br /&gt;
Takes 2 input u8s and 3 input u16s, no output.&lt;br /&gt;
&lt;br /&gt;
=== GetCtrlXferReport ===&lt;br /&gt;
Takes a type-0x6 output buffer, no output.&lt;br /&gt;
&lt;br /&gt;
=== ResetDevice ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== OpenUsbEp ===&lt;br /&gt;
Takes an input u16 and 4 input u32s, returns a 0x7-byte output struct and an [[#IClientEpSession]].&lt;br /&gt;
&lt;br /&gt;
=== IClientEpSession ===&lt;br /&gt;
This is &amp;quot;nn::usb::hs::IClientEpSession&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Open]] || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#Close]] || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || || No input, returns an output handle.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#Populate]] || &lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#PostBufferAsync_2|#PostBufferAsync]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetXferReport]] || &lt;br /&gt;
|-&lt;br /&gt;
| 6 || || Takes 3 input u32s, 2 input u64s, and a type-0x5 input buffer, returns an output u32.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [4.0.0+] || &lt;br /&gt;
|-&lt;br /&gt;
| 8 || [4.0.0+] || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Open ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== Close ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== Populate ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== PostBufferAsync ====&lt;br /&gt;
Takes an input u32 and 2 input u64s, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
==== GetXferReport ====&lt;br /&gt;
Takes an input u32 and a type-0x6 output buffer, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
= usb:pd =&lt;br /&gt;
This is &amp;quot;nn::usb::pd::detail::IPdManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetPdSession&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Only system-titles with access to this are [[PTM_services|ptm]] and [[AM_services|am]].&lt;br /&gt;
&lt;br /&gt;
== IPdSession ==&lt;br /&gt;
This is &amp;quot;nn::usb::pd::detail::IPdSession&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || BindNoticeEvent&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetStatus&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetNotice&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || ReplyPowerRequest&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= usb:pd:c =&lt;br /&gt;
This is &amp;quot;nn::usb::pd::detail::IPdCradleManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetPdCradleSession || Returns a session handle for the below.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
USB-sysmodule symbols for this refer to &amp;quot;Cradle&amp;quot;, which is the [[Dock]].&lt;br /&gt;
&lt;br /&gt;
== IPdCradleSession ==&lt;br /&gt;
This is &amp;quot;nn::usb::pd::detail::IPdCradleSession&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || VdmUserWrite || Input { u32 value; u32 VdmUserId; }. Output {}.&lt;br /&gt;
If Cradle or RelayBox is connected, issues given VDM with value.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || VdmUserRead || Input { u32 VdmUserId; }. Output { u32 value; }.&lt;br /&gt;
If Cradle or RelayBox is connected, returns u32 response from issuing given VDM.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Vdm20Init || No input/output.&lt;br /&gt;
If Cradle or RelayBox is connected, caches result of VDM 0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetFwType || No input. Returns an output u16.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetFwRevision || No input. Returns an output u16.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || GetManufacturerId || No input. Returns an output u16.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || GetDeviceId || No input. Returns an output u16.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [3.0.0+] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [3.0.0+] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: The VdmUserId given to VdmUserRead/VdmUserWrite is translated from the given (enum) value to the actual cmd to send.&lt;br /&gt;
&lt;br /&gt;
= usb:pm =&lt;br /&gt;
This is &amp;quot;nn::usb::pm::IPmService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
USB Port Manager, only system-title using this is [[PTM_services|ptm]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=USB_services&amp;diff=5354</id>
		<title>USB services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=USB_services&amp;diff=5354"/>
		<updated>2018-10-27T04:07:38Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: usb:hs is used by audio too&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;One symbol in USB-sysmodule is: &amp;quot;vtable for nn::usb::detail::UsbComplexTegra21x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= usb:ds =&lt;br /&gt;
This is &amp;quot;nn::usb::ds::IDsService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Used for Switch&amp;lt;&amp;gt;PC USB comms, aka Switch-as-device. This seems to only be usable in handheld-mode with the Switch directly connected to a host via an USB cable, not(?) in docked-mode.&lt;br /&gt;
This service is used during [[Factory Setup|factory setup]] by [[Manu Services|manu]].&lt;br /&gt;
&lt;br /&gt;
This service session is used as an IPC [[IPC_Marshalling|domain]] by [[Manu Services|manu]]. All of these {get-session} commands also return an output u8 and the u32 [[IPC_Marshalling|domainID]], for using those sessions as domains.&lt;br /&gt;
&lt;br /&gt;
This service can be used by multiple processes at the same time, with separate interfaces. However, if one process does usbds shutdown, usbds will reset to defaults even if there&#039;s a process still using it. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#BindDevice]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#BindClientProcess]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetDsInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetState]]&lt;br /&gt;
|-&lt;br /&gt;
| [2.0.0-4.1.0] 5 || [[#SetVidPidBcd]]&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 5 || ClearDeviceData&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [5.0.0+] AddUsbStringDescriptor&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [5.0.0+] DeleteUsbStringDescriptor&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [5.0.0+] SetUsbDeviceDescriptor&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [5.0.0+] SetBinaryObjectStore&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [5.0.0+] Enable&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [5.0.0+] Disable&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Initialization done by [[Manu Services|manu]]:&lt;br /&gt;
* Initial service init:&lt;br /&gt;
** Get service/etc.&lt;br /&gt;
** Uses [[#BindDevice]].&lt;br /&gt;
** Uses [[#BindClientProcess]].&lt;br /&gt;
** Uses [[#GetStateChangeEvent]].&lt;br /&gt;
** Uses [[#SetVidPidBcd]].&lt;br /&gt;
* Interface init:&lt;br /&gt;
** Uses [[#GetDsInterface]], then uses commands from that with the rest of the following.&lt;br /&gt;
** Uses [[#GetSetupEvent]].&lt;br /&gt;
** Uses [[#GetCtrlInCompletionEvent]].&lt;br /&gt;
** Uses [[#GetCtrlOutCompletionEvent]].&lt;br /&gt;
* Initializes two endpoints via using [[#GetDsEndpoint]] twice.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
The following is the default USB config strings, while the usbds service isn&#039;t being used. All of the below configuration will reset to the defaults when all usbds-related sessions are closed. These can be set with [[#SetVidPidBcd]]. The default string for Product is loaded from [[Settings_services|settings]] config. The default is referred to by usb-sysmodule as &amp;quot;Dummy&amp;quot;.&lt;br /&gt;
  Product: Nintendo Switch&lt;br /&gt;
  Manufacturer: Nintendo&lt;br /&gt;
  SerialNumber: SerialNumber&lt;br /&gt;
&lt;br /&gt;
The following is the default &amp;lt;code&amp;gt;lsusb -v {...}&amp;lt;/code&amp;gt; output when the usbds service wasn&#039;t used.&lt;br /&gt;
&lt;br /&gt;
The endpoints are configured using [[#GetDsEndpoint]], the total number of endpoints is the number of open [[#IDsEndpoint]] sessions. bInterfaceNumber is {0-based index for the enabled [[#IDsInterface]] session.} Some of the interface fields are configured using [[#GetDsInterface]].&lt;br /&gt;
&lt;br /&gt;
Additional descriptors for use with interfaces and endpoints can&#039;t be configured with usbds, even though the former is used for the default HID interface. This seems to be the main(?) restriction with using usbds for Switch-as-arbitrary-devices. The device class fields can&#039;t be configured, interface class fields are set instead.&lt;br /&gt;
&lt;br /&gt;
When usbds is in use where [[#SetVidPidBcd]] wasn&#039;t used, the VID/PID is 057e:3000.&lt;br /&gt;
&lt;br /&gt;
  Bus 003 Device 006: ID 057e:2000 Nintendo Co., Ltd &lt;br /&gt;
  Couldn&#039;t open device, some information will be missing&lt;br /&gt;
  Device Descriptor:&lt;br /&gt;
    bLength                18&lt;br /&gt;
    bDescriptorType         1&lt;br /&gt;
    bcdUSB               2.00&lt;br /&gt;
    bDeviceClass            0 (Defined at Interface level)&lt;br /&gt;
    bDeviceSubClass         0 &lt;br /&gt;
    bDeviceProtocol         0 &lt;br /&gt;
    bMaxPacketSize0        64&lt;br /&gt;
    idVendor           0x057e Nintendo Co., Ltd&lt;br /&gt;
    idProduct          0x2000 &lt;br /&gt;
    bcdDevice            1.00&lt;br /&gt;
    iManufacturer           1 &lt;br /&gt;
    iProduct                2 &lt;br /&gt;
    iSerial                 3 &lt;br /&gt;
    bNumConfigurations      1&lt;br /&gt;
    Configuration Descriptor:&lt;br /&gt;
      bLength                 9&lt;br /&gt;
      bDescriptorType         2&lt;br /&gt;
      wTotalLength           34&lt;br /&gt;
      bNumInterfaces          1&lt;br /&gt;
      bConfigurationValue     1&lt;br /&gt;
      iConfiguration          0 &lt;br /&gt;
      bmAttributes         0xc0&lt;br /&gt;
        Self Powered&lt;br /&gt;
      MaxPower              {...}&lt;br /&gt;
      Interface Descriptor:&lt;br /&gt;
        bLength                 9&lt;br /&gt;
        bDescriptorType         4&lt;br /&gt;
        bInterfaceNumber        0&lt;br /&gt;
        bAlternateSetting       0&lt;br /&gt;
        bNumEndpoints           1&lt;br /&gt;
        bInterfaceClass         3 Human Interface Device&lt;br /&gt;
        bInterfaceSubClass      0 No Subclass&lt;br /&gt;
        bInterfaceProtocol      0 None&lt;br /&gt;
        iInterface              0 &lt;br /&gt;
          HID Device Descriptor:&lt;br /&gt;
            bLength                 9&lt;br /&gt;
            bDescriptorType        33&lt;br /&gt;
            bcdHID               2.00&lt;br /&gt;
            bCountryCode            0 Not supported&lt;br /&gt;
            bNumDescriptors         1&lt;br /&gt;
            bDescriptorType        34 Report&lt;br /&gt;
            wDescriptorLength      26&lt;br /&gt;
           Report Descriptors: &lt;br /&gt;
             ** UNAVAILABLE **&lt;br /&gt;
        Endpoint Descriptor:&lt;br /&gt;
          bLength                 7&lt;br /&gt;
          bDescriptorType         5&lt;br /&gt;
          bEndpointAddress     0x81  EP 1 IN&lt;br /&gt;
          bmAttributes            3&lt;br /&gt;
            Transfer Type            Interrupt&lt;br /&gt;
            Synch Type               None&lt;br /&gt;
            Usage Type               Data&lt;br /&gt;
          wMaxPacketSize     0x0001  1x 1 bytes&lt;br /&gt;
          bInterval              16&lt;br /&gt;
&lt;br /&gt;
== BindDevice ==&lt;br /&gt;
Takes an u32 (&#039;&#039;&#039;complexId&#039;&#039;&#039;). [[Manu_Services|Manu]] sends 0x02.&lt;br /&gt;
&lt;br /&gt;
Binding more than once with the current session is not allowed. Once this command is used, the USB device will not be listed with &amp;lt;code&amp;gt;lsusb&amp;lt;/code&amp;gt; until [[#EnableInterface]] is used.&lt;br /&gt;
&lt;br /&gt;
Returns a not-found error when complexId isn&#039;t 0x02, for values 0x0-0x4 at least.&lt;br /&gt;
&lt;br /&gt;
== BindClientProcess ==&lt;br /&gt;
Takes 1 copy-handle for the current process (0xFFFF8001).&lt;br /&gt;
&lt;br /&gt;
== GetDsInterface ==&lt;br /&gt;
Takes 2 type-5 buffers and returns an [[#IDsInterface]]. [[Manu_Services|Manu]] sends a 0x09-byte command (e.g.: 0x09, 0x04, 0x04, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00) in the first buffer and a string (&amp;quot;usb&amp;quot;) in the second buffer.&lt;br /&gt;
&lt;br /&gt;
When the strlen output for the second buffer is &amp;gt;=0x40, size 0x40 is used instead for copying the string. This is the interface name, it&#039;s not sent over USB.&lt;br /&gt;
&lt;br /&gt;
Returns an error when [[#BindDevice]] wasn&#039;t used.&lt;br /&gt;
&lt;br /&gt;
Up to 4 interfaces can be used+[[#EnableInterface|enabled]].&lt;br /&gt;
&lt;br /&gt;
Structure of the first buffer(this is the same as [http://libusb.sourceforge.net/api-1.0/structlibusb__interface__descriptor.html libusb__interface__descriptor]):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || bLength. Must match 0x9.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x1 || bDescriptorType. Must match 0x4.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x1 || bInterfaceNumber. When 0x4, the bInterfaceNumber is automatically allocated(error will be thrown if no space). Otherwise, it&#039;s used directly and must be &amp;lt;=3.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 || 0x1 || bAlternateSetting. Must match 0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x1 || bNumEndpoints. Ignored.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 || 0x1 || bInterfaceClass&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 || 0x1 || bInterfaceSubClass&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 || 0x1 || bInterfaceProtocol&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x1 || iInterface. Ignored.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Only the first 0x9-bytes are used.&lt;br /&gt;
&lt;br /&gt;
== GetStateChangeEvent ==&lt;br /&gt;
Returns an event handle for when the state returned by [[#GetState]] changes. Signalled when Switch&amp;lt;-&amp;gt;host USB comms change between started/stopped. USB cable connected/disconnected while at least 1 interface was enabled, or interface enabled/disabled while the USB cable was connected which then caused USB-comms state to change.&lt;br /&gt;
&lt;br /&gt;
== GetState ==&lt;br /&gt;
No input. Returns an output u32. Returns an error when [[#BindDevice]] wasn&#039;t used.&lt;br /&gt;
&lt;br /&gt;
Returns the current state. Values: &lt;br /&gt;
* 0: Initial state.&lt;br /&gt;
* 6: Device init starting.&lt;br /&gt;
* 3: {Initialization}, previous state is 6.&lt;br /&gt;
* 4: {Initialization}, previous state is 3.&lt;br /&gt;
* 5: Initialization done, data-transfer is now available.&lt;br /&gt;
&lt;br /&gt;
== SetVidPidBcd ==&lt;br /&gt;
Takes a type-5 buffer with 0x66 bytes of USB descriptor data (see [[Manu_Services#manu|manu]]).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || VID (idVendor)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || PID (idProduct)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x2 || bcdDevice&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 || 0x20 || Manufacturer&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 || 0x20 || Product&lt;br /&gt;
|-&lt;br /&gt;
| 0x46 || 0x20 || SerialNumber&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The last 3 blocks are ASCII strings. The data following each string is all-zero, for padding to size 0x20.&lt;br /&gt;
&lt;br /&gt;
== IDsInterface ==&lt;br /&gt;
This is &amp;quot;nn::usb::ds::IDsInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetDsEndpoint]] || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetSetupEvent]] || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || || Takes a type-0x6 output buffer, no other output. Memcpys data to outbuf with outsize, uses size 0x8 if outsize is too large.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#EnableInterface]] || &lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#DisableInterface]] || &lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#CtrlInPostBufferAsync]] || &lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#CtrlOutPostBufferAsync]] || &lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#GetCtrlInCompletionEvent]] || &lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#GetCtrlInReportData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#GetCtrlOutCompletionEvent]] || &lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#GetCtrlOutReportData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#StallCtrl]] || &lt;br /&gt;
|-&lt;br /&gt;
| 12 || [5.0.0+] AppendConfigurationData || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Commands cmd2, [[#CtrlInPostBufferAsync]], [[#CtrlOutPostBufferAsync]], and [[#StallCtrl]], will throw an error if the interface is not [[#EnableInterface|enabled]]. [[#GetDsEndpoint]] will throw an error if the interface is [[#EnableInterface|enabled]].&lt;br /&gt;
&lt;br /&gt;
=== GetDsEndpoint ===&lt;br /&gt;
Takes a type-5 buffer and returns an [[#IDsEndpoint]]. [[Manu_Services|Manu]] uses this twice for getting two endpoint sessions, with the following 0x7-byte buffer data:&lt;br /&gt;
* First endpoint: 0x07, 0x05, 0x80, 0x02, 0x00, 0x02, 0x00&lt;br /&gt;
** bLength=0x7&lt;br /&gt;
** bDescriptorType=LIBUSB_DT_ENDPOINT&lt;br /&gt;
** bEndpointAddress=LIBUSB_ENDPOINT_IN&lt;br /&gt;
** bmAttributes=LIBUSB_TRANSFER_TYPE_BULK&lt;br /&gt;
** wMaxPacketSize=0x200&lt;br /&gt;
** bInterval=0&lt;br /&gt;
* Second endpoint: Same as above except byte2 is 0x00(bEndpointAddress=LIBUSB_ENDPOINT_OUT).&lt;br /&gt;
&lt;br /&gt;
Each field is an u8, except for offset 0x4-0x5 which is an u16.&lt;br /&gt;
&lt;br /&gt;
This structure matches [http://libusb.sourceforge.net/api-1.0/structlibusb__endpoint__descriptor.html libusb_endpoint_descriptor], with audio-only-devices fields bRefresh and bSynchAddress removed.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;gt;=0x7. Only the first 0x7-bytes from the buffer are used.&lt;br /&gt;
* Byte0(bLength) must match 0x7.&lt;br /&gt;
* Byte1(bDescriptorType) must match 0x5.&lt;br /&gt;
* Byte2(bEndpointAddress) is only compared with 0x80 to determine whether to use an input or output endpoint, the actual endpoint-number is allocated automatically by checking state. Hence, all input endpoints must use bEndpointAddress==0x80. Up to endpoint-number 0xF can be allocated for each endpoint-direction, for a total of 16 endpoints including control, and 15 for non-control endpoints([[#IDsEndpoint]] sessions for each direction). This matches the Tegra maximum.&lt;br /&gt;
&lt;br /&gt;
From the Tegra datasheet: &amp;quot;The maximum packet size supported on any endpoint is 1024 bytes in high-speed mode, for both device and host modes.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== GetSetupEvent ===&lt;br /&gt;
Returns an event handle. Unknown what triggers signalling, not signalled during interface-enable / device&amp;lt;&amp;gt;host USB-comms init.&lt;br /&gt;
&lt;br /&gt;
=== EnableInterface ===&lt;br /&gt;
Takes no arguments. Enables the current interface.&lt;br /&gt;
&lt;br /&gt;
Only one interface can be enabled at a time per bInterfaceNumber. When bInterfaceNumber is auto-allocate(0x4) for [[#GetDsEndpoint]] this isn&#039;t an issue since the final bInterfaceNumber will be unique.&lt;br /&gt;
&lt;br /&gt;
Once enabled, the device/interface can then actually be used over USB.&lt;br /&gt;
&lt;br /&gt;
=== DisableInterface ===&lt;br /&gt;
Takes no arguments. Disables the current interface.&lt;br /&gt;
&lt;br /&gt;
=== CtrlInPostBufferAsync ===&lt;br /&gt;
Same as [[#PostBufferAsync]](with same input/output), except this uses control input endpoint 0x80.&lt;br /&gt;
&lt;br /&gt;
=== CtrlOutPostBufferAsync ===&lt;br /&gt;
Same as [[#PostBufferAsync]](with same input/output), except this uses control output endpoint 0x00.&lt;br /&gt;
&lt;br /&gt;
=== GetCtrlInCompletionEvent ===&lt;br /&gt;
Returns an event handle for polling the completion of input control commands. Same as [[#GetCompletionEvent]], except this uses control input endpoint 0x80.&lt;br /&gt;
&lt;br /&gt;
=== GetCtrlInReportData ===&lt;br /&gt;
Same as [[#GetReportData]](with same input/output), except this uses control input endpoint 0x80.&lt;br /&gt;
&lt;br /&gt;
=== GetCtrlOutCompletionEvent ===&lt;br /&gt;
Returns an event handle for polling the completion of output control commands. Same as [[#GetCompletionEvent]], except this uses control output endpoint 0x00.&lt;br /&gt;
&lt;br /&gt;
=== GetCtrlOutReportData ===&lt;br /&gt;
Same as [[#GetReportData]](with same input/output), except this uses control output endpoint 0x00.&lt;br /&gt;
&lt;br /&gt;
=== StallCtrl ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Calls a function with both control endpoints(0x80 and 0x00) with the same function. From strings: &amp;quot;m_pProtocol-&amp;gt;Stall(0x80)&amp;quot; &amp;quot;m_pProtocol-&amp;gt;Stall(0x00)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== IDsEndpoint ===&lt;br /&gt;
This is &amp;quot;nn::usb::ds::IDsEndpoint&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#PostBufferAsync]] || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || || No input/output.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetCompletionEvent]] || &lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetReportData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#Stall]] || &lt;br /&gt;
|-&lt;br /&gt;
| 5 || || Takes an input u8, no output.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== PostBufferAsync ====&lt;br /&gt;
Takes an u32 (&#039;&#039;&#039;size&#039;&#039;&#039;) and an u64 (&#039;&#039;&#039;buffer&#039;&#039;&#039;). Returns an output u32 (&#039;&#039;&#039;urbId&#039;&#039;&#039;). The output urbId can then be used while parsing the output of [[#GetReportData]], after waiting for the CompletionEvent to be signalled.&lt;br /&gt;
&lt;br /&gt;
The buffer address must be 0x1000-byte aligned. The input size doesn&#039;t matter. It helps to use svcSetMemoryAttribute to turn off caching on the buffer.&lt;br /&gt;
&lt;br /&gt;
Used for data-transfer with input/output endpoints.&lt;br /&gt;
&lt;br /&gt;
The user-process must flush dcache for the buffer before using this command.&lt;br /&gt;
&lt;br /&gt;
When sending data where size is larger than wMaxPacketSize, it will automatically send multiple USB packets where last packet size = {remaining size}. Every {wMaxPacketSize}-bytes is a different packet. This only occurs in some cases. When &#039;&#039;&#039;size&#039;&#039;&#039; is ~0x1000000(exact size unknown), Switch-side silently hangs, while host-side will timeout(no traffic on USB bus indicating failure).&lt;br /&gt;
&lt;br /&gt;
For receiving data, if size is less than {actual received USB packet size} the rest of the packet will be discarded. Later PostBufferAsync cmd(s) will only return data from new packets, not the remainder of the earlier packet(s).&lt;br /&gt;
&lt;br /&gt;
==== GetCompletionEvent ====&lt;br /&gt;
No input. Returns an output event handle for polling the completion of [[#PostBufferAsync]], even when it finished via [[#Stall]].&lt;br /&gt;
&lt;br /&gt;
==== GetReportData ====&lt;br /&gt;
No input. Returns 0x84 bytes of report data from the endpoint. Seems to be eventually loaded from state, since this doesn&#039;t trigger any USB bus activity. All-zero before PostBufferAsync was used at least once.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10*0x8(0x80) || 0x8 entries 0x10-bytes each for each report.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80 || 0x4 || u32 report count&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entry data:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || u32 id (urbId from post-buffer commands)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || u32 requestedSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x4 || u32 transferredSize&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || u32 urb status, converted to error-codes. 0x3 = success, 0x4 = 0x828c, 0x5 = 0x748c. All other values are invalid.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Stall ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Calls the same function used by [[#StallCtrl]], except this uses the endpoint associated with the current session.&lt;br /&gt;
&lt;br /&gt;
Stops in-progress data-transfer done by [[#PostBufferAsync]].&lt;br /&gt;
&lt;br /&gt;
= usb:hs =&lt;br /&gt;
This is &amp;quot;nn::usb::hs::IClientRootSession&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#BindClientProcess_2|#BindClientProcess]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#QueryAllInterfaces]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#QueryAvailableInterfaces]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#QueryAcquiredInterfaces]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#CreateInterfaceAvailableEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#DestroyInterfaceAvailableEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#GetInterfaceStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#AcquireUsbIf]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [6.0.0+]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
General USB devices usage, used by [[Audio_services|audio]], [[HID_services|hid]] and [[Sockets_services|bsdsockets]].&lt;br /&gt;
&lt;br /&gt;
== BindClientProcess ==&lt;br /&gt;
Takes 1 copy-handle for the current process (0xFFFF8001).&lt;br /&gt;
&lt;br /&gt;
== QueryAllInterfaces ==&lt;br /&gt;
Takes a 0x10-byte input struct and a type-0x6 output buffer, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
== QueryAvailableInterfaces ==&lt;br /&gt;
Takes a 0x10-byte input struct and a type-0x6 output buffer, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
== QueryAcquiredInterfaces ==&lt;br /&gt;
Takes a type-0x6 output buffer and returns an output u32.&lt;br /&gt;
&lt;br /&gt;
== CreateInterfaceAvailableEvent ==&lt;br /&gt;
Takes an input u8 and returns an output handle.&lt;br /&gt;
&lt;br /&gt;
== DestroyInterfaceAvailableEvent ==&lt;br /&gt;
Takes an input u8, no output.&lt;br /&gt;
&lt;br /&gt;
== GetInterfaceStateChangeEvent ==&lt;br /&gt;
No input, returns an output handle.&lt;br /&gt;
&lt;br /&gt;
== AcquireUsbIf ==&lt;br /&gt;
Takes an input u32 and a type-0x6 output buffer, returns an [[#IClientIfSession]].&lt;br /&gt;
&lt;br /&gt;
== IClientIfSession ==&lt;br /&gt;
This is &amp;quot;nn::usb::hs::IClientIfSession&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || || No input, returns an output handle.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#SetInterface]] || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetInterface]] || &lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetAlternateInterface]] || &lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetCurrentFrame]] || &lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#CtrlXferAsync]] || &lt;br /&gt;
|-&lt;br /&gt;
| 6 || || No input, returns an output handle.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#GetCtrlXferReport]] || &lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#ResetDevice]] || &lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#OpenUsbEp]] || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SetInterface ===&lt;br /&gt;
Takes an input u8 and a type-0x6 output buffer, no output.&lt;br /&gt;
&lt;br /&gt;
=== GetInterface ===&lt;br /&gt;
Takes a type-0x6 output buffer, no output.&lt;br /&gt;
&lt;br /&gt;
=== GetAlternateInterface ===&lt;br /&gt;
Takes an input u8 and a type-0x6 output buffer, no output.&lt;br /&gt;
&lt;br /&gt;
=== GetCurrentFrame ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
=== CtrlXferAsync ===&lt;br /&gt;
Takes 2 input u8s and 3 input u16s, no output.&lt;br /&gt;
&lt;br /&gt;
=== GetCtrlXferReport ===&lt;br /&gt;
Takes a type-0x6 output buffer, no output.&lt;br /&gt;
&lt;br /&gt;
=== ResetDevice ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== OpenUsbEp ===&lt;br /&gt;
Takes an input u16 and 4 input u32s, returns a 0x7-byte output struct and an [[#IClientEpSession]].&lt;br /&gt;
&lt;br /&gt;
=== IClientEpSession ===&lt;br /&gt;
This is &amp;quot;nn::usb::hs::IClientEpSession&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Open]] || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#Close]] || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || || No input, returns an output handle.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#Populate]] || &lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#PostBufferAsync]] || &lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetXferReport]] || &lt;br /&gt;
|-&lt;br /&gt;
| 6 || || Takes 3 input u32s, 2 input u64s, and a type-0x5 input buffer, returns an output u32.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [4.0.0+] || &lt;br /&gt;
|-&lt;br /&gt;
| 8 || [4.0.0+] || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Open ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== Close ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== Populate ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
==== PostBufferAsync ====&lt;br /&gt;
Takes an input u32 and 2 input u64s, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
==== GetXferReport ====&lt;br /&gt;
Takes an input u32 and a type-0x6 output buffer, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
= usb:pd =&lt;br /&gt;
This is &amp;quot;nn::usb::pd::detail::IPdManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetPdSession&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Only system-titles with access to this are [[PTM_services|ptm]] and [[AM_services|am]].&lt;br /&gt;
&lt;br /&gt;
== IPdSession ==&lt;br /&gt;
This is &amp;quot;nn::usb::pd::detail::IPdSession&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || BindNoticeEvent&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetStatus&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetNotice&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || ReplyPowerRequest&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= usb:pd:c =&lt;br /&gt;
This is &amp;quot;nn::usb::pd::detail::IPdCradleManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetPdCradleSession || Returns a session handle for the below.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
USB-sysmodule symbols for this refer to &amp;quot;Cradle&amp;quot;, which is the [[Dock]].&lt;br /&gt;
&lt;br /&gt;
== IPdCradleSession ==&lt;br /&gt;
This is &amp;quot;nn::usb::pd::detail::IPdCradleSession&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || VdmUserWrite || Input { u32 value; u32 VdmUserId; }. Output {}.&lt;br /&gt;
If Cradle or RelayBox is connected, issues given VDM with value.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || VdmUserRead || Input { u32 VdmUserId; }. Output { u32 value; }.&lt;br /&gt;
If Cradle or RelayBox is connected, returns u32 response from issuing given VDM.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Vdm20Init || No input/output.&lt;br /&gt;
If Cradle or RelayBox is connected, caches result of VDM 0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetFwType || No input. Returns an output u16.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetFwRevision || No input. Returns an output u16.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || GetManufacturerId || No input. Returns an output u16.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || GetDeviceId || No input. Returns an output u16.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [3.0.0+] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [3.0.0+] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: The VdmUserId given to VdmUserRead/VdmUserWrite is translated from the given (enum) value to the actual cmd to send.&lt;br /&gt;
&lt;br /&gt;
= usb:pm =&lt;br /&gt;
This is &amp;quot;nn::usb::pm::IPmService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
USB Port Manager, only system-title using this is [[PTM_services|ptm]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=ETicket_services&amp;diff=5237</id>
		<title>ETicket services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=ETicket_services&amp;diff=5237"/>
		<updated>2018-10-18T22:21:17Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Few new names&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= es =&lt;br /&gt;
This is &amp;quot;nn::es::IETicketService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ImportTicket&lt;br /&gt;
|-&lt;br /&gt;
| 2 || ImportTicketCertificateSet&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DeleteTicket&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeletePersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeleteAllCommonTicket&lt;br /&gt;
|-&lt;br /&gt;
| 6 || DeleteAllPersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeleteAllPersonalizedTicketEx&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [2.0.0-5.1.0] GetTitleKey&lt;br /&gt;
|-&lt;br /&gt;
| 9 || CountCommonTicket&lt;br /&gt;
|-&lt;br /&gt;
| 10 || CountPersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 11 || ListCommonTicket / [6.0.0+] ListCommonTicketRightsIds&lt;br /&gt;
|-&lt;br /&gt;
| 12 || ListPersonalizedTicket / [6.0.0+] ListPersonalizedTicketRightsIds&lt;br /&gt;
|-&lt;br /&gt;
| 13 || ListMissingPersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 14 || GetCommonTicketSize&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [2.0.0-5.1.0] GetPersonalizedTicketSize&lt;br /&gt;
|-&lt;br /&gt;
| 16 || GetCommonTicketData&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [2.0.0-5.1.0] GetPersonalizedTicketData&lt;br /&gt;
|-&lt;br /&gt;
| 18 || OwnTicket&lt;br /&gt;
|-&lt;br /&gt;
| 19 || GetTicketInfo&lt;br /&gt;
|-&lt;br /&gt;
| 20 || ListLightTicketInfo&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [2.0.0+] SignData&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [4.0.0+] GetCommonTicketAndCertificateSize&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [4.0.0+] GetCommonTicketAndCertificateData&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [4.0.0+] ImportPrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [4.0.0+] DeletePrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 26 || [4.0.0+] DeleteAllPrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 27 || [4.0.0+] CountPrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 28 || [4.0.0+] ListPrepurchaseRecord / [6.0.0+] ListPrepurchaseRecordRightsIds&lt;br /&gt;
|-&lt;br /&gt;
| 29 || [4.0.0+] ListPrepurchaseRecordInfo&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [5.0.0+] CountTicket&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [5.0.0+] ListTicketRightsIds&lt;br /&gt;
|-&lt;br /&gt;
| 32 || [5.0.0+] CountPrepurchaseRecordEx&lt;br /&gt;
|-&lt;br /&gt;
| 33 || [5.0.0+] ListPrepurchaseRecordRightsIdsEx&lt;br /&gt;
|-&lt;br /&gt;
| 34 || [5.0.0+] GetEncryptedTicketSize&lt;br /&gt;
|-&lt;br /&gt;
| 35 || [5.0.0+] GetEncryptedTicketData&lt;br /&gt;
|-&lt;br /&gt;
| 36 || [6.0.0+] DeleteAllInactiveELicenseRequiredPersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 501 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 502 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 503 || [6.0.0+] GetTitleKey&lt;br /&gt;
|-&lt;br /&gt;
| 504 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 508 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 509 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 510 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1002 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1003 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1004 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1005 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1006 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1007 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1009 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1010 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1011 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1012 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1013 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1014 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1015 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1016 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1501 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1502 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1503 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1504 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1505 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2000 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2501 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2502 || [6.0.0+]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=USB_services&amp;diff=5023</id>
		<title>USB services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=USB_services&amp;diff=5023"/>
		<updated>2018-09-19T08:44:51Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Fixed editing the USB services page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;One symbol in USB-sysmodule is: &amp;quot;vtable for nn::usb::detail::UsbComplexTegra21x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= usb:ds =&lt;br /&gt;
This is &amp;quot;nn::usb::ds::IDsService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Used for Switch&amp;lt;&amp;gt;PC USB comms, aka Switch-as-device. This seems to only be usable in handheld-mode with the Switch directly connected to a host via an USB cable, not(?) in docked-mode.&lt;br /&gt;
This service is used during [[Factory Setup|factory setup]] by [[Manu Services|manu]].&lt;br /&gt;
&lt;br /&gt;
This service session is used as an IPC [[IPC_Marshalling|domain]] by [[Manu Services|manu]]. All of these {get-session} commands also return an output u8 and the u32 [[IPC_Marshalling|domainID]], for using those sessions as domains.&lt;br /&gt;
&lt;br /&gt;
This service can be used by multiple processes at the same time, with separate interfaces. However, if one process does usbds shutdown, usbds will reset to defaults even if there&#039;s a process still using it. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#BindDevice]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#BindClientProcess]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetDsInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetState]]&lt;br /&gt;
|-&lt;br /&gt;
| [2.0.0-4.1.0] 5 || [[#SetVidPidBcd]]&lt;br /&gt;
|-&lt;br /&gt;
| [5.0.0+] 5 || ClearDeviceData&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [5.0.0+] AddUsbStringDescriptor&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [5.0.0+] DeleteUsbStringDescriptor&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [5.0.0+] SetUsbDeviceDescriptor&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [5.0.0+] SetBinaryObjectStore&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [5.0.0+] Enable&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [5.0.0+] Disable&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Initialization done by [[Manu Services|manu]]:&lt;br /&gt;
* Initial service init:&lt;br /&gt;
** Get service/etc.&lt;br /&gt;
** Uses [[#BindDevice]].&lt;br /&gt;
** Uses [[#BindClientProcess]].&lt;br /&gt;
** Uses [[#GetStateChangeEvent]].&lt;br /&gt;
** Uses [[#SetVidPidBcd]].&lt;br /&gt;
* Interface init:&lt;br /&gt;
** Uses [[#GetDsInterface]], then uses commands from that with the rest of the following.&lt;br /&gt;
** Uses [[#GetSetupEvent]].&lt;br /&gt;
** Uses [[#GetCtrlInCompletionEvent]].&lt;br /&gt;
** Uses [[#GetCtrlOutCompletionEvent]].&lt;br /&gt;
* Initializes two endpoints via using [[#GetDsEndpoint]] twice.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
The following is the default USB config strings, while the usbds service isn&#039;t being used. All of the below configuration will reset to the defaults when all usbds-related sessions are closed. These can be set with [[#SetVidPidBcd]]. The default string for Product is loaded from [[Settings_services|settings]] config. The default is referred to by usb-sysmodule as &amp;quot;Dummy&amp;quot;.&lt;br /&gt;
  Product: Nintendo Switch&lt;br /&gt;
  Manufacturer: Nintendo&lt;br /&gt;
  SerialNumber: SerialNumber&lt;br /&gt;
&lt;br /&gt;
The following is the default &amp;lt;code&amp;gt;lsusb -v {...}&amp;lt;/code&amp;gt; output when the usbds service wasn&#039;t used.&lt;br /&gt;
&lt;br /&gt;
The endpoints are configured using [[#GetDsEndpoint]], the total number of endpoints is the number of open [[#IDsEndpoint]] sessions. bInterfaceNumber is {0-based index for the enabled [[#IDsInterface]] session.} Some of the interface fields are configured using [[#GetDsInterface]].&lt;br /&gt;
&lt;br /&gt;
Additional descriptors for use with interfaces and endpoints can&#039;t be configured with usbds, even though the former is used for the default HID interface. This seems to be the main(?) restriction with using usbds for Switch-as-arbitrary-devices. The device class fields can&#039;t be configured, interface class fields are set instead.&lt;br /&gt;
&lt;br /&gt;
When usbds is in use where [[#SetVidPidBcd]] wasn&#039;t used, the VID/PID is 057e:3000.&lt;br /&gt;
&lt;br /&gt;
  Bus 003 Device 006: ID 057e:2000 Nintendo Co., Ltd &lt;br /&gt;
  Couldn&#039;t open device, some information will be missing&lt;br /&gt;
  Device Descriptor:&lt;br /&gt;
    bLength                18&lt;br /&gt;
    bDescriptorType         1&lt;br /&gt;
    bcdUSB               2.00&lt;br /&gt;
    bDeviceClass            0 (Defined at Interface level)&lt;br /&gt;
    bDeviceSubClass         0 &lt;br /&gt;
    bDeviceProtocol         0 &lt;br /&gt;
    bMaxPacketSize0        64&lt;br /&gt;
    idVendor           0x057e Nintendo Co., Ltd&lt;br /&gt;
    idProduct          0x2000 &lt;br /&gt;
    bcdDevice            1.00&lt;br /&gt;
    iManufacturer           1 &lt;br /&gt;
    iProduct                2 &lt;br /&gt;
    iSerial                 3 &lt;br /&gt;
    bNumConfigurations      1&lt;br /&gt;
    Configuration Descriptor:&lt;br /&gt;
      bLength                 9&lt;br /&gt;
      bDescriptorType         2&lt;br /&gt;
      wTotalLength           34&lt;br /&gt;
      bNumInterfaces          1&lt;br /&gt;
      bConfigurationValue     1&lt;br /&gt;
      iConfiguration          0 &lt;br /&gt;
      bmAttributes         0xc0&lt;br /&gt;
        Self Powered&lt;br /&gt;
      MaxPower              {...}&lt;br /&gt;
      Interface Descriptor:&lt;br /&gt;
        bLength                 9&lt;br /&gt;
        bDescriptorType         4&lt;br /&gt;
        bInterfaceNumber        0&lt;br /&gt;
        bAlternateSetting       0&lt;br /&gt;
        bNumEndpoints           1&lt;br /&gt;
        bInterfaceClass         3 Human Interface Device&lt;br /&gt;
        bInterfaceSubClass      0 No Subclass&lt;br /&gt;
        bInterfaceProtocol      0 None&lt;br /&gt;
        iInterface              0 &lt;br /&gt;
          HID Device Descriptor:&lt;br /&gt;
            bLength                 9&lt;br /&gt;
            bDescriptorType        33&lt;br /&gt;
            bcdHID               2.00&lt;br /&gt;
            bCountryCode            0 Not supported&lt;br /&gt;
            bNumDescriptors         1&lt;br /&gt;
            bDescriptorType        34 Report&lt;br /&gt;
            wDescriptorLength      26&lt;br /&gt;
           Report Descriptors: &lt;br /&gt;
             ** UNAVAILABLE **&lt;br /&gt;
        Endpoint Descriptor:&lt;br /&gt;
          bLength                 7&lt;br /&gt;
          bDescriptorType         5&lt;br /&gt;
          bEndpointAddress     0x81  EP 1 IN&lt;br /&gt;
          bmAttributes            3&lt;br /&gt;
            Transfer Type            Interrupt&lt;br /&gt;
            Synch Type               None&lt;br /&gt;
            Usage Type               Data&lt;br /&gt;
          wMaxPacketSize     0x0001  1x 1 bytes&lt;br /&gt;
          bInterval              16&lt;br /&gt;
&lt;br /&gt;
== BindDevice ==&lt;br /&gt;
Takes an u32 (&#039;&#039;&#039;complexId&#039;&#039;&#039;). [[Manu_Services|Manu]] sends 0x02.&lt;br /&gt;
&lt;br /&gt;
Binding more than once with the current session is not allowed. Once this command is used, the USB device will not be listed with &amp;lt;code&amp;gt;lsusb&amp;lt;/code&amp;gt; until [[#EnableInterface]] is used.&lt;br /&gt;
&lt;br /&gt;
Returns a not-found error when complexId isn&#039;t 0x02, for values 0x0-0x4 at least.&lt;br /&gt;
&lt;br /&gt;
== BindClientProcess ==&lt;br /&gt;
Takes 1 copy-handle for the current process (0xFFFF8001).&lt;br /&gt;
&lt;br /&gt;
== GetDsInterface ==&lt;br /&gt;
Takes 2 type-5 buffers and returns an [[#IDsInterface]]. [[Manu_Services|Manu]] sends a 0x09-byte command (e.g.: 0x09, 0x04, 0x04, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00) in the first buffer and a string (&amp;quot;usb&amp;quot;) in the second buffer.&lt;br /&gt;
&lt;br /&gt;
When the strlen output for the second buffer is &amp;gt;=0x40, size 0x40 is used instead for copying the string. This is the interface name, it&#039;s not sent over USB.&lt;br /&gt;
&lt;br /&gt;
Returns an error when [[#BindDevice]] wasn&#039;t used.&lt;br /&gt;
&lt;br /&gt;
Up to 4 interfaces can be used+[[#EnableInterface|enabled]].&lt;br /&gt;
&lt;br /&gt;
Structure of the first buffer(this is the same as [http://libusb.sourceforge.net/api-1.0/structlibusb__interface__descriptor.html libusb__interface__descriptor]):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || bLength. Must match 0x9.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x1 || bDescriptorType. Must match 0x4.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x1 || bInterfaceNumber. When 0x4, the bInterfaceNumber is automatically allocated(error will be thrown if no space). Otherwise, it&#039;s used directly and must be &amp;lt;=3.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 || 0x1 || bAlternateSetting. Must match 0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x1 || bNumEndpoints. Ignored.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 || 0x1 || bInterfaceClass&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 || 0x1 || bInterfaceSubClass&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 || 0x1 || bInterfaceProtocol&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x1 || iInterface. Ignored.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Only the first 0x9-bytes are used.&lt;br /&gt;
&lt;br /&gt;
== GetStateChangeEvent ==&lt;br /&gt;
Returns an event handle for when the state returned by [[#GetState]] changes. Signalled when Switch&amp;lt;-&amp;gt;host USB comms change between started/stopped. USB cable connected/disconnected while at least 1 interface was enabled, or interface enabled/disabled while the USB cable was connected which then caused USB-comms state to change.&lt;br /&gt;
&lt;br /&gt;
== GetState ==&lt;br /&gt;
No input. Returns an output u32. Returns an error when [[#BindDevice]] wasn&#039;t used.&lt;br /&gt;
&lt;br /&gt;
Returns the current state. Values: &lt;br /&gt;
* 0: Initial state.&lt;br /&gt;
* 6: Device init starting.&lt;br /&gt;
* 3: {Initialization}, previous state is 6.&lt;br /&gt;
* 4: {Initialization}, previous state is 3.&lt;br /&gt;
* 5: Initialization done, data-transfer is now available.&lt;br /&gt;
&lt;br /&gt;
== SetVidPidBcd ==&lt;br /&gt;
Takes a type-5 buffer with 0x66 bytes of USB descriptor data (see [[Manu_Services#manu|manu]]).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || VID (idVendor)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || PID (idProduct)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x2 || bcdDevice&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 || 0x20 || Manufacturer&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 || 0x20 || Product&lt;br /&gt;
|-&lt;br /&gt;
| 0x46 || 0x20 || SerialNumber&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The last 3 blocks are ASCII strings. The data following each string is all-zero, for padding to size 0x20.&lt;br /&gt;
&lt;br /&gt;
== IDsInterface ==&lt;br /&gt;
This is &amp;quot;nn::usb::ds::IDsInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetDsEndpoint]] || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetSetupEvent]] || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || || Takes a type-0x6 output buffer, no other output. Memcpys data to outbuf with outsize, uses size 0x8 if outsize is too large.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#EnableInterface]] || &lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#DisableInterface]] || &lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#CtrlInPostBufferAsync]] || &lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#CtrlOutPostBufferAsync]] || &lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#GetCtrlInCompletionEvent]] || &lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#GetCtrlInReportData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#GetCtrlOutCompletionEvent]] || &lt;br /&gt;
|-&lt;br /&gt;
| 10 || [[#GetCtrlOutReportData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 11 || [[#StallCtrl]] || &lt;br /&gt;
|-&lt;br /&gt;
| 12 || [5.0.0+] AppendConfigurationData || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Commands cmd2, [[#CtrlInPostBufferAsync]], [[#CtrlOutPostBufferAsync]], and [[#StallCtrl]], will throw an error if the interface is not [[#EnableInterface|enabled]]. [[#GetDsEndpoint]] will throw an error if the interface is [[#EnableInterface|enabled]].&lt;br /&gt;
&lt;br /&gt;
=== GetDsEndpoint ===&lt;br /&gt;
Takes a type-5 buffer and returns an [[#IDsEndpoint]]. [[Manu_Services|Manu]] uses this twice for getting two endpoint sessions, with the following 0x7-byte buffer data:&lt;br /&gt;
* First endpoint: 0x07, 0x05, 0x80, 0x02, 0x00, 0x02, 0x00&lt;br /&gt;
** bLength=0x7&lt;br /&gt;
** bDescriptorType=LIBUSB_DT_ENDPOINT&lt;br /&gt;
** bEndpointAddress=LIBUSB_ENDPOINT_IN&lt;br /&gt;
** bmAttributes=LIBUSB_TRANSFER_TYPE_BULK&lt;br /&gt;
** wMaxPacketSize=0x200&lt;br /&gt;
** bInterval=0&lt;br /&gt;
* Second endpoint: Same as above except byte2 is 0x00(bEndpointAddress=LIBUSB_ENDPOINT_OUT).&lt;br /&gt;
&lt;br /&gt;
Each field is an u8, except for offset 0x4-0x5 which is an u16.&lt;br /&gt;
&lt;br /&gt;
This structure matches [http://libusb.sourceforge.net/api-1.0/structlibusb__endpoint__descriptor.html libusb_endpoint_descriptor], with audio-only-devices fields bRefresh and bSynchAddress removed.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;gt;=0x7. Only the first 0x7-bytes from the buffer are used.&lt;br /&gt;
* Byte0(bLength) must match 0x7.&lt;br /&gt;
* Byte1(bDescriptorType) must match 0x5.&lt;br /&gt;
* Byte2(bEndpointAddress) is only compared with 0x80 to determine whether to use an input or output endpoint, the actual endpoint-number is allocated automatically by checking state. Hence, all input endpoints must use bEndpointAddress==0x80. Up to endpoint-number 0xF can be allocated for each endpoint-direction, for a total of 16 endpoints including control, and 15 for non-control endpoints([[#IDsEndpoint]] sessions for each direction). This matches the Tegra maximum.&lt;br /&gt;
&lt;br /&gt;
From the Tegra datasheet: &amp;quot;The maximum packet size supported on any endpoint is 1024 bytes in high-speed mode, for both device and host modes.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== GetSetupEvent ===&lt;br /&gt;
Returns an event handle. Unknown what triggers signalling, not signalled during interface-enable / device&amp;lt;&amp;gt;host USB-comms init.&lt;br /&gt;
&lt;br /&gt;
=== EnableInterface ===&lt;br /&gt;
Takes no arguments. Enables the current interface.&lt;br /&gt;
&lt;br /&gt;
Only one interface can be enabled at a time per bInterfaceNumber. When bInterfaceNumber is auto-allocate(0x4) for [[#GetDsEndpoint]] this isn&#039;t an issue since the final bInterfaceNumber will be unique.&lt;br /&gt;
&lt;br /&gt;
Once enabled, the device/interface can then actually be used over USB.&lt;br /&gt;
&lt;br /&gt;
=== DisableInterface ===&lt;br /&gt;
Takes no arguments. Disables the current interface.&lt;br /&gt;
&lt;br /&gt;
=== CtrlInPostBufferAsync ===&lt;br /&gt;
Same as [[#PostBufferAsync]](with same input/output), except this uses control input endpoint 0x80.&lt;br /&gt;
&lt;br /&gt;
=== CtrlOutPostBufferAsync ===&lt;br /&gt;
Same as [[#PostBufferAsync]](with same input/output), except this uses control output endpoint 0x00.&lt;br /&gt;
&lt;br /&gt;
=== GetCtrlInCompletionEvent ===&lt;br /&gt;
Returns an event handle for polling the completion of input control commands. Same as [[#GetCompletionEvent]], except this uses control input endpoint 0x80.&lt;br /&gt;
&lt;br /&gt;
=== GetCtrlInReportData ===&lt;br /&gt;
Same as [[#GetReportData]](with same input/output), except this uses control input endpoint 0x80.&lt;br /&gt;
&lt;br /&gt;
=== GetCtrlOutCompletionEvent ===&lt;br /&gt;
Returns an event handle for polling the completion of output control commands. Same as [[#GetCompletionEvent]], except this uses control output endpoint 0x00.&lt;br /&gt;
&lt;br /&gt;
=== GetCtrlOutReportData ===&lt;br /&gt;
Same as [[#GetReportData]](with same input/output), except this uses control output endpoint 0x00.&lt;br /&gt;
&lt;br /&gt;
=== StallCtrl ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Calls a function with both control endpoints(0x80 and 0x00) with the same function. From strings: &amp;quot;m_pProtocol-&amp;gt;Stall(0x80)&amp;quot; &amp;quot;m_pProtocol-&amp;gt;Stall(0x00)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== IDsEndpoint ===&lt;br /&gt;
This is &amp;quot;nn::usb::ds::IDsEndpoint&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#PostBufferAsync]] || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || || No input/output.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetCompletionEvent]] || &lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetReportData]] || &lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#Stall]] || &lt;br /&gt;
|-&lt;br /&gt;
| 5 || || Takes an input u8, no output.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== PostBufferAsync ====&lt;br /&gt;
Takes an u32 (&#039;&#039;&#039;size&#039;&#039;&#039;) and an u64 (&#039;&#039;&#039;buffer&#039;&#039;&#039;). Returns an output u32 (&#039;&#039;&#039;urbId&#039;&#039;&#039;). The output urbId can then be used while parsing the output of [[#GetReportData]], after waiting for the CompletionEvent to be signalled.&lt;br /&gt;
&lt;br /&gt;
The buffer address must be 0x1000-byte aligned. The input size doesn&#039;t matter. It helps to use svcSetMemoryAttribute to turn off caching on the buffer.&lt;br /&gt;
&lt;br /&gt;
Used for data-transfer with input/output endpoints.&lt;br /&gt;
&lt;br /&gt;
The user-process must flush dcache for the buffer before using this command.&lt;br /&gt;
&lt;br /&gt;
When sending data where size is larger than wMaxPacketSize, it will automatically send multiple USB packets where last packet size = {remaining size}. Every {wMaxPacketSize}-bytes is a different packet. This only occurs in some cases. When &#039;&#039;&#039;size&#039;&#039;&#039; is ~0x1000000(exact size unknown), Switch-side silently hangs, while host-side will timeout(no traffic on USB bus indicating failure).&lt;br /&gt;
&lt;br /&gt;
For receiving data, if size is less than {actual received USB packet size} the rest of the packet will be discarded. Later PostBufferAsync cmd(s) will only return data from new packets, not the remainder of the earlier packet(s).&lt;br /&gt;
&lt;br /&gt;
==== GetCompletionEvent ====&lt;br /&gt;
No input. Returns an output event handle for polling the completion of [[#PostBufferAsync]], even when it finished via [[#Stall]].&lt;br /&gt;
&lt;br /&gt;
==== GetReportData ====&lt;br /&gt;
No input. Returns 0x84 bytes of report data from the endpoint. Seems to be eventually loaded from state, since this doesn&#039;t trigger any USB bus activity. All-zero before PostBufferAsync was used at least once.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10*0x8(0x80) || 0x8 entries 0x10-bytes each for each report.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80 || 0x4 || u32 report count&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entry data:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || u32 id (urbId from post-buffer commands)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || u32 requestedSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x4 || u32 transferredSize&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || u32 urb status, converted to error-codes. 0x3 = success, 0x4 = 0x828c, 0x5 = 0x748c. All other values are invalid.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Stall ====&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Calls the same function used by [[#StallCtrl]], except this uses the endpoint associated with the current session.&lt;br /&gt;
&lt;br /&gt;
Stops in-progress data-transfer done by [[#PostBufferAsync]].&lt;br /&gt;
&lt;br /&gt;
= usb:hs =&lt;br /&gt;
This is &amp;quot;nn::usb::hs::IClientRootSession&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || BindClientProcess&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || GetInterfaceStateChangeEvent&lt;br /&gt;
|-&lt;br /&gt;
| 7 || GetClientIfSession&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
General USB devices usage, used by [[HID_services|hid]] and [[Sockets_services|bsdsockets]].&lt;br /&gt;
&lt;br /&gt;
== IClientIfSession ==&lt;br /&gt;
This is &amp;quot;nn::usb::hs::IClientIfSession&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || CtrlXferAsync&lt;br /&gt;
|-&lt;br /&gt;
| 6 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || GetCtrlXferReport&lt;br /&gt;
|-&lt;br /&gt;
| 8 ||&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetClientEpSession&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IClientEpSession ===&lt;br /&gt;
This is &amp;quot;nn::usb::hs::IClientEpSession&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || PostBufferAsync&lt;br /&gt;
|-&lt;br /&gt;
| 5 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [4.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [4.0.0+]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= usb:pd =&lt;br /&gt;
This is &amp;quot;nn::usb::pd::detail::IPdManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetPdSession&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Only system-titles with access to this are [[PTM_services|ptm]] and [[AM_services|am]].&lt;br /&gt;
&lt;br /&gt;
== IPdSession ==&lt;br /&gt;
This is &amp;quot;nn::usb::pd::detail::IPdSession&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || BindNoticeEvent&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetStatus&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetNotice&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || ReplyPowerRequest&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= usb:pd:c =&lt;br /&gt;
This is &amp;quot;nn::usb::pd::detail::IPdCradleManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetPdCradleSession || Returns a session handle for the below.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
USB-sysmodule symbols for this refer to &amp;quot;Cradle&amp;quot;, which is the [[Dock]].&lt;br /&gt;
&lt;br /&gt;
== IPdCradleSession ==&lt;br /&gt;
This is &amp;quot;nn::usb::pd::detail::IPdCradleSession&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || VdmUserWrite || Input { u32 value; u32 VdmUserId; }. Output {}.&lt;br /&gt;
If Cradle or RelayBox is connected, issues given VDM with value.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || VdmUserRead || Input { u32 VdmUserId; }. Output { u32 value; }.&lt;br /&gt;
If Cradle or RelayBox is connected, returns u32 response from issuing given VDM.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Vdm20Init || No input/output.&lt;br /&gt;
If Cradle or RelayBox is connected, caches result of VDM 0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetFwType || No input. Returns an output u16.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetFwRevision || No input. Returns an output u16.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || GetManufacturerId || No input. Returns an output u16.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || GetDeviceId || No input. Returns an output u16.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [3.0.0+] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [3.0.0+] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: The VdmUserId given to VdmUserRead/VdmUserWrite is translated from the given (enum) value to the actual cmd to send.&lt;br /&gt;
&lt;br /&gt;
= usb:pm =&lt;br /&gt;
This is &amp;quot;nn::usb::pm::IPmService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
USB Port Manager, only system-title using this is [[PTM_services|ptm]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=ETicket_services&amp;diff=4959</id>
		<title>ETicket services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=ETicket_services&amp;diff=4959"/>
		<updated>2018-09-01T01:47:23Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: This appears to be the same function, just renamed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= es =&lt;br /&gt;
This is &amp;quot;nn::es::IETicketService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ImportTicket&lt;br /&gt;
|-&lt;br /&gt;
| 2 || ImportTicketCertificateSet&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DeleteTicket&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeletePersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeleteAllCommonTicket&lt;br /&gt;
|-&lt;br /&gt;
| 6 || DeleteAllPersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeleteAllPersonalizedTicketEx&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [2.0.0-5.1.0] GetTitleKey&lt;br /&gt;
|-&lt;br /&gt;
| 9 || CountCommonTicket&lt;br /&gt;
|-&lt;br /&gt;
| 10 || CountPersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 11 || ListCommonTicket&lt;br /&gt;
|-&lt;br /&gt;
| 12 || ListPersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 13 || ListMissingPersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 14 || GetCommonTicketSize&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [2.0.0-5.1.0] GetPersonalizedTicketSize&lt;br /&gt;
|-&lt;br /&gt;
| 16 || GetCommonTicketData&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [2.0.0-5.1.0] GetPersonalizedTicketData&lt;br /&gt;
|-&lt;br /&gt;
| 18 || OwnTicket&lt;br /&gt;
|-&lt;br /&gt;
| 19 || GetTicketInfo&lt;br /&gt;
|-&lt;br /&gt;
| 20 || ListLightTicketInfo&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [2.0.0+] SignData&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [4.0.0+] GetCommonTicketAndCertificateSize&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [4.0.0+] GetCommonTicketAndCertificateData&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [4.0.0+] ImportPrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [4.0.0+] DeletePrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 26 || [4.0.0+] DeleteAllPrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 27 || [4.0.0+] CountPrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 28 || [4.0.0+] ListPrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 29 || [4.0.0+] ListPrepurchaseRecordInfo&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 32 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 33 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 34 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 35 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 36 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 501 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 502 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 503 || [6.0.0+] GetTitleKey&lt;br /&gt;
|-&lt;br /&gt;
| 504 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 508 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 509 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 510 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1002 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1003 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1004 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1005 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1006 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1007 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1009 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1010 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1011 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1012 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1013 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1014 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1015 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1016 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1501 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1502 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1503 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1504 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1505 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2000 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2501 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2502 || [6.0.0+]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=NS_services&amp;diff=4952</id>
		<title>NS services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=NS_services&amp;diff=4952"/>
		<updated>2018-08-31T10:29:05Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Placeholder name for command 94&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= aoc:u =&lt;br /&gt;
This is &amp;quot;nn::aocsrv::detail::IAddOnContentManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CountAddOnContentByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ListAddOnContentByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 2 || CountAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 3 || ListAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetAddOnContentBaseIdByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 5 || GetAddOnContentBaseId&lt;br /&gt;
|-&lt;br /&gt;
| 6 || PrepareAddOnContentByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 7 || PrepareAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [4.0.0+] GetAddOnContentListChangedEvent&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:am =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IApplicationManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] This service was replaced by [[#ns:am2, ns:ec, ns:rid, ns:rt, ns:web|ns:am2]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ListApplicationRecord]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GenerateApplicationRecordCount&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetApplicationRecordUpdateSystemEvent&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetApplicationViewDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeleteApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeleteApplicationCompletely&lt;br /&gt;
|-&lt;br /&gt;
| 6 || IsAnyApplicationEntityRedundant&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeleteRedundantApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 8 || IsApplicationEntityMovable&lt;br /&gt;
|-&lt;br /&gt;
| 9 || MoveApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 11 || CalculateApplicationOccupiedSize&lt;br /&gt;
|-&lt;br /&gt;
| 16 || PushApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListApplicationRecordContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 18 || &lt;br /&gt;
|-&lt;br /&gt;
| 19 || [[#LaunchApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#GetApplicationContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || TerminateApplication&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [2.0.0+] ResolveApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
| 26 || BeginInstallApplication&lt;br /&gt;
|-&lt;br /&gt;
| 27 || DeleteApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 30 || RequestApplicationUpdateInfo&lt;br /&gt;
|-&lt;br /&gt;
| 31 || RequestUpdateApplication&lt;br /&gt;
|-&lt;br /&gt;
| 32 || CancelApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 33 || ResumeApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 34 || &lt;br /&gt;
|-&lt;br /&gt;
| 35 || UpdateVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 36 || PushLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 37 || ListRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 38 || CheckApplicationLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 39 || CheckApplicationLaunchRights&lt;br /&gt;
|-&lt;br /&gt;
| 40 || GetApplicationLogoData&lt;br /&gt;
|-&lt;br /&gt;
| 41 || CalculateApplicationDownloadRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 42 || CleanupSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 43 || CheckSdCardMountStatus&lt;br /&gt;
|-&lt;br /&gt;
| 44 || GetSdCardMountStatusChangedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 45 || GetGameCardAttachmentEvent&lt;br /&gt;
|-&lt;br /&gt;
| 46 || GetGameCardAttachmentInfo&lt;br /&gt;
|-&lt;br /&gt;
| 47 || [[#GetTotalSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 48 || [[#GetFreeSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 49 || GetSdCardRemovedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 52 || GetGameCardUpdateDetectionEvent&lt;br /&gt;
|-&lt;br /&gt;
| 53 || DisableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 54 || EnableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 55 || [[#GetApplicationDesiredLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 56 || SetApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 57 || ClearApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 58 || GetLastSdCardMountUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 59 || ConvertApplicationLanguageToLanguageCode&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [[#ConvertLanguageCodeToApplicationLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || GetBackgroundDownloadStressTaskInfo&lt;br /&gt;
|-&lt;br /&gt;
| 62 || GetGameCardStopper&lt;br /&gt;
|-&lt;br /&gt;
| 63 || IsSystemProgramInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 64 || [2.0.0+] StartApplyDeltaTask&lt;br /&gt;
|-&lt;br /&gt;
| 65 || [2.0.0+] GetRequestServerStopper&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ResetToFactorySettings&lt;br /&gt;
|-&lt;br /&gt;
| 101 || ResetToFactorySettingsWithoutUserSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [2.0.0+] ResetToFactorySettingsForRefurbishment&lt;br /&gt;
|-&lt;br /&gt;
| 200 || CalculateUserSaveDataStatistics&lt;br /&gt;
|-&lt;br /&gt;
| 201 || DeleteUserSaveDataAll&lt;br /&gt;
|-&lt;br /&gt;
| 210 || DeleteUserSystemSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 220 || UnregisterNetworkServiceAccount&lt;br /&gt;
|-&lt;br /&gt;
| 300 || GetApplicationShellEvent&lt;br /&gt;
|-&lt;br /&gt;
| 301 || PopApplicationShellEventInfo&lt;br /&gt;
|-&lt;br /&gt;
| 302 || LaunchLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 303 || TerminateLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 304 || LaunchSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 305 || TerminateSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 306 || LaunchOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 307 || TerminateOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#GetApplicationControlData]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || InvalidateAllApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 402 || RequestDownloadApplicationControlData&lt;br /&gt;
|-&lt;br /&gt;
| 403 || GetMaxApplicationControlCacheCount&lt;br /&gt;
|-&lt;br /&gt;
| 404 || [2.0.0+] InvalidateApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 405 || [2.0.0+] ListApplicationControlCacheEntryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 502 || [2.0.0+] RequestCheckGameCardRegistration&lt;br /&gt;
|-&lt;br /&gt;
| 503 || [2.0.0+] RequestGameCardRegistrationGoldPoint&lt;br /&gt;
|-&lt;br /&gt;
| 504 || [2.0.0+] RequestRegisterGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 600 || [2.0.0+] CountApplicationContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 601 || [2.0.0+] [[#ListApplicationContentMetaStatus]]&lt;br /&gt;
|-&lt;br /&gt;
| 602 || [2.0.0+] ListAvailableAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 603 || [2.0.0+] GetOwnedApplicationContentMetaStatus&lt;br /&gt;
|-&lt;br /&gt;
| 604 || [2.0.0+] RegisterContentsExternalKey&lt;br /&gt;
|-&lt;br /&gt;
| 605 || [2.0.0+] ListApplicationContentMetaStatusWithRightsCheck&lt;br /&gt;
|-&lt;br /&gt;
| 700 || [2.0.0+] PushDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 701 || [2.0.0+] ClearTaskStatusList&lt;br /&gt;
|-&lt;br /&gt;
| 702 || [2.0.0+] RequestDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 703 || [2.0.0+] RequestEnsureDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 704 || [2.0.0+] ListDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 705 || [2.0.0+] RequestDownloadTaskListData&lt;br /&gt;
|-&lt;br /&gt;
| 800 || [2.0.0+] RequestVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 801 || [2.0.0+] ListVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 900 || [2.0.0+] GetApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 901 || [2.0.0+] GetApplicationRecordProperty&lt;br /&gt;
|-&lt;br /&gt;
| 902 || [2.0.0+] EnableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 903 || [2.0.0+] DisableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 904 || [2.0.0+] TouchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 905 || [2.0.0+] RequestApplicationUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 906 || [2.0.0+] IsApplicationUpdateRequested&lt;br /&gt;
|-&lt;br /&gt;
| 907 || [2.0.0+] WithdrawApplicationUpdateRequest&lt;br /&gt;
|-&lt;br /&gt;
| 908 || [2.0.0+] ListApplicationRecordInstalledContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || [2.0.0+] RequestVerifyApplicationDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || [2.0.0+] CorruptApplicationForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1200 || [2.0.0+] NeedsUpdateVulnerability&lt;br /&gt;
|-&lt;br /&gt;
| 1300 || [2.0.0+] IsAnyApplicationEntityInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 1301 || [2.0.0+] DeleteApplicationContentEntities&lt;br /&gt;
|-&lt;br /&gt;
| 1302 || [2.0.0+] CleanupUnrecordedApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1400 || [2.0.0+] PrepareShutdown&lt;br /&gt;
|-&lt;br /&gt;
| 1500 || [2.0.0+] FormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1501 || [2.0.0+] NeedsSystemUpdateToFormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1502 || [2.0.0+] GetLastSdCardFormatUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 1503 || [2.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1600 || [2.0.0+] GetSystemSeedForPseudoDeviceId&lt;br /&gt;
|-&lt;br /&gt;
| 1700 || [2.0.0+] ListApplicationDownloadingContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 1800 || [2.0.0+] IsNotificationSetupCompleted&lt;br /&gt;
|-&lt;br /&gt;
| 1801 || [2.0.0+] GetLastNotificationInfoCount&lt;br /&gt;
|-&lt;br /&gt;
| 1802 || [2.0.0+] ListLastNotificationInfo&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ListApplicationRecord ==&lt;br /&gt;
Takes a type-6 output buffer and an u64.&lt;br /&gt;
&lt;br /&gt;
Returns an array of title-info entries using the specified offset and size. No input titleID is passed to this.&lt;br /&gt;
&lt;br /&gt;
=== Application Record Format ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| Title ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x1&lt;br /&gt;
| Type? (Known values: 2=Installing?, 3=Gamecard?, 4=Installed?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown, usually 0x02&lt;br /&gt;
|-&lt;br /&gt;
| 0xA&lt;br /&gt;
| 0x6&lt;br /&gt;
| Unknown, usually zeros?&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown, seems to change between reboots and removing/reinserting gamecards&lt;br /&gt;
|-&lt;br /&gt;
| 0x11&lt;br /&gt;
| 0x7&lt;br /&gt;
| Unknown, usually zeros?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LaunchApplication  ==&lt;br /&gt;
Takes an input u64 titleID, returns an output u64 PID.&lt;br /&gt;
&lt;br /&gt;
Launches an application title which is registered with NS.&lt;br /&gt;
&lt;br /&gt;
== GetApplicationContentPath ==&lt;br /&gt;
Takes a 0x16-type output buffer, an u8 [[NCA|type]], and an u64 titleID.&lt;br /&gt;
&lt;br /&gt;
The input titleID is used with the application-title table like various other cmds, anything not in that table can&#039;t be used with this.&lt;br /&gt;
&lt;br /&gt;
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&#039;t exist for this title. Starts with &amp;quot;@{SdCardContent,UserContent}://&amp;quot; and ends in &amp;quot;.nca&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For gamecard content, the output path is: &amp;quot;@GcSXXXXXXXX:/&amp;lt;NcaId&amp;gt;.nca&amp;quot;. NCA-type0 with gamecard returns 0 with an empty output string.&lt;br /&gt;
&lt;br /&gt;
The output string is then used by the user-process with [[Filesystem_services|FS]] to mount the content.&lt;br /&gt;
&lt;br /&gt;
== GetTotalSpaceSize ==&lt;br /&gt;
Takes an input media-id that must be 5.&lt;br /&gt;
&lt;br /&gt;
Returns the u64 from [[Content_Manager_services#IContentStorage]] cmd22.&lt;br /&gt;
&lt;br /&gt;
== GetFreeSpaceSize ==&lt;br /&gt;
Takes an input media-id that must be 5.&lt;br /&gt;
&lt;br /&gt;
Returns the u64 from [[Content_Manager_services#IContentStorage]] cmd23.&lt;br /&gt;
&lt;br /&gt;
== GetApplicationDesiredLanguage ==&lt;br /&gt;
Takes an input u8 language-bitmask, returns an output u8 [[control.nacp]] langentry index.&lt;br /&gt;
&lt;br /&gt;
User-processes generate the language-bitmask with the following for all 16 lang-entries: &amp;lt;code&amp;gt;if(&amp;lt;either string in langentry[i] is non-empty&amp;gt;)bitmask |= 1&amp;lt;&amp;lt;i&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ConvertLanguageCodeToApplicationLanguage ==&lt;br /&gt;
Takes an input u8 pointer for the resulting Id to be written to and a string represented as a u64 (i.e 0x53552D6E65 for &#039;en-US&#039;).&lt;br /&gt;
&lt;br /&gt;
Returns 0 if an ID was successfully found, otherwise returns 0x25810.&lt;br /&gt;
&lt;br /&gt;
== GetApplicationControlData ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Loads cached [[control.nacp]] to buf+0 and the cached icon to buf+0x4000. Returns an error if the buffer is too small.&lt;br /&gt;
&lt;br /&gt;
== ListApplicationContentMetaStatus ==&lt;br /&gt;
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 &amp;gt;= totalentries, this will return 0 with out_entrycount=0.&lt;br /&gt;
&lt;br /&gt;
Entry structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| u8 &amp;quot;type&amp;quot;. [[Content_Manager_services|Title type]] (String is from web-applet)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| u8 &amp;quot;installedStorage&amp;quot; / [[Filesystem_services|StorageId]] (String is from web-applet)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown. Non-zero with output from cmd 605, differs for app/update titles.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| u32 Title-version&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| u64 titleID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:am2, ns:ec, ns:rid, ns:rt, ns:web =&lt;br /&gt;
These services are all, at the top level, &amp;quot;nn::ns::detail::IServiceGetterInterface&amp;quot;. 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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 7992 || [[#IECommerceInterface|GetECommerceInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7993 || [[#IApplicationVersionInterface|GetApplicationVersionInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7994 || [[#IFactoryResetInterface|GetFactoryResetInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7995 || [[#IAccountProxyInterface|GetAccountProxyInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7996 || [[#IApplicationManagerInterface|GetApplicationManagerInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7997 || [[#IDownloadTaskInterface|GetDownloadTaskInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7998 || [[#IContentManagementInterface|GetContentManagementInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7999 || [[#IDocumentInterface|GetDocumentInterface]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IAccountProxyInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IAccountProxyInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CreateUserAccount&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IApplicationManagerInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IApplicationManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ListApplicationRecord]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GenerateApplicationRecordCount&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetApplicationRecordUpdateSystemEvent&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetApplicationViewDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeleteApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeleteApplicationCompletely&lt;br /&gt;
|-&lt;br /&gt;
| 6 || IsAnyApplicationEntityRedundant&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeleteRedundantApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 8 || IsApplicationEntityMovable&lt;br /&gt;
|-&lt;br /&gt;
| 9 || MoveApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 11 || CalculateApplicationOccupiedSize&lt;br /&gt;
|-&lt;br /&gt;
| 16 || PushApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListApplicationRecordContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [?.?.?-5.1.0] [[#LaunchApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#GetApplicationContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || TerminateApplication&lt;br /&gt;
|-&lt;br /&gt;
| 23 || ResolveApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
| 26 || BeginInstallApplication&lt;br /&gt;
|-&lt;br /&gt;
| 27 || DeleteApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 30 || RequestApplicationUpdateInfo&lt;br /&gt;
|-&lt;br /&gt;
| 32 || CancelApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 33 || ResumeApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 35 || UpdateVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 36 || PushLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 37 || ListRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 38 || CheckApplicationLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 39 || CheckApplicationLaunchRights&lt;br /&gt;
|-&lt;br /&gt;
| 40 || GetApplicationLogoData&lt;br /&gt;
|-&lt;br /&gt;
| 41 || CalculateApplicationDownloadRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 42 || CleanupSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 43 || CheckSdCardMountStatus&lt;br /&gt;
|-&lt;br /&gt;
| 44 || GetSdCardMountStatusChangedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 45 || GetGameCardAttachmentEvent&lt;br /&gt;
|-&lt;br /&gt;
| 46 || GetGameCardAttachmentInfo&lt;br /&gt;
|-&lt;br /&gt;
| 47 || [[#GetTotalSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 48 || [[#GetFreeSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 49 || GetSdCardRemovedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 52 || GetGameCardUpdateDetectionEvent&lt;br /&gt;
|-&lt;br /&gt;
| 53 || DisableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 54 || EnableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 55 || GetApplicationDesiredLanguage&lt;br /&gt;
|-&lt;br /&gt;
| 56 || SetApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 57 || ClearApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 58 || GetLastSdCardMountUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 59 || ConvertApplicationLanguageToLanguageCode&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [[#ConvertLanguageCodeToApplicationLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || GetBackgroundDownloadStressTaskInfo&lt;br /&gt;
|-&lt;br /&gt;
| 62 || GetGameCardStopper&lt;br /&gt;
|-&lt;br /&gt;
| 63 || IsSystemProgramInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 64 || StartApplyDeltaTask&lt;br /&gt;
|-&lt;br /&gt;
| 65 || GetRequestServerStopper&lt;br /&gt;
|-&lt;br /&gt;
| 66 || GetBackgroundApplyDeltaStressTaskInfo&lt;br /&gt;
|-&lt;br /&gt;
| 67 || CancelApplicationApplyDelta&lt;br /&gt;
|-&lt;br /&gt;
| 68 || ResumeApplicationApplyDelta&lt;br /&gt;
|-&lt;br /&gt;
| 69 || CalculateApplicationApplyDeltaRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 70 || ResumeAll&lt;br /&gt;
|-&lt;br /&gt;
| 71 || GetStorageSize&lt;br /&gt;
|-&lt;br /&gt;
| 80 || RequestDownloadApplication&lt;br /&gt;
|-&lt;br /&gt;
| 81 || RequestDownloadAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 82 || DownloadApplication&lt;br /&gt;
|-&lt;br /&gt;
| 83 || CheckApplicationResumeRights&lt;br /&gt;
|-&lt;br /&gt;
| 84 || GetDynamicCommitEvent&lt;br /&gt;
|-&lt;br /&gt;
| 85 || RequestUpdateApplication2&lt;br /&gt;
|-&lt;br /&gt;
| 86 || EnableApplicationCrashReport&lt;br /&gt;
|-&lt;br /&gt;
| 87 || IsApplicationCrashReportEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 90 || BoostSystemMemoryResourceLimit&lt;br /&gt;
|-&lt;br /&gt;
| 91 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 92 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 93 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 94 || [6.0.0+] LaunchApplication2&lt;br /&gt;
|-&lt;br /&gt;
| 95 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 96 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 97 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 98 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ResetToFactorySettings&lt;br /&gt;
|-&lt;br /&gt;
| 101 || ResetToFactorySettingsWithoutUserSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 102 || ResetToFactorySettingsForRefurbishment&lt;br /&gt;
|-&lt;br /&gt;
| 200 || CalculateUserSaveDataStatistics&lt;br /&gt;
|-&lt;br /&gt;
| 201 || DeleteUserSaveDataAll&lt;br /&gt;
|-&lt;br /&gt;
| 210 || DeleteUserSystemSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 211 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 220 || UnregisterNetworkServiceAccount&lt;br /&gt;
|-&lt;br /&gt;
| 221 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 300 || GetApplicationShellEvent&lt;br /&gt;
|-&lt;br /&gt;
| 301 || PopApplicationShellEventInfo&lt;br /&gt;
|-&lt;br /&gt;
| 302 || LaunchLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 303 || TerminateLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 304 || LaunchSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 305 || TerminateSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 306 || LaunchOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 307 || TerminateOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 400 || GetApplicationControlData&lt;br /&gt;
|-&lt;br /&gt;
| 401 || InvalidateAllApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 402 || RequestDownloadApplicationControlData&lt;br /&gt;
|-&lt;br /&gt;
| 403 || GetMaxApplicationControlCacheCount&lt;br /&gt;
|-&lt;br /&gt;
| 404 || InvalidateApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 405 || ListApplicationControlCacheEntryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 406 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 502 || RequestCheckGameCardRegistration&lt;br /&gt;
|-&lt;br /&gt;
| 503 || RequestGameCardRegistrationGoldPoint&lt;br /&gt;
|-&lt;br /&gt;
| 504 || RequestRegisterGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 505 || GetGameCardMountFailureEvent&lt;br /&gt;
|-&lt;br /&gt;
| 506 || IsGameCardInserted&lt;br /&gt;
|-&lt;br /&gt;
| 507 || EnsureGameCardAccess&lt;br /&gt;
|-&lt;br /&gt;
| 508 || GetLastGameCardMountFailureResult&lt;br /&gt;
|-&lt;br /&gt;
| 509 || ListApplicationIdOnGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 600 || CountApplicationContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 601 || [[#ListApplicationContentMetaStatus]]&lt;br /&gt;
|-&lt;br /&gt;
| 602 || [?.?.?-5.1.0] ListAvailableAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 603 || GetOwnedApplicationContentMetaStatus&lt;br /&gt;
|-&lt;br /&gt;
| 604 || RegisterContentsExternalKey&lt;br /&gt;
|-&lt;br /&gt;
| 605 || ListApplicationContentMetaStatusWithRightsCheck&lt;br /&gt;
|-&lt;br /&gt;
| 606 || GetContentMetaStorage&lt;br /&gt;
|-&lt;br /&gt;
| 607 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 700 || PushDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 701 || ClearTaskStatusList&lt;br /&gt;
|-&lt;br /&gt;
| 702 || RequestDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 703 || RequestEnsureDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 704 || ListDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 705 || RequestDownloadTaskListData&lt;br /&gt;
|-&lt;br /&gt;
| 800 || RequestVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 801 || ListVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 802 || RequestVersionListData&lt;br /&gt;
|-&lt;br /&gt;
| 900 || GetApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 901 || GetApplicationRecordProperty&lt;br /&gt;
|-&lt;br /&gt;
| 902 || EnableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 903 || DisableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 904 || TouchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 905 || RequestApplicationUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 906 || IsApplicationUpdateRequested&lt;br /&gt;
|-&lt;br /&gt;
| 907 || WithdrawApplicationUpdateRequest&lt;br /&gt;
|-&lt;br /&gt;
| 908 || ListApplicationRecordInstalledContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 909 || WithdrawCleanupAddOnContentsWithNoRightsRecommendation&lt;br /&gt;
|-&lt;br /&gt;
| 910 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 911 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 912 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || RequestVerifyApplicationDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || CorruptApplicationForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1002 || RequestVerifyAddOnContentsRights&lt;br /&gt;
|-&lt;br /&gt;
| 1003 || RequestVerifyApplication&lt;br /&gt;
|-&lt;br /&gt;
| 1004 || CorruptContentForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1200 || NeedsUpdateVulnerability&lt;br /&gt;
|-&lt;br /&gt;
| 1300 || IsAnyApplicationEntityInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 1301 || DeleteApplicationContentEntities&lt;br /&gt;
|-&lt;br /&gt;
| 1302 || CleanupUnrecordedApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1303 || CleanupAddOnContentsWithNoRights&lt;br /&gt;
|-&lt;br /&gt;
| 1304 || DeleteApplicationContentEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1305 || [?.?.?-5.1.0] TryDeleteRunningApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1306 || [?.?.?-5.1.0] TryDeleteRunningApplicationCompletely&lt;br /&gt;
|-&lt;br /&gt;
| 1307 || [?.?.?-5.1.0] TryDeleteRunningApplicationContentEntities&lt;br /&gt;
|-&lt;br /&gt;
| 1308 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1309 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1400 || PrepareShutdown&lt;br /&gt;
|-&lt;br /&gt;
| 1500 || FormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1501 || NeedsSystemUpdateToFormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1502 || GetLastSdCardFormatUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 1504 || InsertSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1505 || RemoveSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1600 || GetSystemSeedForPseudoDeviceId&lt;br /&gt;
|-&lt;br /&gt;
| 1601 || ResetSystemSeedForPseudoDeviceId&lt;br /&gt;
|-&lt;br /&gt;
| 1700 || ListApplicationDownloadingContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 1701 || GetApplicationView&lt;br /&gt;
|-&lt;br /&gt;
| 1702 || GetApplicationDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 1703 || GetApplicationViewDownloadErrorContext&lt;br /&gt;
|-&lt;br /&gt;
| 1800 || IsNotificationSetupCompleted&lt;br /&gt;
|-&lt;br /&gt;
| 1801 || GetLastNotificationInfoCount&lt;br /&gt;
|-&lt;br /&gt;
| 1802 || ListLastNotificationInfo&lt;br /&gt;
|-&lt;br /&gt;
| 1803 || ListNotificationTask&lt;br /&gt;
|-&lt;br /&gt;
| 1900 || IsActiveAccount&lt;br /&gt;
|-&lt;br /&gt;
| 1901 || RequestDownloadApplicationPrepurchasedRights&lt;br /&gt;
|-&lt;br /&gt;
| 1902 || GetApplicationTicketInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2000 || GetSystemDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2001 || SelectLatestSystemDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2002 || VerifyDeliveryProtocolVersion&lt;br /&gt;
|-&lt;br /&gt;
| 2003 || GetApplicationDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2004 || HasAllContentsToDeliver&lt;br /&gt;
|-&lt;br /&gt;
| 2005 || CompareApplicationDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2006 || CanDeliverApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2007 || ListContentMetaKeyToDeliverApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2008 || NeedsSystemUpdateToDeliverApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2009 || EstimateRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 2010 || RequestReceiveApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2011 || CommitReceiveApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2012 || GetReceiveApplicationProgress&lt;br /&gt;
|-&lt;br /&gt;
| 2013 || RequestSendApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2014 || GetSendApplicationProgress&lt;br /&gt;
|-&lt;br /&gt;
| 2015 || CompareSystemDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2016 || ListNotCommittedContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 2017 || CreateDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 2018 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2050 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2100 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2101 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2150 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2151 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2152 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2153 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2154 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2160 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2161 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2170 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2171 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2180 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2181 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2182 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2190 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2199 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2200 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2201 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2250 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2300 || [6.0.0+] &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IApplicationVersionInterface ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetLaunchRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 1 || UpgradeLaunchRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 35 || UpdateVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 36 || PushLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 37 || ListRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 800 || RequestVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 801 || ListVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 802 || RequestVersionListData&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || PerformAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IContentManagerInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IContentManagementInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 11 || CalculateApplicationOccupiedSize&lt;br /&gt;
|-&lt;br /&gt;
| 43 || CheckSdCardMountStatus&lt;br /&gt;
|-&lt;br /&gt;
| 47 || GetTotalSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| 48 || GetFreeSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| 600 || CountApplicationContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 601 || ListApplicationContentMetaStatus&lt;br /&gt;
|-&lt;br /&gt;
| 605 || ListApplicationContentMetaStatusWithRightsCheck&lt;br /&gt;
|-&lt;br /&gt;
| 607 || IsAnyApplicationRunning&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IDocumentInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IDocumentInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 21 || GetApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
| 23 || ResolveApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IDownloadTaskInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IDownloadTaskInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 701 || ClearTaskStatusList&lt;br /&gt;
|-&lt;br /&gt;
| 702 || RequestDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 703 || RequestEnsureDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 704 || ListDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 705 || RequestDownloadTaskListData&lt;br /&gt;
|-&lt;br /&gt;
| 706 || TryCommitCurrentApplicationDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 707 || EnableAutoCommit&lt;br /&gt;
|-&lt;br /&gt;
| 708 || DisableAutoCommit&lt;br /&gt;
|-&lt;br /&gt;
| 709 || TriggerDynamicCommitEvent&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IECommerceInterface===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || RequestLinkDevice&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IFactoryResetInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IFactoryResetInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ResetToFactorySettings&lt;br /&gt;
|-&lt;br /&gt;
| 101 || ResetToFactorySettingsWithoutUserSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 102 || ResetToFactorySettingsForRefurbishment&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:vm =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IVulnerabilityManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1200 || [3.0.0+] NeedsUpdateVulnerability&lt;br /&gt;
|-&lt;br /&gt;
| 1201 || [4.0.0+] UpdateSafeSystemVersionForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1202 || [4.0.0+] GetSafeSystemVersion&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:su =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::ISystemUpdateInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetBackgroundNetworkUpdateState&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#ISystemUpdateControl|OpenSystemUpdateControl]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NotifyExFatDriverRequired&lt;br /&gt;
|-&lt;br /&gt;
| 3 || ClearExFatDriverStatusForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 4 || RequestBackgroundNetworkUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 5 || NotifyBackgroundNetworkUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 6 || NotifyExFatDriverDownloadedForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetSystemUpdateNotificationEventForContentDelivery&lt;br /&gt;
|-&lt;br /&gt;
| 10 || NotifySystemUpdateForContentDelivery&lt;br /&gt;
|-&lt;br /&gt;
| 11 || PrepareShutdown&lt;br /&gt;
|-&lt;br /&gt;
| 16 || DestroySystemUpdateTask&lt;br /&gt;
|-&lt;br /&gt;
| 17 || RequestSendSystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 18 || GetSendSystemUpdateProgress&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ISystemUpdateControl ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || HasDownloaded&lt;br /&gt;
|-&lt;br /&gt;
| 1 || RequestCheckLatestUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 2 || RequestDownloadLatestUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetDownloadProgress&lt;br /&gt;
|-&lt;br /&gt;
| 4 || ApplyDownloadedUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 5 || RequestPrepareCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 6 || GetPrepareCardUpdateProgress&lt;br /&gt;
|-&lt;br /&gt;
| 7 || HasPreparedCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 8 || ApplyCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetDownloadedEulaDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetDownloadedEulaData&lt;br /&gt;
|-&lt;br /&gt;
| 11 || SetupCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetPreparedCardUpdateEulaDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 13 || GetPreparedCardUpdateEulaData&lt;br /&gt;
|-&lt;br /&gt;
| 14 || SetupCardUpdateViaSystemUpdater&lt;br /&gt;
|-&lt;br /&gt;
| 15 || HasReceived&lt;br /&gt;
|-&lt;br /&gt;
| 16 || RequestReceiveSystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 17 || GetReceiveProgress&lt;br /&gt;
|-&lt;br /&gt;
| 18 || ApplyReceivedUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 19 || GetReceivedEulaDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 20 || GetReceivedEulaData&lt;br /&gt;
|-&lt;br /&gt;
| 21 || SetupToReceiveSystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:dev =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IDevelopInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#LaunchProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#TerminateProcess]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#TerminateProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetShellEventHandle]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetShellEventInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#TerminateApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#PrepareLaunchProgramFromHost]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#LaunchApplication_2|#LaunchApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#LaunchApplicationWithStorageId]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LaunchProgram ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#LaunchProcess|LaunchProcess]].&lt;br /&gt;
&lt;br /&gt;
== TerminateProcess ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#TerminateTitleByPid|TerminateTitleByPid]].&lt;br /&gt;
&lt;br /&gt;
== TerminateProgram ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#TerminateTitleByTitleId|TerminateTitleByTitleId]].&lt;br /&gt;
&lt;br /&gt;
== GetShellEventHandle==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#GetProcessEventWaiter|GetProcessEventWaiter]].&lt;br /&gt;
&lt;br /&gt;
== GetShellEventInfo ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#GetProcessEventType|GetProcessEventType]].&lt;br /&gt;
&lt;br /&gt;
== TerminateApplication ==&lt;br /&gt;
Calls &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#GetCrashingProcessPid|GetCrashingProcessPid]] and sends PID to [[Process_Manager_services#TerminateTitleByPid|TerminateTitleByPid]].&lt;br /&gt;
&lt;br /&gt;
== PrepareLaunchProgramFromHost ==&lt;br /&gt;
Takes a type-0x5 input buffer containing the [[Filesystem_services|ContentPath]], returns an output 0x10-byte struct.&lt;br /&gt;
&lt;br /&gt;
Calls [[NCM_services#IPathResolverForStorage|IPathResolverForStorage]] Set...NcaPath functions.&lt;br /&gt;
&lt;br /&gt;
== LaunchApplication ==&lt;br /&gt;
Takes an input u32 [[Process_Manager_services|launch_flags]] and u64 titleID, returns an output u64 PID.&lt;br /&gt;
&lt;br /&gt;
Same as LaunchApplicationWithStorageId except the last two params passed to the internal vtable funcptr call are value 0x6, instead of from the command input.&lt;br /&gt;
&lt;br /&gt;
== LaunchApplicationWithStorageId ==&lt;br /&gt;
Takes 2 input u8s, an u32 [[Process_Manager_services|launch_flags]], and an u64 titleID. Returns an output u64 PID.&lt;br /&gt;
&lt;br /&gt;
Launches an application title which is registered with NS. &lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=ETicket_services&amp;diff=4951</id>
		<title>ETicket services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=ETicket_services&amp;diff=4951"/>
		<updated>2018-08-31T10:24:24Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Placeholder name for command 503&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= es =&lt;br /&gt;
This is &amp;quot;nn::es::IETicketService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ImportTicket&lt;br /&gt;
|-&lt;br /&gt;
| 2 || ImportTicketCertificateSet&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DeleteTicket&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeletePersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeleteAllCommonTicket&lt;br /&gt;
|-&lt;br /&gt;
| 6 || DeleteAllPersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeleteAllPersonalizedTicketEx&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [2.0.0-5.1.0] GetTitleKey&lt;br /&gt;
|-&lt;br /&gt;
| 9 || CountCommonTicket&lt;br /&gt;
|-&lt;br /&gt;
| 10 || CountPersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 11 || ListCommonTicket&lt;br /&gt;
|-&lt;br /&gt;
| 12 || ListPersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 13 || ListMissingPersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 14 || GetCommonTicketSize&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [2.0.0-5.1.0] GetPersonalizedTicketSize&lt;br /&gt;
|-&lt;br /&gt;
| 16 || GetCommonTicketData&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [2.0.0-5.1.0] GetPersonalizedTicketData&lt;br /&gt;
|-&lt;br /&gt;
| 18 || OwnTicket&lt;br /&gt;
|-&lt;br /&gt;
| 19 || GetTicketInfo&lt;br /&gt;
|-&lt;br /&gt;
| 20 || ListLightTicketInfo&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [2.0.0+] SignData&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [4.0.0+] GetCommonTicketAndCertificateSize&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [4.0.0+] GetCommonTicketAndCertificateData&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [4.0.0+] ImportPrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [4.0.0+] DeletePrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 26 || [4.0.0+] DeleteAllPrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 27 || [4.0.0+] CountPrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 28 || [4.0.0+] ListPrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 29 || [4.0.0+] ListPrepurchaseRecordInfo&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 32 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 33 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 34 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 35 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 36 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 501 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 502 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 503 || [6.0.0+] GetTitleKey2&lt;br /&gt;
|-&lt;br /&gt;
| 504 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 508 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 509 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 510 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1002 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1003 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1004 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1005 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1006 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1007 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1009 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1010 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1011 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1012 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1013 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1014 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1015 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1016 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1501 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1502 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1503 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1504 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1505 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2000 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2501 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2502 || [6.0.0+]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=NS_services&amp;diff=4950</id>
		<title>NS services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=NS_services&amp;diff=4950"/>
		<updated>2018-08-31T09:39:13Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Added 6.0.0 commands&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= aoc:u =&lt;br /&gt;
This is &amp;quot;nn::aocsrv::detail::IAddOnContentManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CountAddOnContentByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ListAddOnContentByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 2 || CountAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 3 || ListAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetAddOnContentBaseIdByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 5 || GetAddOnContentBaseId&lt;br /&gt;
|-&lt;br /&gt;
| 6 || PrepareAddOnContentByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 7 || PrepareAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [4.0.0+] GetAddOnContentListChangedEvent&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:am =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IApplicationManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] This service was replaced by [[#ns:am2, ns:ec, ns:rid, ns:rt, ns:web|ns:am2]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ListApplicationRecord]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GenerateApplicationRecordCount&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetApplicationRecordUpdateSystemEvent&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetApplicationViewDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeleteApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeleteApplicationCompletely&lt;br /&gt;
|-&lt;br /&gt;
| 6 || IsAnyApplicationEntityRedundant&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeleteRedundantApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 8 || IsApplicationEntityMovable&lt;br /&gt;
|-&lt;br /&gt;
| 9 || MoveApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 11 || CalculateApplicationOccupiedSize&lt;br /&gt;
|-&lt;br /&gt;
| 16 || PushApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListApplicationRecordContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 18 || &lt;br /&gt;
|-&lt;br /&gt;
| 19 || [[#LaunchApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#GetApplicationContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || TerminateApplication&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [2.0.0+] ResolveApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
| 26 || BeginInstallApplication&lt;br /&gt;
|-&lt;br /&gt;
| 27 || DeleteApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 30 || RequestApplicationUpdateInfo&lt;br /&gt;
|-&lt;br /&gt;
| 31 || RequestUpdateApplication&lt;br /&gt;
|-&lt;br /&gt;
| 32 || CancelApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 33 || ResumeApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 34 || &lt;br /&gt;
|-&lt;br /&gt;
| 35 || UpdateVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 36 || PushLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 37 || ListRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 38 || CheckApplicationLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 39 || CheckApplicationLaunchRights&lt;br /&gt;
|-&lt;br /&gt;
| 40 || GetApplicationLogoData&lt;br /&gt;
|-&lt;br /&gt;
| 41 || CalculateApplicationDownloadRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 42 || CleanupSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 43 || CheckSdCardMountStatus&lt;br /&gt;
|-&lt;br /&gt;
| 44 || GetSdCardMountStatusChangedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 45 || GetGameCardAttachmentEvent&lt;br /&gt;
|-&lt;br /&gt;
| 46 || GetGameCardAttachmentInfo&lt;br /&gt;
|-&lt;br /&gt;
| 47 || [[#GetTotalSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 48 || [[#GetFreeSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 49 || GetSdCardRemovedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 52 || GetGameCardUpdateDetectionEvent&lt;br /&gt;
|-&lt;br /&gt;
| 53 || DisableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 54 || EnableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 55 || [[#GetApplicationDesiredLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 56 || SetApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 57 || ClearApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 58 || GetLastSdCardMountUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 59 || ConvertApplicationLanguageToLanguageCode&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [[#ConvertLanguageCodeToApplicationLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || GetBackgroundDownloadStressTaskInfo&lt;br /&gt;
|-&lt;br /&gt;
| 62 || GetGameCardStopper&lt;br /&gt;
|-&lt;br /&gt;
| 63 || IsSystemProgramInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 64 || [2.0.0+] StartApplyDeltaTask&lt;br /&gt;
|-&lt;br /&gt;
| 65 || [2.0.0+] GetRequestServerStopper&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ResetToFactorySettings&lt;br /&gt;
|-&lt;br /&gt;
| 101 || ResetToFactorySettingsWithoutUserSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [2.0.0+] ResetToFactorySettingsForRefurbishment&lt;br /&gt;
|-&lt;br /&gt;
| 200 || CalculateUserSaveDataStatistics&lt;br /&gt;
|-&lt;br /&gt;
| 201 || DeleteUserSaveDataAll&lt;br /&gt;
|-&lt;br /&gt;
| 210 || DeleteUserSystemSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 220 || UnregisterNetworkServiceAccount&lt;br /&gt;
|-&lt;br /&gt;
| 300 || GetApplicationShellEvent&lt;br /&gt;
|-&lt;br /&gt;
| 301 || PopApplicationShellEventInfo&lt;br /&gt;
|-&lt;br /&gt;
| 302 || LaunchLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 303 || TerminateLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 304 || LaunchSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 305 || TerminateSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 306 || LaunchOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 307 || TerminateOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#GetApplicationControlData]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || InvalidateAllApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 402 || RequestDownloadApplicationControlData&lt;br /&gt;
|-&lt;br /&gt;
| 403 || GetMaxApplicationControlCacheCount&lt;br /&gt;
|-&lt;br /&gt;
| 404 || [2.0.0+] InvalidateApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 405 || [2.0.0+] ListApplicationControlCacheEntryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 502 || [2.0.0+] RequestCheckGameCardRegistration&lt;br /&gt;
|-&lt;br /&gt;
| 503 || [2.0.0+] RequestGameCardRegistrationGoldPoint&lt;br /&gt;
|-&lt;br /&gt;
| 504 || [2.0.0+] RequestRegisterGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 600 || [2.0.0+] CountApplicationContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 601 || [2.0.0+] [[#ListApplicationContentMetaStatus]]&lt;br /&gt;
|-&lt;br /&gt;
| 602 || [2.0.0+] ListAvailableAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 603 || [2.0.0+] GetOwnedApplicationContentMetaStatus&lt;br /&gt;
|-&lt;br /&gt;
| 604 || [2.0.0+] RegisterContentsExternalKey&lt;br /&gt;
|-&lt;br /&gt;
| 605 || [2.0.0+] ListApplicationContentMetaStatusWithRightsCheck&lt;br /&gt;
|-&lt;br /&gt;
| 700 || [2.0.0+] PushDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 701 || [2.0.0+] ClearTaskStatusList&lt;br /&gt;
|-&lt;br /&gt;
| 702 || [2.0.0+] RequestDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 703 || [2.0.0+] RequestEnsureDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 704 || [2.0.0+] ListDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 705 || [2.0.0+] RequestDownloadTaskListData&lt;br /&gt;
|-&lt;br /&gt;
| 800 || [2.0.0+] RequestVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 801 || [2.0.0+] ListVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 900 || [2.0.0+] GetApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 901 || [2.0.0+] GetApplicationRecordProperty&lt;br /&gt;
|-&lt;br /&gt;
| 902 || [2.0.0+] EnableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 903 || [2.0.0+] DisableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 904 || [2.0.0+] TouchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 905 || [2.0.0+] RequestApplicationUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 906 || [2.0.0+] IsApplicationUpdateRequested&lt;br /&gt;
|-&lt;br /&gt;
| 907 || [2.0.0+] WithdrawApplicationUpdateRequest&lt;br /&gt;
|-&lt;br /&gt;
| 908 || [2.0.0+] ListApplicationRecordInstalledContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || [2.0.0+] RequestVerifyApplicationDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || [2.0.0+] CorruptApplicationForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1200 || [2.0.0+] NeedsUpdateVulnerability&lt;br /&gt;
|-&lt;br /&gt;
| 1300 || [2.0.0+] IsAnyApplicationEntityInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 1301 || [2.0.0+] DeleteApplicationContentEntities&lt;br /&gt;
|-&lt;br /&gt;
| 1302 || [2.0.0+] CleanupUnrecordedApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1400 || [2.0.0+] PrepareShutdown&lt;br /&gt;
|-&lt;br /&gt;
| 1500 || [2.0.0+] FormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1501 || [2.0.0+] NeedsSystemUpdateToFormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1502 || [2.0.0+] GetLastSdCardFormatUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 1503 || [2.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1600 || [2.0.0+] GetSystemSeedForPseudoDeviceId&lt;br /&gt;
|-&lt;br /&gt;
| 1700 || [2.0.0+] ListApplicationDownloadingContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 1800 || [2.0.0+] IsNotificationSetupCompleted&lt;br /&gt;
|-&lt;br /&gt;
| 1801 || [2.0.0+] GetLastNotificationInfoCount&lt;br /&gt;
|-&lt;br /&gt;
| 1802 || [2.0.0+] ListLastNotificationInfo&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ListApplicationRecord ==&lt;br /&gt;
Takes a type-6 output buffer and an u64.&lt;br /&gt;
&lt;br /&gt;
Returns an array of title-info entries using the specified offset and size. No input titleID is passed to this.&lt;br /&gt;
&lt;br /&gt;
=== Application Record Format ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| Title ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x1&lt;br /&gt;
| Type? (Known values: 2=Installing?, 3=Gamecard?, 4=Installed?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown, usually 0x02&lt;br /&gt;
|-&lt;br /&gt;
| 0xA&lt;br /&gt;
| 0x6&lt;br /&gt;
| Unknown, usually zeros?&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown, seems to change between reboots and removing/reinserting gamecards&lt;br /&gt;
|-&lt;br /&gt;
| 0x11&lt;br /&gt;
| 0x7&lt;br /&gt;
| Unknown, usually zeros?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LaunchApplication  ==&lt;br /&gt;
Takes an input u64 titleID, returns an output u64 PID.&lt;br /&gt;
&lt;br /&gt;
Launches an application title which is registered with NS.&lt;br /&gt;
&lt;br /&gt;
== GetApplicationContentPath ==&lt;br /&gt;
Takes a 0x16-type output buffer, an u8 [[NCA|type]], and an u64 titleID.&lt;br /&gt;
&lt;br /&gt;
The input titleID is used with the application-title table like various other cmds, anything not in that table can&#039;t be used with this.&lt;br /&gt;
&lt;br /&gt;
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&#039;t exist for this title. Starts with &amp;quot;@{SdCardContent,UserContent}://&amp;quot; and ends in &amp;quot;.nca&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For gamecard content, the output path is: &amp;quot;@GcSXXXXXXXX:/&amp;lt;NcaId&amp;gt;.nca&amp;quot;. NCA-type0 with gamecard returns 0 with an empty output string.&lt;br /&gt;
&lt;br /&gt;
The output string is then used by the user-process with [[Filesystem_services|FS]] to mount the content.&lt;br /&gt;
&lt;br /&gt;
== GetTotalSpaceSize ==&lt;br /&gt;
Takes an input media-id that must be 5.&lt;br /&gt;
&lt;br /&gt;
Returns the u64 from [[Content_Manager_services#IContentStorage]] cmd22.&lt;br /&gt;
&lt;br /&gt;
== GetFreeSpaceSize ==&lt;br /&gt;
Takes an input media-id that must be 5.&lt;br /&gt;
&lt;br /&gt;
Returns the u64 from [[Content_Manager_services#IContentStorage]] cmd23.&lt;br /&gt;
&lt;br /&gt;
== GetApplicationDesiredLanguage ==&lt;br /&gt;
Takes an input u8 language-bitmask, returns an output u8 [[control.nacp]] langentry index.&lt;br /&gt;
&lt;br /&gt;
User-processes generate the language-bitmask with the following for all 16 lang-entries: &amp;lt;code&amp;gt;if(&amp;lt;either string in langentry[i] is non-empty&amp;gt;)bitmask |= 1&amp;lt;&amp;lt;i&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ConvertLanguageCodeToApplicationLanguage ==&lt;br /&gt;
Takes an input u8 pointer for the resulting Id to be written to and a string represented as a u64 (i.e 0x53552D6E65 for &#039;en-US&#039;).&lt;br /&gt;
&lt;br /&gt;
Returns 0 if an ID was successfully found, otherwise returns 0x25810.&lt;br /&gt;
&lt;br /&gt;
== GetApplicationControlData ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Loads cached [[control.nacp]] to buf+0 and the cached icon to buf+0x4000. Returns an error if the buffer is too small.&lt;br /&gt;
&lt;br /&gt;
== ListApplicationContentMetaStatus ==&lt;br /&gt;
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 &amp;gt;= totalentries, this will return 0 with out_entrycount=0.&lt;br /&gt;
&lt;br /&gt;
Entry structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| u8 &amp;quot;type&amp;quot;. [[Content_Manager_services|Title type]] (String is from web-applet)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| u8 &amp;quot;installedStorage&amp;quot; / [[Filesystem_services|StorageId]] (String is from web-applet)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown. Non-zero with output from cmd 605, differs for app/update titles.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| u32 Title-version&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| u64 titleID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:am2, ns:ec, ns:rid, ns:rt, ns:web =&lt;br /&gt;
These services are all, at the top level, &amp;quot;nn::ns::detail::IServiceGetterInterface&amp;quot;. 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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 7992 || [[#IECommerceInterface|GetECommerceInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7993 || [[#IApplicationVersionInterface|GetApplicationVersionInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7994 || [[#IFactoryResetInterface|GetFactoryResetInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7995 || [[#IAccountProxyInterface|GetAccountProxyInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7996 || [[#IApplicationManagerInterface|GetApplicationManagerInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7997 || [[#IDownloadTaskInterface|GetDownloadTaskInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7998 || [[#IContentManagementInterface|GetContentManagementInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7999 || [[#IDocumentInterface|GetDocumentInterface]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IAccountProxyInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IAccountProxyInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CreateUserAccount&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IApplicationManagerInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IApplicationManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ListApplicationRecord]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GenerateApplicationRecordCount&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetApplicationRecordUpdateSystemEvent&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetApplicationViewDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeleteApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeleteApplicationCompletely&lt;br /&gt;
|-&lt;br /&gt;
| 6 || IsAnyApplicationEntityRedundant&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeleteRedundantApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 8 || IsApplicationEntityMovable&lt;br /&gt;
|-&lt;br /&gt;
| 9 || MoveApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 11 || CalculateApplicationOccupiedSize&lt;br /&gt;
|-&lt;br /&gt;
| 16 || PushApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListApplicationRecordContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [?.?.?-5.1.0] [[#LaunchApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#GetApplicationContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || TerminateApplication&lt;br /&gt;
|-&lt;br /&gt;
| 23 || ResolveApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
| 26 || BeginInstallApplication&lt;br /&gt;
|-&lt;br /&gt;
| 27 || DeleteApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 30 || RequestApplicationUpdateInfo&lt;br /&gt;
|-&lt;br /&gt;
| 32 || CancelApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 33 || ResumeApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 35 || UpdateVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 36 || PushLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 37 || ListRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 38 || CheckApplicationLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 39 || CheckApplicationLaunchRights&lt;br /&gt;
|-&lt;br /&gt;
| 40 || GetApplicationLogoData&lt;br /&gt;
|-&lt;br /&gt;
| 41 || CalculateApplicationDownloadRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 42 || CleanupSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 43 || CheckSdCardMountStatus&lt;br /&gt;
|-&lt;br /&gt;
| 44 || GetSdCardMountStatusChangedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 45 || GetGameCardAttachmentEvent&lt;br /&gt;
|-&lt;br /&gt;
| 46 || GetGameCardAttachmentInfo&lt;br /&gt;
|-&lt;br /&gt;
| 47 || [[#GetTotalSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 48 || [[#GetFreeSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 49 || GetSdCardRemovedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 52 || GetGameCardUpdateDetectionEvent&lt;br /&gt;
|-&lt;br /&gt;
| 53 || DisableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 54 || EnableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 55 || GetApplicationDesiredLanguage&lt;br /&gt;
|-&lt;br /&gt;
| 56 || SetApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 57 || ClearApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 58 || GetLastSdCardMountUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 59 || ConvertApplicationLanguageToLanguageCode&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [[#ConvertLanguageCodeToApplicationLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || GetBackgroundDownloadStressTaskInfo&lt;br /&gt;
|-&lt;br /&gt;
| 62 || GetGameCardStopper&lt;br /&gt;
|-&lt;br /&gt;
| 63 || IsSystemProgramInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 64 || StartApplyDeltaTask&lt;br /&gt;
|-&lt;br /&gt;
| 65 || GetRequestServerStopper&lt;br /&gt;
|-&lt;br /&gt;
| 66 || GetBackgroundApplyDeltaStressTaskInfo&lt;br /&gt;
|-&lt;br /&gt;
| 67 || CancelApplicationApplyDelta&lt;br /&gt;
|-&lt;br /&gt;
| 68 || ResumeApplicationApplyDelta&lt;br /&gt;
|-&lt;br /&gt;
| 69 || CalculateApplicationApplyDeltaRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 70 || ResumeAll&lt;br /&gt;
|-&lt;br /&gt;
| 71 || GetStorageSize&lt;br /&gt;
|-&lt;br /&gt;
| 80 || RequestDownloadApplication&lt;br /&gt;
|-&lt;br /&gt;
| 81 || RequestDownloadAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 82 || DownloadApplication&lt;br /&gt;
|-&lt;br /&gt;
| 83 || CheckApplicationResumeRights&lt;br /&gt;
|-&lt;br /&gt;
| 84 || GetDynamicCommitEvent&lt;br /&gt;
|-&lt;br /&gt;
| 85 || RequestUpdateApplication2&lt;br /&gt;
|-&lt;br /&gt;
| 86 || EnableApplicationCrashReport&lt;br /&gt;
|-&lt;br /&gt;
| 87 || IsApplicationCrashReportEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 90 || BoostSystemMemoryResourceLimit&lt;br /&gt;
|-&lt;br /&gt;
| 91 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 92 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 93 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 94 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 95 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 96 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 97 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 98 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ResetToFactorySettings&lt;br /&gt;
|-&lt;br /&gt;
| 101 || ResetToFactorySettingsWithoutUserSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 102 || ResetToFactorySettingsForRefurbishment&lt;br /&gt;
|-&lt;br /&gt;
| 200 || CalculateUserSaveDataStatistics&lt;br /&gt;
|-&lt;br /&gt;
| 201 || DeleteUserSaveDataAll&lt;br /&gt;
|-&lt;br /&gt;
| 210 || DeleteUserSystemSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 211 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 220 || UnregisterNetworkServiceAccount&lt;br /&gt;
|-&lt;br /&gt;
| 221 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 300 || GetApplicationShellEvent&lt;br /&gt;
|-&lt;br /&gt;
| 301 || PopApplicationShellEventInfo&lt;br /&gt;
|-&lt;br /&gt;
| 302 || LaunchLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 303 || TerminateLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 304 || LaunchSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 305 || TerminateSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 306 || LaunchOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 307 || TerminateOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 400 || GetApplicationControlData&lt;br /&gt;
|-&lt;br /&gt;
| 401 || InvalidateAllApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 402 || RequestDownloadApplicationControlData&lt;br /&gt;
|-&lt;br /&gt;
| 403 || GetMaxApplicationControlCacheCount&lt;br /&gt;
|-&lt;br /&gt;
| 404 || InvalidateApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 405 || ListApplicationControlCacheEntryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 406 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 502 || RequestCheckGameCardRegistration&lt;br /&gt;
|-&lt;br /&gt;
| 503 || RequestGameCardRegistrationGoldPoint&lt;br /&gt;
|-&lt;br /&gt;
| 504 || RequestRegisterGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 505 || GetGameCardMountFailureEvent&lt;br /&gt;
|-&lt;br /&gt;
| 506 || IsGameCardInserted&lt;br /&gt;
|-&lt;br /&gt;
| 507 || EnsureGameCardAccess&lt;br /&gt;
|-&lt;br /&gt;
| 508 || GetLastGameCardMountFailureResult&lt;br /&gt;
|-&lt;br /&gt;
| 509 || ListApplicationIdOnGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 600 || CountApplicationContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 601 || [[#ListApplicationContentMetaStatus]]&lt;br /&gt;
|-&lt;br /&gt;
| 602 || [?.?.?-5.1.0] ListAvailableAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 603 || GetOwnedApplicationContentMetaStatus&lt;br /&gt;
|-&lt;br /&gt;
| 604 || RegisterContentsExternalKey&lt;br /&gt;
|-&lt;br /&gt;
| 605 || ListApplicationContentMetaStatusWithRightsCheck&lt;br /&gt;
|-&lt;br /&gt;
| 606 || GetContentMetaStorage&lt;br /&gt;
|-&lt;br /&gt;
| 607 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 700 || PushDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 701 || ClearTaskStatusList&lt;br /&gt;
|-&lt;br /&gt;
| 702 || RequestDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 703 || RequestEnsureDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 704 || ListDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 705 || RequestDownloadTaskListData&lt;br /&gt;
|-&lt;br /&gt;
| 800 || RequestVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 801 || ListVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 802 || RequestVersionListData&lt;br /&gt;
|-&lt;br /&gt;
| 900 || GetApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 901 || GetApplicationRecordProperty&lt;br /&gt;
|-&lt;br /&gt;
| 902 || EnableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 903 || DisableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 904 || TouchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 905 || RequestApplicationUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 906 || IsApplicationUpdateRequested&lt;br /&gt;
|-&lt;br /&gt;
| 907 || WithdrawApplicationUpdateRequest&lt;br /&gt;
|-&lt;br /&gt;
| 908 || ListApplicationRecordInstalledContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 909 || WithdrawCleanupAddOnContentsWithNoRightsRecommendation&lt;br /&gt;
|-&lt;br /&gt;
| 910 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 911 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 912 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || RequestVerifyApplicationDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || CorruptApplicationForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1002 || RequestVerifyAddOnContentsRights&lt;br /&gt;
|-&lt;br /&gt;
| 1003 || RequestVerifyApplication&lt;br /&gt;
|-&lt;br /&gt;
| 1004 || CorruptContentForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1200 || NeedsUpdateVulnerability&lt;br /&gt;
|-&lt;br /&gt;
| 1300 || IsAnyApplicationEntityInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 1301 || DeleteApplicationContentEntities&lt;br /&gt;
|-&lt;br /&gt;
| 1302 || CleanupUnrecordedApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1303 || CleanupAddOnContentsWithNoRights&lt;br /&gt;
|-&lt;br /&gt;
| 1304 || DeleteApplicationContentEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1305 || [?.?.?-5.1.0] TryDeleteRunningApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1306 || [?.?.?-5.1.0] TryDeleteRunningApplicationCompletely&lt;br /&gt;
|-&lt;br /&gt;
| 1307 || [?.?.?-5.1.0] TryDeleteRunningApplicationContentEntities&lt;br /&gt;
|-&lt;br /&gt;
| 1308 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1309 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1400 || PrepareShutdown&lt;br /&gt;
|-&lt;br /&gt;
| 1500 || FormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1501 || NeedsSystemUpdateToFormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1502 || GetLastSdCardFormatUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 1504 || InsertSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1505 || RemoveSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1600 || GetSystemSeedForPseudoDeviceId&lt;br /&gt;
|-&lt;br /&gt;
| 1601 || ResetSystemSeedForPseudoDeviceId&lt;br /&gt;
|-&lt;br /&gt;
| 1700 || ListApplicationDownloadingContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 1701 || GetApplicationView&lt;br /&gt;
|-&lt;br /&gt;
| 1702 || GetApplicationDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 1703 || GetApplicationViewDownloadErrorContext&lt;br /&gt;
|-&lt;br /&gt;
| 1800 || IsNotificationSetupCompleted&lt;br /&gt;
|-&lt;br /&gt;
| 1801 || GetLastNotificationInfoCount&lt;br /&gt;
|-&lt;br /&gt;
| 1802 || ListLastNotificationInfo&lt;br /&gt;
|-&lt;br /&gt;
| 1803 || ListNotificationTask&lt;br /&gt;
|-&lt;br /&gt;
| 1900 || IsActiveAccount&lt;br /&gt;
|-&lt;br /&gt;
| 1901 || RequestDownloadApplicationPrepurchasedRights&lt;br /&gt;
|-&lt;br /&gt;
| 1902 || GetApplicationTicketInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2000 || GetSystemDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2001 || SelectLatestSystemDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2002 || VerifyDeliveryProtocolVersion&lt;br /&gt;
|-&lt;br /&gt;
| 2003 || GetApplicationDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2004 || HasAllContentsToDeliver&lt;br /&gt;
|-&lt;br /&gt;
| 2005 || CompareApplicationDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2006 || CanDeliverApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2007 || ListContentMetaKeyToDeliverApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2008 || NeedsSystemUpdateToDeliverApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2009 || EstimateRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 2010 || RequestReceiveApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2011 || CommitReceiveApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2012 || GetReceiveApplicationProgress&lt;br /&gt;
|-&lt;br /&gt;
| 2013 || RequestSendApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2014 || GetSendApplicationProgress&lt;br /&gt;
|-&lt;br /&gt;
| 2015 || CompareSystemDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2016 || ListNotCommittedContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 2017 || CreateDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 2018 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2050 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2100 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2101 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2150 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2151 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2152 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2153 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2154 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2160 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2161 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2170 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2171 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2180 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2181 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2182 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2190 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2199 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2200 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2201 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2250 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2300 || [6.0.0+] &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IApplicationVersionInterface ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetLaunchRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 1 || UpgradeLaunchRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 35 || UpdateVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 36 || PushLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 37 || ListRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 800 || RequestVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 801 || ListVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 802 || RequestVersionListData&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || PerformAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IContentManagerInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IContentManagementInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 11 || CalculateApplicationOccupiedSize&lt;br /&gt;
|-&lt;br /&gt;
| 43 || CheckSdCardMountStatus&lt;br /&gt;
|-&lt;br /&gt;
| 47 || GetTotalSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| 48 || GetFreeSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| 600 || CountApplicationContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 601 || ListApplicationContentMetaStatus&lt;br /&gt;
|-&lt;br /&gt;
| 605 || ListApplicationContentMetaStatusWithRightsCheck&lt;br /&gt;
|-&lt;br /&gt;
| 607 || IsAnyApplicationRunning&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IDocumentInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IDocumentInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 21 || GetApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
| 23 || ResolveApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IDownloadTaskInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IDownloadTaskInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 701 || ClearTaskStatusList&lt;br /&gt;
|-&lt;br /&gt;
| 702 || RequestDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 703 || RequestEnsureDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 704 || ListDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 705 || RequestDownloadTaskListData&lt;br /&gt;
|-&lt;br /&gt;
| 706 || TryCommitCurrentApplicationDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 707 || EnableAutoCommit&lt;br /&gt;
|-&lt;br /&gt;
| 708 || DisableAutoCommit&lt;br /&gt;
|-&lt;br /&gt;
| 709 || TriggerDynamicCommitEvent&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IECommerceInterface===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || RequestLinkDevice&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IFactoryResetInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IFactoryResetInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ResetToFactorySettings&lt;br /&gt;
|-&lt;br /&gt;
| 101 || ResetToFactorySettingsWithoutUserSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 102 || ResetToFactorySettingsForRefurbishment&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:vm =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IVulnerabilityManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1200 || [3.0.0+] NeedsUpdateVulnerability&lt;br /&gt;
|-&lt;br /&gt;
| 1201 || [4.0.0+] UpdateSafeSystemVersionForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1202 || [4.0.0+] GetSafeSystemVersion&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:su =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::ISystemUpdateInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetBackgroundNetworkUpdateState&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#ISystemUpdateControl|OpenSystemUpdateControl]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NotifyExFatDriverRequired&lt;br /&gt;
|-&lt;br /&gt;
| 3 || ClearExFatDriverStatusForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 4 || RequestBackgroundNetworkUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 5 || NotifyBackgroundNetworkUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 6 || NotifyExFatDriverDownloadedForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetSystemUpdateNotificationEventForContentDelivery&lt;br /&gt;
|-&lt;br /&gt;
| 10 || NotifySystemUpdateForContentDelivery&lt;br /&gt;
|-&lt;br /&gt;
| 11 || PrepareShutdown&lt;br /&gt;
|-&lt;br /&gt;
| 16 || DestroySystemUpdateTask&lt;br /&gt;
|-&lt;br /&gt;
| 17 || RequestSendSystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 18 || GetSendSystemUpdateProgress&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ISystemUpdateControl ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || HasDownloaded&lt;br /&gt;
|-&lt;br /&gt;
| 1 || RequestCheckLatestUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 2 || RequestDownloadLatestUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetDownloadProgress&lt;br /&gt;
|-&lt;br /&gt;
| 4 || ApplyDownloadedUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 5 || RequestPrepareCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 6 || GetPrepareCardUpdateProgress&lt;br /&gt;
|-&lt;br /&gt;
| 7 || HasPreparedCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 8 || ApplyCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetDownloadedEulaDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetDownloadedEulaData&lt;br /&gt;
|-&lt;br /&gt;
| 11 || SetupCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetPreparedCardUpdateEulaDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 13 || GetPreparedCardUpdateEulaData&lt;br /&gt;
|-&lt;br /&gt;
| 14 || SetupCardUpdateViaSystemUpdater&lt;br /&gt;
|-&lt;br /&gt;
| 15 || HasReceived&lt;br /&gt;
|-&lt;br /&gt;
| 16 || RequestReceiveSystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 17 || GetReceiveProgress&lt;br /&gt;
|-&lt;br /&gt;
| 18 || ApplyReceivedUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 19 || GetReceivedEulaDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 20 || GetReceivedEulaData&lt;br /&gt;
|-&lt;br /&gt;
| 21 || SetupToReceiveSystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:dev =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IDevelopInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#LaunchProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#TerminateProcess]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#TerminateProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetShellEventHandle]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetShellEventInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#TerminateApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#PrepareLaunchProgramFromHost]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#LaunchApplication_2|#LaunchApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#LaunchApplicationWithStorageId]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LaunchProgram ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#LaunchProcess|LaunchProcess]].&lt;br /&gt;
&lt;br /&gt;
== TerminateProcess ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#TerminateTitleByPid|TerminateTitleByPid]].&lt;br /&gt;
&lt;br /&gt;
== TerminateProgram ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#TerminateTitleByTitleId|TerminateTitleByTitleId]].&lt;br /&gt;
&lt;br /&gt;
== GetShellEventHandle==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#GetProcessEventWaiter|GetProcessEventWaiter]].&lt;br /&gt;
&lt;br /&gt;
== GetShellEventInfo ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#GetProcessEventType|GetProcessEventType]].&lt;br /&gt;
&lt;br /&gt;
== TerminateApplication ==&lt;br /&gt;
Calls &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#GetCrashingProcessPid|GetCrashingProcessPid]] and sends PID to [[Process_Manager_services#TerminateTitleByPid|TerminateTitleByPid]].&lt;br /&gt;
&lt;br /&gt;
== PrepareLaunchProgramFromHost ==&lt;br /&gt;
Takes a type-0x5 input buffer containing the [[Filesystem_services|ContentPath]], returns an output 0x10-byte struct.&lt;br /&gt;
&lt;br /&gt;
Calls [[NCM_services#IPathResolverForStorage|IPathResolverForStorage]] Set...NcaPath functions.&lt;br /&gt;
&lt;br /&gt;
== LaunchApplication ==&lt;br /&gt;
Takes an input u32 [[Process_Manager_services|launch_flags]] and u64 titleID, returns an output u64 PID.&lt;br /&gt;
&lt;br /&gt;
Same as LaunchApplicationWithStorageId except the last two params passed to the internal vtable funcptr call are value 0x6, instead of from the command input.&lt;br /&gt;
&lt;br /&gt;
== LaunchApplicationWithStorageId ==&lt;br /&gt;
Takes 2 input u8s, an u32 [[Process_Manager_services|launch_flags]], and an u64 titleID. Returns an output u64 PID.&lt;br /&gt;
&lt;br /&gt;
Launches an application title which is registered with NS. &lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=NS_services&amp;diff=4949</id>
		<title>NS services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=NS_services&amp;diff=4949"/>
		<updated>2018-08-31T08:29:34Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Goodnight Sweet Price&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= aoc:u =&lt;br /&gt;
This is &amp;quot;nn::aocsrv::detail::IAddOnContentManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CountAddOnContentByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ListAddOnContentByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 2 || CountAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 3 || ListAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetAddOnContentBaseIdByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 5 || GetAddOnContentBaseId&lt;br /&gt;
|-&lt;br /&gt;
| 6 || PrepareAddOnContentByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 7 || PrepareAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [4.0.0+] GetAddOnContentListChangedEvent&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:am =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IApplicationManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] This service was replaced by [[#ns:am2, ns:ec, ns:rid, ns:rt, ns:web|ns:am2]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ListApplicationRecord]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GenerateApplicationRecordCount&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetApplicationRecordUpdateSystemEvent&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetApplicationViewDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeleteApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeleteApplicationCompletely&lt;br /&gt;
|-&lt;br /&gt;
| 6 || IsAnyApplicationEntityRedundant&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeleteRedundantApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 8 || IsApplicationEntityMovable&lt;br /&gt;
|-&lt;br /&gt;
| 9 || MoveApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 11 || CalculateApplicationOccupiedSize&lt;br /&gt;
|-&lt;br /&gt;
| 16 || PushApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListApplicationRecordContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 18 || &lt;br /&gt;
|-&lt;br /&gt;
| 19 || [1.0.0-5.1.0] [[#LaunchApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#GetApplicationContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || TerminateApplication&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [2.0.0+] ResolveApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
| 26 || BeginInstallApplication&lt;br /&gt;
|-&lt;br /&gt;
| 27 || DeleteApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 30 || RequestApplicationUpdateInfo&lt;br /&gt;
|-&lt;br /&gt;
| 31 || RequestUpdateApplication&lt;br /&gt;
|-&lt;br /&gt;
| 32 || CancelApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 33 || ResumeApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 34 || &lt;br /&gt;
|-&lt;br /&gt;
| 35 || UpdateVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 36 || PushLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 37 || ListRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 38 || CheckApplicationLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 39 || CheckApplicationLaunchRights&lt;br /&gt;
|-&lt;br /&gt;
| 40 || GetApplicationLogoData&lt;br /&gt;
|-&lt;br /&gt;
| 41 || CalculateApplicationDownloadRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 42 || CleanupSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 43 || CheckSdCardMountStatus&lt;br /&gt;
|-&lt;br /&gt;
| 44 || GetSdCardMountStatusChangedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 45 || GetGameCardAttachmentEvent&lt;br /&gt;
|-&lt;br /&gt;
| 46 || GetGameCardAttachmentInfo&lt;br /&gt;
|-&lt;br /&gt;
| 47 || [[#GetTotalSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 48 || [[#GetFreeSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 49 || GetSdCardRemovedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 52 || GetGameCardUpdateDetectionEvent&lt;br /&gt;
|-&lt;br /&gt;
| 53 || DisableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 54 || EnableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 55 || [[#GetApplicationDesiredLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 56 || SetApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 57 || ClearApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 58 || GetLastSdCardMountUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 59 || ConvertApplicationLanguageToLanguageCode&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [[#ConvertLanguageCodeToApplicationLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || GetBackgroundDownloadStressTaskInfo&lt;br /&gt;
|-&lt;br /&gt;
| 62 || GetGameCardStopper&lt;br /&gt;
|-&lt;br /&gt;
| 63 || IsSystemProgramInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 64 || [2.0.0+] StartApplyDeltaTask&lt;br /&gt;
|-&lt;br /&gt;
| 65 || [2.0.0+] GetRequestServerStopper&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ResetToFactorySettings&lt;br /&gt;
|-&lt;br /&gt;
| 101 || ResetToFactorySettingsWithoutUserSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [2.0.0+] ResetToFactorySettingsForRefurbishment&lt;br /&gt;
|-&lt;br /&gt;
| 200 || CalculateUserSaveDataStatistics&lt;br /&gt;
|-&lt;br /&gt;
| 201 || DeleteUserSaveDataAll&lt;br /&gt;
|-&lt;br /&gt;
| 210 || DeleteUserSystemSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 220 || UnregisterNetworkServiceAccount&lt;br /&gt;
|-&lt;br /&gt;
| 300 || GetApplicationShellEvent&lt;br /&gt;
|-&lt;br /&gt;
| 301 || PopApplicationShellEventInfo&lt;br /&gt;
|-&lt;br /&gt;
| 302 || LaunchLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 303 || TerminateLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 304 || LaunchSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 305 || TerminateSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 306 || LaunchOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 307 || TerminateOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#GetApplicationControlData]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || InvalidateAllApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 402 || RequestDownloadApplicationControlData&lt;br /&gt;
|-&lt;br /&gt;
| 403 || GetMaxApplicationControlCacheCount&lt;br /&gt;
|-&lt;br /&gt;
| 404 || [2.0.0+] InvalidateApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 405 || [2.0.0+] ListApplicationControlCacheEntryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 502 || [2.0.0+] RequestCheckGameCardRegistration&lt;br /&gt;
|-&lt;br /&gt;
| 503 || [2.0.0+] RequestGameCardRegistrationGoldPoint&lt;br /&gt;
|-&lt;br /&gt;
| 504 || [2.0.0+] RequestRegisterGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 600 || [2.0.0+] CountApplicationContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 601 || [2.0.0+] [[#ListApplicationContentMetaStatus]]&lt;br /&gt;
|-&lt;br /&gt;
| 602 || [2.0.0+] ListAvailableAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 603 || [2.0.0+] GetOwnedApplicationContentMetaStatus&lt;br /&gt;
|-&lt;br /&gt;
| 604 || [2.0.0+] RegisterContentsExternalKey&lt;br /&gt;
|-&lt;br /&gt;
| 605 || [2.0.0+] ListApplicationContentMetaStatusWithRightsCheck&lt;br /&gt;
|-&lt;br /&gt;
| 700 || [2.0.0+] PushDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 701 || [2.0.0+] ClearTaskStatusList&lt;br /&gt;
|-&lt;br /&gt;
| 702 || [2.0.0+] RequestDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 703 || [2.0.0+] RequestEnsureDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 704 || [2.0.0+] ListDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 705 || [2.0.0+] RequestDownloadTaskListData&lt;br /&gt;
|-&lt;br /&gt;
| 800 || [2.0.0+] RequestVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 801 || [2.0.0+] ListVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 900 || [2.0.0+] GetApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 901 || [2.0.0+] GetApplicationRecordProperty&lt;br /&gt;
|-&lt;br /&gt;
| 902 || [2.0.0+] EnableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 903 || [2.0.0+] DisableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 904 || [2.0.0+] TouchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 905 || [2.0.0+] RequestApplicationUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 906 || [2.0.0+] IsApplicationUpdateRequested&lt;br /&gt;
|-&lt;br /&gt;
| 907 || [2.0.0+] WithdrawApplicationUpdateRequest&lt;br /&gt;
|-&lt;br /&gt;
| 908 || [2.0.0+] ListApplicationRecordInstalledContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || [2.0.0+] RequestVerifyApplicationDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || [2.0.0+] CorruptApplicationForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1200 || [2.0.0+] NeedsUpdateVulnerability&lt;br /&gt;
|-&lt;br /&gt;
| 1300 || [2.0.0+] IsAnyApplicationEntityInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 1301 || [2.0.0+] DeleteApplicationContentEntities&lt;br /&gt;
|-&lt;br /&gt;
| 1302 || [2.0.0+] CleanupUnrecordedApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1400 || [2.0.0+] PrepareShutdown&lt;br /&gt;
|-&lt;br /&gt;
| 1500 || [2.0.0+] FormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1501 || [2.0.0+] NeedsSystemUpdateToFormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1502 || [2.0.0+] GetLastSdCardFormatUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 1503 || [2.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1600 || [2.0.0+] GetSystemSeedForPseudoDeviceId&lt;br /&gt;
|-&lt;br /&gt;
| 1700 || [2.0.0+] ListApplicationDownloadingContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 1800 || [2.0.0+] IsNotificationSetupCompleted&lt;br /&gt;
|-&lt;br /&gt;
| 1801 || [2.0.0+] GetLastNotificationInfoCount&lt;br /&gt;
|-&lt;br /&gt;
| 1802 || [2.0.0+] ListLastNotificationInfo&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ListApplicationRecord ==&lt;br /&gt;
Takes a type-6 output buffer and an u64.&lt;br /&gt;
&lt;br /&gt;
Returns an array of title-info entries using the specified offset and size. No input titleID is passed to this.&lt;br /&gt;
&lt;br /&gt;
=== Application Record Format ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| Title ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x1&lt;br /&gt;
| Type? (Known values: 2=Installing?, 3=Gamecard?, 4=Installed?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown, usually 0x02&lt;br /&gt;
|-&lt;br /&gt;
| 0xA&lt;br /&gt;
| 0x6&lt;br /&gt;
| Unknown, usually zeros?&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown, seems to change between reboots and removing/reinserting gamecards&lt;br /&gt;
|-&lt;br /&gt;
| 0x11&lt;br /&gt;
| 0x7&lt;br /&gt;
| Unknown, usually zeros?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LaunchApplication  ==&lt;br /&gt;
Takes an input u64 titleID, returns an output u64 PID.&lt;br /&gt;
&lt;br /&gt;
Launches an application title which is registered with NS.&lt;br /&gt;
&lt;br /&gt;
== GetApplicationContentPath ==&lt;br /&gt;
Takes a 0x16-type output buffer, an u8 [[NCA|type]], and an u64 titleID.&lt;br /&gt;
&lt;br /&gt;
The input titleID is used with the application-title table like various other cmds, anything not in that table can&#039;t be used with this.&lt;br /&gt;
&lt;br /&gt;
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&#039;t exist for this title. Starts with &amp;quot;@{SdCardContent,UserContent}://&amp;quot; and ends in &amp;quot;.nca&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For gamecard content, the output path is: &amp;quot;@GcSXXXXXXXX:/&amp;lt;NcaId&amp;gt;.nca&amp;quot;. NCA-type0 with gamecard returns 0 with an empty output string.&lt;br /&gt;
&lt;br /&gt;
The output string is then used by the user-process with [[Filesystem_services|FS]] to mount the content.&lt;br /&gt;
&lt;br /&gt;
== GetTotalSpaceSize ==&lt;br /&gt;
Takes an input media-id that must be 5.&lt;br /&gt;
&lt;br /&gt;
Returns the u64 from [[Content_Manager_services#IContentStorage]] cmd22.&lt;br /&gt;
&lt;br /&gt;
== GetFreeSpaceSize ==&lt;br /&gt;
Takes an input media-id that must be 5.&lt;br /&gt;
&lt;br /&gt;
Returns the u64 from [[Content_Manager_services#IContentStorage]] cmd23.&lt;br /&gt;
&lt;br /&gt;
== GetApplicationDesiredLanguage ==&lt;br /&gt;
Takes an input u8 language-bitmask, returns an output u8 [[control.nacp]] langentry index.&lt;br /&gt;
&lt;br /&gt;
User-processes generate the language-bitmask with the following for all 16 lang-entries: &amp;lt;code&amp;gt;if(&amp;lt;either string in langentry[i] is non-empty&amp;gt;)bitmask |= 1&amp;lt;&amp;lt;i&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ConvertLanguageCodeToApplicationLanguage ==&lt;br /&gt;
Takes an input u8 pointer for the resulting Id to be written to and a string represented as a u64 (i.e 0x53552D6E65 for &#039;en-US&#039;).&lt;br /&gt;
&lt;br /&gt;
Returns 0 if an ID was successfully found, otherwise returns 0x25810.&lt;br /&gt;
&lt;br /&gt;
== GetApplicationControlData ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Loads cached [[control.nacp]] to buf+0 and the cached icon to buf+0x4000. Returns an error if the buffer is too small.&lt;br /&gt;
&lt;br /&gt;
== ListApplicationContentMetaStatus ==&lt;br /&gt;
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 &amp;gt;= totalentries, this will return 0 with out_entrycount=0.&lt;br /&gt;
&lt;br /&gt;
Entry structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| u8 &amp;quot;type&amp;quot;. [[Content_Manager_services|Title type]] (String is from web-applet)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| u8 &amp;quot;installedStorage&amp;quot; / [[Filesystem_services|StorageId]] (String is from web-applet)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown. Non-zero with output from cmd 605, differs for app/update titles.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| u32 Title-version&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| u64 titleID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:am2, ns:ec, ns:rid, ns:rt, ns:web =&lt;br /&gt;
These services are all, at the top level, &amp;quot;nn::ns::detail::IServiceGetterInterface&amp;quot;. 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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 7992 || [[#IECommerceInterface|GetECommerceInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7993 || [[#IApplicationVersionInterface|GetApplicationVersionInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7994 || [[#IFactoryResetInterface|GetFactoryResetInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7995 || [[#IAccountProxyInterface|GetAccountProxyInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7996 || [[#IApplicationManagerInterface|GetApplicationManagerInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7997 || [[#IDownloadTaskInterface|GetDownloadTaskInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7998 || [[#IContentManagementInterface|GetContentManagementInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7999 || [[#IDocumentInterface|GetDocumentInterface]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IAccountProxyInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IAccountProxyInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CreateUserAccount&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IApplicationManagerInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IApplicationManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ListApplicationRecord]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GenerateApplicationRecordCount&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetApplicationRecordUpdateSystemEvent&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetApplicationViewDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeleteApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeleteApplicationCompletely&lt;br /&gt;
|-&lt;br /&gt;
| 6 || IsAnyApplicationEntityRedundant&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeleteRedundantApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 8 || IsApplicationEntityMovable&lt;br /&gt;
|-&lt;br /&gt;
| 9 || MoveApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 11 || CalculateApplicationOccupiedSize&lt;br /&gt;
|-&lt;br /&gt;
| 16 || PushApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListApplicationRecordContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [[#LaunchApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#GetApplicationContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || TerminateApplication&lt;br /&gt;
|-&lt;br /&gt;
| 23 || ResolveApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
| 26 || BeginInstallApplication&lt;br /&gt;
|-&lt;br /&gt;
| 27 || DeleteApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 30 || RequestApplicationUpdateInfo&lt;br /&gt;
|-&lt;br /&gt;
| 32 || CancelApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 33 || ResumeApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 35 || UpdateVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 36 || PushLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 37 || ListRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 38 || CheckApplicationLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 39 || CheckApplicationLaunchRights&lt;br /&gt;
|-&lt;br /&gt;
| 40 || GetApplicationLogoData&lt;br /&gt;
|-&lt;br /&gt;
| 41 || CalculateApplicationDownloadRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 42 || CleanupSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 43 || CheckSdCardMountStatus&lt;br /&gt;
|-&lt;br /&gt;
| 44 || GetSdCardMountStatusChangedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 45 || GetGameCardAttachmentEvent&lt;br /&gt;
|-&lt;br /&gt;
| 46 || GetGameCardAttachmentInfo&lt;br /&gt;
|-&lt;br /&gt;
| 47 || [[#GetTotalSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 48 || [[#GetFreeSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 49 || GetSdCardRemovedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 52 || GetGameCardUpdateDetectionEvent&lt;br /&gt;
|-&lt;br /&gt;
| 53 || DisableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 54 || EnableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 55 || GetApplicationDesiredLanguage&lt;br /&gt;
|-&lt;br /&gt;
| 56 || SetApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 57 || ClearApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 58 || GetLastSdCardMountUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 59 || ConvertApplicationLanguageToLanguageCode&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [[#ConvertLanguageCodeToApplicationLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || GetBackgroundDownloadStressTaskInfo&lt;br /&gt;
|-&lt;br /&gt;
| 62 || GetGameCardStopper&lt;br /&gt;
|-&lt;br /&gt;
| 63 || IsSystemProgramInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 64 || StartApplyDeltaTask&lt;br /&gt;
|-&lt;br /&gt;
| 65 || GetRequestServerStopper&lt;br /&gt;
|-&lt;br /&gt;
| 66 || GetBackgroundApplyDeltaStressTaskInfo&lt;br /&gt;
|-&lt;br /&gt;
| 67 || CancelApplicationApplyDelta&lt;br /&gt;
|-&lt;br /&gt;
| 68 || ResumeApplicationApplyDelta&lt;br /&gt;
|-&lt;br /&gt;
| 69 || CalculateApplicationApplyDeltaRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 70 || ResumeAll&lt;br /&gt;
|-&lt;br /&gt;
| 71 || GetStorageSize&lt;br /&gt;
|-&lt;br /&gt;
| 80 || RequestDownloadApplication&lt;br /&gt;
|-&lt;br /&gt;
| 81 || RequestDownloadAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 82 || DownloadApplication&lt;br /&gt;
|-&lt;br /&gt;
| 83 || CheckApplicationResumeRights&lt;br /&gt;
|-&lt;br /&gt;
| 84 || GetDynamicCommitEvent&lt;br /&gt;
|-&lt;br /&gt;
| 85 || RequestUpdateApplication2&lt;br /&gt;
|-&lt;br /&gt;
| 86 || EnableApplicationCrashReport&lt;br /&gt;
|-&lt;br /&gt;
| 87 || IsApplicationCrashReportEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 90 || BoostSystemMemoryResourceLimit&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ResetToFactorySettings&lt;br /&gt;
|-&lt;br /&gt;
| 101 || ResetToFactorySettingsWithoutUserSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 102 || ResetToFactorySettingsForRefurbishment&lt;br /&gt;
|-&lt;br /&gt;
| 200 || CalculateUserSaveDataStatistics&lt;br /&gt;
|-&lt;br /&gt;
| 201 || DeleteUserSaveDataAll&lt;br /&gt;
|-&lt;br /&gt;
| 210 || DeleteUserSystemSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 220 || UnregisterNetworkServiceAccount&lt;br /&gt;
|-&lt;br /&gt;
| 300 || GetApplicationShellEvent&lt;br /&gt;
|-&lt;br /&gt;
| 301 || PopApplicationShellEventInfo&lt;br /&gt;
|-&lt;br /&gt;
| 302 || LaunchLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 303 || TerminateLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 304 || LaunchSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 305 || TerminateSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 306 || LaunchOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 307 || TerminateOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 400 || GetApplicationControlData&lt;br /&gt;
|-&lt;br /&gt;
| 401 || InvalidateAllApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 402 || RequestDownloadApplicationControlData&lt;br /&gt;
|-&lt;br /&gt;
| 403 || GetMaxApplicationControlCacheCount&lt;br /&gt;
|-&lt;br /&gt;
| 404 || InvalidateApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 405 || ListApplicationControlCacheEntryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 502 || RequestCheckGameCardRegistration&lt;br /&gt;
|-&lt;br /&gt;
| 503 || RequestGameCardRegistrationGoldPoint&lt;br /&gt;
|-&lt;br /&gt;
| 504 || RequestRegisterGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 505 || GetGameCardMountFailureEvent&lt;br /&gt;
|-&lt;br /&gt;
| 506 || IsGameCardInserted&lt;br /&gt;
|-&lt;br /&gt;
| 507 || EnsureGameCardAccess&lt;br /&gt;
|-&lt;br /&gt;
| 508 || GetLastGameCardMountFailureResult&lt;br /&gt;
|-&lt;br /&gt;
| 509 || ListApplicationIdOnGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 600 || CountApplicationContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 601 || [[#ListApplicationContentMetaStatus]]&lt;br /&gt;
|-&lt;br /&gt;
| 602 || ListAvailableAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 603 || GetOwnedApplicationContentMetaStatus&lt;br /&gt;
|-&lt;br /&gt;
| 604 || RegisterContentsExternalKey&lt;br /&gt;
|-&lt;br /&gt;
| 605 || ListApplicationContentMetaStatusWithRightsCheck&lt;br /&gt;
|-&lt;br /&gt;
| 606 || GetContentMetaStorage&lt;br /&gt;
|-&lt;br /&gt;
| 700 || PushDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 701 || ClearTaskStatusList&lt;br /&gt;
|-&lt;br /&gt;
| 702 || RequestDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 703 || RequestEnsureDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 704 || ListDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 705 || RequestDownloadTaskListData&lt;br /&gt;
|-&lt;br /&gt;
| 800 || RequestVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 801 || ListVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 802 || RequestVersionListData&lt;br /&gt;
|-&lt;br /&gt;
| 900 || GetApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 901 || GetApplicationRecordProperty&lt;br /&gt;
|-&lt;br /&gt;
| 902 || EnableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 903 || DisableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 904 || TouchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 905 || RequestApplicationUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 906 || IsApplicationUpdateRequested&lt;br /&gt;
|-&lt;br /&gt;
| 907 || WithdrawApplicationUpdateRequest&lt;br /&gt;
|-&lt;br /&gt;
| 908 || ListApplicationRecordInstalledContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 909 || WithdrawCleanupAddOnContentsWithNoRightsRecommendation&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || RequestVerifyApplicationDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || CorruptApplicationForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1002 || RequestVerifyAddOnContentsRights&lt;br /&gt;
|-&lt;br /&gt;
| 1003 || RequestVerifyApplication&lt;br /&gt;
|-&lt;br /&gt;
| 1004 || CorruptContentForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1200 || NeedsUpdateVulnerability&lt;br /&gt;
|-&lt;br /&gt;
| 1300 || IsAnyApplicationEntityInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 1301 || DeleteApplicationContentEntities&lt;br /&gt;
|-&lt;br /&gt;
| 1302 || CleanupUnrecordedApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1303 || CleanupAddOnContentsWithNoRights&lt;br /&gt;
|-&lt;br /&gt;
| 1304 || DeleteApplicationContentEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1305 || TryDeleteRunningApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1306 || TryDeleteRunningApplicationCompletely&lt;br /&gt;
|-&lt;br /&gt;
| 1307 || TryDeleteRunningApplicationContentEntities&lt;br /&gt;
|-&lt;br /&gt;
| 1400 || PrepareShutdown&lt;br /&gt;
|-&lt;br /&gt;
| 1500 || FormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1501 || NeedsSystemUpdateToFormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1502 || GetLastSdCardFormatUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 1504 || InsertSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1505 || RemoveSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1600 || GetSystemSeedForPseudoDeviceId&lt;br /&gt;
|-&lt;br /&gt;
| 1601 || ResetSystemSeedForPseudoDeviceId&lt;br /&gt;
|-&lt;br /&gt;
| 1700 || ListApplicationDownloadingContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 1701 || GetApplicationView&lt;br /&gt;
|-&lt;br /&gt;
| 1702 || GetApplicationDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 1703 || GetApplicationViewDownloadErrorContext&lt;br /&gt;
|-&lt;br /&gt;
| 1800 || IsNotificationSetupCompleted&lt;br /&gt;
|-&lt;br /&gt;
| 1801 || GetLastNotificationInfoCount&lt;br /&gt;
|-&lt;br /&gt;
| 1802 || ListLastNotificationInfo&lt;br /&gt;
|-&lt;br /&gt;
| 1803 || ListNotificationTask&lt;br /&gt;
|-&lt;br /&gt;
| 1900 || IsActiveAccount&lt;br /&gt;
|-&lt;br /&gt;
| 1901 || RequestDownloadApplicationPrepurchasedRights&lt;br /&gt;
|-&lt;br /&gt;
| 1902 || GetApplicationTicketInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2000 || GetSystemDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2001 || SelectLatestSystemDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2002 || VerifyDeliveryProtocolVersion&lt;br /&gt;
|-&lt;br /&gt;
| 2003 || GetApplicationDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2004 || HasAllContentsToDeliver&lt;br /&gt;
|-&lt;br /&gt;
| 2005 || CompareApplicationDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2006 || CanDeliverApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2007 || ListContentMetaKeyToDeliverApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2008 || NeedsSystemUpdateToDeliverApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2009 || EstimateRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 2010 || RequestReceiveApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2011 || CommitReceiveApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2012 || GetReceiveApplicationProgress&lt;br /&gt;
|-&lt;br /&gt;
| 2013 || RequestSendApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2014 || GetSendApplicationProgress&lt;br /&gt;
|-&lt;br /&gt;
| 2015 || CompareSystemDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2016 || ListNotCommittedContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 2017 || CreateDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IApplicationVersionInterface ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetLaunchRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 1 || UpgradeLaunchRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 35 || UpdateVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 36 || PushLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 37 || ListRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 800 || RequestVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 801 || ListVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 802 || RequestVersionListData&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || PerformAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IContentManagerInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IContentManagementInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 11 || CalculateApplicationOccupiedSize&lt;br /&gt;
|-&lt;br /&gt;
| 43 || CheckSdCardMountStatus&lt;br /&gt;
|-&lt;br /&gt;
| 47 || GetTotalSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| 48 || GetFreeSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| 600 || CountApplicationContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 601 || ListApplicationContentMetaStatus&lt;br /&gt;
|-&lt;br /&gt;
| 605 || ListApplicationContentMetaStatusWithRightsCheck&lt;br /&gt;
|-&lt;br /&gt;
| 607 || IsAnyApplicationRunning&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IDocumentInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IDocumentInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 21 || GetApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
| 23 || ResolveApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IDownloadTaskInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IDownloadTaskInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 701 || ClearTaskStatusList&lt;br /&gt;
|-&lt;br /&gt;
| 702 || RequestDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 703 || RequestEnsureDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 704 || ListDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 705 || RequestDownloadTaskListData&lt;br /&gt;
|-&lt;br /&gt;
| 706 || TryCommitCurrentApplicationDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 707 || EnableAutoCommit&lt;br /&gt;
|-&lt;br /&gt;
| 708 || DisableAutoCommit&lt;br /&gt;
|-&lt;br /&gt;
| 709 || TriggerDynamicCommitEvent&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IECommerceInterface===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || RequestLinkDevice&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IFactoryResetInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IFactoryResetInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ResetToFactorySettings&lt;br /&gt;
|-&lt;br /&gt;
| 101 || ResetToFactorySettingsWithoutUserSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 102 || ResetToFactorySettingsForRefurbishment&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:vm =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IVulnerabilityManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1200 || [3.0.0+] NeedsUpdateVulnerability&lt;br /&gt;
|-&lt;br /&gt;
| 1201 || [4.0.0+] UpdateSafeSystemVersionForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1202 || [4.0.0+] GetSafeSystemVersion&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:su =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::ISystemUpdateInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetBackgroundNetworkUpdateState&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#ISystemUpdateControl|OpenSystemUpdateControl]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NotifyExFatDriverRequired&lt;br /&gt;
|-&lt;br /&gt;
| 3 || ClearExFatDriverStatusForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 4 || RequestBackgroundNetworkUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 5 || NotifyBackgroundNetworkUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 6 || NotifyExFatDriverDownloadedForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetSystemUpdateNotificationEventForContentDelivery&lt;br /&gt;
|-&lt;br /&gt;
| 10 || NotifySystemUpdateForContentDelivery&lt;br /&gt;
|-&lt;br /&gt;
| 11 || PrepareShutdown&lt;br /&gt;
|-&lt;br /&gt;
| 16 || DestroySystemUpdateTask&lt;br /&gt;
|-&lt;br /&gt;
| 17 || RequestSendSystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 18 || GetSendSystemUpdateProgress&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ISystemUpdateControl ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || HasDownloaded&lt;br /&gt;
|-&lt;br /&gt;
| 1 || RequestCheckLatestUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 2 || RequestDownloadLatestUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetDownloadProgress&lt;br /&gt;
|-&lt;br /&gt;
| 4 || ApplyDownloadedUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 5 || RequestPrepareCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 6 || GetPrepareCardUpdateProgress&lt;br /&gt;
|-&lt;br /&gt;
| 7 || HasPreparedCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 8 || ApplyCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetDownloadedEulaDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetDownloadedEulaData&lt;br /&gt;
|-&lt;br /&gt;
| 11 || SetupCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetPreparedCardUpdateEulaDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 13 || GetPreparedCardUpdateEulaData&lt;br /&gt;
|-&lt;br /&gt;
| 14 || SetupCardUpdateViaSystemUpdater&lt;br /&gt;
|-&lt;br /&gt;
| 15 || HasReceived&lt;br /&gt;
|-&lt;br /&gt;
| 16 || RequestReceiveSystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 17 || GetReceiveProgress&lt;br /&gt;
|-&lt;br /&gt;
| 18 || ApplyReceivedUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 19 || GetReceivedEulaDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 20 || GetReceivedEulaData&lt;br /&gt;
|-&lt;br /&gt;
| 21 || SetupToReceiveSystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:dev =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IDevelopInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#LaunchProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#TerminateProcess]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#TerminateProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetShellEventHandle]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetShellEventInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#TerminateApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#PrepareLaunchProgramFromHost]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#LaunchApplication_2|#LaunchApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#LaunchApplicationWithStorageId]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LaunchProgram ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#LaunchProcess|LaunchProcess]].&lt;br /&gt;
&lt;br /&gt;
== TerminateProcess ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#TerminateTitleByPid|TerminateTitleByPid]].&lt;br /&gt;
&lt;br /&gt;
== TerminateProgram ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#TerminateTitleByTitleId|TerminateTitleByTitleId]].&lt;br /&gt;
&lt;br /&gt;
== GetShellEventHandle==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#GetProcessEventWaiter|GetProcessEventWaiter]].&lt;br /&gt;
&lt;br /&gt;
== GetShellEventInfo ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#GetProcessEventType|GetProcessEventType]].&lt;br /&gt;
&lt;br /&gt;
== TerminateApplication ==&lt;br /&gt;
Calls &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#GetCrashingProcessPid|GetCrashingProcessPid]] and sends PID to [[Process_Manager_services#TerminateTitleByPid|TerminateTitleByPid]].&lt;br /&gt;
&lt;br /&gt;
== PrepareLaunchProgramFromHost ==&lt;br /&gt;
Takes a type-0x5 input buffer containing the [[Filesystem_services|ContentPath]], returns an output 0x10-byte struct.&lt;br /&gt;
&lt;br /&gt;
Calls [[NCM_services#IPathResolverForStorage|IPathResolverForStorage]] Set...NcaPath functions.&lt;br /&gt;
&lt;br /&gt;
== LaunchApplication ==&lt;br /&gt;
Takes an input u32 [[Process_Manager_services|launch_flags]] and u64 titleID, returns an output u64 PID.&lt;br /&gt;
&lt;br /&gt;
Same as LaunchApplicationWithStorageId except the last two params passed to the internal vtable funcptr call are value 0x6, instead of from the command input.&lt;br /&gt;
&lt;br /&gt;
== LaunchApplicationWithStorageId ==&lt;br /&gt;
Takes 2 input u8s, an u32 [[Process_Manager_services|launch_flags]], and an u64 titleID. Returns an output u64 PID.&lt;br /&gt;
&lt;br /&gt;
Launches an application title which is registered with NS. &lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=ETicket_services&amp;diff=4948</id>
		<title>ETicket services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=ETicket_services&amp;diff=4948"/>
		<updated>2018-08-31T07:14:07Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: These were probably added in 2.0.0, not 1.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= es =&lt;br /&gt;
This is &amp;quot;nn::es::IETicketService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ImportTicket&lt;br /&gt;
|-&lt;br /&gt;
| 2 || ImportTicketCertificateSet&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DeleteTicket&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeletePersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeleteAllCommonTicket&lt;br /&gt;
|-&lt;br /&gt;
| 6 || DeleteAllPersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeleteAllPersonalizedTicketEx&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [2.0.0-5.1.0] GetTitleKey&lt;br /&gt;
|-&lt;br /&gt;
| 9 || CountCommonTicket&lt;br /&gt;
|-&lt;br /&gt;
| 10 || CountPersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 11 || ListCommonTicket&lt;br /&gt;
|-&lt;br /&gt;
| 12 || ListPersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 13 || ListMissingPersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 14 || GetCommonTicketSize&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [2.0.0-5.1.0] GetPersonalizedTicketSize&lt;br /&gt;
|-&lt;br /&gt;
| 16 || GetCommonTicketData&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [2.0.0-5.1.0] GetPersonalizedTicketData&lt;br /&gt;
|-&lt;br /&gt;
| 18 || OwnTicket&lt;br /&gt;
|-&lt;br /&gt;
| 19 || GetTicketInfo&lt;br /&gt;
|-&lt;br /&gt;
| 20 || ListLightTicketInfo&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [2.0.0+] SignData&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [4.0.0+] GetCommonTicketAndCertificateSize&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [4.0.0+] GetCommonTicketAndCertificateData&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [4.0.0+] ImportPrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [4.0.0+] DeletePrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 26 || [4.0.0+] DeleteAllPrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 27 || [4.0.0+] CountPrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 28 || [4.0.0+] ListPrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 29 || [4.0.0+] ListPrepurchaseRecordInfo&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 32 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 33 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 34 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 35 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 36 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 501 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 502 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 503 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 504 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 508 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 509 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 510 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1002 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1003 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1004 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1005 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1006 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1007 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1009 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1010 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1011 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1012 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1013 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1014 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1015 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1016 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1501 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1502 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1503 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1504 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1505 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2000 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2501 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2502 || [6.0.0+]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=ETicket_services&amp;diff=4947</id>
		<title>ETicket services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=ETicket_services&amp;diff=4947"/>
		<updated>2018-08-31T07:12:55Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Added 6.0.0 commands&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= es =&lt;br /&gt;
This is &amp;quot;nn::es::IETicketService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ImportTicket&lt;br /&gt;
|-&lt;br /&gt;
| 2 || ImportTicketCertificateSet&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DeleteTicket&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeletePersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeleteAllCommonTicket&lt;br /&gt;
|-&lt;br /&gt;
| 6 || DeleteAllPersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeleteAllPersonalizedTicketEx&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [1.0.0-5.1.0] GetTitleKey&lt;br /&gt;
|-&lt;br /&gt;
| 9 || CountCommonTicket&lt;br /&gt;
|-&lt;br /&gt;
| 10 || CountPersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 11 || ListCommonTicket&lt;br /&gt;
|-&lt;br /&gt;
| 12 || ListPersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 13 || ListMissingPersonalizedTicket&lt;br /&gt;
|-&lt;br /&gt;
| 14 || GetCommonTicketSize&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [1.0.0-5.1.0] GetPersonalizedTicketSize&lt;br /&gt;
|-&lt;br /&gt;
| 16 || GetCommonTicketData&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [1.0.0-5.1.0] GetPersonalizedTicketData&lt;br /&gt;
|-&lt;br /&gt;
| 18 || OwnTicket&lt;br /&gt;
|-&lt;br /&gt;
| 19 || GetTicketInfo&lt;br /&gt;
|-&lt;br /&gt;
| 20 || ListLightTicketInfo&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [2.0.0+] SignData&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [4.0.0+] GetCommonTicketAndCertificateSize&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [4.0.0+] GetCommonTicketAndCertificateData&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [4.0.0+] ImportPrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [4.0.0+] DeletePrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 26 || [4.0.0+] DeleteAllPrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 27 || [4.0.0+] CountPrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 28 || [4.0.0+] ListPrepurchaseRecord&lt;br /&gt;
|-&lt;br /&gt;
| 29 || [4.0.0+] ListPrepurchaseRecordInfo&lt;br /&gt;
|-&lt;br /&gt;
| 30 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 31 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 32 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 33 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 34 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 35 || [5.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 36 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 501 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 502 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 503 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 504 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 508 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 509 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 510 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1002 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1003 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1004 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1005 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1006 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1007 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1009 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1010 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1011 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1012 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1013 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1014 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1015 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1016 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1501 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1502 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1503 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1504 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1505 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2000 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2501 || [6.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2502 || [6.0.0+]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Error_codes&amp;diff=4833</id>
		<title>Error codes</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Error_codes&amp;diff=4833"/>
		<updated>2018-07-15T02:33:48Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Added FS error code 2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Structure =&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Field&lt;br /&gt;
|-&lt;br /&gt;
| 8-0 || Module&lt;br /&gt;
|-&lt;br /&gt;
| 21-9 || Description&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When a fatal-error is received the error code is outputted using the following formatter:&lt;br /&gt;
  %04d-%04d&lt;br /&gt;
&lt;br /&gt;
.. where the first code is &amp;lt;code&amp;gt;2000 + Module&amp;lt;/code&amp;gt;, and the other being &amp;lt;code&amp;gt;Description&amp;lt;/code&amp;gt;. Bits &amp;gt;=22 from the error-code are unused when displaying fatal-errors, since the Description ends with bit21.&lt;br /&gt;
&lt;br /&gt;
= Modules =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Kernel&lt;br /&gt;
|-&lt;br /&gt;
| 2 || FS&lt;br /&gt;
|-&lt;br /&gt;
| 3 || OS (Memory, Thread, Mutex, NVIDIA)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || HTCS&lt;br /&gt;
|-&lt;br /&gt;
| 5 || NCM&lt;br /&gt;
|-&lt;br /&gt;
| 6 || DD&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Debug Monitor&lt;br /&gt;
|-&lt;br /&gt;
| 8 || LR&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Loader&lt;br /&gt;
|-&lt;br /&gt;
| 10 || CMIF (IPC command interface)&lt;br /&gt;
|-&lt;br /&gt;
| 11 || HIPC (IPC)&lt;br /&gt;
|-&lt;br /&gt;
| 15 || PM&lt;br /&gt;
|-&lt;br /&gt;
| 16 || NS&lt;br /&gt;
|-&lt;br /&gt;
| 17 || Sockets&lt;br /&gt;
|-&lt;br /&gt;
| 18 || HTC&lt;br /&gt;
|-&lt;br /&gt;
| 20 || NCM Content&lt;br /&gt;
|-&lt;br /&gt;
| 21 || SM&lt;br /&gt;
|-&lt;br /&gt;
| 22 || RO userland&lt;br /&gt;
|-&lt;br /&gt;
| 24 || SDMMC&lt;br /&gt;
|-&lt;br /&gt;
| 25 || OVLN&lt;br /&gt;
|-&lt;br /&gt;
| 26 || SPL&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ETHC&lt;br /&gt;
|-&lt;br /&gt;
| 101 || I2C&lt;br /&gt;
|-&lt;br /&gt;
| 102 || GPIO&lt;br /&gt;
|-&lt;br /&gt;
| 103 || UART&lt;br /&gt;
|-&lt;br /&gt;
| 105 || Settings&lt;br /&gt;
|-&lt;br /&gt;
| 107 || WLAN&lt;br /&gt;
|-&lt;br /&gt;
| 108 || XCD&lt;br /&gt;
|-&lt;br /&gt;
| 110 || NIFM&lt;br /&gt;
|-&lt;br /&gt;
| 111 || Hwopus&lt;br /&gt;
|-&lt;br /&gt;
| 113 || Bluetooth&lt;br /&gt;
|-&lt;br /&gt;
| 114 || VI&lt;br /&gt;
|-&lt;br /&gt;
| 115 || NFP&lt;br /&gt;
|-&lt;br /&gt;
| 116 || Time&lt;br /&gt;
|-&lt;br /&gt;
| 117 || FGM&lt;br /&gt;
|-&lt;br /&gt;
| 118 || OE&lt;br /&gt;
|-&lt;br /&gt;
| 120 || PCIe&lt;br /&gt;
|-&lt;br /&gt;
| 121 || Friends&lt;br /&gt;
|-&lt;br /&gt;
| 122 || BCAT&lt;br /&gt;
|-&lt;br /&gt;
| 123 || SSL&lt;br /&gt;
|-&lt;br /&gt;
| 124 || Account&lt;br /&gt;
|-&lt;br /&gt;
| 125 || News&lt;br /&gt;
|-&lt;br /&gt;
| 126 || Mii&lt;br /&gt;
|-&lt;br /&gt;
| 127 || NFC&lt;br /&gt;
|-&lt;br /&gt;
| 128 || AM&lt;br /&gt;
|-&lt;br /&gt;
| 129 || Play Report&lt;br /&gt;
|-&lt;br /&gt;
| 130 || AHID&lt;br /&gt;
|-&lt;br /&gt;
| 132 || Home Menu (Qlaunch)&lt;br /&gt;
|-&lt;br /&gt;
| 133 || PCV&lt;br /&gt;
|-&lt;br /&gt;
| 134 || OMM&lt;br /&gt;
|-&lt;br /&gt;
| 135 || BPC&lt;br /&gt;
|-&lt;br /&gt;
| 136 || PSM&lt;br /&gt;
|-&lt;br /&gt;
| 137 || NIM&lt;br /&gt;
|-&lt;br /&gt;
| 138 || PSC&lt;br /&gt;
|-&lt;br /&gt;
| 139 || TC&lt;br /&gt;
|-&lt;br /&gt;
| 140 || USB&lt;br /&gt;
|-&lt;br /&gt;
| 141 || NSD&lt;br /&gt;
|-&lt;br /&gt;
| 142 || PCTL&lt;br /&gt;
|-&lt;br /&gt;
| 143 || BTM&lt;br /&gt;
|-&lt;br /&gt;
| 144 || EC (Shop)&lt;br /&gt;
|-&lt;br /&gt;
| 145 || ETicket&lt;br /&gt;
|-&lt;br /&gt;
| 146 || NGC (Bad Words)&lt;br /&gt;
|-&lt;br /&gt;
| 147 || Error Report&lt;br /&gt;
|-&lt;br /&gt;
| 148 || APM&lt;br /&gt;
|-&lt;br /&gt;
| 150 || Profiler&lt;br /&gt;
|-&lt;br /&gt;
| 151 || Error Upload&lt;br /&gt;
|-&lt;br /&gt;
| 153 || Audio&lt;br /&gt;
|-&lt;br /&gt;
| 154 || NPNS&lt;br /&gt;
|-&lt;br /&gt;
| 155 || NPNS HTTP Stream&lt;br /&gt;
|-&lt;br /&gt;
| 157 || ARP&lt;br /&gt;
|-&lt;br /&gt;
| 158 || SWKBD&lt;br /&gt;
|-&lt;br /&gt;
| 159 || Boot&lt;br /&gt;
|-&lt;br /&gt;
| 161 || NFC Mifare&lt;br /&gt;
|-&lt;br /&gt;
| 162 || Userland assert&lt;br /&gt;
|-&lt;br /&gt;
| 163 || Fatal&lt;br /&gt;
|-&lt;br /&gt;
| 164 || NIM Shop&lt;br /&gt;
|-&lt;br /&gt;
| 165 || SPSM&lt;br /&gt;
|-&lt;br /&gt;
| 167 || BGTC&lt;br /&gt;
|-&lt;br /&gt;
| 168 || Userland crash&lt;br /&gt;
|-&lt;br /&gt;
| 180 || SREPO&lt;br /&gt;
|-&lt;br /&gt;
| 181 || Dauth&lt;br /&gt;
|-&lt;br /&gt;
| 202 || HID&lt;br /&gt;
|-&lt;br /&gt;
| 203 || LDN&lt;br /&gt;
|-&lt;br /&gt;
| 205 || Irsensor&lt;br /&gt;
|-&lt;br /&gt;
| 206 || Capture&lt;br /&gt;
|-&lt;br /&gt;
| 208 || Manu&lt;br /&gt;
|-&lt;br /&gt;
| 209 || ATK&lt;br /&gt;
|-&lt;br /&gt;
| 210 || Web&lt;br /&gt;
|-&lt;br /&gt;
| 211 ||&lt;br /&gt;
|-&lt;br /&gt;
| 212 || GRC&lt;br /&gt;
|-&lt;br /&gt;
| 216 || Migration&lt;br /&gt;
|-&lt;br /&gt;
| 217 || Migration Idc Server&lt;br /&gt;
|-&lt;br /&gt;
| 345 || libnx&lt;br /&gt;
|-&lt;br /&gt;
| 346 || [[Homebrew ABI]]&lt;br /&gt;
|-&lt;br /&gt;
| 347 || Homebrew Loader&lt;br /&gt;
|-&lt;br /&gt;
| 348 || libnx Nvidia errors&lt;br /&gt;
|-&lt;br /&gt;
| 800 || [[Internet_Browser|General web-applet]]&lt;br /&gt;
|-&lt;br /&gt;
| 809 || [[Internet_Browser|WifiWebAuthApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 810 || [[Internet_Browser|Whitelisted-applet]]&lt;br /&gt;
|-&lt;br /&gt;
| 811 || [[Internet_Browser|ShopN]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
8XX is for/includes system applets.&lt;br /&gt;
&lt;br /&gt;
= Error codes =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Module || Description || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C01 || 1 || 14 || Invalid kernel capability descriptor&lt;br /&gt;
|-&lt;br /&gt;
| 0x4201 || 1 || 33 || [[SPL_services#GetConfig|IsDebugMode]] isn&#039;t set.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8C01 || 1 || 70 || No more debug events&lt;br /&gt;
|-&lt;br /&gt;
| 0xCA01 || 1 || 101 || Invalid size&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC01 || 1 || 102 || Invalid address&lt;br /&gt;
|-&lt;br /&gt;
| 0xCE01 || 1 || 103 || Slabheap full&lt;br /&gt;
|-&lt;br /&gt;
| 0xD001 || 1 || 104 || Memory full&lt;br /&gt;
|-&lt;br /&gt;
| 0xD201 || 1 || 105 || Handle-table full.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD401 || 1 || 106 || Invalid memory state / invalid memory permissions.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD801 || 1 || 108 || Invalid memory permissions.&lt;br /&gt;
|-&lt;br /&gt;
| 0xDC01 || 1 || 110 || Invalid memory range&lt;br /&gt;
|-&lt;br /&gt;
| 0xE001 || 1 || 112 || Invalid thread priority.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE201 || 1 || 113 || Invalid processor id.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE401 || 1 || 114 || Invalid handle.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE601 || 1 || 115 || Syscall copy from user failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE801 || 1 || 116 || Invalid combination&lt;br /&gt;
|-&lt;br /&gt;
| 0xEA01 || 1 || 117 || Time out. Also when you give 0 handles to svcWaitSynchronizationN.&lt;br /&gt;
|-&lt;br /&gt;
| 0xEC01 || 1 || 118 || Canceled/interrupted [?]&lt;br /&gt;
|-&lt;br /&gt;
| 0xEE01 || 1 || 119 || Exceeding maximum&lt;br /&gt;
|-&lt;br /&gt;
| 0xF001 || 1 || 120 || Invalid enum&lt;br /&gt;
|-&lt;br /&gt;
| 0xF201 || 1 || 121 || No such entry&lt;br /&gt;
|-&lt;br /&gt;
| 0xF401 || 1 || 122 || Irq/DeviceAddressSpace/{...} already registered&lt;br /&gt;
|-&lt;br /&gt;
| 0xF601 || 1 || 123 || Port remote dead&lt;br /&gt;
|-&lt;br /&gt;
| 0xF801 || 1 || 124 || [Usermode] Unhandled interrupt&lt;br /&gt;
|-&lt;br /&gt;
| 0xFA01 || 1 || 125 || Wrong memory permission?&lt;br /&gt;
|-&lt;br /&gt;
| 0xFC01 || 1 || 126 || Reserved value&lt;br /&gt;
|-&lt;br /&gt;
| 0xFE01 || 1 || 127 || Invalid hardware breakpoint&lt;br /&gt;
|-&lt;br /&gt;
| 0x10001 || 1 || 128 || [Usermode] Fatal exception&lt;br /&gt;
|-&lt;br /&gt;
| 0x10201 || 1 || 129 || Last thread didn&#039;t belong to your process&lt;br /&gt;
|-&lt;br /&gt;
| 0x10601 || 1 || 131 || Port max sessions exceeded&lt;br /&gt;
|-&lt;br /&gt;
| 0x10801 || 1 || 132 || Resource limit exceeded&lt;br /&gt;
|-&lt;br /&gt;
| 0x20801 || 1 || 260 || Command buffer too small&lt;br /&gt;
|-&lt;br /&gt;
| 0x41001 || 1 || 520 || Process not being debugged&lt;br /&gt;
|-&lt;br /&gt;
| 0x402 || 2 || 2 || Directory/file(?) already exists.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE02 || 2 || 7 || Savedata [[Filesystem_services|already]] mounted&lt;br /&gt;
|-&lt;br /&gt;
| 0x7802 || 2 || 60 || The specified [[NCA]]-type doesn&#039;t exist for this title.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D202 || 2 || 1001 || Process does not have RomFs &lt;br /&gt;
|-&lt;br /&gt;
| 0x7D402 || 2 || 1002 || Title-id not found / savedata not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0xFA202 || 2 || 2001 || SD card not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x13B002 || 2 || 2520 || Gamecard not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x13DA02 || 2 || 2541 || Version check failed when mounting gamecard sysupdate partition?&lt;br /&gt;
|-&lt;br /&gt;
| 0x171402 || 2 || 2954 || Invalid gamecard handle.&lt;br /&gt;
|-&lt;br /&gt;
| 0x196002 || 2 || 3248 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x196202 || 2 || 3249 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A4A02 || 2 || 3365 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x235202 || 2 || 4521 || Invalid NCA Key index&lt;br /&gt;
|-&lt;br /&gt;
| 0x235E02 || 2 || 4527 || NCA-path used with the wrong titleID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x250E02 || 2 || 4743 || [[NAX0|Corrupted]] NAX0 header.&lt;br /&gt;
|-&lt;br /&gt;
| 0x251002 || 2 || 4744 || Invalid [[NAX0]] magicnum.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE202 || 2 || 6001 || Invalid input&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE602 || 2 || 6003 || Path too long&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EEA02 || 2 || 6005 || Invalid directory path.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5A02 || 2 || 6061 || Offset outside storage&lt;br /&gt;
|-&lt;br /&gt;
| 0x313802 || 2 || 6300 || Operation not supported&lt;br /&gt;
|-&lt;br /&gt;
| 0x320002 || 2 || 6400 || Permission denied&lt;br /&gt;
|-&lt;br /&gt;
| 0x326602 || 2 || 6451 || Missing titlekey(?) required to mount content&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EA03 || 3 || 501 || Invalid handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EE03 || 3 || 503 || Invalid memory mirror&lt;br /&gt;
|-&lt;br /&gt;
| 0x7FE03 || 3 || 1023 || TLS slot is not allocated&lt;br /&gt;
|-&lt;br /&gt;
| 0xA05 || 5 || 5 || [[Content_Manager_services|NcaID]] not found. Returned when attempting to mount titles which exist that aren&#039;t *8XX titles, the same way *8XX titles are mounted.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE05 || 5 || 7 || TitleId not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x1805 || 5 || 12 || Invalid StorageId&lt;br /&gt;
|-&lt;br /&gt;
| 0xDC05 || 5 || 110 || Gamecard not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x17C05 || 5 || 190 || Gamecard not initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F405 || 5 || 250 || Sdcard not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x20805 || 5 || 260 || Storage not mounted&lt;br /&gt;
|-&lt;br /&gt;
| 0x806 || 6 || 4 || Converted from error 0xD401&lt;br /&gt;
|-&lt;br /&gt;
| 0x1006 || 6 || 8 || Converted from error 0xE401&lt;br /&gt;
|-&lt;br /&gt;
| 0x408 || 8 || 2 || Program location entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x608 || 8 || 3 || Invalid context for control location&lt;br /&gt;
|-&lt;br /&gt;
| 0x808 || 8 || 4 || Storage not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xA08 || 8 || 5 || Access denied&lt;br /&gt;
|-&lt;br /&gt;
| 0xC08 || 8 || 6 || Offline manual HTML location entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xE08 || 8 || 7 || Title is not registered&lt;br /&gt;
|-&lt;br /&gt;
| 0x1008 || 8 || 8 || Control location entry for host not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x1208 || 8 || 9 || Legal info HTML location entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x209 || 9 || 1 || Args too long.&lt;br /&gt;
|-&lt;br /&gt;
| 0x409 || 9 || 2 || Maximum processes loaded.&lt;br /&gt;
|-&lt;br /&gt;
| 0x609 || 9 || 3 || NPDM too big.&lt;br /&gt;
|-&lt;br /&gt;
| 0x19009 || 9 || 200 || Invalid access control sizes in NPDM.&lt;br /&gt;
|-&lt;br /&gt;
| 0x809 || 9 || 4 || Invalid NPDM.&lt;br /&gt;
|-&lt;br /&gt;
| 0xA09 || 9 || 5 || Invalid files.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE09 || 9 || 7 || Already registered.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1009 || 9 || 8 || Title not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1209 || 9 || 9 || Title-id in ACI0 doesn&#039;t match range in ACID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6609 || 9 || 51 || Invalid memory state/permission&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A09 || 9 || 53 || Invalid NRR&lt;br /&gt;
|-&lt;br /&gt;
| 0xA209 || 9 || 81 || Unaligned NRR address&lt;br /&gt;
|-&lt;br /&gt;
| 0xA409 || 9 || 82 || Bad NRR size&lt;br /&gt;
|-&lt;br /&gt;
| 0xAA09 || 9 || 85 || Bad NRR address&lt;br /&gt;
|-&lt;br /&gt;
| 0xAE09 || 9 || 87 || Bad initialization&lt;br /&gt;
|-&lt;br /&gt;
| 0xC809 || 9 || 100 || Unknown ACI0 descriptor&lt;br /&gt;
|-&lt;br /&gt;
| 0xCE09 || 9 || 103 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;KernelFlags&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xD009 || 9 || 104 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;SyscallMask&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xD409 || 9 || 106 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;MapIoOrNormalRange&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xD609 || 9 || 107 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;MapNormalPage&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xDE09 || 9 || 111 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;InterruptPair&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE209 || 9 || 113 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;ApplicationType&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE409 || 9 || 114 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;KernelReleaseVersion&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE609 || 9 || 115 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;HandleTableSize&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE809 || 9 || 116 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;DebugFlags&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A80A || 10 || 212 || Bad magic (expected &#039;SFCO&#039;)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20B || 11 || 1 || Size too big to fit to marshal.&lt;br /&gt;
|-&lt;br /&gt;
| 0x11A0B || 11 || 141 || Went past maximum during marshalling.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1900B || 11 || 200 || Session doesn&#039;t support domains.&lt;br /&gt;
|-&lt;br /&gt;
| 0x25A0B || 11 || 301 || Remote process is dead.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D60B || 11 || 491 || IPC Query 1 failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20F || 15 || 1 || Pid not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x60F || 15 || 3 || Process has no pending events&lt;br /&gt;
|-&lt;br /&gt;
| 0xA0F || 15 || 5 || Application already running&lt;br /&gt;
|-&lt;br /&gt;
| 0x410 || 16 || 2 || Title-id not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xF010 || 16 || 120 || Gamecard sysupdate not required&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F610 || 16 || 251 || Unexpected StorageId&lt;br /&gt;
|-&lt;br /&gt;
| 0x415 || 21 || 2 || Not initialized.&lt;br /&gt;
|-&lt;br /&gt;
| 0x615 || 21 || 3 || Max sessions&lt;br /&gt;
|-&lt;br /&gt;
| 0xC15 || 21 || 6 || Invalid name (all zeroes)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1015 || 21 || 8 || Permission denied&lt;br /&gt;
|-&lt;br /&gt;
| 0x416 || 22 || 2 || Address space is full&lt;br /&gt;
|-&lt;br /&gt;
| 0x616 || 22 || 3 || NRO already loaded&lt;br /&gt;
|-&lt;br /&gt;
| 0x816 || 22 || 4 || Invalid NRO header values&lt;br /&gt;
|-&lt;br /&gt;
| 0xC16 || 22 || 6 || Bad NRR magic&lt;br /&gt;
|-&lt;br /&gt;
| 0x1016 || 22 || 8 || Reached max NRR count&lt;br /&gt;
|-&lt;br /&gt;
| 0x1216 || 22 || 9 || Unable to verify NRO hash or NRR signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x80216 || 22 || 1025 || Address not page-aligned&lt;br /&gt;
|-&lt;br /&gt;
| 0x80416 || 22 || 1026 || Incorrect NRO size&lt;br /&gt;
|-&lt;br /&gt;
| 0x80816 || 22 || 1028 || NRO not loaded&lt;br /&gt;
|-&lt;br /&gt;
| 0x80A16 || 22 || 1029 || NRR not loaded&lt;br /&gt;
|-&lt;br /&gt;
| 0x80C16 || 22 || 1030 || Already initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x80E16 || 22 || 1031 || Not initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x41A || 26 || 2 || Argument is invalid&lt;br /&gt;
|-&lt;br /&gt;
| 0xC81A || 26 || 100 || Incorrect buffer size&lt;br /&gt;
|-&lt;br /&gt;
| 0xCA1A || 26 || 101 || Unknown TZ error&lt;br /&gt;
|-&lt;br /&gt;
| 0xD01A || 26 || 104 || All AES engines busy&lt;br /&gt;
|-&lt;br /&gt;
| 0xD21A || 26 || 105 || Invalid AES engine-id&lt;br /&gt;
|-&lt;br /&gt;
| 0x272 || 114 || 1 || Generic error&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC74 || 116 || 102 || Time not set&lt;br /&gt;
|-&lt;br /&gt;
| 0x287C || 124 || 20 || Argument is NULL&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C7C || 124 || 22 || Argument is invalid&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C7C || 124 || 30 || Bad input buffer size&lt;br /&gt;
|-&lt;br /&gt;
| 0x407C || 124 || 32 || Invalid input buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A880 || 128 || 500 || &amp;lt;code&amp;gt;am.debug!dev_function&amp;lt;/code&amp;gt; setting needs to be set&lt;br /&gt;
|-&lt;br /&gt;
| 0x3CF089 || 137 || 7800 || Unknown/invalid libcurl error.&lt;br /&gt;
|-&lt;br /&gt;
| 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.&lt;br /&gt;
|-&lt;br /&gt;
| 0x668C || 140 || 51 || USB data-transfer in progress&lt;br /&gt;
|-&lt;br /&gt;
| 0xD48C || 140 || 106 || Invalid descriptor&lt;br /&gt;
|-&lt;br /&gt;
| 0x1928C || 140 || 201 || USB device not bound / interface already enabled&lt;br /&gt;
|-&lt;br /&gt;
| 0x299 || 153 || 1 || Invalid audio device&lt;br /&gt;
|-&lt;br /&gt;
| 0x499 || 153 || 2 || Invalid buffer address&lt;br /&gt;
|-&lt;br /&gt;
| 0x699 || 153 || 3 || Invalid sample rate&lt;br /&gt;
|-&lt;br /&gt;
| 0x1499 || 153 || 10 || Invalid channel count&lt;br /&gt;
|-&lt;br /&gt;
| 0xC0899 || 153 || 1540 || Audio output was already started&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C9D || 157 || 30 || Address is NULL&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E9D || 157 || 31 || PID is NULL&lt;br /&gt;
|-&lt;br /&gt;
| 0x549D || 157 || 42 || Already bound&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC9D || 157 || 102 || Invalid PID&lt;br /&gt;
|-&lt;br /&gt;
| 0x35B || 347 || 1 || Failed to init SM.&lt;br /&gt;
|-&lt;br /&gt;
| 0x55B || 347 || 2 || Failed to init FS.&lt;br /&gt;
|-&lt;br /&gt;
| 0x75B || 347 || 3 || Failed to to open NRO file. May also happen when SD card isn&#039;t inserted / SD mounting failed earlier.&lt;br /&gt;
|-&lt;br /&gt;
| 0x95B || 347 || 4 || Failed to read NRO header.&lt;br /&gt;
|-&lt;br /&gt;
| 0xB5B || 347 || 5 || Invalid NRO magic.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD5B || 347 || 6 || Invalid NRO segments.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF5B || 347 || 7 || Failed to read NRO.&lt;br /&gt;
|-&lt;br /&gt;
| 0x135B || 347 || 9 || Failed to allocate heap.&lt;br /&gt;
|-&lt;br /&gt;
| 0x255B || 347 || 18 || Failed to map code-binary memory.&lt;br /&gt;
|-&lt;br /&gt;
| 0x275B || 347 || 19 || Failed to map code memory (.text).&lt;br /&gt;
|-&lt;br /&gt;
| 0x295B || 347 || 20 || Failed to map code memory (.rodata).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B5B || 347 || 21 || Failed to map code memory (.data+.bss).&lt;br /&gt;
|-&lt;br /&gt;
| 0x315B || 347 || 24 || Failed to unmap code memory (.text).&lt;br /&gt;
|-&lt;br /&gt;
| 0x335B || 347 || 25 || Failed to unmap code memory (.rodata).&lt;br /&gt;
|-&lt;br /&gt;
| 0x355B || 347 || 26 || Failed to unmap code memory (.data+.bss).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== FS Error Codes ==&lt;br /&gt;
The following are the error codes recognized by nn::fs::detail::LogErrorMessage found in some [[Factory Setup|factory]] titles:&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Description || Message&lt;br /&gt;
|-&lt;br /&gt;
| 0x7802 || 60 || Error: Specified mount name already exists.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD401 || 106 || Error: Passed buffer is not usable for fs library.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D202 || 1001 || Error: Specified partition is not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D402 || 1002 || Error: Specified target is not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0xFA002 - 0x138602 || 2000 - 2499 || Error: Failed to access SD card.&lt;br /&gt;
|-&lt;br /&gt;
| 0x136802 - 0x176E02 || 2500 - 2999 || Error: Failed to access game card.&lt;br /&gt;
|-&lt;br /&gt;
| 0x177202 || 3001 || Error: Specified operation is not implemented.&lt;br /&gt;
|-&lt;br /&gt;
| 0x177A02 || 3005 || Error: Specified value is out of range.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B5802 - 0x1F3E02 || 3500 - 3999 || Error: Failed to access MMC.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F4202 - 0x219602 || 4001 - 4299 || Error: ROM is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x219A02 - 0x232602 || 4301 - 4499 || Error: Save data is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x232A02 - 0x23EE02 || 4501 - 4599 || Error: NCA is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x23F202 - 0x243E02 || 4601 - 4639 || Error: Integrity verification failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x244202 - 0x246602 || 4641 - 4659 || Error: Partition FS is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x246A02 - 0x248E02 || 4661 - 4679 || Error: Built-in-storage is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x249202 - 0x24B602 || 4681 - 4699 || Error: FAT FS is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24BA02 - 0x24DE02 || 4701 - 4719 || Error: HOST FS is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F4002 - 0x270E02 || 4000, 4300, 4500, 4600, 4640, 4660, 4680, 4700, 4720-4999 || Error: Data is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x271002 - 0x2EDE02 || 5000-5999 || Error: Unexpected failure occurred.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE402 - 0x2F1A02 || 6002-6029 || Error: Invalid path was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5A02 || 6061 || Error: Invalid offset was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5C02 || 6062 || Error: Invalid size was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5E02 || 6063 || Error: Null pointer argument was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE002 || 6000 || Error: Precondition violation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE202 - 0x306E02 || 6001-6199 || Error: Invalid argument was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x307202 || 6201 || Error: OpenMode_AllowAppend is required for implicit extension of file size by WriteFile().&lt;br /&gt;
|-&lt;br /&gt;
| 0x307002 - 0x313602 || 6200, 6202 - 6299 || Error: Invalid operation for the open mode.&lt;br /&gt;
|-&lt;br /&gt;
| 0x313802 - 0x31FE02 || 6300-6399 || Error: Unsupported operation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x320002 - 0x32C602 || 6400-6499 || Error: Permission denied.&lt;br /&gt;
|-&lt;br /&gt;
| 0x346402 || 6706 || Error: Enough journal space is not left.&lt;br /&gt;
|-&lt;br /&gt;
| 0x346A02 || 6709 || Error: The open count of files and directories reached the limitation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Fatal Errors =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Error || Description&lt;br /&gt;
|-&lt;br /&gt;
| 2162-0002&lt;br /&gt;
| Can be triggered by running [[SVC|svcBreak]]. The svcBreak params have no affect on the value of the thrown error-code.&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0000&lt;br /&gt;
| Userland ARM undefined instruction exception&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0001&lt;br /&gt;
| Userland ARM prefetch-abort due to PC set to non-executable region&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0002&lt;br /&gt;
| 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.&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0003&lt;br /&gt;
| Userland PC address not aligned to 4 bytes&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0008&lt;br /&gt;
| Can occur when attempting to call an svc outside the whitelist&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Support Errors =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Error || Module || Description || Notes&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| {web-applets listed above}&lt;br /&gt;
| 2750&lt;br /&gt;
| MP4 parsing failed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Normal error-codes displayed by the system also use the same format as fatal-errors.&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Error_codes&amp;diff=4832</id>
		<title>Error codes</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Error_codes&amp;diff=4832"/>
		<updated>2018-07-15T02:01:49Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Third time&amp;#039;s the charm&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Structure =&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Field&lt;br /&gt;
|-&lt;br /&gt;
| 8-0 || Module&lt;br /&gt;
|-&lt;br /&gt;
| 21-9 || Description&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When a fatal-error is received the error code is outputted using the following formatter:&lt;br /&gt;
  %04d-%04d&lt;br /&gt;
&lt;br /&gt;
.. where the first code is &amp;lt;code&amp;gt;2000 + Module&amp;lt;/code&amp;gt;, and the other being &amp;lt;code&amp;gt;Description&amp;lt;/code&amp;gt;. Bits &amp;gt;=22 from the error-code are unused when displaying fatal-errors, since the Description ends with bit21.&lt;br /&gt;
&lt;br /&gt;
= Modules =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Kernel&lt;br /&gt;
|-&lt;br /&gt;
| 2 || FS&lt;br /&gt;
|-&lt;br /&gt;
| 3 || OS (Memory, Thread, Mutex, NVIDIA)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || HTCS&lt;br /&gt;
|-&lt;br /&gt;
| 5 || NCM&lt;br /&gt;
|-&lt;br /&gt;
| 6 || DD&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Debug Monitor&lt;br /&gt;
|-&lt;br /&gt;
| 8 || LR&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Loader&lt;br /&gt;
|-&lt;br /&gt;
| 10 || CMIF (IPC command interface)&lt;br /&gt;
|-&lt;br /&gt;
| 11 || HIPC (IPC)&lt;br /&gt;
|-&lt;br /&gt;
| 15 || PM&lt;br /&gt;
|-&lt;br /&gt;
| 16 || NS&lt;br /&gt;
|-&lt;br /&gt;
| 17 || Sockets&lt;br /&gt;
|-&lt;br /&gt;
| 18 || HTC&lt;br /&gt;
|-&lt;br /&gt;
| 20 || NCM Content&lt;br /&gt;
|-&lt;br /&gt;
| 21 || SM&lt;br /&gt;
|-&lt;br /&gt;
| 22 || RO userland&lt;br /&gt;
|-&lt;br /&gt;
| 24 || SDMMC&lt;br /&gt;
|-&lt;br /&gt;
| 25 || OVLN&lt;br /&gt;
|-&lt;br /&gt;
| 26 || SPL&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ETHC&lt;br /&gt;
|-&lt;br /&gt;
| 101 || I2C&lt;br /&gt;
|-&lt;br /&gt;
| 102 || GPIO&lt;br /&gt;
|-&lt;br /&gt;
| 103 || UART&lt;br /&gt;
|-&lt;br /&gt;
| 105 || Settings&lt;br /&gt;
|-&lt;br /&gt;
| 107 || WLAN&lt;br /&gt;
|-&lt;br /&gt;
| 108 || XCD&lt;br /&gt;
|-&lt;br /&gt;
| 110 || NIFM&lt;br /&gt;
|-&lt;br /&gt;
| 111 || Hwopus&lt;br /&gt;
|-&lt;br /&gt;
| 113 || Bluetooth&lt;br /&gt;
|-&lt;br /&gt;
| 114 || VI&lt;br /&gt;
|-&lt;br /&gt;
| 115 || NFP&lt;br /&gt;
|-&lt;br /&gt;
| 116 || Time&lt;br /&gt;
|-&lt;br /&gt;
| 117 || FGM&lt;br /&gt;
|-&lt;br /&gt;
| 118 || OE&lt;br /&gt;
|-&lt;br /&gt;
| 120 || PCIe&lt;br /&gt;
|-&lt;br /&gt;
| 121 || Friends&lt;br /&gt;
|-&lt;br /&gt;
| 122 || BCAT&lt;br /&gt;
|-&lt;br /&gt;
| 123 || SSL&lt;br /&gt;
|-&lt;br /&gt;
| 124 || Account&lt;br /&gt;
|-&lt;br /&gt;
| 125 || News&lt;br /&gt;
|-&lt;br /&gt;
| 126 || Mii&lt;br /&gt;
|-&lt;br /&gt;
| 127 || NFC&lt;br /&gt;
|-&lt;br /&gt;
| 128 || AM&lt;br /&gt;
|-&lt;br /&gt;
| 129 || Play Report&lt;br /&gt;
|-&lt;br /&gt;
| 130 || AHID&lt;br /&gt;
|-&lt;br /&gt;
| 132 || Home Menu (Qlaunch)&lt;br /&gt;
|-&lt;br /&gt;
| 133 || PCV&lt;br /&gt;
|-&lt;br /&gt;
| 134 || OMM&lt;br /&gt;
|-&lt;br /&gt;
| 135 || BPC&lt;br /&gt;
|-&lt;br /&gt;
| 136 || PSM&lt;br /&gt;
|-&lt;br /&gt;
| 137 || NIM&lt;br /&gt;
|-&lt;br /&gt;
| 138 || PSC&lt;br /&gt;
|-&lt;br /&gt;
| 139 || TC&lt;br /&gt;
|-&lt;br /&gt;
| 140 || USB&lt;br /&gt;
|-&lt;br /&gt;
| 141 || NSD&lt;br /&gt;
|-&lt;br /&gt;
| 142 || PCTL&lt;br /&gt;
|-&lt;br /&gt;
| 143 || BTM&lt;br /&gt;
|-&lt;br /&gt;
| 144 || EC (Shop)&lt;br /&gt;
|-&lt;br /&gt;
| 145 || ETicket&lt;br /&gt;
|-&lt;br /&gt;
| 146 || NGC (Bad Words)&lt;br /&gt;
|-&lt;br /&gt;
| 147 || Error Report&lt;br /&gt;
|-&lt;br /&gt;
| 148 || APM&lt;br /&gt;
|-&lt;br /&gt;
| 150 || Profiler&lt;br /&gt;
|-&lt;br /&gt;
| 151 || Error Upload&lt;br /&gt;
|-&lt;br /&gt;
| 153 || Audio&lt;br /&gt;
|-&lt;br /&gt;
| 154 || NPNS&lt;br /&gt;
|-&lt;br /&gt;
| 155 || NPNS HTTP Stream&lt;br /&gt;
|-&lt;br /&gt;
| 157 || ARP&lt;br /&gt;
|-&lt;br /&gt;
| 158 || SWKBD&lt;br /&gt;
|-&lt;br /&gt;
| 159 || Boot&lt;br /&gt;
|-&lt;br /&gt;
| 161 || NFC Mifare&lt;br /&gt;
|-&lt;br /&gt;
| 162 || Userland assert&lt;br /&gt;
|-&lt;br /&gt;
| 163 || Fatal&lt;br /&gt;
|-&lt;br /&gt;
| 164 || NIM Shop&lt;br /&gt;
|-&lt;br /&gt;
| 165 || SPSM&lt;br /&gt;
|-&lt;br /&gt;
| 167 || BGTC&lt;br /&gt;
|-&lt;br /&gt;
| 168 || Userland crash&lt;br /&gt;
|-&lt;br /&gt;
| 180 || SREPO&lt;br /&gt;
|-&lt;br /&gt;
| 181 || Dauth&lt;br /&gt;
|-&lt;br /&gt;
| 202 || HID&lt;br /&gt;
|-&lt;br /&gt;
| 203 || LDN&lt;br /&gt;
|-&lt;br /&gt;
| 205 || Irsensor&lt;br /&gt;
|-&lt;br /&gt;
| 206 || Capture&lt;br /&gt;
|-&lt;br /&gt;
| 208 || Manu&lt;br /&gt;
|-&lt;br /&gt;
| 209 || ATK&lt;br /&gt;
|-&lt;br /&gt;
| 210 || Web&lt;br /&gt;
|-&lt;br /&gt;
| 211 ||&lt;br /&gt;
|-&lt;br /&gt;
| 212 || GRC&lt;br /&gt;
|-&lt;br /&gt;
| 216 || Migration&lt;br /&gt;
|-&lt;br /&gt;
| 217 || Migration Idc Server&lt;br /&gt;
|-&lt;br /&gt;
| 345 || libnx&lt;br /&gt;
|-&lt;br /&gt;
| 346 || [[Homebrew ABI]]&lt;br /&gt;
|-&lt;br /&gt;
| 347 || Homebrew Loader&lt;br /&gt;
|-&lt;br /&gt;
| 348 || libnx Nvidia errors&lt;br /&gt;
|-&lt;br /&gt;
| 800 || [[Internet_Browser|General web-applet]]&lt;br /&gt;
|-&lt;br /&gt;
| 809 || [[Internet_Browser|WifiWebAuthApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 810 || [[Internet_Browser|Whitelisted-applet]]&lt;br /&gt;
|-&lt;br /&gt;
| 811 || [[Internet_Browser|ShopN]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
8XX is for/includes system applets.&lt;br /&gt;
&lt;br /&gt;
= Error codes =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Module || Description || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C01 || 1 || 14 || Invalid kernel capability descriptor&lt;br /&gt;
|-&lt;br /&gt;
| 0x4201 || 1 || 33 || [[SPL_services#GetConfig|IsDebugMode]] isn&#039;t set.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8C01 || 1 || 70 || No more debug events&lt;br /&gt;
|-&lt;br /&gt;
| 0xCA01 || 1 || 101 || Invalid size&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC01 || 1 || 102 || Invalid address&lt;br /&gt;
|-&lt;br /&gt;
| 0xCE01 || 1 || 103 || Slabheap full&lt;br /&gt;
|-&lt;br /&gt;
| 0xD001 || 1 || 104 || Memory full&lt;br /&gt;
|-&lt;br /&gt;
| 0xD201 || 1 || 105 || Handle-table full.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD401 || 1 || 106 || Invalid memory state / invalid memory permissions.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD801 || 1 || 108 || Invalid memory permissions.&lt;br /&gt;
|-&lt;br /&gt;
| 0xDC01 || 1 || 110 || Invalid memory range&lt;br /&gt;
|-&lt;br /&gt;
| 0xE001 || 1 || 112 || Invalid thread priority.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE201 || 1 || 113 || Invalid processor id.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE401 || 1 || 114 || Invalid handle.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE601 || 1 || 115 || Syscall copy from user failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE801 || 1 || 116 || Invalid combination&lt;br /&gt;
|-&lt;br /&gt;
| 0xEA01 || 1 || 117 || Time out. Also when you give 0 handles to svcWaitSynchronizationN.&lt;br /&gt;
|-&lt;br /&gt;
| 0xEC01 || 1 || 118 || Canceled/interrupted [?]&lt;br /&gt;
|-&lt;br /&gt;
| 0xEE01 || 1 || 119 || Exceeding maximum&lt;br /&gt;
|-&lt;br /&gt;
| 0xF001 || 1 || 120 || Invalid enum&lt;br /&gt;
|-&lt;br /&gt;
| 0xF201 || 1 || 121 || No such entry&lt;br /&gt;
|-&lt;br /&gt;
| 0xF401 || 1 || 122 || Irq/DeviceAddressSpace/{...} already registered&lt;br /&gt;
|-&lt;br /&gt;
| 0xF601 || 1 || 123 || Port remote dead&lt;br /&gt;
|-&lt;br /&gt;
| 0xF801 || 1 || 124 || [Usermode] Unhandled interrupt&lt;br /&gt;
|-&lt;br /&gt;
| 0xFA01 || 1 || 125 || Wrong memory permission?&lt;br /&gt;
|-&lt;br /&gt;
| 0xFC01 || 1 || 126 || Reserved value&lt;br /&gt;
|-&lt;br /&gt;
| 0xFE01 || 1 || 127 || Invalid hardware breakpoint&lt;br /&gt;
|-&lt;br /&gt;
| 0x10001 || 1 || 128 || [Usermode] Fatal exception&lt;br /&gt;
|-&lt;br /&gt;
| 0x10201 || 1 || 129 || Last thread didn&#039;t belong to your process&lt;br /&gt;
|-&lt;br /&gt;
| 0x10601 || 1 || 131 || Port max sessions exceeded&lt;br /&gt;
|-&lt;br /&gt;
| 0x10801 || 1 || 132 || Resource limit exceeded&lt;br /&gt;
|-&lt;br /&gt;
| 0x20801 || 1 || 260 || Command buffer too small&lt;br /&gt;
|-&lt;br /&gt;
| 0x41001 || 1 || 520 || Process not being debugged&lt;br /&gt;
|-&lt;br /&gt;
| 0xE02 || 2 || 7 || Savedata [[Filesystem_services|already]] mounted&lt;br /&gt;
|-&lt;br /&gt;
| 0x7802 || 2 || 60 || The specified [[NCA]]-type doesn&#039;t exist for this title.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D202 || 2 || 1001 || Process does not have RomFs &lt;br /&gt;
|-&lt;br /&gt;
| 0x7D402 || 2 || 1002 || Title-id not found / savedata not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0xFA202 || 2 || 2001 || SD card not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x13B002 || 2 || 2520 || Gamecard not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x13DA02 || 2 || 2541 || Version check failed when mounting gamecard sysupdate partition?&lt;br /&gt;
|-&lt;br /&gt;
| 0x171402 || 2 || 2954 || Invalid gamecard handle.&lt;br /&gt;
|-&lt;br /&gt;
| 0x196002 || 2 || 3248 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x196202 || 2 || 3249 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A4A02 || 2 || 3365 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EEA02 || 1 || 6005 || Directory/file(?) already exists.&lt;br /&gt;
|-&lt;br /&gt;
| 0x235202 || 2 || 4521 || Invalid NCA Key index&lt;br /&gt;
|-&lt;br /&gt;
| 0x235E02 || 2 || 4527 || NCA-path used with the wrong titleID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x250E02 || 2 || 4743 || [[NAX0|Corrupted]] NAX0 header.&lt;br /&gt;
|-&lt;br /&gt;
| 0x251002 || 2 || 4744 || Invalid [[NAX0]] magicnum.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE202 || 2 || 6001 || Invalid input&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE602 || 2 || 6003 || Path too long&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EEA02 || 2 || 6005 || Directory/file(?) already exists.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5A02 || 2 || 6061 || Offset outside storage&lt;br /&gt;
|-&lt;br /&gt;
| 0x313802 || 2 || 6300 || Operation not supported&lt;br /&gt;
|-&lt;br /&gt;
| 0x320002 || 2 || 6400 || Permission denied&lt;br /&gt;
|-&lt;br /&gt;
| 0x326602 || 2 || 6451 || Missing titlekey(?) required to mount content&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EA03 || 3 || 501 || Invalid handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EE03 || 3 || 503 || Invalid memory mirror&lt;br /&gt;
|-&lt;br /&gt;
| 0x7FE03 || 3 || 1023 || TLS slot is not allocated&lt;br /&gt;
|-&lt;br /&gt;
| 0xA05 || 5 || 5 || [[Content_Manager_services|NcaID]] not found. Returned when attempting to mount titles which exist that aren&#039;t *8XX titles, the same way *8XX titles are mounted.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE05 || 5 || 7 || TitleId not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x1805 || 5 || 12 || Invalid StorageId&lt;br /&gt;
|-&lt;br /&gt;
| 0xDC05 || 5 || 110 || Gamecard not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x17C05 || 5 || 190 || Gamecard not initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F405 || 5 || 250 || Sdcard not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x20805 || 5 || 260 || Storage not mounted&lt;br /&gt;
|-&lt;br /&gt;
| 0x806 || 6 || 4 || Converted from error 0xD401&lt;br /&gt;
|-&lt;br /&gt;
| 0x1006 || 6 || 8 || Converted from error 0xE401&lt;br /&gt;
|-&lt;br /&gt;
| 0x408 || 8 || 2 || Program location entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x608 || 8 || 3 || Invalid context for control location&lt;br /&gt;
|-&lt;br /&gt;
| 0x808 || 8 || 4 || Storage not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xA08 || 8 || 5 || Access denied&lt;br /&gt;
|-&lt;br /&gt;
| 0xC08 || 8 || 6 || Offline manual HTML location entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xE08 || 8 || 7 || Title is not registered&lt;br /&gt;
|-&lt;br /&gt;
| 0x1008 || 8 || 8 || Control location entry for host not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x1208 || 8 || 9 || Legal info HTML location entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x209 || 9 || 1 || Args too long.&lt;br /&gt;
|-&lt;br /&gt;
| 0x409 || 9 || 2 || Maximum processes loaded.&lt;br /&gt;
|-&lt;br /&gt;
| 0x609 || 9 || 3 || NPDM too big.&lt;br /&gt;
|-&lt;br /&gt;
| 0x19009 || 9 || 200 || Invalid access control sizes in NPDM.&lt;br /&gt;
|-&lt;br /&gt;
| 0x809 || 9 || 4 || Invalid NPDM.&lt;br /&gt;
|-&lt;br /&gt;
| 0xA09 || 9 || 5 || Invalid files.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE09 || 9 || 7 || Already registered.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1009 || 9 || 8 || Title not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1209 || 9 || 9 || Title-id in ACI0 doesn&#039;t match range in ACID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6609 || 9 || 51 || Invalid memory state/permission&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A09 || 9 || 53 || Invalid NRR&lt;br /&gt;
|-&lt;br /&gt;
| 0xA209 || 9 || 81 || Unaligned NRR address&lt;br /&gt;
|-&lt;br /&gt;
| 0xA409 || 9 || 82 || Bad NRR size&lt;br /&gt;
|-&lt;br /&gt;
| 0xAA09 || 9 || 85 || Bad NRR address&lt;br /&gt;
|-&lt;br /&gt;
| 0xAE09 || 9 || 87 || Bad initialization&lt;br /&gt;
|-&lt;br /&gt;
| 0xC809 || 9 || 100 || Unknown ACI0 descriptor&lt;br /&gt;
|-&lt;br /&gt;
| 0xCE09 || 9 || 103 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;KernelFlags&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xD009 || 9 || 104 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;SyscallMask&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xD409 || 9 || 106 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;MapIoOrNormalRange&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xD609 || 9 || 107 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;MapNormalPage&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xDE09 || 9 || 111 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;InterruptPair&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE209 || 9 || 113 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;ApplicationType&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE409 || 9 || 114 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;KernelReleaseVersion&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE609 || 9 || 115 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;HandleTableSize&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE809 || 9 || 116 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;DebugFlags&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A80A || 10 || 212 || Bad magic (expected &#039;SFCO&#039;)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20B || 11 || 1 || Size too big to fit to marshal.&lt;br /&gt;
|-&lt;br /&gt;
| 0x11A0B || 11 || 141 || Went past maximum during marshalling.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1900B || 11 || 200 || Session doesn&#039;t support domains.&lt;br /&gt;
|-&lt;br /&gt;
| 0x25A0B || 11 || 301 || Remote process is dead.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D60B || 11 || 491 || IPC Query 1 failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20F || 15 || 1 || Pid not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x60F || 15 || 3 || Process has no pending events&lt;br /&gt;
|-&lt;br /&gt;
| 0xA0F || 15 || 5 || Application already running&lt;br /&gt;
|-&lt;br /&gt;
| 0x410 || 16 || 2 || Title-id not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xF010 || 16 || 120 || Gamecard sysupdate not required&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F610 || 16 || 251 || Unexpected StorageId&lt;br /&gt;
|-&lt;br /&gt;
| 0x415 || 21 || 2 || Not initialized.&lt;br /&gt;
|-&lt;br /&gt;
| 0x615 || 21 || 3 || Max sessions&lt;br /&gt;
|-&lt;br /&gt;
| 0xC15 || 21 || 6 || Invalid name (all zeroes)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1015 || 21 || 8 || Permission denied&lt;br /&gt;
|-&lt;br /&gt;
| 0x416 || 22 || 2 || Address space is full&lt;br /&gt;
|-&lt;br /&gt;
| 0x616 || 22 || 3 || NRO already loaded&lt;br /&gt;
|-&lt;br /&gt;
| 0x816 || 22 || 4 || Invalid NRO header values&lt;br /&gt;
|-&lt;br /&gt;
| 0xC16 || 22 || 6 || Bad NRR magic&lt;br /&gt;
|-&lt;br /&gt;
| 0x1016 || 22 || 8 || Reached max NRR count&lt;br /&gt;
|-&lt;br /&gt;
| 0x1216 || 22 || 9 || Unable to verify NRO hash or NRR signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x80216 || 22 || 1025 || Address not page-aligned&lt;br /&gt;
|-&lt;br /&gt;
| 0x80416 || 22 || 1026 || Incorrect NRO size&lt;br /&gt;
|-&lt;br /&gt;
| 0x80816 || 22 || 1028 || NRO not loaded&lt;br /&gt;
|-&lt;br /&gt;
| 0x80A16 || 22 || 1029 || NRR not loaded&lt;br /&gt;
|-&lt;br /&gt;
| 0x80C16 || 22 || 1030 || Already initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x80E16 || 22 || 1031 || Not initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x41A || 26 || 2 || Argument is invalid&lt;br /&gt;
|-&lt;br /&gt;
| 0xC81A || 26 || 100 || Incorrect buffer size&lt;br /&gt;
|-&lt;br /&gt;
| 0xCA1A || 26 || 101 || Unknown TZ error&lt;br /&gt;
|-&lt;br /&gt;
| 0xD01A || 26 || 104 || All AES engines busy&lt;br /&gt;
|-&lt;br /&gt;
| 0xD21A || 26 || 105 || Invalid AES engine-id&lt;br /&gt;
|-&lt;br /&gt;
| 0x272 || 114 || 1 || Generic error&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC74 || 116 || 102 || Time not set&lt;br /&gt;
|-&lt;br /&gt;
| 0x287C || 124 || 20 || Argument is NULL&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C7C || 124 || 22 || Argument is invalid&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C7C || 124 || 30 || Bad input buffer size&lt;br /&gt;
|-&lt;br /&gt;
| 0x407C || 124 || 32 || Invalid input buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A880 || 128 || 500 || &amp;lt;code&amp;gt;am.debug!dev_function&amp;lt;/code&amp;gt; setting needs to be set&lt;br /&gt;
|-&lt;br /&gt;
| 0x3CF089 || 137 || 7800 || Unknown/invalid libcurl error.&lt;br /&gt;
|-&lt;br /&gt;
| 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.&lt;br /&gt;
|-&lt;br /&gt;
| 0x668C || 140 || 51 || USB data-transfer in progress&lt;br /&gt;
|-&lt;br /&gt;
| 0xD48C || 140 || 106 || Invalid descriptor&lt;br /&gt;
|-&lt;br /&gt;
| 0x1928C || 140 || 201 || USB device not bound / interface already enabled&lt;br /&gt;
|-&lt;br /&gt;
| 0x299 || 153 || 1 || Invalid audio device&lt;br /&gt;
|-&lt;br /&gt;
| 0x499 || 153 || 2 || Invalid buffer address&lt;br /&gt;
|-&lt;br /&gt;
| 0x699 || 153 || 3 || Invalid sample rate&lt;br /&gt;
|-&lt;br /&gt;
| 0x1499 || 153 || 10 || Invalid channel count&lt;br /&gt;
|-&lt;br /&gt;
| 0xC0899 || 153 || 1540 || Audio output was already started&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C9D || 157 || 30 || Address is NULL&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E9D || 157 || 31 || PID is NULL&lt;br /&gt;
|-&lt;br /&gt;
| 0x549D || 157 || 42 || Already bound&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC9D || 157 || 102 || Invalid PID&lt;br /&gt;
|-&lt;br /&gt;
| 0x35B || 347 || 1 || Failed to init SM.&lt;br /&gt;
|-&lt;br /&gt;
| 0x55B || 347 || 2 || Failed to init FS.&lt;br /&gt;
|-&lt;br /&gt;
| 0x75B || 347 || 3 || Failed to to open NRO file. May also happen when SD card isn&#039;t inserted / SD mounting failed earlier.&lt;br /&gt;
|-&lt;br /&gt;
| 0x95B || 347 || 4 || Failed to read NRO header.&lt;br /&gt;
|-&lt;br /&gt;
| 0xB5B || 347 || 5 || Invalid NRO magic.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD5B || 347 || 6 || Invalid NRO segments.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF5B || 347 || 7 || Failed to read NRO.&lt;br /&gt;
|-&lt;br /&gt;
| 0x135B || 347 || 9 || Failed to allocate heap.&lt;br /&gt;
|-&lt;br /&gt;
| 0x255B || 347 || 18 || Failed to map code-binary memory.&lt;br /&gt;
|-&lt;br /&gt;
| 0x275B || 347 || 19 || Failed to map code memory (.text).&lt;br /&gt;
|-&lt;br /&gt;
| 0x295B || 347 || 20 || Failed to map code memory (.rodata).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B5B || 347 || 21 || Failed to map code memory (.data+.bss).&lt;br /&gt;
|-&lt;br /&gt;
| 0x315B || 347 || 24 || Failed to unmap code memory (.text).&lt;br /&gt;
|-&lt;br /&gt;
| 0x335B || 347 || 25 || Failed to unmap code memory (.rodata).&lt;br /&gt;
|-&lt;br /&gt;
| 0x355B || 347 || 26 || Failed to unmap code memory (.data+.bss).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== FS Error Codes ==&lt;br /&gt;
The following are the error codes recognized by nn::fs::detail::LogErrorMessage found in some [[Factory Setup|factory]] titles:&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Description || Message&lt;br /&gt;
|-&lt;br /&gt;
| 0x7802 || 60 || Error: Specified mount name already exists.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD401 || 106 || Error: Passed buffer is not usable for fs library.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D202 || 1001 || Error: Specified partition is not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D402 || 1002 || Error: Specified target is not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0xFA002 - 0x138602 || 2000 - 2499 || Error: Failed to access SD card.&lt;br /&gt;
|-&lt;br /&gt;
| 0x136802 - 0x176E02 || 2500 - 2999 || Error: Failed to access game card.&lt;br /&gt;
|-&lt;br /&gt;
| 0x177202 || 3001 || Error: Specified operation is not implemented.&lt;br /&gt;
|-&lt;br /&gt;
| 0x177A02 || 3005 || Error: Specified value is out of range.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B5802 - 0x1F3E02 || 3500 - 3999 || Error: Failed to access MMC.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F4202 - 0x219602 || 4001 - 4299 || Error: ROM is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x219A02 - 0x232602 || 4301 - 4499 || Error: Save data is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x232A02 - 0x23EE02 || 4501 - 4599 || Error: NCA is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x23F202 - 0x243E02 || 4601 - 4639 || Error: Integrity verification failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x244202 - 0x246602 || 4641 - 4659 || Error: Partition FS is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x246A02 - 0x248E02 || 4661 - 4679 || Error: Built-in-storage is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x249202 - 0x24B602 || 4681 - 4699 || Error: FAT FS is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24BA02 - 0x24DE02 || 4701 - 4719 || Error: HOST FS is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F4002 - 0x270E02 || 4000, 4300, 4500, 4600, 4640, 4660, 4680, 4700, 4720-4999 || Error: Data is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x271002 - 0x2EDE02 || 5000-5999 || Error: Unexpected failure occurred.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE402 - 0x2F1A02 || 6002-6029 || Error: Invalid path was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5A02 || 6061 || Error: Invalid offset was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5C02 || 6062 || Error: Invalid size was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5E02 || 6063 || Error: Null pointer argument was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE002 || 6000 || Error: Precondition violation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE202 - 0x306E02 || 6001-6199 || Error: Invalid argument was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x307202 || 6201 || Error: OpenMode_AllowAppend is required for implicit extension of file size by WriteFile().&lt;br /&gt;
|-&lt;br /&gt;
| 0x307002 - 0x313602 || 6200, 6202 - 6299 || Error: Invalid operation for the open mode.&lt;br /&gt;
|-&lt;br /&gt;
| 0x313802 - 0x31FE02 || 6300-6399 || Error: Unsupported operation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x320002 - 0x32C602 || 6400-6499 || Error: Permission denied.&lt;br /&gt;
|-&lt;br /&gt;
| 0x346402 || 6706 || Error: Enough journal space is not left.&lt;br /&gt;
|-&lt;br /&gt;
| 0x346A02 || 6709 || Error: The open count of files and directories reached the limitation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Fatal Errors =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Error || Description&lt;br /&gt;
|-&lt;br /&gt;
| 2162-0002&lt;br /&gt;
| Can be triggered by running [[SVC|svcBreak]]. The svcBreak params have no affect on the value of the thrown error-code.&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0000&lt;br /&gt;
| Userland ARM undefined instruction exception&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0001&lt;br /&gt;
| Userland ARM prefetch-abort due to PC set to non-executable region&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0002&lt;br /&gt;
| 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.&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0003&lt;br /&gt;
| Userland PC address not aligned to 4 bytes&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0008&lt;br /&gt;
| Can occur when attempting to call an svc outside the whitelist&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Support Errors =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Error || Module || Description || Notes&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| {web-applets listed above}&lt;br /&gt;
| 2750&lt;br /&gt;
| MP4 parsing failed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Normal error-codes displayed by the system also use the same format as fatal-errors.&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Error_codes&amp;diff=4831</id>
		<title>Error codes</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Error_codes&amp;diff=4831"/>
		<updated>2018-07-15T01:58:42Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Wrong location&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Structure =&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Field&lt;br /&gt;
|-&lt;br /&gt;
| 8-0 || Module&lt;br /&gt;
|-&lt;br /&gt;
| 21-9 || Description&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When a fatal-error is received the error code is outputted using the following formatter:&lt;br /&gt;
  %04d-%04d&lt;br /&gt;
&lt;br /&gt;
.. where the first code is &amp;lt;code&amp;gt;2000 + Module&amp;lt;/code&amp;gt;, and the other being &amp;lt;code&amp;gt;Description&amp;lt;/code&amp;gt;. Bits &amp;gt;=22 from the error-code are unused when displaying fatal-errors, since the Description ends with bit21.&lt;br /&gt;
&lt;br /&gt;
= Modules =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Kernel&lt;br /&gt;
|-&lt;br /&gt;
| 2 || FS&lt;br /&gt;
|-&lt;br /&gt;
| 3 || OS (Memory, Thread, Mutex, NVIDIA)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || HTCS&lt;br /&gt;
|-&lt;br /&gt;
| 5 || NCM&lt;br /&gt;
|-&lt;br /&gt;
| 6 || DD&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Debug Monitor&lt;br /&gt;
|-&lt;br /&gt;
| 8 || LR&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Loader&lt;br /&gt;
|-&lt;br /&gt;
| 10 || CMIF (IPC command interface)&lt;br /&gt;
|-&lt;br /&gt;
| 11 || HIPC (IPC)&lt;br /&gt;
|-&lt;br /&gt;
| 15 || PM&lt;br /&gt;
|-&lt;br /&gt;
| 16 || NS&lt;br /&gt;
|-&lt;br /&gt;
| 17 || Sockets&lt;br /&gt;
|-&lt;br /&gt;
| 18 || HTC&lt;br /&gt;
|-&lt;br /&gt;
| 20 || NCM Content&lt;br /&gt;
|-&lt;br /&gt;
| 21 || SM&lt;br /&gt;
|-&lt;br /&gt;
| 22 || RO userland&lt;br /&gt;
|-&lt;br /&gt;
| 24 || SDMMC&lt;br /&gt;
|-&lt;br /&gt;
| 25 || OVLN&lt;br /&gt;
|-&lt;br /&gt;
| 26 || SPL&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ETHC&lt;br /&gt;
|-&lt;br /&gt;
| 101 || I2C&lt;br /&gt;
|-&lt;br /&gt;
| 102 || GPIO&lt;br /&gt;
|-&lt;br /&gt;
| 103 || UART&lt;br /&gt;
|-&lt;br /&gt;
| 105 || Settings&lt;br /&gt;
|-&lt;br /&gt;
| 107 || WLAN&lt;br /&gt;
|-&lt;br /&gt;
| 108 || XCD&lt;br /&gt;
|-&lt;br /&gt;
| 110 || NIFM&lt;br /&gt;
|-&lt;br /&gt;
| 111 || Hwopus&lt;br /&gt;
|-&lt;br /&gt;
| 113 || Bluetooth&lt;br /&gt;
|-&lt;br /&gt;
| 114 || VI&lt;br /&gt;
|-&lt;br /&gt;
| 115 || NFP&lt;br /&gt;
|-&lt;br /&gt;
| 116 || Time&lt;br /&gt;
|-&lt;br /&gt;
| 117 || FGM&lt;br /&gt;
|-&lt;br /&gt;
| 118 || OE&lt;br /&gt;
|-&lt;br /&gt;
| 120 || PCIe&lt;br /&gt;
|-&lt;br /&gt;
| 121 || Friends&lt;br /&gt;
|-&lt;br /&gt;
| 122 || BCAT&lt;br /&gt;
|-&lt;br /&gt;
| 123 || SSL&lt;br /&gt;
|-&lt;br /&gt;
| 124 || Account&lt;br /&gt;
|-&lt;br /&gt;
| 125 || News&lt;br /&gt;
|-&lt;br /&gt;
| 126 || Mii&lt;br /&gt;
|-&lt;br /&gt;
| 127 || NFC&lt;br /&gt;
|-&lt;br /&gt;
| 128 || AM&lt;br /&gt;
|-&lt;br /&gt;
| 129 || Play Report&lt;br /&gt;
|-&lt;br /&gt;
| 130 || AHID&lt;br /&gt;
|-&lt;br /&gt;
| 132 || Home Menu (Qlaunch)&lt;br /&gt;
|-&lt;br /&gt;
| 133 || PCV&lt;br /&gt;
|-&lt;br /&gt;
| 134 || OMM&lt;br /&gt;
|-&lt;br /&gt;
| 135 || BPC&lt;br /&gt;
|-&lt;br /&gt;
| 136 || PSM&lt;br /&gt;
|-&lt;br /&gt;
| 137 || NIM&lt;br /&gt;
|-&lt;br /&gt;
| 138 || PSC&lt;br /&gt;
|-&lt;br /&gt;
| 139 || TC&lt;br /&gt;
|-&lt;br /&gt;
| 140 || USB&lt;br /&gt;
|-&lt;br /&gt;
| 141 || NSD&lt;br /&gt;
|-&lt;br /&gt;
| 142 || PCTL&lt;br /&gt;
|-&lt;br /&gt;
| 143 || BTM&lt;br /&gt;
|-&lt;br /&gt;
| 144 || EC (Shop)&lt;br /&gt;
|-&lt;br /&gt;
| 145 || ETicket&lt;br /&gt;
|-&lt;br /&gt;
| 146 || NGC (Bad Words)&lt;br /&gt;
|-&lt;br /&gt;
| 147 || Error Report&lt;br /&gt;
|-&lt;br /&gt;
| 148 || APM&lt;br /&gt;
|-&lt;br /&gt;
| 150 || Profiler&lt;br /&gt;
|-&lt;br /&gt;
| 151 || Error Upload&lt;br /&gt;
|-&lt;br /&gt;
| 153 || Audio&lt;br /&gt;
|-&lt;br /&gt;
| 154 || NPNS&lt;br /&gt;
|-&lt;br /&gt;
| 155 || NPNS HTTP Stream&lt;br /&gt;
|-&lt;br /&gt;
| 157 || ARP&lt;br /&gt;
|-&lt;br /&gt;
| 158 || SWKBD&lt;br /&gt;
|-&lt;br /&gt;
| 159 || Boot&lt;br /&gt;
|-&lt;br /&gt;
| 161 || NFC Mifare&lt;br /&gt;
|-&lt;br /&gt;
| 162 || Userland assert&lt;br /&gt;
|-&lt;br /&gt;
| 163 || Fatal&lt;br /&gt;
|-&lt;br /&gt;
| 164 || NIM Shop&lt;br /&gt;
|-&lt;br /&gt;
| 165 || SPSM&lt;br /&gt;
|-&lt;br /&gt;
| 167 || BGTC&lt;br /&gt;
|-&lt;br /&gt;
| 168 || Userland crash&lt;br /&gt;
|-&lt;br /&gt;
| 180 || SREPO&lt;br /&gt;
|-&lt;br /&gt;
| 181 || Dauth&lt;br /&gt;
|-&lt;br /&gt;
| 202 || HID&lt;br /&gt;
|-&lt;br /&gt;
| 203 || LDN&lt;br /&gt;
|-&lt;br /&gt;
| 205 || Irsensor&lt;br /&gt;
|-&lt;br /&gt;
| 206 || Capture&lt;br /&gt;
|-&lt;br /&gt;
| 208 || Manu&lt;br /&gt;
|-&lt;br /&gt;
| 209 || ATK&lt;br /&gt;
|-&lt;br /&gt;
| 210 || Web&lt;br /&gt;
|-&lt;br /&gt;
| 211 ||&lt;br /&gt;
|-&lt;br /&gt;
| 212 || GRC&lt;br /&gt;
|-&lt;br /&gt;
| 216 || Migration&lt;br /&gt;
|-&lt;br /&gt;
| 217 || Migration Idc Server&lt;br /&gt;
|-&lt;br /&gt;
| 345 || libnx&lt;br /&gt;
|-&lt;br /&gt;
| 346 || [[Homebrew ABI]]&lt;br /&gt;
|-&lt;br /&gt;
| 347 || Homebrew Loader&lt;br /&gt;
|-&lt;br /&gt;
| 348 || libnx Nvidia errors&lt;br /&gt;
|-&lt;br /&gt;
| 800 || [[Internet_Browser|General web-applet]]&lt;br /&gt;
|-&lt;br /&gt;
| 809 || [[Internet_Browser|WifiWebAuthApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 810 || [[Internet_Browser|Whitelisted-applet]]&lt;br /&gt;
|-&lt;br /&gt;
| 811 || [[Internet_Browser|ShopN]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
8XX is for/includes system applets.&lt;br /&gt;
&lt;br /&gt;
= Error codes =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Module || Description || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C01 || 1 || 14 || Invalid kernel capability descriptor&lt;br /&gt;
|-&lt;br /&gt;
| 0x4201 || 1 || 33 || [[SPL_services#GetConfig|IsDebugMode]] isn&#039;t set.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8C01 || 1 || 70 || No more debug events&lt;br /&gt;
|-&lt;br /&gt;
| 0xCA01 || 1 || 101 || Invalid size&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC01 || 1 || 102 || Invalid address&lt;br /&gt;
|-&lt;br /&gt;
| 0xCE01 || 1 || 103 || Slabheap full&lt;br /&gt;
|-&lt;br /&gt;
| 0xD001 || 1 || 104 || Memory full&lt;br /&gt;
|-&lt;br /&gt;
| 0xD201 || 1 || 105 || Handle-table full.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD401 || 1 || 106 || Invalid memory state / invalid memory permissions.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD801 || 1 || 108 || Invalid memory permissions.&lt;br /&gt;
|-&lt;br /&gt;
| 0xDC01 || 1 || 110 || Invalid memory range&lt;br /&gt;
|-&lt;br /&gt;
| 0xE001 || 1 || 112 || Invalid thread priority.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE201 || 1 || 113 || Invalid processor id.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE401 || 1 || 114 || Invalid handle.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE601 || 1 || 115 || Syscall copy from user failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE801 || 1 || 116 || Invalid combination&lt;br /&gt;
|-&lt;br /&gt;
| 0xEA01 || 1 || 117 || Time out. Also when you give 0 handles to svcWaitSynchronizationN.&lt;br /&gt;
|-&lt;br /&gt;
| 0xEC01 || 1 || 118 || Canceled/interrupted [?]&lt;br /&gt;
|-&lt;br /&gt;
| 0xEE01 || 1 || 119 || Exceeding maximum&lt;br /&gt;
|-&lt;br /&gt;
| 0xF001 || 1 || 120 || Invalid enum&lt;br /&gt;
|-&lt;br /&gt;
| 0xF201 || 1 || 121 || No such entry&lt;br /&gt;
|-&lt;br /&gt;
| 0xF401 || 1 || 122 || Irq/DeviceAddressSpace/{...} already registered&lt;br /&gt;
|-&lt;br /&gt;
| 0xF601 || 1 || 123 || Port remote dead&lt;br /&gt;
|-&lt;br /&gt;
| 0xF801 || 1 || 124 || [Usermode] Unhandled interrupt&lt;br /&gt;
|-&lt;br /&gt;
| 0xFA01 || 1 || 125 || Wrong memory permission?&lt;br /&gt;
|-&lt;br /&gt;
| 0xFC01 || 1 || 126 || Reserved value&lt;br /&gt;
|-&lt;br /&gt;
| 0xFE01 || 1 || 127 || Invalid hardware breakpoint&lt;br /&gt;
|-&lt;br /&gt;
| 0x10001 || 1 || 128 || [Usermode] Fatal exception&lt;br /&gt;
|-&lt;br /&gt;
| 0x10201 || 1 || 129 || Last thread didn&#039;t belong to your process&lt;br /&gt;
|-&lt;br /&gt;
| 0x10601 || 1 || 131 || Port max sessions exceeded&lt;br /&gt;
|-&lt;br /&gt;
| 0x10801 || 1 || 132 || Resource limit exceeded&lt;br /&gt;
|-&lt;br /&gt;
| 0x20801 || 1 || 260 || Command buffer too small&lt;br /&gt;
|-&lt;br /&gt;
| 0x41001 || 1 || 520 || Process not being debugged&lt;br /&gt;
|-&lt;br /&gt;
| 0xE02 || 2 || 7 || Savedata [[Filesystem_services|already]] mounted&lt;br /&gt;
|-&lt;br /&gt;
| 0x7802 || 2 || 60 || The specified [[NCA]]-type doesn&#039;t exist for this title.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D202 || 2 || 1001 || Process does not have RomFs &lt;br /&gt;
|-&lt;br /&gt;
| 0x7D402 || 2 || 1002 || Title-id not found / savedata not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0xFA202 || 2 || 2001 || SD card not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x13B002 || 2 || 2520 || Gamecard not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x13DA02 || 2 || 2541 || Version check failed when mounting gamecard sysupdate partition?&lt;br /&gt;
|-&lt;br /&gt;
| 0x171402 || 2 || 2954 || Invalid gamecard handle.&lt;br /&gt;
|-&lt;br /&gt;
| 0x196002 || 2 || 3248 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x196202 || 2 || 3249 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A4A02 || 2 || 3365 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EEA02 || 1 || 6005 || Directory/file(?) already exists.&lt;br /&gt;
|-&lt;br /&gt;
| 0x235202 || 2 || 4521 || Invalid NCA Key index&lt;br /&gt;
|-&lt;br /&gt;
| 0x235E02 || 2 || 4527 || NCA-path used with the wrong titleID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x250E02 || 2 || 4743 || [[NAX0|Corrupted]] NAX0 header.&lt;br /&gt;
|-&lt;br /&gt;
| 0x251002 || 2 || 4744 || Invalid [[NAX0]] magicnum.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE202 || 2 || 6001 || Invalid input&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE602 || 2 || 6003 || Path too long&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5A02 || 2 || 6061 || Offset outside storage&lt;br /&gt;
|-&lt;br /&gt;
| 0x313802 || 2 || 6300 || Operation not supported&lt;br /&gt;
|-&lt;br /&gt;
| 0x320002 || 2 || 6400 || Permission denied&lt;br /&gt;
|-&lt;br /&gt;
| 0x326602 || 2 || 6451 || Missing titlekey(?) required to mount content&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EA03 || 3 || 501 || Invalid handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EE03 || 3 || 503 || Invalid memory mirror&lt;br /&gt;
|-&lt;br /&gt;
| 0x7FE03 || 3 || 1023 || TLS slot is not allocated&lt;br /&gt;
|-&lt;br /&gt;
| 0xA05 || 5 || 5 || [[Content_Manager_services|NcaID]] not found. Returned when attempting to mount titles which exist that aren&#039;t *8XX titles, the same way *8XX titles are mounted.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE05 || 5 || 7 || TitleId not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x1805 || 5 || 12 || Invalid StorageId&lt;br /&gt;
|-&lt;br /&gt;
| 0xDC05 || 5 || 110 || Gamecard not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x17C05 || 5 || 190 || Gamecard not initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F405 || 5 || 250 || Sdcard not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x20805 || 5 || 260 || Storage not mounted&lt;br /&gt;
|-&lt;br /&gt;
| 0x806 || 6 || 4 || Converted from error 0xD401&lt;br /&gt;
|-&lt;br /&gt;
| 0x1006 || 6 || 8 || Converted from error 0xE401&lt;br /&gt;
|-&lt;br /&gt;
| 0x408 || 8 || 2 || Program location entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x608 || 8 || 3 || Invalid context for control location&lt;br /&gt;
|-&lt;br /&gt;
| 0x808 || 8 || 4 || Storage not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xA08 || 8 || 5 || Access denied&lt;br /&gt;
|-&lt;br /&gt;
| 0xC08 || 8 || 6 || Offline manual HTML location entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xE08 || 8 || 7 || Title is not registered&lt;br /&gt;
|-&lt;br /&gt;
| 0x1008 || 8 || 8 || Control location entry for host not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x1208 || 8 || 9 || Legal info HTML location entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x209 || 9 || 1 || Args too long.&lt;br /&gt;
|-&lt;br /&gt;
| 0x409 || 9 || 2 || Maximum processes loaded.&lt;br /&gt;
|-&lt;br /&gt;
| 0x609 || 9 || 3 || NPDM too big.&lt;br /&gt;
|-&lt;br /&gt;
| 0x19009 || 9 || 200 || Invalid access control sizes in NPDM.&lt;br /&gt;
|-&lt;br /&gt;
| 0x809 || 9 || 4 || Invalid NPDM.&lt;br /&gt;
|-&lt;br /&gt;
| 0xA09 || 9 || 5 || Invalid files.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE09 || 9 || 7 || Already registered.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1009 || 9 || 8 || Title not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1209 || 9 || 9 || Title-id in ACI0 doesn&#039;t match range in ACID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6609 || 9 || 51 || Invalid memory state/permission&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A09 || 9 || 53 || Invalid NRR&lt;br /&gt;
|-&lt;br /&gt;
| 0xA209 || 9 || 81 || Unaligned NRR address&lt;br /&gt;
|-&lt;br /&gt;
| 0xA409 || 9 || 82 || Bad NRR size&lt;br /&gt;
|-&lt;br /&gt;
| 0xAA09 || 9 || 85 || Bad NRR address&lt;br /&gt;
|-&lt;br /&gt;
| 0xAE09 || 9 || 87 || Bad initialization&lt;br /&gt;
|-&lt;br /&gt;
| 0xC809 || 9 || 100 || Unknown ACI0 descriptor&lt;br /&gt;
|-&lt;br /&gt;
| 0xCE09 || 9 || 103 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;KernelFlags&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xD009 || 9 || 104 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;SyscallMask&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xD409 || 9 || 106 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;MapIoOrNormalRange&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xD609 || 9 || 107 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;MapNormalPage&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xDE09 || 9 || 111 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;InterruptPair&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE209 || 9 || 113 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;ApplicationType&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE409 || 9 || 114 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;KernelReleaseVersion&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE609 || 9 || 115 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;HandleTableSize&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE809 || 9 || 116 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;DebugFlags&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A80A || 10 || 212 || Bad magic (expected &#039;SFCO&#039;)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20B || 11 || 1 || Size too big to fit to marshal.&lt;br /&gt;
|-&lt;br /&gt;
| 0x11A0B || 11 || 141 || Went past maximum during marshalling.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1900B || 11 || 200 || Session doesn&#039;t support domains.&lt;br /&gt;
|-&lt;br /&gt;
| 0x25A0B || 11 || 301 || Remote process is dead.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D60B || 11 || 491 || IPC Query 1 failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20F || 15 || 1 || Pid not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x60F || 15 || 3 || Process has no pending events&lt;br /&gt;
|-&lt;br /&gt;
| 0xA0F || 15 || 5 || Application already running&lt;br /&gt;
|-&lt;br /&gt;
| 0x410 || 16 || 2 || Title-id not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xF010 || 16 || 120 || Gamecard sysupdate not required&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F610 || 16 || 251 || Unexpected StorageId&lt;br /&gt;
|-&lt;br /&gt;
| 0x415 || 21 || 2 || Not initialized.&lt;br /&gt;
|-&lt;br /&gt;
| 0x615 || 21 || 3 || Max sessions&lt;br /&gt;
|-&lt;br /&gt;
| 0xC15 || 21 || 6 || Invalid name (all zeroes)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1015 || 21 || 8 || Permission denied&lt;br /&gt;
|-&lt;br /&gt;
| 0x416 || 22 || 2 || Address space is full&lt;br /&gt;
|-&lt;br /&gt;
| 0x616 || 22 || 3 || NRO already loaded&lt;br /&gt;
|-&lt;br /&gt;
| 0x816 || 22 || 4 || Invalid NRO header values&lt;br /&gt;
|-&lt;br /&gt;
| 0xC16 || 22 || 6 || Bad NRR magic&lt;br /&gt;
|-&lt;br /&gt;
| 0x1016 || 22 || 8 || Reached max NRR count&lt;br /&gt;
|-&lt;br /&gt;
| 0x1216 || 22 || 9 || Unable to verify NRO hash or NRR signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x80216 || 22 || 1025 || Address not page-aligned&lt;br /&gt;
|-&lt;br /&gt;
| 0x80416 || 22 || 1026 || Incorrect NRO size&lt;br /&gt;
|-&lt;br /&gt;
| 0x80816 || 22 || 1028 || NRO not loaded&lt;br /&gt;
|-&lt;br /&gt;
| 0x80A16 || 22 || 1029 || NRR not loaded&lt;br /&gt;
|-&lt;br /&gt;
| 0x80C16 || 22 || 1030 || Already initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x80E16 || 22 || 1031 || Not initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x41A || 26 || 2 || Argument is invalid&lt;br /&gt;
|-&lt;br /&gt;
| 0xC81A || 26 || 100 || Incorrect buffer size&lt;br /&gt;
|-&lt;br /&gt;
| 0xCA1A || 26 || 101 || Unknown TZ error&lt;br /&gt;
|-&lt;br /&gt;
| 0xD01A || 26 || 104 || All AES engines busy&lt;br /&gt;
|-&lt;br /&gt;
| 0xD21A || 26 || 105 || Invalid AES engine-id&lt;br /&gt;
|-&lt;br /&gt;
| 0x272 || 114 || 1 || Generic error&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC74 || 116 || 102 || Time not set&lt;br /&gt;
|-&lt;br /&gt;
| 0x287C || 124 || 20 || Argument is NULL&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C7C || 124 || 22 || Argument is invalid&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C7C || 124 || 30 || Bad input buffer size&lt;br /&gt;
|-&lt;br /&gt;
| 0x407C || 124 || 32 || Invalid input buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A880 || 128 || 500 || &amp;lt;code&amp;gt;am.debug!dev_function&amp;lt;/code&amp;gt; setting needs to be set&lt;br /&gt;
|-&lt;br /&gt;
| 0x3CF089 || 137 || 7800 || Unknown/invalid libcurl error.&lt;br /&gt;
|-&lt;br /&gt;
| 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.&lt;br /&gt;
|-&lt;br /&gt;
| 0x668C || 140 || 51 || USB data-transfer in progress&lt;br /&gt;
|-&lt;br /&gt;
| 0xD48C || 140 || 106 || Invalid descriptor&lt;br /&gt;
|-&lt;br /&gt;
| 0x1928C || 140 || 201 || USB device not bound / interface already enabled&lt;br /&gt;
|-&lt;br /&gt;
| 0x299 || 153 || 1 || Invalid audio device&lt;br /&gt;
|-&lt;br /&gt;
| 0x499 || 153 || 2 || Invalid buffer address&lt;br /&gt;
|-&lt;br /&gt;
| 0x699 || 153 || 3 || Invalid sample rate&lt;br /&gt;
|-&lt;br /&gt;
| 0x1499 || 153 || 10 || Invalid channel count&lt;br /&gt;
|-&lt;br /&gt;
| 0xC0899 || 153 || 1540 || Audio output was already started&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C9D || 157 || 30 || Address is NULL&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E9D || 157 || 31 || PID is NULL&lt;br /&gt;
|-&lt;br /&gt;
| 0x549D || 157 || 42 || Already bound&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC9D || 157 || 102 || Invalid PID&lt;br /&gt;
|-&lt;br /&gt;
| 0x35B || 347 || 1 || Failed to init SM.&lt;br /&gt;
|-&lt;br /&gt;
| 0x55B || 347 || 2 || Failed to init FS.&lt;br /&gt;
|-&lt;br /&gt;
| 0x75B || 347 || 3 || Failed to to open NRO file. May also happen when SD card isn&#039;t inserted / SD mounting failed earlier.&lt;br /&gt;
|-&lt;br /&gt;
| 0x95B || 347 || 4 || Failed to read NRO header.&lt;br /&gt;
|-&lt;br /&gt;
| 0xB5B || 347 || 5 || Invalid NRO magic.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD5B || 347 || 6 || Invalid NRO segments.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF5B || 347 || 7 || Failed to read NRO.&lt;br /&gt;
|-&lt;br /&gt;
| 0x135B || 347 || 9 || Failed to allocate heap.&lt;br /&gt;
|-&lt;br /&gt;
| 0x255B || 347 || 18 || Failed to map code-binary memory.&lt;br /&gt;
|-&lt;br /&gt;
| 0x275B || 347 || 19 || Failed to map code memory (.text).&lt;br /&gt;
|-&lt;br /&gt;
| 0x295B || 347 || 20 || Failed to map code memory (.rodata).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B5B || 347 || 21 || Failed to map code memory (.data+.bss).&lt;br /&gt;
|-&lt;br /&gt;
| 0x315B || 347 || 24 || Failed to unmap code memory (.text).&lt;br /&gt;
|-&lt;br /&gt;
| 0x335B || 347 || 25 || Failed to unmap code memory (.rodata).&lt;br /&gt;
|-&lt;br /&gt;
| 0x355B || 347 || 26 || Failed to unmap code memory (.data+.bss).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== FS Error Codes ==&lt;br /&gt;
The following are the error codes recognized by nn::fs::detail::LogErrorMessage found in some [[Factory Setup|factory]] titles:&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Description || Message&lt;br /&gt;
|-&lt;br /&gt;
| 0x7802 || 60 || Error: Specified mount name already exists.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD401 || 106 || Error: Passed buffer is not usable for fs library.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D202 || 1001 || Error: Specified partition is not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D402 || 1002 || Error: Specified target is not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0xFA002 - 0x138602 || 2000 - 2499 || Error: Failed to access SD card.&lt;br /&gt;
|-&lt;br /&gt;
| 0x136802 - 0x176E02 || 2500 - 2999 || Error: Failed to access game card.&lt;br /&gt;
|-&lt;br /&gt;
| 0x177202 || 3001 || Error: Specified operation is not implemented.&lt;br /&gt;
|-&lt;br /&gt;
| 0x177A02 || 3005 || Error: Specified value is out of range.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B5802 - 0x1F3E02 || 3500 - 3999 || Error: Failed to access MMC.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F4202 - 0x219602 || 4001 - 4299 || Error: ROM is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x219A02 - 0x232602 || 4301 - 4499 || Error: Save data is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x232A02 - 0x23EE02 || 4501 - 4599 || Error: NCA is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x23F202 - 0x243E02 || 4601 - 4639 || Error: Integrity verification failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x244202 - 0x246602 || 4641 - 4659 || Error: Partition FS is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x246A02 - 0x248E02 || 4661 - 4679 || Error: Built-in-storage is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x249202 - 0x24B602 || 4681 - 4699 || Error: FAT FS is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24BA02 - 0x24DE02 || 4701 - 4719 || Error: HOST FS is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F4002 - 0x270E02 || 4000, 4300, 4500, 4600, 4640, 4660, 4680, 4700, 4720-4999 || Error: Data is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x271002 - 0x2EDE02 || 5000-5999 || Error: Unexpected failure occurred.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE402 - 0x2F1A02 || 6002-6029 || Error: Invalid path was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5A02 || 6061 || Error: Invalid offset was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5C02 || 6062 || Error: Invalid size was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5E02 || 6063 || Error: Null pointer argument was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE002 || 6000 || Error: Precondition violation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE202 - 0x306E02 || 6001-6199 || Error: Invalid argument was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x307202 || 6201 || Error: OpenMode_AllowAppend is required for implicit extension of file size by WriteFile().&lt;br /&gt;
|-&lt;br /&gt;
| 0x307002 - 0x313602 || 6200, 6202 - 6299 || Error: Invalid operation for the open mode.&lt;br /&gt;
|-&lt;br /&gt;
| 0x313802 - 0x31FE02 || 6300-6399 || Error: Unsupported operation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x320002 - 0x32C602 || 6400-6499 || Error: Permission denied.&lt;br /&gt;
|-&lt;br /&gt;
| 0x346402 || 6706 || Error: Enough journal space is not left.&lt;br /&gt;
|-&lt;br /&gt;
| 0x346A02 || 6709 || Error: The open count of files and directories reached the limitation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Fatal Errors =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Error || Description&lt;br /&gt;
|-&lt;br /&gt;
| 2162-0002&lt;br /&gt;
| Can be triggered by running [[SVC|svcBreak]]. The svcBreak params have no affect on the value of the thrown error-code.&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0000&lt;br /&gt;
| Userland ARM undefined instruction exception&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0001&lt;br /&gt;
| Userland ARM prefetch-abort due to PC set to non-executable region&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0002&lt;br /&gt;
| 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.&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0003&lt;br /&gt;
| Userland PC address not aligned to 4 bytes&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0008&lt;br /&gt;
| Can occur when attempting to call an svc outside the whitelist&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Support Errors =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Error || Module || Description || Notes&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| {web-applets listed above}&lt;br /&gt;
| 2750&lt;br /&gt;
| MP4 parsing failed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Normal error-codes displayed by the system also use the same format as fatal-errors.&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Error_codes&amp;diff=4830</id>
		<title>Error codes</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Error_codes&amp;diff=4830"/>
		<updated>2018-07-15T01:56:39Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Added error code 6005&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Structure =&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Field&lt;br /&gt;
|-&lt;br /&gt;
| 8-0 || Module&lt;br /&gt;
|-&lt;br /&gt;
| 21-9 || Description&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When a fatal-error is received the error code is outputted using the following formatter:&lt;br /&gt;
  %04d-%04d&lt;br /&gt;
&lt;br /&gt;
.. where the first code is &amp;lt;code&amp;gt;2000 + Module&amp;lt;/code&amp;gt;, and the other being &amp;lt;code&amp;gt;Description&amp;lt;/code&amp;gt;. Bits &amp;gt;=22 from the error-code are unused when displaying fatal-errors, since the Description ends with bit21.&lt;br /&gt;
&lt;br /&gt;
= Modules =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Kernel&lt;br /&gt;
|-&lt;br /&gt;
| 2 || FS&lt;br /&gt;
|-&lt;br /&gt;
| 3 || OS (Memory, Thread, Mutex, NVIDIA)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || HTCS&lt;br /&gt;
|-&lt;br /&gt;
| 5 || NCM&lt;br /&gt;
|-&lt;br /&gt;
| 6 || DD&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Debug Monitor&lt;br /&gt;
|-&lt;br /&gt;
| 8 || LR&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Loader&lt;br /&gt;
|-&lt;br /&gt;
| 10 || CMIF (IPC command interface)&lt;br /&gt;
|-&lt;br /&gt;
| 11 || HIPC (IPC)&lt;br /&gt;
|-&lt;br /&gt;
| 15 || PM&lt;br /&gt;
|-&lt;br /&gt;
| 16 || NS&lt;br /&gt;
|-&lt;br /&gt;
| 17 || Sockets&lt;br /&gt;
|-&lt;br /&gt;
| 18 || HTC&lt;br /&gt;
|-&lt;br /&gt;
| 20 || NCM Content&lt;br /&gt;
|-&lt;br /&gt;
| 21 || SM&lt;br /&gt;
|-&lt;br /&gt;
| 22 || RO userland&lt;br /&gt;
|-&lt;br /&gt;
| 24 || SDMMC&lt;br /&gt;
|-&lt;br /&gt;
| 25 || OVLN&lt;br /&gt;
|-&lt;br /&gt;
| 26 || SPL&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ETHC&lt;br /&gt;
|-&lt;br /&gt;
| 101 || I2C&lt;br /&gt;
|-&lt;br /&gt;
| 102 || GPIO&lt;br /&gt;
|-&lt;br /&gt;
| 103 || UART&lt;br /&gt;
|-&lt;br /&gt;
| 105 || Settings&lt;br /&gt;
|-&lt;br /&gt;
| 107 || WLAN&lt;br /&gt;
|-&lt;br /&gt;
| 108 || XCD&lt;br /&gt;
|-&lt;br /&gt;
| 110 || NIFM&lt;br /&gt;
|-&lt;br /&gt;
| 111 || Hwopus&lt;br /&gt;
|-&lt;br /&gt;
| 113 || Bluetooth&lt;br /&gt;
|-&lt;br /&gt;
| 114 || VI&lt;br /&gt;
|-&lt;br /&gt;
| 115 || NFP&lt;br /&gt;
|-&lt;br /&gt;
| 116 || Time&lt;br /&gt;
|-&lt;br /&gt;
| 117 || FGM&lt;br /&gt;
|-&lt;br /&gt;
| 118 || OE&lt;br /&gt;
|-&lt;br /&gt;
| 120 || PCIe&lt;br /&gt;
|-&lt;br /&gt;
| 121 || Friends&lt;br /&gt;
|-&lt;br /&gt;
| 122 || BCAT&lt;br /&gt;
|-&lt;br /&gt;
| 123 || SSL&lt;br /&gt;
|-&lt;br /&gt;
| 124 || Account&lt;br /&gt;
|-&lt;br /&gt;
| 125 || News&lt;br /&gt;
|-&lt;br /&gt;
| 126 || Mii&lt;br /&gt;
|-&lt;br /&gt;
| 127 || NFC&lt;br /&gt;
|-&lt;br /&gt;
| 128 || AM&lt;br /&gt;
|-&lt;br /&gt;
| 129 || Play Report&lt;br /&gt;
|-&lt;br /&gt;
| 130 || AHID&lt;br /&gt;
|-&lt;br /&gt;
| 132 || Home Menu (Qlaunch)&lt;br /&gt;
|-&lt;br /&gt;
| 133 || PCV&lt;br /&gt;
|-&lt;br /&gt;
| 134 || OMM&lt;br /&gt;
|-&lt;br /&gt;
| 135 || BPC&lt;br /&gt;
|-&lt;br /&gt;
| 136 || PSM&lt;br /&gt;
|-&lt;br /&gt;
| 137 || NIM&lt;br /&gt;
|-&lt;br /&gt;
| 138 || PSC&lt;br /&gt;
|-&lt;br /&gt;
| 139 || TC&lt;br /&gt;
|-&lt;br /&gt;
| 140 || USB&lt;br /&gt;
|-&lt;br /&gt;
| 141 || NSD&lt;br /&gt;
|-&lt;br /&gt;
| 142 || PCTL&lt;br /&gt;
|-&lt;br /&gt;
| 143 || BTM&lt;br /&gt;
|-&lt;br /&gt;
| 144 || EC (Shop)&lt;br /&gt;
|-&lt;br /&gt;
| 145 || ETicket&lt;br /&gt;
|-&lt;br /&gt;
| 146 || NGC (Bad Words)&lt;br /&gt;
|-&lt;br /&gt;
| 147 || Error Report&lt;br /&gt;
|-&lt;br /&gt;
| 148 || APM&lt;br /&gt;
|-&lt;br /&gt;
| 150 || Profiler&lt;br /&gt;
|-&lt;br /&gt;
| 151 || Error Upload&lt;br /&gt;
|-&lt;br /&gt;
| 153 || Audio&lt;br /&gt;
|-&lt;br /&gt;
| 154 || NPNS&lt;br /&gt;
|-&lt;br /&gt;
| 155 || NPNS HTTP Stream&lt;br /&gt;
|-&lt;br /&gt;
| 157 || ARP&lt;br /&gt;
|-&lt;br /&gt;
| 158 || SWKBD&lt;br /&gt;
|-&lt;br /&gt;
| 159 || Boot&lt;br /&gt;
|-&lt;br /&gt;
| 161 || NFC Mifare&lt;br /&gt;
|-&lt;br /&gt;
| 162 || Userland assert&lt;br /&gt;
|-&lt;br /&gt;
| 163 || Fatal&lt;br /&gt;
|-&lt;br /&gt;
| 164 || NIM Shop&lt;br /&gt;
|-&lt;br /&gt;
| 165 || SPSM&lt;br /&gt;
|-&lt;br /&gt;
| 167 || BGTC&lt;br /&gt;
|-&lt;br /&gt;
| 168 || Userland crash&lt;br /&gt;
|-&lt;br /&gt;
| 180 || SREPO&lt;br /&gt;
|-&lt;br /&gt;
| 181 || Dauth&lt;br /&gt;
|-&lt;br /&gt;
| 202 || HID&lt;br /&gt;
|-&lt;br /&gt;
| 203 || LDN&lt;br /&gt;
|-&lt;br /&gt;
| 205 || Irsensor&lt;br /&gt;
|-&lt;br /&gt;
| 206 || Capture&lt;br /&gt;
|-&lt;br /&gt;
| 208 || Manu&lt;br /&gt;
|-&lt;br /&gt;
| 209 || ATK&lt;br /&gt;
|-&lt;br /&gt;
| 210 || Web&lt;br /&gt;
|-&lt;br /&gt;
| 211 ||&lt;br /&gt;
|-&lt;br /&gt;
| 212 || GRC&lt;br /&gt;
|-&lt;br /&gt;
| 216 || Migration&lt;br /&gt;
|-&lt;br /&gt;
| 217 || Migration Idc Server&lt;br /&gt;
|-&lt;br /&gt;
| 345 || libnx&lt;br /&gt;
|-&lt;br /&gt;
| 346 || [[Homebrew ABI]]&lt;br /&gt;
|-&lt;br /&gt;
| 347 || Homebrew Loader&lt;br /&gt;
|-&lt;br /&gt;
| 348 || libnx Nvidia errors&lt;br /&gt;
|-&lt;br /&gt;
| 800 || [[Internet_Browser|General web-applet]]&lt;br /&gt;
|-&lt;br /&gt;
| 809 || [[Internet_Browser|WifiWebAuthApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 810 || [[Internet_Browser|Whitelisted-applet]]&lt;br /&gt;
|-&lt;br /&gt;
| 811 || [[Internet_Browser|ShopN]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
8XX is for/includes system applets.&lt;br /&gt;
&lt;br /&gt;
= Error codes =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Module || Description || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C01 || 1 || 14 || Invalid kernel capability descriptor&lt;br /&gt;
|-&lt;br /&gt;
| 0x4201 || 1 || 33 || [[SPL_services#GetConfig|IsDebugMode]] isn&#039;t set.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8C01 || 1 || 70 || No more debug events&lt;br /&gt;
|-&lt;br /&gt;
| 0xCA01 || 1 || 101 || Invalid size&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC01 || 1 || 102 || Invalid address&lt;br /&gt;
|-&lt;br /&gt;
| 0xCE01 || 1 || 103 || Slabheap full&lt;br /&gt;
|-&lt;br /&gt;
| 0xD001 || 1 || 104 || Memory full&lt;br /&gt;
|-&lt;br /&gt;
| 0xD201 || 1 || 105 || Handle-table full.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD401 || 1 || 106 || Invalid memory state / invalid memory permissions.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD801 || 1 || 108 || Invalid memory permissions.&lt;br /&gt;
|-&lt;br /&gt;
| 0xDC01 || 1 || 110 || Invalid memory range&lt;br /&gt;
|-&lt;br /&gt;
| 0xE001 || 1 || 112 || Invalid thread priority.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE201 || 1 || 113 || Invalid processor id.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE401 || 1 || 114 || Invalid handle.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE601 || 1 || 115 || Syscall copy from user failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE801 || 1 || 116 || Invalid combination&lt;br /&gt;
|-&lt;br /&gt;
| 0xEA01 || 1 || 117 || Time out. Also when you give 0 handles to svcWaitSynchronizationN.&lt;br /&gt;
|-&lt;br /&gt;
| 0xEC01 || 1 || 118 || Canceled/interrupted [?]&lt;br /&gt;
|-&lt;br /&gt;
| 0xEE01 || 1 || 119 || Exceeding maximum&lt;br /&gt;
|-&lt;br /&gt;
| 0xF001 || 1 || 120 || Invalid enum&lt;br /&gt;
|-&lt;br /&gt;
| 0xF201 || 1 || 121 || No such entry&lt;br /&gt;
|-&lt;br /&gt;
| 0xF401 || 1 || 122 || Irq/DeviceAddressSpace/{...} already registered&lt;br /&gt;
|-&lt;br /&gt;
| 0xF601 || 1 || 123 || Port remote dead&lt;br /&gt;
|-&lt;br /&gt;
| 0xF801 || 1 || 124 || [Usermode] Unhandled interrupt&lt;br /&gt;
|-&lt;br /&gt;
| 0xFA01 || 1 || 125 || Wrong memory permission?&lt;br /&gt;
|-&lt;br /&gt;
| 0xFC01 || 1 || 126 || Reserved value&lt;br /&gt;
|-&lt;br /&gt;
| 0xFE01 || 1 || 127 || Invalid hardware breakpoint&lt;br /&gt;
|-&lt;br /&gt;
| 0x10001 || 1 || 128 || [Usermode] Fatal exception&lt;br /&gt;
|-&lt;br /&gt;
| 0x10201 || 1 || 129 || Last thread didn&#039;t belong to your process&lt;br /&gt;
|-&lt;br /&gt;
| 0x10601 || 1 || 131 || Port max sessions exceeded&lt;br /&gt;
|-&lt;br /&gt;
| 0x10801 || 1 || 132 || Resource limit exceeded&lt;br /&gt;
|-&lt;br /&gt;
| 0x20801 || 1 || 260 || Command buffer too small&lt;br /&gt;
|-&lt;br /&gt;
| 0x41001 || 1 || 520 || Process not being debugged&lt;br /&gt;
|-&lt;br /&gt;
| 0xE02 || 2 || 7 || Savedata [[Filesystem_services|already]] mounted&lt;br /&gt;
|-&lt;br /&gt;
| 0x7802 || 2 || 60 || The specified [[NCA]]-type doesn&#039;t exist for this title.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D202 || 2 || 1001 || Process does not have RomFs &lt;br /&gt;
|-&lt;br /&gt;
| 0x7D402 || 2 || 1002 || Title-id not found / savedata not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0xFA202 || 2 || 2001 || SD card not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x13B002 || 2 || 2520 || Gamecard not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x13DA02 || 2 || 2541 || Version check failed when mounting gamecard sysupdate partition?&lt;br /&gt;
|-&lt;br /&gt;
| 0x171402 || 2 || 2954 || Invalid gamecard handle.&lt;br /&gt;
|-&lt;br /&gt;
| 0x196002 || 2 || 3248 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x196202 || 2 || 3249 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A4A02 || 2 || 3365 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x235202 || 2 || 4521 || Invalid NCA Key index&lt;br /&gt;
|-&lt;br /&gt;
| 0x235E02 || 2 || 4527 || NCA-path used with the wrong titleID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x250E02 || 2 || 4743 || [[NAX0|Corrupted]] NAX0 header.&lt;br /&gt;
|-&lt;br /&gt;
| 0x251002 || 2 || 4744 || Invalid [[NAX0]] magicnum.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE202 || 2 || 6001 || Invalid input&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE602 || 2 || 6003 || Path too long&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5A02 || 2 || 6061 || Offset outside storage&lt;br /&gt;
|-&lt;br /&gt;
| 0x313802 || 2 || 6300 || Operation not supported&lt;br /&gt;
|-&lt;br /&gt;
| 0x320002 || 2 || 6400 || Permission denied&lt;br /&gt;
|-&lt;br /&gt;
| 0x326602 || 2 || 6451 || Missing titlekey(?) required to mount content&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EA03 || 3 || 501 || Invalid handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EE03 || 3 || 503 || Invalid memory mirror&lt;br /&gt;
|-&lt;br /&gt;
| 0x7FE03 || 3 || 1023 || TLS slot is not allocated&lt;br /&gt;
|-&lt;br /&gt;
| 0xA05 || 5 || 5 || [[Content_Manager_services|NcaID]] not found. Returned when attempting to mount titles which exist that aren&#039;t *8XX titles, the same way *8XX titles are mounted.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE05 || 5 || 7 || TitleId not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x1805 || 5 || 12 || Invalid StorageId&lt;br /&gt;
|-&lt;br /&gt;
| 0xDC05 || 5 || 110 || Gamecard not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x17C05 || 5 || 190 || Gamecard not initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F405 || 5 || 250 || Sdcard not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x20805 || 5 || 260 || Storage not mounted&lt;br /&gt;
|-&lt;br /&gt;
| 0x806 || 6 || 4 || Converted from error 0xD401&lt;br /&gt;
|-&lt;br /&gt;
| 0x1006 || 6 || 8 || Converted from error 0xE401&lt;br /&gt;
|-&lt;br /&gt;
| 0x408 || 8 || 2 || Program location entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x608 || 8 || 3 || Invalid context for control location&lt;br /&gt;
|-&lt;br /&gt;
| 0x808 || 8 || 4 || Storage not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xA08 || 8 || 5 || Access denied&lt;br /&gt;
|-&lt;br /&gt;
| 0xC08 || 8 || 6 || Offline manual HTML location entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xE08 || 8 || 7 || Title is not registered&lt;br /&gt;
|-&lt;br /&gt;
| 0x1008 || 8 || 8 || Control location entry for host not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x1208 || 8 || 9 || Legal info HTML location entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x209 || 9 || 1 || Args too long.&lt;br /&gt;
|-&lt;br /&gt;
| 0x409 || 9 || 2 || Maximum processes loaded.&lt;br /&gt;
|-&lt;br /&gt;
| 0x609 || 9 || 3 || NPDM too big.&lt;br /&gt;
|-&lt;br /&gt;
| 0x19009 || 9 || 200 || Invalid access control sizes in NPDM.&lt;br /&gt;
|-&lt;br /&gt;
| 0x809 || 9 || 4 || Invalid NPDM.&lt;br /&gt;
|-&lt;br /&gt;
| 0xA09 || 9 || 5 || Invalid files.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE09 || 9 || 7 || Already registered.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1009 || 9 || 8 || Title not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1209 || 9 || 9 || Title-id in ACI0 doesn&#039;t match range in ACID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6609 || 9 || 51 || Invalid memory state/permission&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A09 || 9 || 53 || Invalid NRR&lt;br /&gt;
|-&lt;br /&gt;
| 0xA209 || 9 || 81 || Unaligned NRR address&lt;br /&gt;
|-&lt;br /&gt;
| 0xA409 || 9 || 82 || Bad NRR size&lt;br /&gt;
|-&lt;br /&gt;
| 0xAA09 || 9 || 85 || Bad NRR address&lt;br /&gt;
|-&lt;br /&gt;
| 0xAE09 || 9 || 87 || Bad initialization&lt;br /&gt;
|-&lt;br /&gt;
| 0xC809 || 9 || 100 || Unknown ACI0 descriptor&lt;br /&gt;
|-&lt;br /&gt;
| 0xCE09 || 9 || 103 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;KernelFlags&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xD009 || 9 || 104 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;SyscallMask&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xD409 || 9 || 106 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;MapIoOrNormalRange&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xD609 || 9 || 107 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;MapNormalPage&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xDE09 || 9 || 111 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;InterruptPair&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE209 || 9 || 113 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;ApplicationType&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE409 || 9 || 114 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;KernelReleaseVersion&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE609 || 9 || 115 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;HandleTableSize&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE809 || 9 || 116 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;DebugFlags&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A80A || 10 || 212 || Bad magic (expected &#039;SFCO&#039;)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20B || 11 || 1 || Size too big to fit to marshal.&lt;br /&gt;
|-&lt;br /&gt;
| 0x11A0B || 11 || 141 || Went past maximum during marshalling.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1900B || 11 || 200 || Session doesn&#039;t support domains.&lt;br /&gt;
|-&lt;br /&gt;
| 0x25A0B || 11 || 301 || Remote process is dead.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D60B || 11 || 491 || IPC Query 1 failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20F || 15 || 1 || Pid not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x60F || 15 || 3 || Process has no pending events&lt;br /&gt;
|-&lt;br /&gt;
| 0xA0F || 15 || 5 || Application already running&lt;br /&gt;
|-&lt;br /&gt;
| 0x410 || 16 || 2 || Title-id not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xF010 || 16 || 120 || Gamecard sysupdate not required&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F610 || 16 || 251 || Unexpected StorageId&lt;br /&gt;
|-&lt;br /&gt;
| 0x415 || 21 || 2 || Not initialized.&lt;br /&gt;
|-&lt;br /&gt;
| 0x615 || 21 || 3 || Max sessions&lt;br /&gt;
|-&lt;br /&gt;
| 0xC15 || 21 || 6 || Invalid name (all zeroes)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1015 || 21 || 8 || Permission denied&lt;br /&gt;
|-&lt;br /&gt;
| 0x416 || 22 || 2 || Address space is full&lt;br /&gt;
|-&lt;br /&gt;
| 0x616 || 22 || 3 || NRO already loaded&lt;br /&gt;
|-&lt;br /&gt;
| 0x816 || 22 || 4 || Invalid NRO header values&lt;br /&gt;
|-&lt;br /&gt;
| 0xC16 || 22 || 6 || Bad NRR magic&lt;br /&gt;
|-&lt;br /&gt;
| 0x1016 || 22 || 8 || Reached max NRR count&lt;br /&gt;
|-&lt;br /&gt;
| 0x1216 || 22 || 9 || Unable to verify NRO hash or NRR signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x80216 || 22 || 1025 || Address not page-aligned&lt;br /&gt;
|-&lt;br /&gt;
| 0x80416 || 22 || 1026 || Incorrect NRO size&lt;br /&gt;
|-&lt;br /&gt;
| 0x80816 || 22 || 1028 || NRO not loaded&lt;br /&gt;
|-&lt;br /&gt;
| 0x80A16 || 22 || 1029 || NRR not loaded&lt;br /&gt;
|-&lt;br /&gt;
| 0x80C16 || 22 || 1030 || Already initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x80E16 || 22 || 1031 || Not initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x41A || 26 || 2 || Argument is invalid&lt;br /&gt;
|-&lt;br /&gt;
| 0xC81A || 26 || 100 || Incorrect buffer size&lt;br /&gt;
|-&lt;br /&gt;
| 0xCA1A || 26 || 101 || Unknown TZ error&lt;br /&gt;
|-&lt;br /&gt;
| 0xD01A || 26 || 104 || All AES engines busy&lt;br /&gt;
|-&lt;br /&gt;
| 0xD21A || 26 || 105 || Invalid AES engine-id&lt;br /&gt;
|-&lt;br /&gt;
| 0x272 || 114 || 1 || Generic error&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC74 || 116 || 102 || Time not set&lt;br /&gt;
|-&lt;br /&gt;
| 0x287C || 124 || 20 || Argument is NULL&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C7C || 124 || 22 || Argument is invalid&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C7C || 124 || 30 || Bad input buffer size&lt;br /&gt;
|-&lt;br /&gt;
| 0x407C || 124 || 32 || Invalid input buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A880 || 128 || 500 || &amp;lt;code&amp;gt;am.debug!dev_function&amp;lt;/code&amp;gt; setting needs to be set&lt;br /&gt;
|-&lt;br /&gt;
| 0x3CF089 || 137 || 7800 || Unknown/invalid libcurl error.&lt;br /&gt;
|-&lt;br /&gt;
| 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.&lt;br /&gt;
|-&lt;br /&gt;
| 0x668C || 140 || 51 || USB data-transfer in progress&lt;br /&gt;
|-&lt;br /&gt;
| 0xD48C || 140 || 106 || Invalid descriptor&lt;br /&gt;
|-&lt;br /&gt;
| 0x1928C || 140 || 201 || USB device not bound / interface already enabled&lt;br /&gt;
|-&lt;br /&gt;
| 0x299 || 153 || 1 || Invalid audio device&lt;br /&gt;
|-&lt;br /&gt;
| 0x499 || 153 || 2 || Invalid buffer address&lt;br /&gt;
|-&lt;br /&gt;
| 0x699 || 153 || 3 || Invalid sample rate&lt;br /&gt;
|-&lt;br /&gt;
| 0x1499 || 153 || 10 || Invalid channel count&lt;br /&gt;
|-&lt;br /&gt;
| 0xC0899 || 153 || 1540 || Audio output was already started&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C9D || 157 || 30 || Address is NULL&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E9D || 157 || 31 || PID is NULL&lt;br /&gt;
|-&lt;br /&gt;
| 0x549D || 157 || 42 || Already bound&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC9D || 157 || 102 || Invalid PID&lt;br /&gt;
|-&lt;br /&gt;
| 0x35B || 347 || 1 || Failed to init SM.&lt;br /&gt;
|-&lt;br /&gt;
| 0x55B || 347 || 2 || Failed to init FS.&lt;br /&gt;
|-&lt;br /&gt;
| 0x75B || 347 || 3 || Failed to to open NRO file. May also happen when SD card isn&#039;t inserted / SD mounting failed earlier.&lt;br /&gt;
|-&lt;br /&gt;
| 0x95B || 347 || 4 || Failed to read NRO header.&lt;br /&gt;
|-&lt;br /&gt;
| 0xB5B || 347 || 5 || Invalid NRO magic.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD5B || 347 || 6 || Invalid NRO segments.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF5B || 347 || 7 || Failed to read NRO.&lt;br /&gt;
|-&lt;br /&gt;
| 0x135B || 347 || 9 || Failed to allocate heap.&lt;br /&gt;
|-&lt;br /&gt;
| 0x255B || 347 || 18 || Failed to map code-binary memory.&lt;br /&gt;
|-&lt;br /&gt;
| 0x275B || 347 || 19 || Failed to map code memory (.text).&lt;br /&gt;
|-&lt;br /&gt;
| 0x295B || 347 || 20 || Failed to map code memory (.rodata).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B5B || 347 || 21 || Failed to map code memory (.data+.bss).&lt;br /&gt;
|-&lt;br /&gt;
| 0x315B || 347 || 24 || Failed to unmap code memory (.text).&lt;br /&gt;
|-&lt;br /&gt;
| 0x335B || 347 || 25 || Failed to unmap code memory (.rodata).&lt;br /&gt;
|-&lt;br /&gt;
| 0x355B || 347 || 26 || Failed to unmap code memory (.data+.bss).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== FS Error Codes ==&lt;br /&gt;
The following are the error codes recognized by nn::fs::detail::LogErrorMessage found in some [[Factory Setup|factory]] titles:&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Description || Message&lt;br /&gt;
|-&lt;br /&gt;
| 0x7802 || 60 || Error: Specified mount name already exists.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD401 || 106 || Error: Passed buffer is not usable for fs library.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D202 || 1001 || Error: Specified partition is not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D402 || 1002 || Error: Specified target is not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0xFA002 - 0x138602 || 2000 - 2499 || Error: Failed to access SD card.&lt;br /&gt;
|-&lt;br /&gt;
| 0x136802 - 0x176E02 || 2500 - 2999 || Error: Failed to access game card.&lt;br /&gt;
|-&lt;br /&gt;
| 0x177202 || 3001 || Error: Specified operation is not implemented.&lt;br /&gt;
|-&lt;br /&gt;
| 0x177A02 || 3005 || Error: Specified value is out of range.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B5802 - 0x1F3E02 || 3500 - 3999 || Error: Failed to access MMC.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F4202 - 0x219602 || 4001 - 4299 || Error: ROM is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x219A02 - 0x232602 || 4301 - 4499 || Error: Save data is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x232A02 - 0x23EE02 || 4501 - 4599 || Error: NCA is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x23F202 - 0x243E02 || 4601 - 4639 || Error: Integrity verification failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x244202 - 0x246602 || 4641 - 4659 || Error: Partition FS is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x246A02 - 0x248E02 || 4661 - 4679 || Error: Built-in-storage is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x249202 - 0x24B602 || 4681 - 4699 || Error: FAT FS is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24BA02 - 0x24DE02 || 4701 - 4719 || Error: HOST FS is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F4002 - 0x270E02 || 4000, 4300, 4500, 4600, 4640, 4660, 4680, 4700, 4720-4999 || Error: Data is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x271002 - 0x2EDE02 || 5000-5999 || Error: Unexpected failure occurred.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE402 - 0x2F1A02 || 6002-6029 || Error: Invalid path was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5A02 || 6061 || Error: Invalid offset was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5C02 || 6062 || Error: Invalid size was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5E02 || 6063 || Error: Null pointer argument was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE002 || 6000 || Error: Precondition violation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE202 - 0x306E02 || 6001-6199 || Error: Invalid argument was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EEA02 || 6005 || Directory/file(?) already exists.&lt;br /&gt;
|-&lt;br /&gt;
| 0x307202 || 6201 || Error: OpenMode_AllowAppend is required for implicit extension of file size by WriteFile().&lt;br /&gt;
|-&lt;br /&gt;
| 0x307002 - 0x313602 || 6200, 6202 - 6299 || Error: Invalid operation for the open mode.&lt;br /&gt;
|-&lt;br /&gt;
| 0x313802 - 0x31FE02 || 6300-6399 || Error: Unsupported operation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x320002 - 0x32C602 || 6400-6499 || Error: Permission denied.&lt;br /&gt;
|-&lt;br /&gt;
| 0x346402 || 6706 || Error: Enough journal space is not left.&lt;br /&gt;
|-&lt;br /&gt;
| 0x346A02 || 6709 || Error: The open count of files and directories reached the limitation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Fatal Errors =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Error || Description&lt;br /&gt;
|-&lt;br /&gt;
| 2162-0002&lt;br /&gt;
| Can be triggered by running [[SVC|svcBreak]]. The svcBreak params have no affect on the value of the thrown error-code.&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0000&lt;br /&gt;
| Userland ARM undefined instruction exception&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0001&lt;br /&gt;
| Userland ARM prefetch-abort due to PC set to non-executable region&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0002&lt;br /&gt;
| 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.&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0003&lt;br /&gt;
| Userland PC address not aligned to 4 bytes&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0008&lt;br /&gt;
| Can occur when attempting to call an svc outside the whitelist&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Support Errors =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Error || Module || Description || Notes&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| {web-applets listed above}&lt;br /&gt;
| 2750&lt;br /&gt;
| MP4 parsing failed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Normal error-codes displayed by the system also use the same format as fatal-errors.&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=NCM_services&amp;diff=4827</id>
		<title>NCM services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=NCM_services&amp;diff=4827"/>
		<updated>2018-07-13T11:39:10Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Correct return order&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NCM contains services for internal file path and content management.&lt;br /&gt;
&lt;br /&gt;
= Location Resolver services =&lt;br /&gt;
== lr ==&lt;br /&gt;
This is &amp;quot;nn::lr::ILocationResolverManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || OpenLocationResolver || [[Filesystem_services#StorageId|StorageID]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || OpenRegisteredLocationResolver || None || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || RefreshLocationResolver || [[Filesystem_services#StorageId|StorageID]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [2.0.0+] OpenAddOnContentLocationResolver || None  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The only sysmodules which use this service are [[Filesystem_services|FS]], [[Loader_services|Loader]], and [[NS_Services|NS]]. [[boot2]] has access but doesn&#039;t use it.&lt;br /&gt;
&lt;br /&gt;
=== ILocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::ILocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ResolveProgramPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#RedirectProgramPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#ResolveApplicationControlPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#ResolveApplicationHtmlDocumentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#ResolveDataPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#RedirectApplicationControlPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#RedirectApplicationHtmlDocumentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#ResolveApplicationLegalInformationPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#RedirectApplicationLegalInformationPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [[#Refresh]]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [5.0.0+] [[#SetProgramNcaPath2]]&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [5.0.0+] [[#ClearLocationResolver2]]&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [5.0.0+] [[#DeleteProgramNcaPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [5.0.0+] [[#DeleteControlNcaPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [5.0.0+] [[#DeleteDocHtmlNcaPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [5.0.0+] [[#DeleteInfoHtmlNcaPath]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If the supplied [[Filesystem_services#StorageId|StorageID]] is 1 (Host), a different set of internal functions is used to handle these commands. In this more restricted set of functions, GetControlNcaPath is stubbed and only returns error 0x608.&lt;br /&gt;
&lt;br /&gt;
The Get* commands load the [[Filesystem_services|ContentPath]] from linked-lists&#039; [[#Location_List_Entry|entries]] in memory using the input TitleID. When the command fails to find an entry for the specified TitleID, 0x408 is returned for GetProgramNcaPath and 0xA08 is returned for the rest.&lt;br /&gt;
&lt;br /&gt;
The Set* commands always return 0 and add a new entry to the list. If a matching entry is found, it&#039;s removed first.&lt;br /&gt;
&lt;br /&gt;
==== ResolveProgramPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectProgramPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 0.&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationControlPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationHtmlDocumentPath====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
==== ResolveDataPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationControlPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationHtmlDocumentPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== ResolveApplicationLegalInformationPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a C descriptor. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
==== RedirectApplicationLegalInformationPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039; and a X descriptor with a [[Filesystem_services#ContentPath|ContentPath]]. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
Inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== Refresh ====&lt;br /&gt;
Takes no input. Frees all linked-lists&#039; entries that have &#039;&#039;&#039;flag&#039;&#039;&#039; set to 0.&lt;br /&gt;
&lt;br /&gt;
==== SetProgramNcaPath2 ====&lt;br /&gt;
Same as [[#SetProgramNcaPath|SetProgramNcaPath]], but inserts a new [[#Location_List_Entry|entry]] with &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== ClearLocationResolver2 ====&lt;br /&gt;
Takes no input. Frees all linked-lists&#039; entries that have &#039;&#039;&#039;flag&#039;&#039;&#039; set to 1.&lt;br /&gt;
&lt;br /&gt;
==== DeleteProgramNcaPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== DeleteControlNcaPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== DeleteDocHtmlNcaPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
==== DeleteInfoHtmlNcaPath ====&lt;br /&gt;
Takes an u64 &#039;&#039;&#039;TitleID&#039;&#039;&#039;. Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
&lt;br /&gt;
Removes the [[#Location_List_Entry|entry]] that matches the input TitleID.&lt;br /&gt;
&lt;br /&gt;
=== IRegisteredLocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::IRegisteredLocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This works like [[#ILocationResolver]], but only two types of NCA paths can be gotten/set. In addition, each type has a fallback path that can be set for a single title ID at a time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || ResolveProgramPath || u64 TitleID + C descriptor || Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || RegisterProgramPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] || Sets the Type 0 fallback TID and path to the provided arguments.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || UnregisterProgramPath || u64 TitleID || If the Type 0 fallback TID is == argument TID, unregisters the fallback path. Otherwise, noop.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || RedirectProgramPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [2.0.0+] ResolveHtmlDocumentPath || u64 TitleID + C descriptor ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [2.0.0+] RegisterHtmlDocumentPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] || Sets the Type 1 fallback TID and path to the provided arguments.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [2.0.0+] UnregisterHtmlDocumentPath || u64 TitleID || If the Type 1 fallback TID is == argument TID, unregisters the fallback path. Otherwise, noop.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [2.0.0+] RedirectHtmlDocumentPath || u64 TitleID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IAddOnContentLocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::IAddOnContentLocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || ResolveAddOnContentPath || u64 TitleID + C descriptor || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || RegisterAddOnContentStorage || [[Filesystem_services#StorageId|StorageID]] + u64 TitleID || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || UnregisterAllAddOnContentPath || None || Clears all registered titles here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Location List Entry ===&lt;br /&gt;
Total size is 0x320 bytes. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset || Size || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8|| Pointer to previous entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x8|| Pointer to next entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x8|| TitleID&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x300 || [[Filesystem_services|ContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x318 || 0x4 || Flag&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C || 0x4 || Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Content Manager services =&lt;br /&gt;
== ncm ==&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CreateContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CreateContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || VerifyContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || VerifyContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || OpenContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], [2.0.0+] Only returns a storage if one has previously been opened globally via OpenIContentStorage.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || OpenContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], [2.0.0+] Only returns a storage if one has previously been opened globally via OpenIContentStorage.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [1.0.0] CloseContentStorageForcibly || Takes a [[Filesystem_services#StorageId|StorageID]]. Calls IContentStorage-&amp;gt;CloseAndFlushStorage().&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [1.0.0] CloseContentMetaDatabaseForcibly || Takes a [[Filesystem_services#StorageId|StorageID]].  Calls IContentMetaDatabase-&amp;gt;CloseMetaDatabase().&lt;br /&gt;
|-&lt;br /&gt;
| 8 || CleanupContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and deletes the associated savedata.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || [2.0.0+] OpenContentStorage2 || Takes a [[Filesystem_services#StorageId|StorageID]], and opens an IContentStorage for the StorageID to be gotten with GetIContentStorage. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || [2.0.0+] CloseContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]], and closes the associated IContentStorage. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || [2.0.0+] OpenContentMetaDatabase2 || Takes a [[Filesystem_services#StorageId|StorageID]], and opens an IContentMetaDatabase for the StorageID to be gotten with GetIContentMetaDatabase. Note: Name is not official.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [2.0.0+] CloseContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]], and closes the associated IContentMetaDatabase. Note: Name is not official.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IContentStorage ===&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentStorage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GeneratePlaceHolderId]] || Returns a random UUID for the Content Storage.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CreatePlaceHolder || Takes two [[#NcaID]]s, and a u64 filesize.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DeletePlaceHolder || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || HasPlaceHolder ||  Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || WritePlaceHolder || Takes a [[#NcaID]], a u64-offset, and type 5 buffer. Writes the buffer to the file for the NcaID&#039;s placeholder path at the specified offset.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Register || Takes two [[#NcaID]]s, moves the Placeholder NCA content to the registered NCA path.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Delete || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Has || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || GetPath || Takes a [[#NcaID]]. Returns a [[Filesystem_services#ContentPath|Content Path]].&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetPlaceHolderPath || Takes a [[#NcaID]]. Returns a [[Filesystem_services#ContentPath|Content Path]].&lt;br /&gt;
|-&lt;br /&gt;
| 10 || CleanupAllPlaceHolder || Deletes and re-creates the Placeholder directory.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || ListPlaceHolder || This is like [[#GetNumberOfRegisteredEntries]], but for the Placeholder directory.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#GetContentCount]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#ListContentId]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#GetSize]] || &lt;br /&gt;
|-&lt;br /&gt;
| 15 || DisableForcibly || Closes/Flushes all resources for the storage, and causes all future IPC commands to the current session to return error 0xC805.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [2.0.0+] RevertToPlaceHolder || Takes three 0x10-sized [[#NcaID]]s. Creates the registered directory NCA path, and renames the placeholder path to the registered NCA path.&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [2.0.0+] SetPlaceHolderSize || Takes a [[#NcaID]], and a u64 size&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [2.0.0+] [[#ReadContentIdFile]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [2.0.0+] GetRightsIdFromPlaceHolderId || Gets the Rights ID for the [[#NcaID]]&#039;s placeholder path.&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [2.0.0+] GetRightsIdFromContentId || Gets the Rights ID for the [[#NcaID]]&#039;s registered path&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [2.0.0+] WriteContentForDebug || Takes a [[#NcaID]], a u64 offset, and a type 5 buffer. On debug units, writes the buffer to the NCA&#039;s registered path. On retail units, this just aborts.&lt;br /&gt;
|-&lt;br /&gt;
| 22 || [2.0.0+] GetFreeSpaceSize || Gets free space for the storage.&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [2.0.0+] GetTotalSpaceSize || Gets total space for the storage.&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [3.0.0+] FlushStorage || Flushes resources for the storage without closing it.&lt;br /&gt;
|-&lt;br /&gt;
| 25 || [4.0.0+] || &lt;br /&gt;
|-&lt;br /&gt;
| 26 || [4.0.0+] || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== GeneratePlaceHolderId ====&lt;br /&gt;
Generates a random [[#NcaID]] for use as a placeholder.&lt;br /&gt;
&lt;br /&gt;
Calls nn::util::GenerateUuid(), which internally calls nn::os::GenerateRandomBytes(16);&lt;br /&gt;
&lt;br /&gt;
==== GetContentCount ====&lt;br /&gt;
Writes the total number of entries which can be read by GetEntries, to cmdreply &amp;lt;SFCO_offset&amp;gt;+0x10.&lt;br /&gt;
&lt;br /&gt;
==== ListContentId====&lt;br /&gt;
Takes an output buffer, u32 offset and gets all entries starting at that offset.&lt;br /&gt;
Returns number of entries read.&lt;br /&gt;
&lt;br /&gt;
Each entry is a [[#NcaID]].&lt;br /&gt;
&lt;br /&gt;
The total read entries is exactly the same as the number of &amp;quot;&amp;lt;hex&amp;gt;.nca&amp;quot; directories in the storage FS(or at least under the &amp;quot;registered&amp;quot; directory?).&lt;br /&gt;
&lt;br /&gt;
==== GetSize ====&lt;br /&gt;
Takes a [[#NcaID]] as input.&lt;br /&gt;
&lt;br /&gt;
Returns the total size readable by ReadEntryRaw. This is the same as the size-field in the [[NAX0]] &amp;quot;&amp;lt;NcaID&amp;gt;.nca/00&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
==== ReadContentIdFile ====&lt;br /&gt;
Takes an output buffer, a [[#NcaID]] as input, and a u64 file offset.&lt;br /&gt;
&lt;br /&gt;
Reads plaintext NCA file contents from the Registered path for the NcaID.&lt;br /&gt;
&lt;br /&gt;
=== IContentMetaDatabase ===&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentMetaDatabase&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the official name for Meta Record is &amp;quot;ContentMetaKey&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Set || Takes a [[NCA#Meta_records|Meta Record]], a type-5 [[NCA#Content_records|Content Records]] buffer and a u64 size.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Get || Takes a [[NCA#Meta_records|Meta Record]], a type-6 buffer to write [[NCA#Content_records|Content Records]] to and a u64 size. Returns the actual Content Records size read.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Remove || Takes a [[NCA#Meta_records|Meta Record]], and removes the associated record.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetContentIdByType || Takes a [[NCA#Meta_records|Meta Record]] and a u8 [[#Title_Types|Title Type]]. Returns a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || ListContentInfo || Takes a type-6 buffer to write [[NCA#Content_records|Content Record]] entries to, a [[NCA#Meta_records|Meta Record]], and a u32 index into the Content Record entries to start copying from. Returns a u32 entries_read.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || List || Takes a type-6 buffer to write [[NCA#Meta_records|Meta Record]]s to, a u32 [[#Title_Types|Title Type]], a u64 TID, a u64 TID_LOW, and u64 TID_HIGH. Writes into the buffer all Meta Records with low &amp;lt;= record-&amp;gt;title_id &amp;lt;= high, and record-&amp;gt;type == type. Additionally requires record-&amp;gt;title_id == TID, if record-&amp;gt;type is Application, Patch, Add-On, or Delta.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || GetLatestContentMetaKey || Takes a u64 title id, and returns the [[NCA#Meta_records|Meta Record]] with the highest version field for that title id.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#ListApplication]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Has || Takes a [[NCA#Meta_records|Meta Record]] and returns whether that record is present in the database.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || HasAll || Takes a type-5 buffer containing [[NCA#Meta_records|Meta Records]] (code assumes there are size/sizeof(meta_record) records in the buffer), and returns whether all of those records are present in the database.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetSize || Takes a [[NCA#Meta_records|Meta Record]], and returns the size of the associated [[NCA#Content_records|Content Records]].&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetRequiredSystemVersion || Takes a [[NCA#Meta_records|Meta Record]], and returns u32 from ContentRecords + 16 (only if the Meta record has type Application or Patch).&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetPatchId || Takes a [[NCA#Meta_records|Meta Record]], and returns the update title id for that record.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || DisableForcibly ||  Closes the meta database, and causes all future IPC commands to the current session to return error 0xDC05.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#LookupOrphanContent]] || Takes a type-6 byte buffer, and a type-5 buffer of [[#NcaID]]s.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Commit || Flushes the in-memory database to savedata.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || HasContent || Takes a [[NCA#Meta_records|Meta Record]] and an [[#NcaID]]. Returns whether the content records for that meta record contain the NcaID.&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListContentMetaInfo || Takes a type-6 [[NCA#Meta_records|Meta Record]] output buffer, a u32 eoffset into that buffer, and an input [[NCA#Meta_records|Meta Record]].&lt;br /&gt;
|-&lt;br /&gt;
| 18 || GetAttributes || Takes a [[NCA#Meta_records|Meta Record]], and returns u8 from ContentRecords + 6.&lt;br /&gt;
|-&lt;br /&gt;
| 19 || [2.0.0+] GetRequiredApplicationVersion || Does the same thing as GetEntryUnknownRecordSize, but for AddOnContents.&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [5.0.0+] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== ListApplication ====&lt;br /&gt;
Each 24-byte entry (officially &amp;quot;ApplicationContentMetaKey&amp;quot;) is as follows:&lt;br /&gt;
  [[NCA#Meta_records|meta_record]] meta_record;&lt;br /&gt;
  u64    base_title_id;&lt;br /&gt;
&lt;br /&gt;
This function takes in a type 6 buffer to write entries to, and a u8 &amp;quot;filter&amp;quot; [[#Title_Types|type]]. If filter is zero, all update records will be copied to to the output buffer (space permitting). Otherwise, only titles with type == filter_type will be copied to the output buffer.&lt;br /&gt;
&lt;br /&gt;
This func returns a u32 num_entries_total, and a u32 num_entries_written.&lt;br /&gt;
&lt;br /&gt;
==== ReadEntryMetaRecords ====&lt;br /&gt;
Takes a type-6 [[NCA#Meta_records|Meta Record]] output buffer, a u32 eoffset into that buffer, and an input [[NCA#Meta_records|Meta Record]] entry. Returns a u32 for total_read_entries.&lt;br /&gt;
&lt;br /&gt;
Reads the meta records stored in the entry&#039;s content records into the output buffer.&lt;br /&gt;
&lt;br /&gt;
This is used, for example, with System Update title 0100000000000816, which contains Meta Records for all other systitles in its Content Records.&lt;br /&gt;
&lt;br /&gt;
==== LookupOrphanContent ====&lt;br /&gt;
Takes a type-6 byte buffer, and a type-5 buffer containing [[#NcaID]]s.&lt;br /&gt;
&lt;br /&gt;
This function was stubbed to return 0xDC05 in [[2.0.0]].&lt;br /&gt;
&lt;br /&gt;
On 1.0.0: Initialized the output buffer to all 1s. Then, for each [[#NcaID]] in the input buffer, it checks if that NcaID is present anywhere in the database, and if so writes 0 to the corresponding output byte.&lt;br /&gt;
&lt;br /&gt;
In pseudocode, the function basically does the following:&lt;br /&gt;
&lt;br /&gt;
for i in range(len(out_buf)):&lt;br /&gt;
    out_buf[i] = 1&lt;br /&gt;
&lt;br /&gt;
for i, NcaID in NcaIDs:&lt;br /&gt;
    if is_present_in_database(NcaID):&lt;br /&gt;
        out_buf[i] = 0&lt;br /&gt;
&lt;br /&gt;
=== NcaID ===&lt;br /&gt;
This is a 0x10-byte entry. This is originally from the hex portion of &amp;quot;&amp;lt;hex&amp;gt;.nca&amp;quot; directory-names from this storage FS(like [[SD_Filesystem|SD]]). This is also referred to as &amp;quot;ContentId&amp;quot; in the official SDK.&lt;br /&gt;
&lt;br /&gt;
The NcaID is the same as the first 0x10-bytes from the calculated SHA256 hash, from hashing the entire output from ReadEntryRaw.&lt;br /&gt;
&lt;br /&gt;
=== Enums ===&lt;br /&gt;
==== Title Types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| System Programs ([[Title_list#System_Modules|System Modules]] or [[Title_list#System_Applets|System Applets]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| [[Title_list#System_Data_Archives|System Data Archives]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| System Update&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| [[Title_list|Firmware package A]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x05&lt;br /&gt;
| [[Title_list|Firmware package B]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x80&lt;br /&gt;
| Regular application&lt;br /&gt;
|-&lt;br /&gt;
| 0x81&lt;br /&gt;
| Update title&lt;br /&gt;
|-&lt;br /&gt;
| 0x82&lt;br /&gt;
| Add-on content&lt;br /&gt;
|-&lt;br /&gt;
| 0x83&lt;br /&gt;
| Delta title&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ncm:v ==&lt;br /&gt;
This service doesn&#039;t normally exist on retail.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Glue_services&amp;diff=4825</id>
		<title>Glue services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Glue_services&amp;diff=4825"/>
		<updated>2018-07-12T03:06:20Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Added info on the launch property format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= arp:r =&lt;br /&gt;
This is &amp;quot;nn::arp::detail::IReader&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetApplicationLaunchProperty&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetApplicationLaunchPropertyWithApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetApplicationControlProperty&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetApplicationControlPropertyWithApplicationId&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== GetApplicationControlPropertyWithApplicationId ==&lt;br /&gt;
&lt;br /&gt;
Takes in a title id and a type-0x16 buffer. This is filled with the contents of control.nacp for that application.&lt;br /&gt;
&lt;br /&gt;
= arp:w =&lt;br /&gt;
This is &amp;quot;nn::arp::detail::IWriter&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || AcquireRegistrar&lt;br /&gt;
|-&lt;br /&gt;
| 1 || DeleteProperties&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== IRegistrar ==&lt;br /&gt;
This is &amp;quot;nn::arp::detail::IRegistrar&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Issue&lt;br /&gt;
|-&lt;br /&gt;
| 1 || SetApplicationLaunchProperty&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SetApplicationControlProperty&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Launch Property Format ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| Title ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Version&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x1&lt;br /&gt;
| Base Game Storage ID&lt;br /&gt;
|-&lt;br /&gt;
| 0xD&lt;br /&gt;
| 0x1&lt;br /&gt;
| Update Storage ID&lt;br /&gt;
|-&lt;br /&gt;
| 0xE&lt;br /&gt;
| 0x2&lt;br /&gt;
| Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Glue_services&amp;diff=4816</id>
		<title>Glue services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Glue_services&amp;diff=4816"/>
		<updated>2018-07-07T05:21:12Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Added info on GetApplicationControlPropertyWithApplicationId&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= arp:r =&lt;br /&gt;
This is &amp;quot;nn::arp::detail::IReader&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetApplicationLaunchProperty&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetApplicationLaunchPropertyWithApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetApplicationControlProperty&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetApplicationControlPropertyWithApplicationId&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== GetApplicationControlPropertyWithApplicationId ==&lt;br /&gt;
&lt;br /&gt;
Takes in a title id and a type-0x16 buffer. This is filled with the contents of control.nacp for that application.&lt;br /&gt;
&lt;br /&gt;
= arp:w =&lt;br /&gt;
This is &amp;quot;nn::arp::detail::IWriter&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || AcquireRegistrar&lt;br /&gt;
|-&lt;br /&gt;
| 1 || DeleteProperties&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== IRegistrar ==&lt;br /&gt;
This is &amp;quot;nn::arp::detail::IRegistrar&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Issue&lt;br /&gt;
|-&lt;br /&gt;
| 1 || SetApplicationLaunchProperty&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SetApplicationControlProperty&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=NS_services&amp;diff=4734</id>
		<title>NS services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=NS_services&amp;diff=4734"/>
		<updated>2018-06-02T22:50:30Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Additional App Record Info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= aoc:u =&lt;br /&gt;
This is &amp;quot;nn::aocsrv::detail::IAddOnContentManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CountAddOnContentByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ListAddOnContentByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 2 || CountAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 3 || ListAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetAddOnContentBaseIdByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 5 || GetAddOnContentBaseId&lt;br /&gt;
|-&lt;br /&gt;
| 6 || PrepareAddOnContentByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 7 || PrepareAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [4.0.0+] GetAddOnContentListChangedEvent&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:am =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IApplicationManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] This service was replaced by [[#ns:am2, ns:ec, ns:rid, ns:rt, ns:web|ns:am2]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ListApplicationRecord]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GenerateApplicationRecordCount&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetApplicationRecordUpdateSystemEvent&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetApplicationViewDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeleteApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeleteApplicationCompletely&lt;br /&gt;
|-&lt;br /&gt;
| 6 || IsAnyApplicationEntityRedundant&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeleteRedundantApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 8 || IsApplicationEntityMovable&lt;br /&gt;
|-&lt;br /&gt;
| 9 || MoveApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 11 || CalculateApplicationOccupiedSize&lt;br /&gt;
|-&lt;br /&gt;
| 16 || PushApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListApplicationRecordContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 18 || &lt;br /&gt;
|-&lt;br /&gt;
| 19 || LaunchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#GetApplicationContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || TerminateApplication&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [2.0.0+] ResolveApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
| 26 || BeginInstallApplication&lt;br /&gt;
|-&lt;br /&gt;
| 27 || DeleteApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 30 || RequestApplicationUpdateInfo&lt;br /&gt;
|-&lt;br /&gt;
| 31 || RequestUpdateApplication&lt;br /&gt;
|-&lt;br /&gt;
| 32 || CancelApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 33 || ResumeApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 34 || &lt;br /&gt;
|-&lt;br /&gt;
| 35 || UpdateVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 36 || PushLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 37 || ListRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 38 || CheckApplicationLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 39 || CheckApplicationLaunchRights&lt;br /&gt;
|-&lt;br /&gt;
| 40 || GetApplicationLogoData&lt;br /&gt;
|-&lt;br /&gt;
| 41 || CalculateApplicationDownloadRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 42 || CleanupSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 43 || CheckSdCardMountStatus&lt;br /&gt;
|-&lt;br /&gt;
| 44 || GetSdCardMountStatusChangedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 45 || GetGameCardAttachmentEvent&lt;br /&gt;
|-&lt;br /&gt;
| 46 || GetGameCardAttachmentInfo&lt;br /&gt;
|-&lt;br /&gt;
| 47 || [[#GetTotalSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 48 || [[#GetFreeSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 49 || GetSdCardRemovedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 52 || GetGameCardUpdateDetectionEvent&lt;br /&gt;
|-&lt;br /&gt;
| 53 || DisableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 54 || EnableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 55 || [[#GetApplicationDesiredLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 56 || SetApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 57 || ClearApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 58 || GetLastSdCardMountUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 59 || ConvertApplicationLanguageToLanguageCode&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [[#ConvertLanguageCodeToApplicationLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || GetBackgroundDownloadStressTaskInfo&lt;br /&gt;
|-&lt;br /&gt;
| 62 || GetGameCardStopper&lt;br /&gt;
|-&lt;br /&gt;
| 63 || IsSystemProgramInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 64 || [2.0.0+] StartApplyDeltaTask&lt;br /&gt;
|-&lt;br /&gt;
| 65 || [2.0.0+] GetRequestServerStopper&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ResetToFactorySettings&lt;br /&gt;
|-&lt;br /&gt;
| 101 || ResetToFactorySettingsWithoutUserSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [2.0.0+] ResetToFactorySettingsForRefurbishment&lt;br /&gt;
|-&lt;br /&gt;
| 200 || CalculateUserSaveDataStatistics&lt;br /&gt;
|-&lt;br /&gt;
| 201 || DeleteUserSaveDataAll&lt;br /&gt;
|-&lt;br /&gt;
| 210 || DeleteUserSystemSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 220 || UnregisterNetworkServiceAccount&lt;br /&gt;
|-&lt;br /&gt;
| 300 || GetApplicationShellEvent&lt;br /&gt;
|-&lt;br /&gt;
| 301 || PopApplicationShellEventInfo&lt;br /&gt;
|-&lt;br /&gt;
| 302 || LaunchLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 303 || TerminateLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 304 || LaunchSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 305 || TerminateSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 306 || LaunchOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 307 || TerminateOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#GetApplicationControlData]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || InvalidateAllApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 402 || RequestDownloadApplicationControlData&lt;br /&gt;
|-&lt;br /&gt;
| 403 || GetMaxApplicationControlCacheCount&lt;br /&gt;
|-&lt;br /&gt;
| 404 || [2.0.0+] InvalidateApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 405 || [2.0.0+] ListApplicationControlCacheEntryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 502 || [2.0.0+] RequestCheckGameCardRegistration&lt;br /&gt;
|-&lt;br /&gt;
| 503 || [2.0.0+] RequestGameCardRegistrationGoldPoint&lt;br /&gt;
|-&lt;br /&gt;
| 504 || [2.0.0+] RequestRegisterGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 600 || [2.0.0+] CountApplicationContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 601 || [2.0.0+] [[#ListApplicationContentMetaStatus]]&lt;br /&gt;
|-&lt;br /&gt;
| 602 || [2.0.0+] ListAvailableAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 603 || [2.0.0+] GetOwnedApplicationContentMetaStatus&lt;br /&gt;
|-&lt;br /&gt;
| 604 || [2.0.0+] RegisterContentsExternalKey&lt;br /&gt;
|-&lt;br /&gt;
| 605 || [2.0.0+] ListApplicationContentMetaStatusWithRightsCheck&lt;br /&gt;
|-&lt;br /&gt;
| 700 || [2.0.0+] PushDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 701 || [2.0.0+] ClearTaskStatusList&lt;br /&gt;
|-&lt;br /&gt;
| 702 || [2.0.0+] RequestDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 703 || [2.0.0+] RequestEnsureDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 704 || [2.0.0+] ListDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 705 || [2.0.0+] RequestDownloadTaskListData&lt;br /&gt;
|-&lt;br /&gt;
| 800 || [2.0.0+] RequestVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 801 || [2.0.0+] ListVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 900 || [2.0.0+] GetApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 901 || [2.0.0+] GetApplicationRecordProperty&lt;br /&gt;
|-&lt;br /&gt;
| 902 || [2.0.0+] EnableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 903 || [2.0.0+] DisableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 904 || [2.0.0+] TouchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 905 || [2.0.0+] RequestApplicationUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 906 || [2.0.0+] IsApplicationUpdateRequested&lt;br /&gt;
|-&lt;br /&gt;
| 907 || [2.0.0+] WithdrawApplicationUpdateRequest&lt;br /&gt;
|-&lt;br /&gt;
| 908 || [2.0.0+] ListApplicationRecordInstalledContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || [2.0.0+] RequestVerifyApplicationDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || [2.0.0+] CorruptApplicationForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1200 || [2.0.0+] NeedsUpdateVulnerability&lt;br /&gt;
|-&lt;br /&gt;
| 1300 || [2.0.0+] IsAnyApplicationEntityInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 1301 || [2.0.0+] DeleteApplicationContentEntities&lt;br /&gt;
|-&lt;br /&gt;
| 1302 || [2.0.0+] CleanupUnrecordedApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1400 || [2.0.0+] PrepareShutdown&lt;br /&gt;
|-&lt;br /&gt;
| 1500 || [2.0.0+] FormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1501 || [2.0.0+] NeedsSystemUpdateToFormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1502 || [2.0.0+] GetLastSdCardFormatUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 1503 || [2.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1600 || [2.0.0+] GetSystemSeedForPseudoDeviceId&lt;br /&gt;
|-&lt;br /&gt;
| 1700 || [2.0.0+] ListApplicationDownloadingContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 1800 || [2.0.0+] IsNotificationSetupCompleted&lt;br /&gt;
|-&lt;br /&gt;
| 1801 || [2.0.0+] GetLastNotificationInfoCount&lt;br /&gt;
|-&lt;br /&gt;
| 1802 || [2.0.0+] ListLastNotificationInfo&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ListApplicationRecord ==&lt;br /&gt;
Takes a type-6 output buffer and an u64.&lt;br /&gt;
&lt;br /&gt;
Returns an array of title-info entries using the specified offset and size. No input titleID is passed to this.&lt;br /&gt;
&lt;br /&gt;
=== Application Record Format ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| Title ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x1&lt;br /&gt;
| Type? (Known values: 2=Installing?, 3=Gamecard?, 4=Installed?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown, usually 0x02&lt;br /&gt;
|-&lt;br /&gt;
| 0xA&lt;br /&gt;
| 0x6&lt;br /&gt;
| Unknown, usually zeros?&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown, seems to change between reboots and removing/reinserting gamecards&lt;br /&gt;
|-&lt;br /&gt;
| 0x11&lt;br /&gt;
| 0x7&lt;br /&gt;
| Unknown, usually zeros?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== GetApplicationContentPath ==&lt;br /&gt;
Takes a 0x16-type output buffer, an u8 [[NCA|type]], and an u64 titleID.&lt;br /&gt;
&lt;br /&gt;
The input titleID is used with the application-title table like various other cmds, anything not in that table can&#039;t be used with this.&lt;br /&gt;
&lt;br /&gt;
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&#039;t exist for this title. Starts with &amp;quot;@{SdCardContent,UserContent}://&amp;quot; and ends in &amp;quot;.nca&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For gamecard content, the output path is: &amp;quot;@GcSXXXXXXXX:/&amp;lt;NcaId&amp;gt;.nca&amp;quot;. NCA-type0 with gamecard returns 0 with an empty output string.&lt;br /&gt;
&lt;br /&gt;
The output string is then used by the user-process with [[Filesystem_services|FS]] to mount the content.&lt;br /&gt;
&lt;br /&gt;
== GetTotalSpaceSize ==&lt;br /&gt;
Takes an input media-id that must be 5.&lt;br /&gt;
&lt;br /&gt;
Returns the u64 from [[Content_Manager_services#IContentStorage]] cmd22.&lt;br /&gt;
&lt;br /&gt;
== GetFreeSpaceSize ==&lt;br /&gt;
Takes an input media-id that must be 5.&lt;br /&gt;
&lt;br /&gt;
Returns the u64 from [[Content_Manager_services#IContentStorage]] cmd23.&lt;br /&gt;
&lt;br /&gt;
== GetApplicationDesiredLanguage ==&lt;br /&gt;
Takes an input u8 language-bitmask, returns an output u8 [[control.nacp]] langentry index.&lt;br /&gt;
&lt;br /&gt;
User-processes generate the language-bitmask with the following for all 16 lang-entries: &amp;lt;code&amp;gt;if(&amp;lt;either string in langentry[i] is non-empty&amp;gt;)bitmask |= 1&amp;lt;&amp;lt;i&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ConvertLanguageCodeToApplicationLanguage ==&lt;br /&gt;
Takes an input u8 pointer for the resulting Id to be written to and a string represented as a u64 (i.e 0x53552D6E65 for &#039;en-US&#039;).&lt;br /&gt;
&lt;br /&gt;
Returns 0 if an ID was successfully found, otherwise returns 0x25810.&lt;br /&gt;
&lt;br /&gt;
== GetApplicationControlData ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Loads cached [[control.nacp]] to buf+0 and the cached icon to buf+0x4000. Returns an error if the buffer is too small.&lt;br /&gt;
&lt;br /&gt;
== ListApplicationContentMetaStatus ==&lt;br /&gt;
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 &amp;gt;= totalentries, this will return 0 with out_entrycount=0.&lt;br /&gt;
&lt;br /&gt;
Entry structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| u8 &amp;quot;type&amp;quot;. [[Content_Manager_services|Title type]] (String is from web-applet)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| u8 &amp;quot;installedStorage&amp;quot; / [[Filesystem_services|StorageId]] (String is from web-applet)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown. Non-zero with output from cmd 605, differs for app/update titles.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| u32 Title-version&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| u64 titleID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:am2, ns:ec, ns:rid, ns:rt, ns:web =&lt;br /&gt;
These services are all, at the top level, &amp;quot;nn::ns::detail::IServiceGetterInterface&amp;quot;. 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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 7992 || [[#IECommerceInterface|GetECommerceInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7993 || [[#IApplicationVersionInterface|GetApplicationVersionInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7994 || [[#IFactoryResetInterface|GetFactoryResetInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7995 || [[#IAccountProxyInterface|GetAccountProxyInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7996 || [[#IApplicationManagerInterface|GetApplicationManagerInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7997 || [[#IDownloadTaskInterface|GetDownloadTaskInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7998 || [[#IContentManagementInterface|GetContentManagementInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7999 || [[#IDocumentInterface|GetDocumentInterface]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IAccountProxyInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IAccountProxyInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CreateUserAccount&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IApplicationManagerInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IApplicationManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ListApplicationRecord]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GenerateApplicationRecordCount&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetApplicationRecordUpdateSystemEvent&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetApplicationViewDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeleteApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeleteApplicationCompletely&lt;br /&gt;
|-&lt;br /&gt;
| 6 || IsAnyApplicationEntityRedundant&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeleteRedundantApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 8 || IsApplicationEntityMovable&lt;br /&gt;
|-&lt;br /&gt;
| 9 || MoveApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 11 || CalculateApplicationOccupiedSize&lt;br /&gt;
|-&lt;br /&gt;
| 16 || PushApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListApplicationRecordContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 19 || LaunchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#GetApplicationContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || TerminateApplication&lt;br /&gt;
|-&lt;br /&gt;
| 23 || ResolveApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
| 26 || BeginInstallApplication&lt;br /&gt;
|-&lt;br /&gt;
| 27 || DeleteApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 30 || RequestApplicationUpdateInfo&lt;br /&gt;
|-&lt;br /&gt;
| 32 || CancelApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 33 || ResumeApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 35 || UpdateVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 36 || PushLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 37 || ListRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 38 || CheckApplicationLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 39 || CheckApplicationLaunchRights&lt;br /&gt;
|-&lt;br /&gt;
| 40 || GetApplicationLogoData&lt;br /&gt;
|-&lt;br /&gt;
| 41 || CalculateApplicationDownloadRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 42 || CleanupSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 43 || CheckSdCardMountStatus&lt;br /&gt;
|-&lt;br /&gt;
| 44 || GetSdCardMountStatusChangedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 45 || GetGameCardAttachmentEvent&lt;br /&gt;
|-&lt;br /&gt;
| 46 || GetGameCardAttachmentInfo&lt;br /&gt;
|-&lt;br /&gt;
| 47 || [[#GetTotalSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 48 || [[#GetFreeSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 49 || GetSdCardRemovedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 52 || GetGameCardUpdateDetectionEvent&lt;br /&gt;
|-&lt;br /&gt;
| 53 || DisableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 54 || EnableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 55 || GetApplicationDesiredLanguage&lt;br /&gt;
|-&lt;br /&gt;
| 56 || SetApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 57 || ClearApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 58 || GetLastSdCardMountUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 59 || ConvertApplicationLanguageToLanguageCode&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [[#ConvertLanguageCodeToApplicationLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || GetBackgroundDownloadStressTaskInfo&lt;br /&gt;
|-&lt;br /&gt;
| 62 || GetGameCardStopper&lt;br /&gt;
|-&lt;br /&gt;
| 63 || IsSystemProgramInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 64 || StartApplyDeltaTask&lt;br /&gt;
|-&lt;br /&gt;
| 65 || GetRequestServerStopper&lt;br /&gt;
|-&lt;br /&gt;
| 66 || GetBackgroundApplyDeltaStressTaskInfo&lt;br /&gt;
|-&lt;br /&gt;
| 67 || CancelApplicationApplyDelta&lt;br /&gt;
|-&lt;br /&gt;
| 68 || ResumeApplicationApplyDelta&lt;br /&gt;
|-&lt;br /&gt;
| 69 || CalculateApplicationApplyDeltaRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 70 || ResumeAll&lt;br /&gt;
|-&lt;br /&gt;
| 71 || GetStorageSize&lt;br /&gt;
|-&lt;br /&gt;
| 80 || RequestDownloadApplication&lt;br /&gt;
|-&lt;br /&gt;
| 81 || RequestDownloadAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 82 || DownloadApplication&lt;br /&gt;
|-&lt;br /&gt;
| 83 || CheckApplicationResumeRights&lt;br /&gt;
|-&lt;br /&gt;
| 84 || GetDynamicCommitEvent&lt;br /&gt;
|-&lt;br /&gt;
| 85 || RequestUpdateApplication2&lt;br /&gt;
|-&lt;br /&gt;
| 86 || EnableApplicationCrashReport&lt;br /&gt;
|-&lt;br /&gt;
| 87 || IsApplicationCrashReportEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 90 || BoostSystemMemoryResourceLimit&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ResetToFactorySettings&lt;br /&gt;
|-&lt;br /&gt;
| 101 || ResetToFactorySettingsWithoutUserSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 102 || ResetToFactorySettingsForRefurbishment&lt;br /&gt;
|-&lt;br /&gt;
| 200 || CalculateUserSaveDataStatistics&lt;br /&gt;
|-&lt;br /&gt;
| 201 || DeleteUserSaveDataAll&lt;br /&gt;
|-&lt;br /&gt;
| 210 || DeleteUserSystemSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 220 || UnregisterNetworkServiceAccount&lt;br /&gt;
|-&lt;br /&gt;
| 300 || GetApplicationShellEvent&lt;br /&gt;
|-&lt;br /&gt;
| 301 || PopApplicationShellEventInfo&lt;br /&gt;
|-&lt;br /&gt;
| 302 || LaunchLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 303 || TerminateLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 304 || LaunchSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 305 || TerminateSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 306 || LaunchOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 307 || TerminateOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 400 || GetApplicationControlData&lt;br /&gt;
|-&lt;br /&gt;
| 401 || InvalidateAllApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 402 || RequestDownloadApplicationControlData&lt;br /&gt;
|-&lt;br /&gt;
| 403 || GetMaxApplicationControlCacheCount&lt;br /&gt;
|-&lt;br /&gt;
| 404 || InvalidateApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 405 || ListApplicationControlCacheEntryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 502 || RequestCheckGameCardRegistration&lt;br /&gt;
|-&lt;br /&gt;
| 503 || RequestGameCardRegistrationGoldPoint&lt;br /&gt;
|-&lt;br /&gt;
| 504 || RequestRegisterGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 505 || GetGameCardMountFailureEvent&lt;br /&gt;
|-&lt;br /&gt;
| 506 || IsGameCardInserted&lt;br /&gt;
|-&lt;br /&gt;
| 507 || EnsureGameCardAccess&lt;br /&gt;
|-&lt;br /&gt;
| 508 || GetLastGameCardMountFailureResult&lt;br /&gt;
|-&lt;br /&gt;
| 509 || ListApplicationIdOnGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 600 || CountApplicationContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 601 || [[#ListApplicationContentMetaStatus]]&lt;br /&gt;
|-&lt;br /&gt;
| 602 || ListAvailableAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 603 || GetOwnedApplicationContentMetaStatus&lt;br /&gt;
|-&lt;br /&gt;
| 604 || RegisterContentsExternalKey&lt;br /&gt;
|-&lt;br /&gt;
| 605 || ListApplicationContentMetaStatusWithRightsCheck&lt;br /&gt;
|-&lt;br /&gt;
| 606 || GetContentMetaStorage&lt;br /&gt;
|-&lt;br /&gt;
| 700 || PushDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 701 || ClearTaskStatusList&lt;br /&gt;
|-&lt;br /&gt;
| 702 || RequestDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 703 || RequestEnsureDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 704 || ListDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 705 || RequestDownloadTaskListData&lt;br /&gt;
|-&lt;br /&gt;
| 800 || RequestVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 801 || ListVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 802 || RequestVersionListData&lt;br /&gt;
|-&lt;br /&gt;
| 900 || GetApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 901 || GetApplicationRecordProperty&lt;br /&gt;
|-&lt;br /&gt;
| 902 || EnableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 903 || DisableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 904 || TouchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 905 || RequestApplicationUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 906 || IsApplicationUpdateRequested&lt;br /&gt;
|-&lt;br /&gt;
| 907 || WithdrawApplicationUpdateRequest&lt;br /&gt;
|-&lt;br /&gt;
| 908 || ListApplicationRecordInstalledContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 909 || WithdrawCleanupAddOnContentsWithNoRightsRecommendation&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || RequestVerifyApplicationDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || CorruptApplicationForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1002 || RequestVerifyAddOnContentsRights&lt;br /&gt;
|-&lt;br /&gt;
| 1003 || RequestVerifyApplication&lt;br /&gt;
|-&lt;br /&gt;
| 1004 || CorruptContentForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1200 || NeedsUpdateVulnerability&lt;br /&gt;
|-&lt;br /&gt;
| 1300 || IsAnyApplicationEntityInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 1301 || DeleteApplicationContentEntities&lt;br /&gt;
|-&lt;br /&gt;
| 1302 || CleanupUnrecordedApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1303 || CleanupAddOnContentsWithNoRights&lt;br /&gt;
|-&lt;br /&gt;
| 1304 || DeleteApplicationContentEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1305 || TryDeleteRunningApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1306 || TryDeleteRunningApplicationCompletely&lt;br /&gt;
|-&lt;br /&gt;
| 1307 || TryDeleteRunningApplicationContentEntities&lt;br /&gt;
|-&lt;br /&gt;
| 1400 || PrepareShutdown&lt;br /&gt;
|-&lt;br /&gt;
| 1500 || FormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1501 || NeedsSystemUpdateToFormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1502 || GetLastSdCardFormatUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 1504 || InsertSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1505 || RemoveSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1600 || GetSystemSeedForPseudoDeviceId&lt;br /&gt;
|-&lt;br /&gt;
| 1601 || ResetSystemSeedForPseudoDeviceId&lt;br /&gt;
|-&lt;br /&gt;
| 1700 || ListApplicationDownloadingContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 1701 || GetApplicationView&lt;br /&gt;
|-&lt;br /&gt;
| 1702 || GetApplicationDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 1703 || GetApplicationViewDownloadErrorContext&lt;br /&gt;
|-&lt;br /&gt;
| 1800 || IsNotificationSetupCompleted&lt;br /&gt;
|-&lt;br /&gt;
| 1801 || GetLastNotificationInfoCount&lt;br /&gt;
|-&lt;br /&gt;
| 1802 || ListLastNotificationInfo&lt;br /&gt;
|-&lt;br /&gt;
| 1803 || ListNotificationTask&lt;br /&gt;
|-&lt;br /&gt;
| 1900 || IsActiveAccount&lt;br /&gt;
|-&lt;br /&gt;
| 1901 || RequestDownloadApplicationPrepurchasedRights&lt;br /&gt;
|-&lt;br /&gt;
| 1902 || GetApplicationTicketInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2000 || GetSystemDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2001 || SelectLatestSystemDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2002 || VerifyDeliveryProtocolVersion&lt;br /&gt;
|-&lt;br /&gt;
| 2003 || GetApplicationDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2004 || HasAllContentsToDeliver&lt;br /&gt;
|-&lt;br /&gt;
| 2005 || CompareApplicationDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2006 || CanDeliverApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2007 || ListContentMetaKeyToDeliverApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2008 || NeedsSystemUpdateToDeliverApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2009 || EstimateRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 2010 || RequestReceiveApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2011 || CommitReceiveApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2012 || GetReceiveApplicationProgress&lt;br /&gt;
|-&lt;br /&gt;
| 2013 || RequestSendApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2014 || GetSendApplicationProgress&lt;br /&gt;
|-&lt;br /&gt;
| 2015 || CompareSystemDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2016 || ListNotCommittedContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 2017 || CreateDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IApplicationVersionInterface ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetLaunchRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 1 || UpgradeLaunchRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 35 || UpdateVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 36 || PushLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 37 || ListRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 800 || RequestVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 801 || ListVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 802 || RequestVersionListData&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || PerformAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IContentManagerInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IContentManagementInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 11 || CalculateApplicationOccupiedSize&lt;br /&gt;
|-&lt;br /&gt;
| 43 || CheckSdCardMountStatus&lt;br /&gt;
|-&lt;br /&gt;
| 47 || GetTotalSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| 48 || GetFreeSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| 600 || CountApplicationContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 601 || ListApplicationContentMetaStatus&lt;br /&gt;
|-&lt;br /&gt;
| 605 || ListApplicationContentMetaStatusWithRightsCheck&lt;br /&gt;
|-&lt;br /&gt;
| 607 || IsAnyApplicationRunning&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IDocumentInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IDocumentInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 21 || GetApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
| 23 || ResolveApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IDownloadTaskInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IDownloadTaskInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 701 || ClearTaskStatusList&lt;br /&gt;
|-&lt;br /&gt;
| 702 || RequestDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 703 || RequestEnsureDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 704 || ListDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 705 || RequestDownloadTaskListData&lt;br /&gt;
|-&lt;br /&gt;
| 706 || TryCommitCurrentApplicationDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 707 || EnableAutoCommit&lt;br /&gt;
|-&lt;br /&gt;
| 708 || DisableAutoCommit&lt;br /&gt;
|-&lt;br /&gt;
| 709 || TriggerDynamicCommitEvent&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IECommerceInterface===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || RequestLinkDevice&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IFactoryResetInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IFactoryResetInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ResetToFactorySettings&lt;br /&gt;
|-&lt;br /&gt;
| 101 || ResetToFactorySettingsWithoutUserSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 102 || ResetToFactorySettingsForRefurbishment&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:vm =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IVulnerabilityManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1200 || [3.0.0+] NeedsUpdateVulnerability&lt;br /&gt;
|-&lt;br /&gt;
| 1201 || [4.0.0+] UpdateSafeSystemVersionForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1202 || [4.0.0+] GetSafeSystemVersion&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:su =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::ISystemUpdateInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetBackgroundNetworkUpdateState&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#ISystemUpdateControl|OpenSystemUpdateControl]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NotifyExFatDriverRequired&lt;br /&gt;
|-&lt;br /&gt;
| 3 || ClearExFatDriverStatusForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 4 || RequestBackgroundNetworkUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 5 || NotifyBackgroundNetworkUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 6 || NotifyExFatDriverDownloadedForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetSystemUpdateNotificationEventForContentDelivery&lt;br /&gt;
|-&lt;br /&gt;
| 10 || NotifySystemUpdateForContentDelivery&lt;br /&gt;
|-&lt;br /&gt;
| 11 || PrepareShutdown&lt;br /&gt;
|-&lt;br /&gt;
| 16 || DestroySystemUpdateTask&lt;br /&gt;
|-&lt;br /&gt;
| 17 || RequestSendSystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 18 || GetSendSystemUpdateProgress&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ISystemUpdateControl ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || HasDownloaded&lt;br /&gt;
|-&lt;br /&gt;
| 1 || RequestCheckLatestUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 2 || RequestDownloadLatestUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetDownloadProgress&lt;br /&gt;
|-&lt;br /&gt;
| 4 || ApplyDownloadedUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 5 || RequestPrepareCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 6 || GetPrepareCardUpdateProgress&lt;br /&gt;
|-&lt;br /&gt;
| 7 || HasPreparedCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 8 || ApplyCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetDownloadedEulaDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetDownloadedEulaData&lt;br /&gt;
|-&lt;br /&gt;
| 11 || SetupCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetPreparedCardUpdateEulaDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 13 || GetPreparedCardUpdateEulaData&lt;br /&gt;
|-&lt;br /&gt;
| 14 || SetupCardUpdateViaSystemUpdater&lt;br /&gt;
|-&lt;br /&gt;
| 15 || HasReceived&lt;br /&gt;
|-&lt;br /&gt;
| 16 || RequestReceiveSystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 17 || GetReceiveProgress&lt;br /&gt;
|-&lt;br /&gt;
| 18 || ApplyReceivedUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 19 || GetReceivedEulaDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 20 || GetReceivedEulaData&lt;br /&gt;
|-&lt;br /&gt;
| 21 || SetupToReceiveSystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:dev =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IDevelopInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#LaunchProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#TerminateProcess]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#TerminateProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetShellEventHandle]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetShellEventInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#TerminateApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#PrepareLaunchProgramFromHost]]&lt;br /&gt;
|-&lt;br /&gt;
| 7 || LaunchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 8 || LaunchApplicationWithStorageId&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LaunchProgram ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#LaunchProcess|LaunchProcess]].&lt;br /&gt;
&lt;br /&gt;
== TerminateProcess ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#TerminateTitleByPid|TerminateTitleByPid]].&lt;br /&gt;
&lt;br /&gt;
== TerminateProgram ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#TerminateTitleByTitleId|TerminateTitleByTitleId]].&lt;br /&gt;
&lt;br /&gt;
== GetShellEventHandle==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#GetProcessEventWaiter|GetProcessEventWaiter]].&lt;br /&gt;
&lt;br /&gt;
== GetShellEventInfo ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#GetProcessEventType|GetProcessEventType]].&lt;br /&gt;
&lt;br /&gt;
== TerminateApplication ==&lt;br /&gt;
Calls &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#GetCrashingProcessPid|GetCrashingProcessPid]] and sends PID to [[Process_Manager_services#TerminateTitleByPid|TerminateTitleByPid]].&lt;br /&gt;
&lt;br /&gt;
== PrepareLaunchProgramFromHost ==&lt;br /&gt;
Calls [[NCM_services#IPathResolverForStorage|IPathResolverForStorage]] Set...NcaPath functions.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=NS_services&amp;diff=4733</id>
		<title>NS services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=NS_services&amp;diff=4733"/>
		<updated>2018-06-02T22:26:54Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Added current findings on Application Records&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= aoc:u =&lt;br /&gt;
This is &amp;quot;nn::aocsrv::detail::IAddOnContentManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CountAddOnContentByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ListAddOnContentByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 2 || CountAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 3 || ListAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetAddOnContentBaseIdByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 5 || GetAddOnContentBaseId&lt;br /&gt;
|-&lt;br /&gt;
| 6 || PrepareAddOnContentByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 7 || PrepareAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [4.0.0+] GetAddOnContentListChangedEvent&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:am =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IApplicationManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] This service was replaced by [[#ns:am2, ns:ec, ns:rid, ns:rt, ns:web|ns:am2]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ListApplicationRecord]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GenerateApplicationRecordCount&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetApplicationRecordUpdateSystemEvent&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetApplicationViewDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeleteApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeleteApplicationCompletely&lt;br /&gt;
|-&lt;br /&gt;
| 6 || IsAnyApplicationEntityRedundant&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeleteRedundantApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 8 || IsApplicationEntityMovable&lt;br /&gt;
|-&lt;br /&gt;
| 9 || MoveApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 11 || CalculateApplicationOccupiedSize&lt;br /&gt;
|-&lt;br /&gt;
| 16 || PushApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListApplicationRecordContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 18 || &lt;br /&gt;
|-&lt;br /&gt;
| 19 || LaunchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#GetApplicationContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || TerminateApplication&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [2.0.0+] ResolveApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
| 26 || BeginInstallApplication&lt;br /&gt;
|-&lt;br /&gt;
| 27 || DeleteApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 30 || RequestApplicationUpdateInfo&lt;br /&gt;
|-&lt;br /&gt;
| 31 || RequestUpdateApplication&lt;br /&gt;
|-&lt;br /&gt;
| 32 || CancelApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 33 || ResumeApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 34 || &lt;br /&gt;
|-&lt;br /&gt;
| 35 || UpdateVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 36 || PushLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 37 || ListRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 38 || CheckApplicationLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 39 || CheckApplicationLaunchRights&lt;br /&gt;
|-&lt;br /&gt;
| 40 || GetApplicationLogoData&lt;br /&gt;
|-&lt;br /&gt;
| 41 || CalculateApplicationDownloadRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 42 || CleanupSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 43 || CheckSdCardMountStatus&lt;br /&gt;
|-&lt;br /&gt;
| 44 || GetSdCardMountStatusChangedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 45 || GetGameCardAttachmentEvent&lt;br /&gt;
|-&lt;br /&gt;
| 46 || GetGameCardAttachmentInfo&lt;br /&gt;
|-&lt;br /&gt;
| 47 || [[#GetTotalSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 48 || [[#GetFreeSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 49 || GetSdCardRemovedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 52 || GetGameCardUpdateDetectionEvent&lt;br /&gt;
|-&lt;br /&gt;
| 53 || DisableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 54 || EnableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 55 || [[#GetApplicationDesiredLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 56 || SetApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 57 || ClearApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 58 || GetLastSdCardMountUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 59 || ConvertApplicationLanguageToLanguageCode&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [[#ConvertLanguageCodeToApplicationLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || GetBackgroundDownloadStressTaskInfo&lt;br /&gt;
|-&lt;br /&gt;
| 62 || GetGameCardStopper&lt;br /&gt;
|-&lt;br /&gt;
| 63 || IsSystemProgramInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 64 || [2.0.0+] StartApplyDeltaTask&lt;br /&gt;
|-&lt;br /&gt;
| 65 || [2.0.0+] GetRequestServerStopper&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ResetToFactorySettings&lt;br /&gt;
|-&lt;br /&gt;
| 101 || ResetToFactorySettingsWithoutUserSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [2.0.0+] ResetToFactorySettingsForRefurbishment&lt;br /&gt;
|-&lt;br /&gt;
| 200 || CalculateUserSaveDataStatistics&lt;br /&gt;
|-&lt;br /&gt;
| 201 || DeleteUserSaveDataAll&lt;br /&gt;
|-&lt;br /&gt;
| 210 || DeleteUserSystemSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 220 || UnregisterNetworkServiceAccount&lt;br /&gt;
|-&lt;br /&gt;
| 300 || GetApplicationShellEvent&lt;br /&gt;
|-&lt;br /&gt;
| 301 || PopApplicationShellEventInfo&lt;br /&gt;
|-&lt;br /&gt;
| 302 || LaunchLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 303 || TerminateLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 304 || LaunchSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 305 || TerminateSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 306 || LaunchOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 307 || TerminateOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#GetApplicationControlData]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || InvalidateAllApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 402 || RequestDownloadApplicationControlData&lt;br /&gt;
|-&lt;br /&gt;
| 403 || GetMaxApplicationControlCacheCount&lt;br /&gt;
|-&lt;br /&gt;
| 404 || [2.0.0+] InvalidateApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 405 || [2.0.0+] ListApplicationControlCacheEntryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 502 || [2.0.0+] RequestCheckGameCardRegistration&lt;br /&gt;
|-&lt;br /&gt;
| 503 || [2.0.0+] RequestGameCardRegistrationGoldPoint&lt;br /&gt;
|-&lt;br /&gt;
| 504 || [2.0.0+] RequestRegisterGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 600 || [2.0.0+] CountApplicationContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 601 || [2.0.0+] [[#ListApplicationContentMetaStatus]]&lt;br /&gt;
|-&lt;br /&gt;
| 602 || [2.0.0+] ListAvailableAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 603 || [2.0.0+] GetOwnedApplicationContentMetaStatus&lt;br /&gt;
|-&lt;br /&gt;
| 604 || [2.0.0+] RegisterContentsExternalKey&lt;br /&gt;
|-&lt;br /&gt;
| 605 || [2.0.0+] ListApplicationContentMetaStatusWithRightsCheck&lt;br /&gt;
|-&lt;br /&gt;
| 700 || [2.0.0+] PushDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 701 || [2.0.0+] ClearTaskStatusList&lt;br /&gt;
|-&lt;br /&gt;
| 702 || [2.0.0+] RequestDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 703 || [2.0.0+] RequestEnsureDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 704 || [2.0.0+] ListDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 705 || [2.0.0+] RequestDownloadTaskListData&lt;br /&gt;
|-&lt;br /&gt;
| 800 || [2.0.0+] RequestVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 801 || [2.0.0+] ListVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 900 || [2.0.0+] GetApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 901 || [2.0.0+] GetApplicationRecordProperty&lt;br /&gt;
|-&lt;br /&gt;
| 902 || [2.0.0+] EnableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 903 || [2.0.0+] DisableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 904 || [2.0.0+] TouchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 905 || [2.0.0+] RequestApplicationUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 906 || [2.0.0+] IsApplicationUpdateRequested&lt;br /&gt;
|-&lt;br /&gt;
| 907 || [2.0.0+] WithdrawApplicationUpdateRequest&lt;br /&gt;
|-&lt;br /&gt;
| 908 || [2.0.0+] ListApplicationRecordInstalledContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || [2.0.0+] RequestVerifyApplicationDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || [2.0.0+] CorruptApplicationForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1200 || [2.0.0+] NeedsUpdateVulnerability&lt;br /&gt;
|-&lt;br /&gt;
| 1300 || [2.0.0+] IsAnyApplicationEntityInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 1301 || [2.0.0+] DeleteApplicationContentEntities&lt;br /&gt;
|-&lt;br /&gt;
| 1302 || [2.0.0+] CleanupUnrecordedApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1400 || [2.0.0+] PrepareShutdown&lt;br /&gt;
|-&lt;br /&gt;
| 1500 || [2.0.0+] FormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1501 || [2.0.0+] NeedsSystemUpdateToFormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1502 || [2.0.0+] GetLastSdCardFormatUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 1503 || [2.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1600 || [2.0.0+] GetSystemSeedForPseudoDeviceId&lt;br /&gt;
|-&lt;br /&gt;
| 1700 || [2.0.0+] ListApplicationDownloadingContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 1800 || [2.0.0+] IsNotificationSetupCompleted&lt;br /&gt;
|-&lt;br /&gt;
| 1801 || [2.0.0+] GetLastNotificationInfoCount&lt;br /&gt;
|-&lt;br /&gt;
| 1802 || [2.0.0+] ListLastNotificationInfo&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ListApplicationRecord ==&lt;br /&gt;
Takes a type-6 output buffer and an u64.&lt;br /&gt;
&lt;br /&gt;
Returns an array of title-info entries using the specified offset and size. No input titleID is passed to this.&lt;br /&gt;
&lt;br /&gt;
=== Application Record Format ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x8&lt;br /&gt;
| Title ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x1&lt;br /&gt;
| Type? (Known values: 2=Installing?, 3=Gamecard?, 4=Installed?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0xA&lt;br /&gt;
| 0x6&lt;br /&gt;
| Unknown, usually zeros?&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x11&lt;br /&gt;
| 0x7&lt;br /&gt;
| Unknown, usually zeros?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== GetApplicationContentPath ==&lt;br /&gt;
Takes a 0x16-type output buffer, an u8 [[NCA|type]], and an u64 titleID.&lt;br /&gt;
&lt;br /&gt;
The input titleID is used with the application-title table like various other cmds, anything not in that table can&#039;t be used with this.&lt;br /&gt;
&lt;br /&gt;
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&#039;t exist for this title. Starts with &amp;quot;@{SdCardContent,UserContent}://&amp;quot; and ends in &amp;quot;.nca&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For gamecard content, the output path is: &amp;quot;@GcSXXXXXXXX:/&amp;lt;NcaId&amp;gt;.nca&amp;quot;. NCA-type0 with gamecard returns 0 with an empty output string.&lt;br /&gt;
&lt;br /&gt;
The output string is then used by the user-process with [[Filesystem_services|FS]] to mount the content.&lt;br /&gt;
&lt;br /&gt;
== GetTotalSpaceSize ==&lt;br /&gt;
Takes an input media-id that must be 5.&lt;br /&gt;
&lt;br /&gt;
Returns the u64 from [[Content_Manager_services#IContentStorage]] cmd22.&lt;br /&gt;
&lt;br /&gt;
== GetFreeSpaceSize ==&lt;br /&gt;
Takes an input media-id that must be 5.&lt;br /&gt;
&lt;br /&gt;
Returns the u64 from [[Content_Manager_services#IContentStorage]] cmd23.&lt;br /&gt;
&lt;br /&gt;
== GetApplicationDesiredLanguage ==&lt;br /&gt;
Takes an input u8 language-bitmask, returns an output u8 [[control.nacp]] langentry index.&lt;br /&gt;
&lt;br /&gt;
User-processes generate the language-bitmask with the following for all 16 lang-entries: &amp;lt;code&amp;gt;if(&amp;lt;either string in langentry[i] is non-empty&amp;gt;)bitmask |= 1&amp;lt;&amp;lt;i&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ConvertLanguageCodeToApplicationLanguage ==&lt;br /&gt;
Takes an input u8 pointer for the resulting Id to be written to and a string represented as a u64 (i.e 0x53552D6E65 for &#039;en-US&#039;).&lt;br /&gt;
&lt;br /&gt;
Returns 0 if an ID was successfully found, otherwise returns 0x25810.&lt;br /&gt;
&lt;br /&gt;
== GetApplicationControlData ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Loads cached [[control.nacp]] to buf+0 and the cached icon to buf+0x4000. Returns an error if the buffer is too small.&lt;br /&gt;
&lt;br /&gt;
== ListApplicationContentMetaStatus ==&lt;br /&gt;
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 &amp;gt;= totalentries, this will return 0 with out_entrycount=0.&lt;br /&gt;
&lt;br /&gt;
Entry structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| u8 &amp;quot;type&amp;quot;. [[Content_Manager_services|Title type]] (String is from web-applet)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| u8 &amp;quot;installedStorage&amp;quot; / [[Filesystem_services|StorageId]] (String is from web-applet)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown. Non-zero with output from cmd 605, differs for app/update titles.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| u32 Title-version&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| u64 titleID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:am2, ns:ec, ns:rid, ns:rt, ns:web =&lt;br /&gt;
These services are all, at the top level, &amp;quot;nn::ns::detail::IServiceGetterInterface&amp;quot;. 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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 7992 || [[#IECommerceInterface|GetECommerceInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7993 || [[#IApplicationVersionInterface|GetApplicationVersionInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7994 || [[#IFactoryResetInterface|GetFactoryResetInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7995 || [[#IAccountProxyInterface|GetAccountProxyInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7996 || [[#IApplicationManagerInterface|GetApplicationManagerInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7997 || [[#IDownloadTaskInterface|GetDownloadTaskInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7998 || [[#IContentManagementInterface|GetContentManagementInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7999 || [[#IDocumentInterface|GetDocumentInterface]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IAccountProxyInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IAccountProxyInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CreateUserAccount&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IApplicationManagerInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IApplicationManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ListApplicationRecord]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GenerateApplicationRecordCount&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetApplicationRecordUpdateSystemEvent&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetApplicationViewDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeleteApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeleteApplicationCompletely&lt;br /&gt;
|-&lt;br /&gt;
| 6 || IsAnyApplicationEntityRedundant&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeleteRedundantApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 8 || IsApplicationEntityMovable&lt;br /&gt;
|-&lt;br /&gt;
| 9 || MoveApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 11 || CalculateApplicationOccupiedSize&lt;br /&gt;
|-&lt;br /&gt;
| 16 || PushApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListApplicationRecordContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 19 || LaunchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#GetApplicationContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || TerminateApplication&lt;br /&gt;
|-&lt;br /&gt;
| 23 || ResolveApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
| 26 || BeginInstallApplication&lt;br /&gt;
|-&lt;br /&gt;
| 27 || DeleteApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 30 || RequestApplicationUpdateInfo&lt;br /&gt;
|-&lt;br /&gt;
| 32 || CancelApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 33 || ResumeApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 35 || UpdateVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 36 || PushLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 37 || ListRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 38 || CheckApplicationLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 39 || CheckApplicationLaunchRights&lt;br /&gt;
|-&lt;br /&gt;
| 40 || GetApplicationLogoData&lt;br /&gt;
|-&lt;br /&gt;
| 41 || CalculateApplicationDownloadRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 42 || CleanupSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 43 || CheckSdCardMountStatus&lt;br /&gt;
|-&lt;br /&gt;
| 44 || GetSdCardMountStatusChangedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 45 || GetGameCardAttachmentEvent&lt;br /&gt;
|-&lt;br /&gt;
| 46 || GetGameCardAttachmentInfo&lt;br /&gt;
|-&lt;br /&gt;
| 47 || [[#GetTotalSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 48 || [[#GetFreeSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 49 || GetSdCardRemovedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 52 || GetGameCardUpdateDetectionEvent&lt;br /&gt;
|-&lt;br /&gt;
| 53 || DisableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 54 || EnableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 55 || GetApplicationDesiredLanguage&lt;br /&gt;
|-&lt;br /&gt;
| 56 || SetApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 57 || ClearApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 58 || GetLastSdCardMountUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 59 || ConvertApplicationLanguageToLanguageCode&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [[#ConvertLanguageCodeToApplicationLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || GetBackgroundDownloadStressTaskInfo&lt;br /&gt;
|-&lt;br /&gt;
| 62 || GetGameCardStopper&lt;br /&gt;
|-&lt;br /&gt;
| 63 || IsSystemProgramInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 64 || StartApplyDeltaTask&lt;br /&gt;
|-&lt;br /&gt;
| 65 || GetRequestServerStopper&lt;br /&gt;
|-&lt;br /&gt;
| 66 || GetBackgroundApplyDeltaStressTaskInfo&lt;br /&gt;
|-&lt;br /&gt;
| 67 || CancelApplicationApplyDelta&lt;br /&gt;
|-&lt;br /&gt;
| 68 || ResumeApplicationApplyDelta&lt;br /&gt;
|-&lt;br /&gt;
| 69 || CalculateApplicationApplyDeltaRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 70 || ResumeAll&lt;br /&gt;
|-&lt;br /&gt;
| 71 || GetStorageSize&lt;br /&gt;
|-&lt;br /&gt;
| 80 || RequestDownloadApplication&lt;br /&gt;
|-&lt;br /&gt;
| 81 || RequestDownloadAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 82 || DownloadApplication&lt;br /&gt;
|-&lt;br /&gt;
| 83 || CheckApplicationResumeRights&lt;br /&gt;
|-&lt;br /&gt;
| 84 || GetDynamicCommitEvent&lt;br /&gt;
|-&lt;br /&gt;
| 85 || RequestUpdateApplication2&lt;br /&gt;
|-&lt;br /&gt;
| 86 || EnableApplicationCrashReport&lt;br /&gt;
|-&lt;br /&gt;
| 87 || IsApplicationCrashReportEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 90 || BoostSystemMemoryResourceLimit&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ResetToFactorySettings&lt;br /&gt;
|-&lt;br /&gt;
| 101 || ResetToFactorySettingsWithoutUserSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 102 || ResetToFactorySettingsForRefurbishment&lt;br /&gt;
|-&lt;br /&gt;
| 200 || CalculateUserSaveDataStatistics&lt;br /&gt;
|-&lt;br /&gt;
| 201 || DeleteUserSaveDataAll&lt;br /&gt;
|-&lt;br /&gt;
| 210 || DeleteUserSystemSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 220 || UnregisterNetworkServiceAccount&lt;br /&gt;
|-&lt;br /&gt;
| 300 || GetApplicationShellEvent&lt;br /&gt;
|-&lt;br /&gt;
| 301 || PopApplicationShellEventInfo&lt;br /&gt;
|-&lt;br /&gt;
| 302 || LaunchLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 303 || TerminateLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 304 || LaunchSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 305 || TerminateSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 306 || LaunchOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 307 || TerminateOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 400 || GetApplicationControlData&lt;br /&gt;
|-&lt;br /&gt;
| 401 || InvalidateAllApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 402 || RequestDownloadApplicationControlData&lt;br /&gt;
|-&lt;br /&gt;
| 403 || GetMaxApplicationControlCacheCount&lt;br /&gt;
|-&lt;br /&gt;
| 404 || InvalidateApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 405 || ListApplicationControlCacheEntryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 502 || RequestCheckGameCardRegistration&lt;br /&gt;
|-&lt;br /&gt;
| 503 || RequestGameCardRegistrationGoldPoint&lt;br /&gt;
|-&lt;br /&gt;
| 504 || RequestRegisterGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 505 || GetGameCardMountFailureEvent&lt;br /&gt;
|-&lt;br /&gt;
| 506 || IsGameCardInserted&lt;br /&gt;
|-&lt;br /&gt;
| 507 || EnsureGameCardAccess&lt;br /&gt;
|-&lt;br /&gt;
| 508 || GetLastGameCardMountFailureResult&lt;br /&gt;
|-&lt;br /&gt;
| 509 || ListApplicationIdOnGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 600 || CountApplicationContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 601 || [[#ListApplicationContentMetaStatus]]&lt;br /&gt;
|-&lt;br /&gt;
| 602 || ListAvailableAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 603 || GetOwnedApplicationContentMetaStatus&lt;br /&gt;
|-&lt;br /&gt;
| 604 || RegisterContentsExternalKey&lt;br /&gt;
|-&lt;br /&gt;
| 605 || ListApplicationContentMetaStatusWithRightsCheck&lt;br /&gt;
|-&lt;br /&gt;
| 606 || GetContentMetaStorage&lt;br /&gt;
|-&lt;br /&gt;
| 700 || PushDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 701 || ClearTaskStatusList&lt;br /&gt;
|-&lt;br /&gt;
| 702 || RequestDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 703 || RequestEnsureDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 704 || ListDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 705 || RequestDownloadTaskListData&lt;br /&gt;
|-&lt;br /&gt;
| 800 || RequestVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 801 || ListVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 802 || RequestVersionListData&lt;br /&gt;
|-&lt;br /&gt;
| 900 || GetApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 901 || GetApplicationRecordProperty&lt;br /&gt;
|-&lt;br /&gt;
| 902 || EnableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 903 || DisableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 904 || TouchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 905 || RequestApplicationUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 906 || IsApplicationUpdateRequested&lt;br /&gt;
|-&lt;br /&gt;
| 907 || WithdrawApplicationUpdateRequest&lt;br /&gt;
|-&lt;br /&gt;
| 908 || ListApplicationRecordInstalledContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 909 || WithdrawCleanupAddOnContentsWithNoRightsRecommendation&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || RequestVerifyApplicationDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || CorruptApplicationForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1002 || RequestVerifyAddOnContentsRights&lt;br /&gt;
|-&lt;br /&gt;
| 1003 || RequestVerifyApplication&lt;br /&gt;
|-&lt;br /&gt;
| 1004 || CorruptContentForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1200 || NeedsUpdateVulnerability&lt;br /&gt;
|-&lt;br /&gt;
| 1300 || IsAnyApplicationEntityInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 1301 || DeleteApplicationContentEntities&lt;br /&gt;
|-&lt;br /&gt;
| 1302 || CleanupUnrecordedApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1303 || CleanupAddOnContentsWithNoRights&lt;br /&gt;
|-&lt;br /&gt;
| 1304 || DeleteApplicationContentEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1305 || TryDeleteRunningApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1306 || TryDeleteRunningApplicationCompletely&lt;br /&gt;
|-&lt;br /&gt;
| 1307 || TryDeleteRunningApplicationContentEntities&lt;br /&gt;
|-&lt;br /&gt;
| 1400 || PrepareShutdown&lt;br /&gt;
|-&lt;br /&gt;
| 1500 || FormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1501 || NeedsSystemUpdateToFormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1502 || GetLastSdCardFormatUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 1504 || InsertSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1505 || RemoveSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1600 || GetSystemSeedForPseudoDeviceId&lt;br /&gt;
|-&lt;br /&gt;
| 1601 || ResetSystemSeedForPseudoDeviceId&lt;br /&gt;
|-&lt;br /&gt;
| 1700 || ListApplicationDownloadingContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 1701 || GetApplicationView&lt;br /&gt;
|-&lt;br /&gt;
| 1702 || GetApplicationDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 1703 || GetApplicationViewDownloadErrorContext&lt;br /&gt;
|-&lt;br /&gt;
| 1800 || IsNotificationSetupCompleted&lt;br /&gt;
|-&lt;br /&gt;
| 1801 || GetLastNotificationInfoCount&lt;br /&gt;
|-&lt;br /&gt;
| 1802 || ListLastNotificationInfo&lt;br /&gt;
|-&lt;br /&gt;
| 1803 || ListNotificationTask&lt;br /&gt;
|-&lt;br /&gt;
| 1900 || IsActiveAccount&lt;br /&gt;
|-&lt;br /&gt;
| 1901 || RequestDownloadApplicationPrepurchasedRights&lt;br /&gt;
|-&lt;br /&gt;
| 1902 || GetApplicationTicketInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2000 || GetSystemDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2001 || SelectLatestSystemDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2002 || VerifyDeliveryProtocolVersion&lt;br /&gt;
|-&lt;br /&gt;
| 2003 || GetApplicationDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2004 || HasAllContentsToDeliver&lt;br /&gt;
|-&lt;br /&gt;
| 2005 || CompareApplicationDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2006 || CanDeliverApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2007 || ListContentMetaKeyToDeliverApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2008 || NeedsSystemUpdateToDeliverApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2009 || EstimateRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 2010 || RequestReceiveApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2011 || CommitReceiveApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2012 || GetReceiveApplicationProgress&lt;br /&gt;
|-&lt;br /&gt;
| 2013 || RequestSendApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2014 || GetSendApplicationProgress&lt;br /&gt;
|-&lt;br /&gt;
| 2015 || CompareSystemDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2016 || ListNotCommittedContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 2017 || CreateDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IApplicationVersionInterface ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetLaunchRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 1 || UpgradeLaunchRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 35 || UpdateVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 36 || PushLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 37 || ListRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 800 || RequestVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 801 || ListVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 802 || RequestVersionListData&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || PerformAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IContentManagerInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IContentManagementInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 11 || CalculateApplicationOccupiedSize&lt;br /&gt;
|-&lt;br /&gt;
| 43 || CheckSdCardMountStatus&lt;br /&gt;
|-&lt;br /&gt;
| 47 || GetTotalSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| 48 || GetFreeSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| 600 || CountApplicationContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 601 || ListApplicationContentMetaStatus&lt;br /&gt;
|-&lt;br /&gt;
| 605 || ListApplicationContentMetaStatusWithRightsCheck&lt;br /&gt;
|-&lt;br /&gt;
| 607 || IsAnyApplicationRunning&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IDocumentInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IDocumentInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 21 || GetApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
| 23 || ResolveApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IDownloadTaskInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IDownloadTaskInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 701 || ClearTaskStatusList&lt;br /&gt;
|-&lt;br /&gt;
| 702 || RequestDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 703 || RequestEnsureDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 704 || ListDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 705 || RequestDownloadTaskListData&lt;br /&gt;
|-&lt;br /&gt;
| 706 || TryCommitCurrentApplicationDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 707 || EnableAutoCommit&lt;br /&gt;
|-&lt;br /&gt;
| 708 || DisableAutoCommit&lt;br /&gt;
|-&lt;br /&gt;
| 709 || TriggerDynamicCommitEvent&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IECommerceInterface===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || RequestLinkDevice&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IFactoryResetInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IFactoryResetInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ResetToFactorySettings&lt;br /&gt;
|-&lt;br /&gt;
| 101 || ResetToFactorySettingsWithoutUserSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 102 || ResetToFactorySettingsForRefurbishment&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:vm =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IVulnerabilityManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1200 || [3.0.0+] NeedsUpdateVulnerability&lt;br /&gt;
|-&lt;br /&gt;
| 1201 || [4.0.0+] UpdateSafeSystemVersionForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1202 || [4.0.0+] GetSafeSystemVersion&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:su =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::ISystemUpdateInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetBackgroundNetworkUpdateState&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#ISystemUpdateControl|OpenSystemUpdateControl]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NotifyExFatDriverRequired&lt;br /&gt;
|-&lt;br /&gt;
| 3 || ClearExFatDriverStatusForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 4 || RequestBackgroundNetworkUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 5 || NotifyBackgroundNetworkUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 6 || NotifyExFatDriverDownloadedForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetSystemUpdateNotificationEventForContentDelivery&lt;br /&gt;
|-&lt;br /&gt;
| 10 || NotifySystemUpdateForContentDelivery&lt;br /&gt;
|-&lt;br /&gt;
| 11 || PrepareShutdown&lt;br /&gt;
|-&lt;br /&gt;
| 16 || DestroySystemUpdateTask&lt;br /&gt;
|-&lt;br /&gt;
| 17 || RequestSendSystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 18 || GetSendSystemUpdateProgress&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ISystemUpdateControl ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || HasDownloaded&lt;br /&gt;
|-&lt;br /&gt;
| 1 || RequestCheckLatestUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 2 || RequestDownloadLatestUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetDownloadProgress&lt;br /&gt;
|-&lt;br /&gt;
| 4 || ApplyDownloadedUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 5 || RequestPrepareCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 6 || GetPrepareCardUpdateProgress&lt;br /&gt;
|-&lt;br /&gt;
| 7 || HasPreparedCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 8 || ApplyCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetDownloadedEulaDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetDownloadedEulaData&lt;br /&gt;
|-&lt;br /&gt;
| 11 || SetupCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetPreparedCardUpdateEulaDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 13 || GetPreparedCardUpdateEulaData&lt;br /&gt;
|-&lt;br /&gt;
| 14 || SetupCardUpdateViaSystemUpdater&lt;br /&gt;
|-&lt;br /&gt;
| 15 || HasReceived&lt;br /&gt;
|-&lt;br /&gt;
| 16 || RequestReceiveSystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 17 || GetReceiveProgress&lt;br /&gt;
|-&lt;br /&gt;
| 18 || ApplyReceivedUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 19 || GetReceivedEulaDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 20 || GetReceivedEulaData&lt;br /&gt;
|-&lt;br /&gt;
| 21 || SetupToReceiveSystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:dev =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IDevelopInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#LaunchProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#TerminateProcess]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#TerminateProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetShellEventHandle]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetShellEventInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#TerminateApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#PrepareLaunchProgramFromHost]]&lt;br /&gt;
|-&lt;br /&gt;
| 7 || LaunchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 8 || LaunchApplicationWithStorageId&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LaunchProgram ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#LaunchProcess|LaunchProcess]].&lt;br /&gt;
&lt;br /&gt;
== TerminateProcess ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#TerminateTitleByPid|TerminateTitleByPid]].&lt;br /&gt;
&lt;br /&gt;
== TerminateProgram ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#TerminateTitleByTitleId|TerminateTitleByTitleId]].&lt;br /&gt;
&lt;br /&gt;
== GetShellEventHandle==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#GetProcessEventWaiter|GetProcessEventWaiter]].&lt;br /&gt;
&lt;br /&gt;
== GetShellEventInfo ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#GetProcessEventType|GetProcessEventType]].&lt;br /&gt;
&lt;br /&gt;
== TerminateApplication ==&lt;br /&gt;
Calls &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#GetCrashingProcessPid|GetCrashingProcessPid]] and sends PID to [[Process_Manager_services#TerminateTitleByPid|TerminateTitleByPid]].&lt;br /&gt;
&lt;br /&gt;
== PrepareLaunchProgramFromHost ==&lt;br /&gt;
Calls [[NCM_services#IPathResolverForStorage|IPathResolverForStorage]] Set...NcaPath functions.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=NS_services&amp;diff=4724</id>
		<title>NS services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=NS_services&amp;diff=4724"/>
		<updated>2018-06-01T01:11:09Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Added ns:vm command version info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= aoc:u =&lt;br /&gt;
This is &amp;quot;nn::aocsrv::detail::IAddOnContentManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CountAddOnContentByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ListAddOnContentByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 2 || CountAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 3 || ListAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetAddOnContentBaseIdByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 5 || GetAddOnContentBaseId&lt;br /&gt;
|-&lt;br /&gt;
| 6 || PrepareAddOnContentByApplicationId&lt;br /&gt;
|-&lt;br /&gt;
| 7 || PrepareAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [4.0.0+] GetAddOnContentListChangedEvent&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:am =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IApplicationManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[3.0.0+] This service was replaced by [[#ns:am2, ns:ec, ns:rid, ns:rt, ns:web|ns:am2]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ListApplicationRecord]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GenerateApplicationRecordCount&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetApplicationRecordUpdateSystemEvent&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetApplicationViewDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeleteApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeleteApplicationCompletely&lt;br /&gt;
|-&lt;br /&gt;
| 6 || IsAnyApplicationEntityRedundant&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeleteRedundantApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 8 || IsApplicationEntityMovable&lt;br /&gt;
|-&lt;br /&gt;
| 9 || MoveApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 11 || CalculateApplicationOccupiedSize&lt;br /&gt;
|-&lt;br /&gt;
| 16 || PushApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListApplicationRecordContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 18 || &lt;br /&gt;
|-&lt;br /&gt;
| 19 || LaunchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#GetApplicationContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || TerminateApplication&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [2.0.0+] ResolveApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
| 26 || BeginInstallApplication&lt;br /&gt;
|-&lt;br /&gt;
| 27 || DeleteApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 30 || RequestApplicationUpdateInfo&lt;br /&gt;
|-&lt;br /&gt;
| 31 || RequestUpdateApplication&lt;br /&gt;
|-&lt;br /&gt;
| 32 || CancelApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 33 || ResumeApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 34 || &lt;br /&gt;
|-&lt;br /&gt;
| 35 || UpdateVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 36 || PushLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 37 || ListRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 38 || CheckApplicationLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 39 || CheckApplicationLaunchRights&lt;br /&gt;
|-&lt;br /&gt;
| 40 || GetApplicationLogoData&lt;br /&gt;
|-&lt;br /&gt;
| 41 || CalculateApplicationDownloadRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 42 || CleanupSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 43 || CheckSdCardMountStatus&lt;br /&gt;
|-&lt;br /&gt;
| 44 || GetSdCardMountStatusChangedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 45 || GetGameCardAttachmentEvent&lt;br /&gt;
|-&lt;br /&gt;
| 46 || GetGameCardAttachmentInfo&lt;br /&gt;
|-&lt;br /&gt;
| 47 || [[#GetTotalSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 48 || [[#GetFreeSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 49 || GetSdCardRemovedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 52 || GetGameCardUpdateDetectionEvent&lt;br /&gt;
|-&lt;br /&gt;
| 53 || DisableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 54 || EnableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 55 || [[#GetApplicationDesiredLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 56 || SetApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 57 || ClearApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 58 || GetLastSdCardMountUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 59 || ConvertApplicationLanguageToLanguageCode&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [[#ConvertLanguageCodeToApplicationLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || GetBackgroundDownloadStressTaskInfo&lt;br /&gt;
|-&lt;br /&gt;
| 62 || GetGameCardStopper&lt;br /&gt;
|-&lt;br /&gt;
| 63 || IsSystemProgramInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 64 || [2.0.0+] StartApplyDeltaTask&lt;br /&gt;
|-&lt;br /&gt;
| 65 || [2.0.0+] GetRequestServerStopper&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ResetToFactorySettings&lt;br /&gt;
|-&lt;br /&gt;
| 101 || ResetToFactorySettingsWithoutUserSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [2.0.0+] ResetToFactorySettingsForRefurbishment&lt;br /&gt;
|-&lt;br /&gt;
| 200 || CalculateUserSaveDataStatistics&lt;br /&gt;
|-&lt;br /&gt;
| 201 || DeleteUserSaveDataAll&lt;br /&gt;
|-&lt;br /&gt;
| 210 || DeleteUserSystemSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 220 || UnregisterNetworkServiceAccount&lt;br /&gt;
|-&lt;br /&gt;
| 300 || GetApplicationShellEvent&lt;br /&gt;
|-&lt;br /&gt;
| 301 || PopApplicationShellEventInfo&lt;br /&gt;
|-&lt;br /&gt;
| 302 || LaunchLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 303 || TerminateLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 304 || LaunchSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 305 || TerminateSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 306 || LaunchOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 307 || TerminateOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#GetApplicationControlData]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || InvalidateAllApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 402 || RequestDownloadApplicationControlData&lt;br /&gt;
|-&lt;br /&gt;
| 403 || GetMaxApplicationControlCacheCount&lt;br /&gt;
|-&lt;br /&gt;
| 404 || [2.0.0+] InvalidateApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 405 || [2.0.0+] ListApplicationControlCacheEntryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 502 || [2.0.0+] RequestCheckGameCardRegistration&lt;br /&gt;
|-&lt;br /&gt;
| 503 || [2.0.0+] RequestGameCardRegistrationGoldPoint&lt;br /&gt;
|-&lt;br /&gt;
| 504 || [2.0.0+] RequestRegisterGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 600 || [2.0.0+] CountApplicationContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 601 || [2.0.0+] [[#ListApplicationContentMetaStatus]]&lt;br /&gt;
|-&lt;br /&gt;
| 602 || [2.0.0+] ListAvailableAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 603 || [2.0.0+] GetOwnedApplicationContentMetaStatus&lt;br /&gt;
|-&lt;br /&gt;
| 604 || [2.0.0+] RegisterContentsExternalKey&lt;br /&gt;
|-&lt;br /&gt;
| 605 || [2.0.0+] ListApplicationContentMetaStatusWithRightsCheck&lt;br /&gt;
|-&lt;br /&gt;
| 700 || [2.0.0+] PushDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 701 || [2.0.0+] ClearTaskStatusList&lt;br /&gt;
|-&lt;br /&gt;
| 702 || [2.0.0+] RequestDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 703 || [2.0.0+] RequestEnsureDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 704 || [2.0.0+] ListDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 705 || [2.0.0+] RequestDownloadTaskListData&lt;br /&gt;
|-&lt;br /&gt;
| 800 || [2.0.0+] RequestVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 801 || [2.0.0+] ListVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 900 || [2.0.0+] GetApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 901 || [2.0.0+] GetApplicationRecordProperty&lt;br /&gt;
|-&lt;br /&gt;
| 902 || [2.0.0+] EnableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 903 || [2.0.0+] DisableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 904 || [2.0.0+] TouchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 905 || [2.0.0+] RequestApplicationUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 906 || [2.0.0+] IsApplicationUpdateRequested&lt;br /&gt;
|-&lt;br /&gt;
| 907 || [2.0.0+] WithdrawApplicationUpdateRequest&lt;br /&gt;
|-&lt;br /&gt;
| 908 || [2.0.0+] ListApplicationRecordInstalledContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || [2.0.0+] RequestVerifyApplicationDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || [2.0.0+] CorruptApplicationForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1200 || [2.0.0+] NeedsUpdateVulnerability&lt;br /&gt;
|-&lt;br /&gt;
| 1300 || [2.0.0+] IsAnyApplicationEntityInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 1301 || [2.0.0+] DeleteApplicationContentEntities&lt;br /&gt;
|-&lt;br /&gt;
| 1302 || [2.0.0+] CleanupUnrecordedApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1400 || [2.0.0+] PrepareShutdown&lt;br /&gt;
|-&lt;br /&gt;
| 1500 || [2.0.0+] FormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1501 || [2.0.0+] NeedsSystemUpdateToFormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1502 || [2.0.0+] GetLastSdCardFormatUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 1503 || [2.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 1600 || [2.0.0+] GetSystemSeedForPseudoDeviceId&lt;br /&gt;
|-&lt;br /&gt;
| 1700 || [2.0.0+] ListApplicationDownloadingContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 1800 || [2.0.0+] IsNotificationSetupCompleted&lt;br /&gt;
|-&lt;br /&gt;
| 1801 || [2.0.0+] GetLastNotificationInfoCount&lt;br /&gt;
|-&lt;br /&gt;
| 1802 || [2.0.0+] ListLastNotificationInfo&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ListApplicationRecord ==&lt;br /&gt;
Takes a type-6 output buffer and an u64.&lt;br /&gt;
&lt;br /&gt;
Returns an array of title-info entries using the specified offset and size. No input titleID is passed to this.&lt;br /&gt;
&lt;br /&gt;
== GetApplicationContentPath ==&lt;br /&gt;
Takes a 0x16-type output buffer, an u8 [[NCA|type]], and an u64 titleID.&lt;br /&gt;
&lt;br /&gt;
The input titleID is used with the application-title table like various other cmds, anything not in that table can&#039;t be used with this.&lt;br /&gt;
&lt;br /&gt;
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&#039;t exist for this title. Starts with &amp;quot;@{SdCardContent,UserContent}://&amp;quot; and ends in &amp;quot;.nca&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For gamecard content, the output path is: &amp;quot;@GcSXXXXXXXX:/&amp;lt;NcaId&amp;gt;.nca&amp;quot;. NCA-type0 with gamecard returns 0 with an empty output string.&lt;br /&gt;
&lt;br /&gt;
The output string is then used by the user-process with [[Filesystem_services|FS]] to mount the content.&lt;br /&gt;
&lt;br /&gt;
== GetTotalSpaceSize ==&lt;br /&gt;
Takes an input media-id that must be 5.&lt;br /&gt;
&lt;br /&gt;
Returns the u64 from [[Content_Manager_services#IContentStorage]] cmd22.&lt;br /&gt;
&lt;br /&gt;
== GetFreeSpaceSize ==&lt;br /&gt;
Takes an input media-id that must be 5.&lt;br /&gt;
&lt;br /&gt;
Returns the u64 from [[Content_Manager_services#IContentStorage]] cmd23.&lt;br /&gt;
&lt;br /&gt;
== GetApplicationDesiredLanguage ==&lt;br /&gt;
Takes an input u8 language-bitmask, returns an output u8 [[control.nacp]] langentry index.&lt;br /&gt;
&lt;br /&gt;
User-processes generate the language-bitmask with the following for all 16 lang-entries: &amp;lt;code&amp;gt;if(&amp;lt;either string in langentry[i] is non-empty&amp;gt;)bitmask |= 1&amp;lt;&amp;lt;i&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ConvertLanguageCodeToApplicationLanguage ==&lt;br /&gt;
Takes an input u8 pointer for the resulting Id to be written to and a string represented as a u64 (i.e 0x53552D6E65 for &#039;en-US&#039;).&lt;br /&gt;
&lt;br /&gt;
Returns 0 if an ID was successfully found, otherwise returns 0x25810.&lt;br /&gt;
&lt;br /&gt;
== GetApplicationControlData ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Loads cached [[control.nacp]] to buf+0 and the cached icon to buf+0x4000. Returns an error if the buffer is too small.&lt;br /&gt;
&lt;br /&gt;
== ListApplicationContentMetaStatus ==&lt;br /&gt;
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 &amp;gt;= totalentries, this will return 0 with out_entrycount=0.&lt;br /&gt;
&lt;br /&gt;
Entry structure:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| u8 &amp;quot;type&amp;quot;. [[Content_Manager_services|Title type]] (String is from web-applet)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| u8 &amp;quot;installedStorage&amp;quot; / [[Filesystem_services|StorageId]] (String is from web-applet)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Unknown. Non-zero with output from cmd 605, differs for app/update titles.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| u32 Title-version&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| u64 titleID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:am2, ns:ec, ns:rid, ns:rt, ns:web =&lt;br /&gt;
These services are all, at the top level, &amp;quot;nn::ns::detail::IServiceGetterInterface&amp;quot;. 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.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 7992 || [[#IECommerceInterface|GetECommerceInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7993 || [[#IApplicationVersionInterface|GetApplicationVersionInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7994 || [[#IFactoryResetInterface|GetFactoryResetInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7995 || [[#IAccountProxyInterface|GetAccountProxyInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7996 || [[#IApplicationManagerInterface|GetApplicationManagerInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7997 || [[#IDownloadTaskInterface|GetDownloadTaskInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7998 || [[#IContentManagementInterface|GetContentManagementInterface]]&lt;br /&gt;
|-&lt;br /&gt;
| 7999 || [[#IDocumentInterface|GetDocumentInterface]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IAccountProxyInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IAccountProxyInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CreateUserAccount&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IApplicationManagerInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IApplicationManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#ListApplicationRecord]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GenerateApplicationRecordCount&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetApplicationRecordUpdateSystemEvent&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetApplicationViewDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeleteApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeleteApplicationCompletely&lt;br /&gt;
|-&lt;br /&gt;
| 6 || IsAnyApplicationEntityRedundant&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeleteRedundantApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 8 || IsApplicationEntityMovable&lt;br /&gt;
|-&lt;br /&gt;
| 9 || MoveApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 11 || CalculateApplicationOccupiedSize&lt;br /&gt;
|-&lt;br /&gt;
| 16 || PushApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ListApplicationRecordContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 19 || LaunchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#GetApplicationContentPath]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || TerminateApplication&lt;br /&gt;
|-&lt;br /&gt;
| 23 || ResolveApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
| 26 || BeginInstallApplication&lt;br /&gt;
|-&lt;br /&gt;
| 27 || DeleteApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 30 || RequestApplicationUpdateInfo&lt;br /&gt;
|-&lt;br /&gt;
| 32 || CancelApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 33 || ResumeApplicationDownload&lt;br /&gt;
|-&lt;br /&gt;
| 35 || UpdateVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 36 || PushLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 37 || ListRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 38 || CheckApplicationLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 39 || CheckApplicationLaunchRights&lt;br /&gt;
|-&lt;br /&gt;
| 40 || GetApplicationLogoData&lt;br /&gt;
|-&lt;br /&gt;
| 41 || CalculateApplicationDownloadRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 42 || CleanupSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 43 || CheckSdCardMountStatus&lt;br /&gt;
|-&lt;br /&gt;
| 44 || GetSdCardMountStatusChangedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 45 || GetGameCardAttachmentEvent&lt;br /&gt;
|-&lt;br /&gt;
| 46 || GetGameCardAttachmentInfo&lt;br /&gt;
|-&lt;br /&gt;
| 47 || [[#GetTotalSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 48 || [[#GetFreeSpaceSize]]&lt;br /&gt;
|-&lt;br /&gt;
| 49 || GetSdCardRemovedEvent&lt;br /&gt;
|-&lt;br /&gt;
| 52 || GetGameCardUpdateDetectionEvent&lt;br /&gt;
|-&lt;br /&gt;
| 53 || DisableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 54 || EnableApplicationAutoDelete&lt;br /&gt;
|-&lt;br /&gt;
| 55 || GetApplicationDesiredLanguage&lt;br /&gt;
|-&lt;br /&gt;
| 56 || SetApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 57 || ClearApplicationTerminateResult&lt;br /&gt;
|-&lt;br /&gt;
| 58 || GetLastSdCardMountUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 59 || ConvertApplicationLanguageToLanguageCode&lt;br /&gt;
|-&lt;br /&gt;
| 60 || [[#ConvertLanguageCodeToApplicationLanguage]]&lt;br /&gt;
|-&lt;br /&gt;
| 61 || GetBackgroundDownloadStressTaskInfo&lt;br /&gt;
|-&lt;br /&gt;
| 62 || GetGameCardStopper&lt;br /&gt;
|-&lt;br /&gt;
| 63 || IsSystemProgramInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 64 || StartApplyDeltaTask&lt;br /&gt;
|-&lt;br /&gt;
| 65 || GetRequestServerStopper&lt;br /&gt;
|-&lt;br /&gt;
| 66 || GetBackgroundApplyDeltaStressTaskInfo&lt;br /&gt;
|-&lt;br /&gt;
| 67 || CancelApplicationApplyDelta&lt;br /&gt;
|-&lt;br /&gt;
| 68 || ResumeApplicationApplyDelta&lt;br /&gt;
|-&lt;br /&gt;
| 69 || CalculateApplicationApplyDeltaRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 70 || ResumeAll&lt;br /&gt;
|-&lt;br /&gt;
| 71 || GetStorageSize&lt;br /&gt;
|-&lt;br /&gt;
| 80 || RequestDownloadApplication&lt;br /&gt;
|-&lt;br /&gt;
| 81 || RequestDownloadAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 82 || DownloadApplication&lt;br /&gt;
|-&lt;br /&gt;
| 83 || CheckApplicationResumeRights&lt;br /&gt;
|-&lt;br /&gt;
| 84 || GetDynamicCommitEvent&lt;br /&gt;
|-&lt;br /&gt;
| 85 || RequestUpdateApplication2&lt;br /&gt;
|-&lt;br /&gt;
| 86 || EnableApplicationCrashReport&lt;br /&gt;
|-&lt;br /&gt;
| 87 || IsApplicationCrashReportEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 90 || BoostSystemMemoryResourceLimit&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ResetToFactorySettings&lt;br /&gt;
|-&lt;br /&gt;
| 101 || ResetToFactorySettingsWithoutUserSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 102 || ResetToFactorySettingsForRefurbishment&lt;br /&gt;
|-&lt;br /&gt;
| 200 || CalculateUserSaveDataStatistics&lt;br /&gt;
|-&lt;br /&gt;
| 201 || DeleteUserSaveDataAll&lt;br /&gt;
|-&lt;br /&gt;
| 210 || DeleteUserSystemSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 220 || UnregisterNetworkServiceAccount&lt;br /&gt;
|-&lt;br /&gt;
| 300 || GetApplicationShellEvent&lt;br /&gt;
|-&lt;br /&gt;
| 301 || PopApplicationShellEventInfo&lt;br /&gt;
|-&lt;br /&gt;
| 302 || LaunchLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 303 || TerminateLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 304 || LaunchSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 305 || TerminateSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 306 || LaunchOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 307 || TerminateOverlayApplet&lt;br /&gt;
|-&lt;br /&gt;
| 400 || GetApplicationControlData&lt;br /&gt;
|-&lt;br /&gt;
| 401 || InvalidateAllApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 402 || RequestDownloadApplicationControlData&lt;br /&gt;
|-&lt;br /&gt;
| 403 || GetMaxApplicationControlCacheCount&lt;br /&gt;
|-&lt;br /&gt;
| 404 || InvalidateApplicationControlCache&lt;br /&gt;
|-&lt;br /&gt;
| 405 || ListApplicationControlCacheEntryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 502 || RequestCheckGameCardRegistration&lt;br /&gt;
|-&lt;br /&gt;
| 503 || RequestGameCardRegistrationGoldPoint&lt;br /&gt;
|-&lt;br /&gt;
| 504 || RequestRegisterGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 505 || GetGameCardMountFailureEvent&lt;br /&gt;
|-&lt;br /&gt;
| 506 || IsGameCardInserted&lt;br /&gt;
|-&lt;br /&gt;
| 507 || EnsureGameCardAccess&lt;br /&gt;
|-&lt;br /&gt;
| 508 || GetLastGameCardMountFailureResult&lt;br /&gt;
|-&lt;br /&gt;
| 509 || ListApplicationIdOnGameCard&lt;br /&gt;
|-&lt;br /&gt;
| 600 || CountApplicationContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 601 || [[#ListApplicationContentMetaStatus]]&lt;br /&gt;
|-&lt;br /&gt;
| 602 || ListAvailableAddOnContent&lt;br /&gt;
|-&lt;br /&gt;
| 603 || GetOwnedApplicationContentMetaStatus&lt;br /&gt;
|-&lt;br /&gt;
| 604 || RegisterContentsExternalKey&lt;br /&gt;
|-&lt;br /&gt;
| 605 || ListApplicationContentMetaStatusWithRightsCheck&lt;br /&gt;
|-&lt;br /&gt;
| 606 || GetContentMetaStorage&lt;br /&gt;
|-&lt;br /&gt;
| 700 || PushDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 701 || ClearTaskStatusList&lt;br /&gt;
|-&lt;br /&gt;
| 702 || RequestDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 703 || RequestEnsureDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 704 || ListDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 705 || RequestDownloadTaskListData&lt;br /&gt;
|-&lt;br /&gt;
| 800 || RequestVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 801 || ListVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 802 || RequestVersionListData&lt;br /&gt;
|-&lt;br /&gt;
| 900 || GetApplicationRecord&lt;br /&gt;
|-&lt;br /&gt;
| 901 || GetApplicationRecordProperty&lt;br /&gt;
|-&lt;br /&gt;
| 902 || EnableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 903 || DisableApplicationAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 904 || TouchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 905 || RequestApplicationUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 906 || IsApplicationUpdateRequested&lt;br /&gt;
|-&lt;br /&gt;
| 907 || WithdrawApplicationUpdateRequest&lt;br /&gt;
|-&lt;br /&gt;
| 908 || ListApplicationRecordInstalledContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 909 || WithdrawCleanupAddOnContentsWithNoRightsRecommendation&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || RequestVerifyApplicationDeprecated&lt;br /&gt;
|-&lt;br /&gt;
| 1001 || CorruptApplicationForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1002 || RequestVerifyAddOnContentsRights&lt;br /&gt;
|-&lt;br /&gt;
| 1003 || RequestVerifyApplication&lt;br /&gt;
|-&lt;br /&gt;
| 1004 || CorruptContentForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1200 || NeedsUpdateVulnerability&lt;br /&gt;
|-&lt;br /&gt;
| 1300 || IsAnyApplicationEntityInstalled&lt;br /&gt;
|-&lt;br /&gt;
| 1301 || DeleteApplicationContentEntities&lt;br /&gt;
|-&lt;br /&gt;
| 1302 || CleanupUnrecordedApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1303 || CleanupAddOnContentsWithNoRights&lt;br /&gt;
|-&lt;br /&gt;
| 1304 || DeleteApplicationContentEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1305 || TryDeleteRunningApplicationEntity&lt;br /&gt;
|-&lt;br /&gt;
| 1306 || TryDeleteRunningApplicationCompletely&lt;br /&gt;
|-&lt;br /&gt;
| 1307 || TryDeleteRunningApplicationContentEntities&lt;br /&gt;
|-&lt;br /&gt;
| 1400 || PrepareShutdown&lt;br /&gt;
|-&lt;br /&gt;
| 1500 || FormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1501 || NeedsSystemUpdateToFormatSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1502 || GetLastSdCardFormatUnexpectedResult&lt;br /&gt;
|-&lt;br /&gt;
| 1504 || InsertSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1505 || RemoveSdCard&lt;br /&gt;
|-&lt;br /&gt;
| 1600 || GetSystemSeedForPseudoDeviceId&lt;br /&gt;
|-&lt;br /&gt;
| 1601 || ResetSystemSeedForPseudoDeviceId&lt;br /&gt;
|-&lt;br /&gt;
| 1700 || ListApplicationDownloadingContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 1701 || GetApplicationView&lt;br /&gt;
|-&lt;br /&gt;
| 1702 || GetApplicationDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 1703 || GetApplicationViewDownloadErrorContext&lt;br /&gt;
|-&lt;br /&gt;
| 1800 || IsNotificationSetupCompleted&lt;br /&gt;
|-&lt;br /&gt;
| 1801 || GetLastNotificationInfoCount&lt;br /&gt;
|-&lt;br /&gt;
| 1802 || ListLastNotificationInfo&lt;br /&gt;
|-&lt;br /&gt;
| 1803 || ListNotificationTask&lt;br /&gt;
|-&lt;br /&gt;
| 1900 || IsActiveAccount&lt;br /&gt;
|-&lt;br /&gt;
| 1901 || RequestDownloadApplicationPrepurchasedRights&lt;br /&gt;
|-&lt;br /&gt;
| 1902 || GetApplicationTicketInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2000 || GetSystemDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2001 || SelectLatestSystemDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2002 || VerifyDeliveryProtocolVersion&lt;br /&gt;
|-&lt;br /&gt;
| 2003 || GetApplicationDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2004 || HasAllContentsToDeliver&lt;br /&gt;
|-&lt;br /&gt;
| 2005 || CompareApplicationDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2006 || CanDeliverApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2007 || ListContentMetaKeyToDeliverApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2008 || NeedsSystemUpdateToDeliverApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2009 || EstimateRequiredSize&lt;br /&gt;
|-&lt;br /&gt;
| 2010 || RequestReceiveApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2011 || CommitReceiveApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2012 || GetReceiveApplicationProgress&lt;br /&gt;
|-&lt;br /&gt;
| 2013 || RequestSendApplication&lt;br /&gt;
|-&lt;br /&gt;
| 2014 || GetSendApplicationProgress&lt;br /&gt;
|-&lt;br /&gt;
| 2015 || CompareSystemDeliveryInfo&lt;br /&gt;
|-&lt;br /&gt;
| 2016 || ListNotCommittedContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 2017 || CreateDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IApplicationVersionInterface ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetLaunchRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 1 || UpgradeLaunchRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 35 || UpdateVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 36 || PushLaunchVersion&lt;br /&gt;
|-&lt;br /&gt;
| 37 || ListRequiredVersion&lt;br /&gt;
|-&lt;br /&gt;
| 800 || RequestVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 801 || ListVersionList&lt;br /&gt;
|-&lt;br /&gt;
| 802 || RequestVersionListData&lt;br /&gt;
|-&lt;br /&gt;
| 1000 || PerformAutoUpdate&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IContentManagerInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IContentManagementInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 11 || CalculateApplicationOccupiedSize&lt;br /&gt;
|-&lt;br /&gt;
| 43 || CheckSdCardMountStatus&lt;br /&gt;
|-&lt;br /&gt;
| 47 || GetTotalSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| 48 || GetFreeSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| 600 || CountApplicationContentMeta&lt;br /&gt;
|-&lt;br /&gt;
| 601 || ListApplicationContentMetaStatus&lt;br /&gt;
|-&lt;br /&gt;
| 605 || ListApplicationContentMetaStatusWithRightsCheck&lt;br /&gt;
|-&lt;br /&gt;
| 607 || IsAnyApplicationRunning&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IDocumentInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IDocumentInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 21 || GetApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
| 23 || ResolveApplicationContentPath&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IDownloadTaskInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IDownloadTaskInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 701 || ClearTaskStatusList&lt;br /&gt;
|-&lt;br /&gt;
| 702 || RequestDownloadTaskList&lt;br /&gt;
|-&lt;br /&gt;
| 703 || RequestEnsureDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 704 || ListDownloadTaskStatus&lt;br /&gt;
|-&lt;br /&gt;
| 705 || RequestDownloadTaskListData&lt;br /&gt;
|-&lt;br /&gt;
| 706 || TryCommitCurrentApplicationDownloadTask&lt;br /&gt;
|-&lt;br /&gt;
| 707 || EnableAutoCommit&lt;br /&gt;
|-&lt;br /&gt;
| 708 || DisableAutoCommit&lt;br /&gt;
|-&lt;br /&gt;
| 709 || TriggerDynamicCommitEvent&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IECommerceInterface===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || RequestLinkDevice&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IFactoryResetInterface ===&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IFactoryResetInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 100 || ResetToFactorySettings&lt;br /&gt;
|-&lt;br /&gt;
| 101 || ResetToFactorySettingsWithoutUserSaveData&lt;br /&gt;
|-&lt;br /&gt;
| 102 || ResetToFactorySettingsForRefurbishment&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:vm =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IVulnerabilityManagerInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1200 || [3.0.0+] NeedsUpdateVulnerability&lt;br /&gt;
|-&lt;br /&gt;
| 1201 || [4.0.0+] UpdateSafeSystemVersionForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 1202 || [4.0.0+] GetSafeSystemVersion&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:su =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::ISystemUpdateInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetBackgroundNetworkUpdateState&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#ISystemUpdateControl|OpenSystemUpdateControl]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NotifyExFatDriverRequired&lt;br /&gt;
|-&lt;br /&gt;
| 3 || ClearExFatDriverStatusForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 4 || RequestBackgroundNetworkUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 5 || NotifyBackgroundNetworkUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 6 || NotifyExFatDriverDownloadedForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetSystemUpdateNotificationEventForContentDelivery&lt;br /&gt;
|-&lt;br /&gt;
| 10 || NotifySystemUpdateForContentDelivery&lt;br /&gt;
|-&lt;br /&gt;
| 11 || PrepareShutdown&lt;br /&gt;
|-&lt;br /&gt;
| 16 || DestroySystemUpdateTask&lt;br /&gt;
|-&lt;br /&gt;
| 17 || RequestSendSystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 18 || GetSendSystemUpdateProgress&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ISystemUpdateControl ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || HasDownloaded&lt;br /&gt;
|-&lt;br /&gt;
| 1 || RequestCheckLatestUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 2 || RequestDownloadLatestUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetDownloadProgress&lt;br /&gt;
|-&lt;br /&gt;
| 4 || ApplyDownloadedUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 5 || RequestPrepareCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 6 || GetPrepareCardUpdateProgress&lt;br /&gt;
|-&lt;br /&gt;
| 7 || HasPreparedCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 8 || ApplyCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetDownloadedEulaDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetDownloadedEulaData&lt;br /&gt;
|-&lt;br /&gt;
| 11 || SetupCardUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetPreparedCardUpdateEulaDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 13 || GetPreparedCardUpdateEulaData&lt;br /&gt;
|-&lt;br /&gt;
| 14 || SetupCardUpdateViaSystemUpdater&lt;br /&gt;
|-&lt;br /&gt;
| 15 || HasReceived&lt;br /&gt;
|-&lt;br /&gt;
| 16 || RequestReceiveSystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 17 || GetReceiveProgress&lt;br /&gt;
|-&lt;br /&gt;
| 18 || ApplyReceivedUpdate&lt;br /&gt;
|-&lt;br /&gt;
| 19 || GetReceivedEulaDataSize&lt;br /&gt;
|-&lt;br /&gt;
| 20 || GetReceivedEulaData&lt;br /&gt;
|-&lt;br /&gt;
| 21 || SetupToReceiveSystemUpdate&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ns:dev =&lt;br /&gt;
This is &amp;quot;nn::ns::detail::IDevelopInterface&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#LaunchProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#TerminateProcess]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#TerminateProgram]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetShellEventHandle]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetShellEventInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#TerminateApplication]]&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[#PrepareLaunchProgramFromHost]]&lt;br /&gt;
|-&lt;br /&gt;
| 7 || LaunchApplication&lt;br /&gt;
|-&lt;br /&gt;
| 8 || LaunchApplicationWithStorageId&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LaunchProgram ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#LaunchProcess|LaunchProcess]].&lt;br /&gt;
&lt;br /&gt;
== TerminateProcess ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#TerminateTitleByPid|TerminateTitleByPid]].&lt;br /&gt;
&lt;br /&gt;
== TerminateProgram ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#TerminateTitleByTitleId|TerminateTitleByTitleId]].&lt;br /&gt;
&lt;br /&gt;
== GetShellEventHandle==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#GetProcessEventWaiter|GetProcessEventWaiter]].&lt;br /&gt;
&lt;br /&gt;
== GetShellEventInfo ==&lt;br /&gt;
Wrapper for &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#GetProcessEventType|GetProcessEventType]].&lt;br /&gt;
&lt;br /&gt;
== TerminateApplication ==&lt;br /&gt;
Calls &amp;quot;pm:shell&amp;quot; [[Process_Manager_services#GetCrashingProcessPid|GetCrashingProcessPid]] and sends PID to [[Process_Manager_services#TerminateTitleByPid|TerminateTitleByPid]].&lt;br /&gt;
&lt;br /&gt;
== PrepareLaunchProgramFromHost ==&lt;br /&gt;
Calls [[NCM_services#IPathResolverForStorage|IPathResolverForStorage]] Set...NcaPath functions.&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=NCM_services&amp;diff=3680</id>
		<title>NCM services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=NCM_services&amp;diff=3680"/>
		<updated>2018-02-09T06:11:09Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: Typo fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NCM contains services for internal file path and content management.&lt;br /&gt;
&lt;br /&gt;
= Location Resolver services =&lt;br /&gt;
== lr ==&lt;br /&gt;
This is &amp;quot;nn::lr::ILocationResolverManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetLocationResolver || [[Filesystem_services#StorageId|StorageID]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || GetRegisteredLocationResolver || None || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || CheckStorage || [[Filesystem_services#StorageId|StorageID]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetAddOnContentLocationResolver || None  ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The only sysmodules which use this service are [[Filesystem_services|FS]], [[Loader_services|Loader]], and [[NS_Services|NS]]. [[boot2]] has access but doesn&#039;t use it.&lt;br /&gt;
&lt;br /&gt;
=== ILocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::ILocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetProgramNcaPath || u64 TID + C descriptor || Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || SetProgramNcaPath || u64 TID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] || Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetUserControlNcaPath || u64 TID + C descriptor || Used for [[NCA_Content_FS#NCA-type3|NCA-type3]] (gamecard only?).&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetDocHtmlNcaPath || u64 TID + C descriptor || Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetControlNcaPath || u64 TID + C descriptor || Used for [[NCA_Content_FS#NCA-type3|NCA-type3]]. Stubbed, only returns error 0x608.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || SetControlNcaPath || u64 TID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] || Used for [[NCA_Content_FS#NCA-type3|NCA-type3]].&lt;br /&gt;
|-&lt;br /&gt;
| 6 || SetDocHtmlNcaPath || u64 TID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] || Used for [[NCA_Content_FS#NCA-type4|NCA-type4]].&lt;br /&gt;
|-&lt;br /&gt;
| 7 || GetInfoHtmlNcaPath || u64 TID + C descriptor || Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || SetInfoHtmlNcaPath || u64 TID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] || Used for [[NCA_Content_FS#NCA-type5|NCA-type5]].&lt;br /&gt;
|-&lt;br /&gt;
| 9 || ClearLocationResolver || None || Clears all NCA paths set.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These get-commands load the [[Filesystem_services|ContentPath]] from linked-lists in memory using the input titleID. The set-commands add a new entry to the list, if a matching entry is found it&#039;s removed first. ClearLocationResolver frees all entries in all of these linked-lists. The ContentPath is only used with memcpy() here with size=0x300, nothing more.&lt;br /&gt;
 &lt;br /&gt;
The set commands always return 0. When the get-commands fail to find an entry for the specified titleID, 0x408 is returned for GetProgramNcaPath, while the rest of the commands return 0xA08.&lt;br /&gt;
&lt;br /&gt;
=== IRegisteredLocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::IRegisteredLocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This works like [[#ILocationResolver]], but only two types of NCA paths can be gotten/set. In addition, each type has a fallback path that can be set for a single title ID at a time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetPatchType0NcaPath || u64 TID + C descriptor || Used for [[NCA_Content_FS#NCA-type1|NCA-type1]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || RegisterPatchType0FallbackPath || u64 TID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] || Sets the Type 0 fallback TID and path to the provided arguments.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || UnregisterPatchType0FallbackPath || u64 TID || If the Type 0 fallback TID is == argument TID, unregisters the fallback path. Otherwise, noop.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || SetPatchType0NcaPath || u64 TID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] ||&lt;br /&gt;
|-&lt;br /&gt;
| ([[2.0.0]]+) 4 || GetPatchType1NcaPath || u64 TID + C descriptor ||&lt;br /&gt;
|-&lt;br /&gt;
| ([[2.0.0]]+) 5 || RegisterPatchType1FallbackPath || u64 TID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] || Sets the Type 1 fallback TID and path to the provided arguments.&lt;br /&gt;
|-&lt;br /&gt;
| ([[2.0.0]]+) 6 || UnregisterPatchType1FallbackPath || u64 TID || If the Type 1 fallback TID is == argument TID, unregisters the fallback path. Otherwise, noop.&lt;br /&gt;
|-&lt;br /&gt;
| ([[2.0.0]]+) 7 || SetPatchType1NcaPath || u64 TID + X descriptor [[Filesystem_services#ContentPath|ContentPath]] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== IAddOnContentLocationResolver ===&lt;br /&gt;
This is &amp;quot;nn::lr::IAddOnContentLocationResolver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Arguments || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || GetAddOnContentNcaPath || u64 TID + C descriptor || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || RegisterAddOnContent || [[Filesystem_services#StorageId|StorageID]] + u64 TID || &lt;br /&gt;
|-&lt;br /&gt;
| 2 || ClearAddOnContentLocationResolver || None || Clears all registered titles here.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Content Manager services =&lt;br /&gt;
== ncm ==&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentManager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || CreatePlaceholderAndRegisteredDirectoriesForMediaId || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CreateSaveDataDirectoryForMediaId || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 2 || GetExistsPlaceholderAndRegisteredDirectoriesForMediaId || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetExistsSaveDataDirectoryForMediaId || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || GetIContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| 5 || GetIContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]].&lt;br /&gt;
|-&lt;br /&gt;
| ([[1.0.0]]) 6 || CloseAndLockIContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]]. Calls IContentStorage-&amp;gt;CloseAndFlushStorage().&lt;br /&gt;
|-&lt;br /&gt;
| ([[1.0.0]]) 7 || CloseAndLockIContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]].  Calls IContentMetaDatabase-&amp;gt;CloseMetaDatabase().&lt;br /&gt;
|-&lt;br /&gt;
| 8 || DeleteSaveDataForMediaId || Takes a [[Filesystem_services#StorageId|StorageID]], and deletes the associated savedata.&lt;br /&gt;
|-&lt;br /&gt;
| (2.0.0+?) 9 || MountStorageForMediaId ||&lt;br /&gt;
|-&lt;br /&gt;
| (2.0.0+?) 10 || UnmountStorageForMediaId ||&lt;br /&gt;
|-&lt;br /&gt;
| (2.0.0+?) 11 || MountDatabaseForMediaId ||&lt;br /&gt;
|-&lt;br /&gt;
| (2.0.0+?) 12 || UnmountDatabaseForMediaId ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All of the above cmds takes a u8 as input.&lt;br /&gt;
&lt;br /&gt;
=== IContentStorage ===&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentStorage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetUUID]] || Returns a random UUID for the Content Storage.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CreatePlaceholderEntryAndRegisteredDirectoryEntry || Takes two [[#NcaID]]s, and a u64 filesize.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DeletePlaceholderEntry || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DoesPlaceholderEntryExist ||  Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || WritePlaceholderEntry || Takes a [[#NcaID]], a u64-offset, and type 5 buffer. Writes the buffer to the file for the NcaID&#039;s placeholder path at the specified offset.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || MovePlaceholderToRegistered || Takes two [[#NcaID]]s, moves the Placeholder NCA content to the registered NCA path.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || DeleteRegisteredEntry || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DoesRegisteredEntryExist || Takes a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || GetPathForRegisteredEntry || Takes a [[#NcaID]]. Returns a [[Filesystem_services#ContentPath|Content Path]].&lt;br /&gt;
|-&lt;br /&gt;
| 9 || GetPathForPlaceholderEntry || Takes a [[#NcaID]]. Returns a [[Filesystem_services#ContentPath|Content Path]].&lt;br /&gt;
|-&lt;br /&gt;
| 10 || CleanPlaceholderDirectory || Deletes and re-creates the Placeholder directory.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetNumberOfRegisteredEntries || This is like [[#GetRegisteredEntries]], but for the Placeholder directory.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || [[#GetNumberOfRegisteredEntries]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || [[#GetRegisteredEntries]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#GetRegisteredEntrySize]] || &lt;br /&gt;
|-&lt;br /&gt;
| 15 || CloseAndFlushStorage || Closes/Flushes all resources for the storage, and causes all future IPC commands to the current session to return error 0xC805.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || || Takes three 0x10-sized entries.&lt;br /&gt;
|-&lt;br /&gt;
| 17 || SetPlaceholderEntrySize || Takes a [[#NcaID]], and a u64 size&lt;br /&gt;
|-&lt;br /&gt;
| 18 || [[#ReadRegisteredEntryRaw]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 19 || GetPlaceholderEntryRightsID || Gets the Rights ID for the [[#NcaID]]&#039;s placeholder path.&lt;br /&gt;
|-&lt;br /&gt;
| 20 || GetRegisteredEntryRightsID || Gets the Rights ID for the [[#NcaID]]&#039;s registered path&lt;br /&gt;
|-&lt;br /&gt;
| 21 || WriteRegisteredPathForDebug || Takes a [[#NcaID]], a u64 offset, and a type 5 buffer. On debug units, writes the buffer to the NCA&#039;s registered path. On retail units, this just aborts.&lt;br /&gt;
|-&lt;br /&gt;
| 22 || GetFreeSpace || Gets free space for the storage.&lt;br /&gt;
|-&lt;br /&gt;
| 23 || GetTotalSpace || Gets total space for the storage.&lt;br /&gt;
|-&lt;br /&gt;
| 24 || FlushStorage || Flushes resources for the storage without closing it.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== GetUUID ====&lt;br /&gt;
Calls  nn::util::GenerateUuid(), which internally calls nn::os::GenerateRandomBytes(16);&lt;br /&gt;
&lt;br /&gt;
==== GetNumberOfRegisteredEntries ====&lt;br /&gt;
Writes the total number of entries which can be read by GetEntries, to cmdreply &amp;lt;SFCO_offset&amp;gt;+0x10.&lt;br /&gt;
&lt;br /&gt;
==== GetRegisteredEntries ====&lt;br /&gt;
Takes an output buffer, u32 offset and gets all entries starting at that offset.&lt;br /&gt;
Returns number of entries read.&lt;br /&gt;
&lt;br /&gt;
Each entry is a [[#NcaID]].&lt;br /&gt;
&lt;br /&gt;
The total read entries is exactly the same as the number of &amp;quot;&amp;lt;hex&amp;gt;.nca&amp;quot; directories in the storage FS(or at least under the &amp;quot;registered&amp;quot; directory?).&lt;br /&gt;
&lt;br /&gt;
==== GetRegisteredEntrySize ====&lt;br /&gt;
Takes a [[#NcaID]] as input.&lt;br /&gt;
&lt;br /&gt;
Returns the total size readable by ReadEntryRaw. This is the same as the size-field in the [[NAX0]] &amp;quot;&amp;lt;NcaID&amp;gt;.nca/00&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
==== ReadRegisteredEntryRaw ====&lt;br /&gt;
Takes an output buffer, a [[#NcaID]] as input, and a u64 file offset.&lt;br /&gt;
&lt;br /&gt;
Returns encrypted looking data from the content in the [[NAX0]]. Doesn&#039;t match the encrypted raw data in the [[NAX0]] &amp;quot;&amp;lt;NcaID&amp;gt;.nca/00&amp;quot; file. Seems to be at least one crypto layer below the initial NAX0 layer, since the data doesn&#039;t change after NAX0 recreation.&lt;br /&gt;
&lt;br /&gt;
Manually modifying the content in the NAX0(starting at offset 0x4000) results in different output data being returned by this cmd. Changing any data within the first 0x10-bytes results in the entire 0x10-byte block changing. Likewise for offset 0x4010 size 0x1, entire 0x10-byte block at 0x4010 changes. Changing the first 0x20-bytes at 0x4000 to zeros has the same combined changed output, as when offset 0x4000 size 0x10 and offset 0x4010 size 0x10 were changed to zeros separately. Output BlockA and BlockB are completely different, where the raw NAX0 data for those blocks are all-zero.&lt;br /&gt;
&lt;br /&gt;
Overwriting the entire raw NAX0 content with zeros results in output data which doesn&#039;t seem to have any duplicate blocks/data. When changing the previously mentioned raw content for the first 8 blocks to last-block-byte = 1&amp;lt;&amp;lt;i, where i is 0-7, none of the changed output blocks match any output blocks from the previously mentioned output(all-zero raw content).&lt;br /&gt;
&lt;br /&gt;
This implies that that an AES mode is being used which isn&#039;t CTR, where changing data in one block doesn&#039;t affect other blocks.&lt;br /&gt;
&lt;br /&gt;
See GetEntrySize for the total size readable with this.&lt;br /&gt;
&lt;br /&gt;
=== IContentMetaDatabase ===&lt;br /&gt;
This is &amp;quot;nn::ncm::IContentMetaDatabase&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the official name for Meta Record is &amp;quot;ContentMetaKey&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || InsertEntryContentRecords || Takes a [[NCA#Meta_records|Meta Record]], a type-5 [[NCA#Content_records|Content Records]] buffer and a u64 size.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ReadEntryContentRecords || Takes a [[NCA#Meta_records|Meta Record]], a type-6 buffer to write [[NCA#Content_records|Content Records]] to and a u64 size. Returns the actual Content Records size read.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || RemoveEntryContentRecords || Takes a [[NCA#Meta_records|Meta Record]], and removes the associated record.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || GetEntryContentNcaId || Takes a [[NCA#Meta_records|Meta Record]] and a u8 [[#Title_Types|Title Type]]. Returns a [[#NcaID]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || ReadEntryContentRecordEntries || Takes a type-6 buffer to write [[NCA#Content_records|Content Record]] entries to, a [[NCA#Meta_records|Meta Record]], and a u32 index into the Content Record entries to start copying from. Returns a u32 entries_read.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || List || Takes a type-6 buffer to write [[NCA#Meta_records|Meta Record]]s to, a u32 [[#Title_Types|Title Type]], a u64 TID, a u64 TID_LOW, and u64 TID_HIGH. Writes into the buffer all Meta Records with low &amp;lt;= record-&amp;gt;title_id &amp;lt;= high, and record-&amp;gt;type == type. Additionally requires record-&amp;gt;title_id == TID, if record-&amp;gt;type is Application, Patch, Add-On, or Delta.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || GetMetaRecord || Takes a u64 title id, and returns the [[NCA#Meta_records|Meta Record]] with the highest version field for that title id.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[#ListApplication]] ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 || IsEntryPresent || Takes a [[NCA#Meta_records|Meta Record]] and returns whether that record is present in the database.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || AreEntriesPresent || Takes a type-5 buffer containing [[NCA#Meta_records|Meta Records]] (code assumes there are size/sizeof(meta_record) records in the buffer), and returns whether all of those records are present in the database.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetEntryContentRecordsSize || Takes a [[NCA#Meta_records|Meta Record]], and returns the size of the associated [[NCA#Content_records|Content Records]].&lt;br /&gt;
|-&lt;br /&gt;
| 11 || GetEntryUnknownRecordSize || Takes a [[NCA#Meta_records|Meta Record]], and returns u32 from ContentRecords + 16 (only if the Meta record has type Application or Patch).&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetEntryUpdateTitleId || Takes a [[NCA#Meta_records|Meta Record]], and returns the update title id for that record.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || CloseMetaDatabase ||  Closes the meta database, and causes all future IPC commands to the current session to return error 0xDC05.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#CheckNcaIDsPresent]] || Takes a type-6 byte buffer, and a type-5 buffer of [[#NcaID]]s.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || SaveMetaDatabase || Flushes the in-memory database to savedata.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || CheckEntryHasNcaId || Takes a [[NCA#Meta_records|Meta Record]] and an [[#NcaID]]. Returns whether the content records for that meta record contain the NcaID.&lt;br /&gt;
|-&lt;br /&gt;
| 17 || ReadEntryMetaRecords || Takes a type-6 [[NCA#Meta_records|Meta Record]] output buffer, a u32 eoffset into that buffer, and an input [[NCA#Meta_records|Meta Record]].&lt;br /&gt;
|-&lt;br /&gt;
| 18 || GetEntryUnknown6 || Takes a [[NCA#Meta_records|Meta Record]], and returns u8 from ContentRecords + 6.&lt;br /&gt;
|-&lt;br /&gt;
| 19 || GetAddOnContentEntryUnknownRecordSize || Does the same thing as GetEntryUnknownRecordSize, but for AddOnContents.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== ListApplication ====&lt;br /&gt;
Each 24-byte entry (officially &amp;quot;ApplicationContentMetaKey&amp;quot;) is as follows:&lt;br /&gt;
  [[NCA#Meta_records|meta_record]] meta_record;&lt;br /&gt;
  u64    base_title_id;&lt;br /&gt;
&lt;br /&gt;
This function takes in a type 6 buffer to write entries to, and a u8 &amp;quot;filter&amp;quot; [[#Title_Types|type]]. If filter is zero, all update records will be copied to to the output buffer (space permitting). Otherwise, only titles with type == filter_type will be copied to the output buffer.&lt;br /&gt;
&lt;br /&gt;
This func returns a u32 num_entries_written, and a u32 num_entries_total.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== ReadEntryMetaRecords ====&lt;br /&gt;
Takes a type-6 [[NCA#Meta_records|Meta Record]] output buffer, a u32 eoffset into that buffer, and an input [[NCA#Meta_records|Meta Record]] entry. Returns a u32 for total_read_entries.&lt;br /&gt;
&lt;br /&gt;
Reads the meta records stored in the entry&#039;s content records into the output buffer.&lt;br /&gt;
&lt;br /&gt;
This is used, for example, with System Update title 0100000000000816, which contains Meta Records for all other systitles in its Content Records.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== CheckEntryNcaIDsPresent ====&lt;br /&gt;
Takes a type-6 byte buffer, and a type-5 buffer containing [[#NcaID]]s.&lt;br /&gt;
&lt;br /&gt;
This function was stubbed to return 0xDC05 in [[2.0.0]].&lt;br /&gt;
&lt;br /&gt;
On 1.0.0: Initialized the output buffer to all 1s. Then, for each [[#NcaID]] in the input buffer, it checks if that NcaID is present anywhere in the database, and if so writes 0 to the corresponding output byte.&lt;br /&gt;
&lt;br /&gt;
In pseudocode, the function basically does the following:&lt;br /&gt;
&lt;br /&gt;
for i in range(len(out_buf)):&lt;br /&gt;
    out_buf[i] = 1&lt;br /&gt;
&lt;br /&gt;
for i, NcaID in NcaIDs:&lt;br /&gt;
    if is_present_in_database(NcaID):&lt;br /&gt;
        out_buf[i] = 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NcaID ===&lt;br /&gt;
This is a 0x10-byte entry. This is originally from the hex portion of &amp;quot;&amp;lt;hex&amp;gt;.nca&amp;quot; directory-names from this storage FS(like [[SD_Filesystem|SD]]).&lt;br /&gt;
&lt;br /&gt;
The NcaID is the same as the first 0x10-bytes from the calculated SHA256 hash, from hashing the entire output from ReadEntryRaw.&lt;br /&gt;
&lt;br /&gt;
=== Enums ===&lt;br /&gt;
==== Title Types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01&lt;br /&gt;
| System Programs ([[Title_list#System_Modules|System Modules]] or [[Title_list#System_Applets|System Applets]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x02&lt;br /&gt;
| [[Title_list#System_Data_Archives|System Data Archives]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| System Update&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| [[Title_list|Firmware package A]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x05&lt;br /&gt;
| [[Title_list|Firmware package B]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x80&lt;br /&gt;
| Regular application&lt;br /&gt;
|-&lt;br /&gt;
| 0x81&lt;br /&gt;
| Update title&lt;br /&gt;
|-&lt;br /&gt;
| 0x82&lt;br /&gt;
| Add-on content&lt;br /&gt;
|-&lt;br /&gt;
| 0x83&lt;br /&gt;
| Delta title&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ncm:v ==&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=User_talk:Sebastiaan&amp;diff=3316</id>
		<title>User talk:Sebastiaan</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=User_talk:Sebastiaan&amp;diff=3316"/>
		<updated>2017-12-31T09:29:49Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hey man,&lt;br /&gt;
&lt;br /&gt;
This wiki is for reverse engineering notes based on retail software.&lt;br /&gt;
&lt;br /&gt;
Please keep things from the official SDK off the wiki, thanks!&lt;br /&gt;
&lt;br /&gt;
[[User:Qlutoo|Qlutoo]] ([[User talk:Qlutoo|talk]]) 04:31, 26 December 2017 (CST)&lt;br /&gt;
&lt;br /&gt;
PING&lt;br /&gt;
&lt;br /&gt;
[[User:Qlutoo|Qlutoo]] ([[User talk:Qlutoo|talk]]) 04:22, 31 December 2017 (CST)&lt;br /&gt;
&lt;br /&gt;
You&#039;re probably best joining #switchdev on EFNet if you wish to talk to Qlutoo directly. Much better than trying to chat on a wiki!&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=SVC&amp;diff=2806</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=SVC&amp;diff=2806"/>
		<updated>2017-10-14T09:50:45Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&lt;br /&gt;
= System calls =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
|  0x1 || [[#svcSetHeapSize]] || W1=size || W0=result, X1=outaddr&lt;br /&gt;
|-&lt;br /&gt;
|  0x2 || [[#svcSetMemoryPermission]] || X0=addr, X1=size, W2=prot || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x3 || [[#svcSetMemoryAttribute]] || X0=addr, X1=size, W2=state0, W3=state1 || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x4 || [[#svcMapMemory]] || X0=dstaddr, X1=srcaddr, X2=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x5 || [[#svcUnmapMemory]] || X0=dstaddr, X1=srcaddr, X2=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x6 || [[#svcQueryMemory]] || X0=MemoryInfo*, X2=addr || W0=result, W1=PageInfo                                                         &lt;br /&gt;
|-&lt;br /&gt;
|  0x7 || [[#svcExitProcess]] || None ||&lt;br /&gt;
|-&lt;br /&gt;
|  0x8 || [[#svcCreateThread]] || X1=entry, X2=arg, X3=stacktop, W4=prio, W5=processor_id  || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
|  0x9 || [[#svcStartThread]] || W0=thread_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0xA || [[#svcExitThread]] || None ||                                                         &lt;br /&gt;
|-&lt;br /&gt;
|  0xB || [[#svcSleepThread]] || X0=nano || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0xC || [[#svcGetThreadPriority]] || W1=thread_handle || W0=result, W1=prio&lt;br /&gt;
|-&lt;br /&gt;
|  0xD || [[#svcSetThreadPriority]] || W0=thread_handle, W1=prio || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0xE || [[#svcGetThreadCoreMask]] || W2=thread_handle || W0=result, W1=out, X2=out&lt;br /&gt;
|-&lt;br /&gt;
|  0xF || [[#svcSetThreadCoreMask]] || W0=thread_handle, W1=in, X2=in2 || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || [[#svcGetCurrentProcessorNumber]] || None || W0/X0=cpuid&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 || svcSignalEvent || W0=wevent_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || svcClearEvent || W0=wevent_or_revent_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || [[#svcMapSharedMemory]] || W0=shmem_handle, X1=addr, X2=size, W3=perm || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || svcUnmapSharedMemory || W0=shmem_handle, X1=addr, X2=size || W0=result                                                 &lt;br /&gt;
|-&lt;br /&gt;
| 0x15 || [[#svcCreateTransferMemory]] || X1=addr, X2=size, W3=perm || W0=result, W1=tmem_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || svcCloseHandle || W0=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 || svcResetSignal || W0=revent_or_process_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || [[#svcWaitSynchronization]] || X1=handles_ptr, W2=num_handles. X3=timeout || W0=result, W1=handle_idx&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 || svcCancelSynchronization || W0=thread_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A || svcArbitrateLock || W0=cur_thread_handle, X1=ptr, W2=req_thread_handle ||                                     &lt;br /&gt;
|-&lt;br /&gt;
| 0x1B || svcArbitrateUnlock || X0=ptr ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || svcWaitProcessWideKeyAtomic || X0=ptr0, X1=ptr, W2=thread_handle, X3=timeout || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D || svcSignalProcessWideKey || X0=ptr, W1=value || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E || svcGetSystemTick || None || X0={value of cntpct_el0}&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F || svcConnectToNamedPort || X1=port_name_str || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || svcSendSyncRequestLight || W0=light_session_handle, X1=? || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || svcSendSyncRequest || X0=normal_session_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 || [[#svcSendSyncRequestWithUserBuffer]] || X0=cmdbufptr, X1=size, X2=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 || svcSendAsyncRequestWithUserBuffer || X1=cmdbufptr, X2=size, X3=handle || W0=result, W1=event_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || svcGetProcessId || W0=thread_or_process_or_debug_handle || W0=result, X1=pid&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 || svcGetThreadId || W0=thread_handle || W0=result, X1=out&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 || svcBreak || X0,X1,X2=info || ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 || svcOutputDebugString || X0=str, X1=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || svcReturnFromException || X0=result || &lt;br /&gt;
|-&lt;br /&gt;
| 0x29 || [[#svcGetInfo]] || X1=info_id, X2=handle, X3=info_sub_id || W0=result, X1=out&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A || svcFlushEntireDataCache || None || None&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B || svcFlushDataCache || X0=addr, X1=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || [3.0.0+] svcMapPhysicalMemory ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D || [3.0.0+] svcUnmapPhysicalMemory||  ||&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x2F || svcGetLastThreadInfo || None || W0=result, W1,W2,W3,W4=unk, W5=truncated_u64, W6=bool&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || svcGetResourceLimitLimitValue || W1=reslimit_handle, W2=[[#LimitableResource]] || W0=result, X1=value&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 || svcGetResourceLimitCurrentValue || W1=reslimit_handle, W2=[[#LimitableResource]] || W0=result, X1=value&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || svcSetThreadActivity || W0=thread_handle, W1=bool || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 || svcGetThreadContext3 || W0=thread_handle, W1=[[#ThreadContext]]* || W0=result&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x3C || svcDumpInfo ||  || &lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x40 || svcCreateSession || W2=is_light, X3=? || W0=result, W1=client_handle, W2=server_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x41 || svcAcceptSession || W1=port_handle || W0=result, W1=session_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x42 || svcReplyAndReceiveLight || W0=light_session_handle || W0=result, W1,W2,W3,W4,W5,W6,W7=out&lt;br /&gt;
|-&lt;br /&gt;
| 0x43 || svcReplyAndReceive || X1=ptr_handles, W2=num_handles, X3=replytarget_handle(0=none), X4=timeout || W0=result, W1=handle_idx&lt;br /&gt;
|-&lt;br /&gt;
| 0x44 || svcReplyAndReceiveWithUserBuffer|| X1=buf, X2=sz, X3=ptr_handles, W4=num_handles, X5=replytarget_handle(0=none), X6=timeout || W0=result, W1=handle_idx&lt;br /&gt;
|-&lt;br /&gt;
| 0x45 || svcCreateEvent || None || W0=result, W1=client_handle ?, W2=server_handle ?&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x4D || svcSleepSystem || None || None&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E || [[#svcReadWriteRegister]] || X1=reg_addr, W2=rw_mask, W3=in_val || W0=result, W1=out_val&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F || svcSetProcessActivity || W0=process_handle, W1=bool || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 || [[#svcCreateSharedMemory]] || W1=size, W2=myperm, W3=otherperm || W0=result, W1=shmem_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 || [[#svcMapTransferMemory]] || X0=tmem_handle, X1=addr, X2=size, W3=perm || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 || [[#svcUnmapTransferMemory]] || W0=tmemhandle, X1=addr, X2=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 || svcCreateInterruptEvent || X1=irq_id, W2=flag || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 || [[#svcQueryPhysicalAddress]] || X1=addr || W0=result, X1=out0, X2=out1, X3=out2&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 || [[#svcQueryIoMapping]] || X1=physaddr, X2=size || W0=result, X1=virtaddr&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 || [[#svcCreateDeviceAddressSpace]] || X1=dev_as_start_addr, X2=dev_as_end_addr || W0=result, W1=dev_as_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 || [[#svcAttachDeviceAddressSpace]] || W0=device, X1=dev_as_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x58 || [[#svcDetachDeviceAddressSpace]] || W0=device, X1=dev_as_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x59 || [[#svcMapDeviceAddressSpaceByForce]] || W0=dev_as_handle, W1=proc_handle, X2=dev_map_addr, X3=dev_as_size, X4=dev_as_addr, W5=perm || W0=result &lt;br /&gt;
|-&lt;br /&gt;
| 0x5A || [[#svcMapDeviceAddressSpaceAligned]] || W0=dev_as_handle, W1=proc_handle, X2=dev_map_addr, X3=dev_as_size, X4=dev_as_addr, W5=perm || W0=result &lt;br /&gt;
|-&lt;br /&gt;
| 0x5B || svcMapDeviceAddressSpace || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x5C || [[#svcUnmapDeviceAddressSpace]] || W0=dev_as_handle, W1=proc_handle, X2=dev_map_addr, X3=dev_as_size, X4=dev_as_addr || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x5D || svcInvalidateProcessDataCache || W0=process_handle, X1=addr, X2=size || W0=size&lt;br /&gt;
|-&lt;br /&gt;
| 0x5E || svcStoreProcessDataCache || W0=process_handle, X1=addr, X2=size || W0=size&lt;br /&gt;
|-&lt;br /&gt;
| 0x5F || svcFlushProcessDataCache || W0=process_handle, X1=addr, X2=size || W0=size&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || svcDebugActiveProcess || X1=pid || W0=result, W1=debug_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 || svcBreakDebugProcess || W0=debug_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 || svcTerminateDebugProcess || W0=debug_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 || svcGetDebugEvent || X0=DebugEventInfo*, W1=debug_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 || svcContinueDebugEvent || W0=debug_handle, W1=flags, X2=? || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 || svcGetProcessList || X1=pids_out_ptr, W2=max_out || W0=result, W1=num_out &lt;br /&gt;
|-&lt;br /&gt;
| 0x66 || svcGetThreadList || X1=tids_out_ptr, W2=max_out, W3=debug_handle_or_zero || W0=result, X1=num_out&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 || svcGetDebugThreadContext || X0=ThreadContext*, X1=debug_handle, X2=?, W3=? || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || svcSetDebugThreadContext || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x69 || svcQueryDebugProcessMemory || X0=[[#MemoryInfo]]*, X2=debug_handle, X3=addr || W0=result, W1=PageInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A || svcReadDebugProcessMemory || X0=buffer*, X1=debug_handle, X2=src_addr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B || svcWriteDebugProcessMemory || X0=debug_handle, X1=buffer*, X2=dst_addr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C || svcSetHardwareBreakPoint || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x6D || svcGetDebugThreadParam || X2=debug_handle, X3=thread_id, W4=DebugThreadParam || W0=result, X1=out0, W2=out1&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x70 || svcCreatePort || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x71 || svcManageNamedPort || X1=name_ptr, W2=max_sessions(?) || W0=result, W1=serverport_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x72 || svcConnectToPort || W1=clientport_handle || W0=result, W1=session_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x73 || svcSetProcessMemoryPermission || X0=addr, X1=size, W2=perm || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x74 || [[#svcMapProcessMemory]] || X0=srcaddr, W1=process_handle, X2=dstaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x75 || [[#svcUnmapProcessMemory]] || W0=process_handle, X1=dstaddr, X2=srcaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x76 || [[#svcQueryProcessMemory]] || X0=meminfo_ptr, W2=process_handle, X3=addr || W0=result, W1=pageinfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x77 || [[#svcMapProcessCodeMemory]] || W0=process_handle, X2=dstaddr, X2=srcaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x78 || [[#svcUnmapProcessCodeMemory]] || W0=process_handle, X1=dstaddr, X2=srcaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x79 || [[#svcCreateProcess]] || X1=procinfo_ptr, X2=caps_ptr, W3=cap_num ||  W0=result, W1=process_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A || svcStartProcess || W0=process_handle, W1=main_thread_prio, W2=default_cpuid, W3=main_thread_stacksz || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x7B || svcTerminateProcess || W0=process_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C || [[#svcGetProcessInfo]] || W0=process_handle || W0=result, X1=[[#ProcessState]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D || svcCreateResourceLimit || None || W0=result, W1=reslimit_handle &lt;br /&gt;
|-&lt;br /&gt;
| 0x7E || svcSetResourceLimitLimitValue || W0=reslimit_handle, W1=[[#LimitableResource]], X2=value || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x7F || svcCallSecureMonitor || || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== svcSetHeapSize ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || u64 || &amp;lt;code&amp;gt;OutAddr&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Set the process heap to a given &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;. It can both extend and shrink the heap.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt; must be a multiple of 0x2000000.&lt;br /&gt;
&lt;br /&gt;
On success, the heap base-address (which is fixed by kernel, aslr&#039;d) is written to &amp;lt;code&amp;gt;OutAddr&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt; must be less than 0x18000000.&lt;br /&gt;
&lt;br /&gt;
== svcSetMemoryPermission ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;Prot&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Change permission of page-aligned memory region.&lt;br /&gt;
&lt;br /&gt;
Bit2 of permission (exec) is not allowed. Setting write-only is not allowed either (bit1).&lt;br /&gt;
&lt;br /&gt;
This can be used to move back and forth between ---, r-- and rw-.&lt;br /&gt;
&lt;br /&gt;
== svcSetMemoryAttribute ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;State0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;State1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Change attribute of page-aligned memory region. &lt;br /&gt;
&lt;br /&gt;
This is used to turn on/off caching for a given memory area. Useful when talking to devices such as the GPU.&lt;br /&gt;
&lt;br /&gt;
What happens &amp;quot;under the hood&amp;quot; is the &amp;quot;Memory Attribute Indirection Register&amp;quot; index is changed from 2 to 3 in the MMU descriptor.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! State0 || State1 || Action&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || Clear bit3 in [[#MemoryAttribute]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 0 || Clear bit3 in [[#MemoryAttribute]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 8 || Set bit3 in [[#MemoryAttribute]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== svcMapMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Dst&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Src&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Maps a memory range into a different range.&lt;br /&gt;
&lt;br /&gt;
Mainly used for adding guard pages around stack.&lt;br /&gt;
&lt;br /&gt;
Source range gets reprotected to --- (it can no longer be accessed), and bit0 is set in the source [[#MemoryAttribute]].&lt;br /&gt;
&lt;br /&gt;
If dstaddr &amp;gt;= LowerTreshold, the dst-range is enforced to be within the process&#039; &amp;quot;MapRegion&amp;quot;. Code can get the range of this region from [[#svcGetInfo]] id0=2,3.&lt;br /&gt;
&lt;br /&gt;
In this case, the mapped memory will have state &amp;lt;code&amp;gt;0x5C3C0B&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As long as (dstaddr+size) &amp;lt; LowerThreshold, then you can map anywhere but the mapped memory will have state &amp;lt;code&amp;gt;0x482907&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
LowerTreshold is 0x80000000 for 36-bit address spaces, and 0x40000000 for 32-bit ones.&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] Support for the &amp;lt;code&amp;gt;0x482907&amp;lt;/code&amp;gt; mappings outside the &amp;quot;MapRegion&amp;quot; were removed.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Dst&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Src&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Unmaps a region that was previously mapped with [[#svcMapMemory]].&lt;br /&gt;
&lt;br /&gt;
It&#039;s possible to unmap ranges partially, you don&#039;t need to unmap the entire range &amp;quot;in one go&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The srcaddr/dstaddr must match what was given when the pages were originally mapped.&lt;br /&gt;
&lt;br /&gt;
== svcQueryMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || MemoryInfo*|| &amp;lt;code&amp;gt;Mem Info&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || PageInfo || &amp;lt;code&amp;gt;Page Info&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Query information about an address. Will always fetch the lowest page-aligned mapping that contains the provided address.&lt;br /&gt;
&lt;br /&gt;
Outputs a [[#MemoryInfo]] struct.&lt;br /&gt;
&lt;br /&gt;
== svcExitProcess ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Exits the current process.&lt;br /&gt;
&lt;br /&gt;
== svcCreateThread ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Entry&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Arg&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Stack Top&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W4 || u64 || &amp;lt;code&amp;gt;Priority&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W5 || u64 || &amp;lt;code&amp;gt;Processor ID&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Create a thread in the current process.&lt;br /&gt;
&lt;br /&gt;
Processor_id must be 0,1,2,3 or -2, where -2 uses the default cpuid for process.&lt;br /&gt;
&lt;br /&gt;
== svcStartThread ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0|| u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) None ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Starts the thread for the provided handle.&lt;br /&gt;
&lt;br /&gt;
== svcExitThread ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Exits the current thread.&lt;br /&gt;
&lt;br /&gt;
== svcSleepThread ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Nano&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Sleep for a specified amount of time, or yield thread.&lt;br /&gt;
&lt;br /&gt;
Setting nano=0 means &amp;quot;yield thread&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== svcGetThreadPriority ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1|| u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Priority&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Get priority of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== svcSetThreadPriority ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0|| u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1|| u64 || &amp;lt;code&amp;gt;Priority&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Set priority of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
Priority is a number 0-0x3F. Lower value means higher priority.&lt;br /&gt;
&lt;br /&gt;
== svcGetThreadCoreMask ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Out&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X2 || u64 || &amp;lt;code&amp;gt;Out&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Get affinity mask of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== svcSetThreadCoreMask ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || u64 || &amp;lt;code&amp;gt;In&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;In&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Set affinity mask of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== svcGetCurrentProcessorNumber ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0/X0 || u64 || &amp;lt;code&amp;gt;CPU ID&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Get which cpu is executing the current thread.&lt;br /&gt;
&lt;br /&gt;
Cpu-id is an integer in the range 0-3.&lt;br /&gt;
&lt;br /&gt;
== svcMapSharedMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Mem Block Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Maps the block supplied by the handle. The required permissions are different for the process that created the handle and all other processes.&lt;br /&gt;
&lt;br /&gt;
Increases reference count for the KSharedMemory object. Thus in order to release the memory associated with the object, all handles to it must be closed and all mappings must be unmapped.&lt;br /&gt;
&lt;br /&gt;
== svcCreateTransferMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one reprotects the src block with perms you give it. It also sets bit0 into [[#MemoryAttribute]].&lt;br /&gt;
&lt;br /&gt;
Executable bit perm not allowed.&lt;br /&gt;
&lt;br /&gt;
Closing all handles automatically causes the bit0 in [[#MemoryAttribute]] to clear, and the permission to reset.&lt;br /&gt;
&lt;br /&gt;
== svcWaitSynchronization ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Handles Pointer&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;Number of Handles&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Timeout&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Handle Index&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Works with num_handles &amp;lt;= 0x40, error on num_handles == 0.&lt;br /&gt;
&lt;br /&gt;
Does not accept 0xFFFF8001 or 0xFFFF8000 as handles.&lt;br /&gt;
&lt;br /&gt;
== svcSendSyncRequestWithUserBuffer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Command Buffer Pointer&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Size must be 0x1000-aligned.&lt;br /&gt;
&lt;br /&gt;
== svcBreak ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 ||&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 ||&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Info&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) ? || ? || &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used on retail where inx0 bit31 is clear, the system will throw a [[Error_codes|fatal-error]]. Otherwise when bit31 is set, it will return 0.&lt;br /&gt;
&lt;br /&gt;
== svcGetInfo ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Info ID&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Info Sub ID&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || u64 || &amp;lt;code&amp;gt;Out&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Handle type || Id0 || Id1 || Description&lt;br /&gt;
|-&lt;br /&gt;
| Process || 0 || 0 || AllowedCpuIdBitmask&lt;br /&gt;
|-&lt;br /&gt;
| Process || 1 || 0 || AllowedThreadPrioBitmask&lt;br /&gt;
|-&lt;br /&gt;
| Process || 2 || 0 || ReservedMapRegionBaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 3 || 0 || ReservedMapRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 4 || 0 || ReservedHeapRegionBaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 5 || 0 || ReservedHeapRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 6 || 0 || TotalMemoryUsage&lt;br /&gt;
|-&lt;br /&gt;
| Process || 7 || 0 || TotalHeapUsage&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 8 || 0 || IsCurrentProcessBeingDebugged&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 9 || 0 || Returns ResourceLimit handle for current process. Used by [[Process_Manager_services|PM]].&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 10 || -1, {current coreid} || Unknown. Output data changes each time this SVC is used. Global and core-specific tick-count?&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 11 || 0-3 || RandomEntropy from current process. TRNG. Used to seed usermode PRNGs.&lt;br /&gt;
|-&lt;br /&gt;
| Process || 12 || 0 || [2.0.0+] AddressSpaceStart&lt;br /&gt;
|-&lt;br /&gt;
| Process || 13 || 0 || [2.0.0+] AddressSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 14 || 0 || [2.0.0+] NewReservedRegionStartAddr&lt;br /&gt;
|-&lt;br /&gt;
| Process || 15 || 0 || [2.0.0+] NewReservedRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 18 || 0 || [3.0.0+] Title-id.&lt;br /&gt;
|-&lt;br /&gt;
| Thread || 0xF0000002 || 0 || Performance counter related.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== svcDumpInfo ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Does nothing, just returns with registers set to all-zero.&lt;br /&gt;
&lt;br /&gt;
== svcReadWriteRegister ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Reg Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;RW Mask&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;In Value&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1|| u64 || &amp;lt;code&amp;gt;Out Value&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Read/write IO registers with a hardcoded whitelist. Input address is physical-address and must be aligned to 4.&lt;br /&gt;
&lt;br /&gt;
rw_mask is 0 for reading and 0xffffffff for writing. You can also write individual bits by using a mask value.&lt;br /&gt;
&lt;br /&gt;
You can only write to registers inside physical pages 0x70019000 (MC), 0x7001C000 (MC0), 0x7001D000 (MC1), and they all share the same whitelist.&lt;br /&gt;
&lt;br /&gt;
The whitelist is same for writing as for reading.&lt;br /&gt;
&lt;br /&gt;
The whitelist is:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
0x054, 0x090, 0x094, 0x098, 0x09c, 0x0a0, 0x0a4, 0x0a8, 0x0ac, 0x0b0, 0x0b4, 0x0b8, 0x0bc, 0x0c0, 0x0c4, 0x0c8, 0x0d0, 0x0d4, 0x0d8, 0x0dc, 0x0e0, 0x100, 0x108, 0x10c, 0x118, 0x11c, 0x124, 0x128, 0x12c, 0x130, 0x134, 0x138, 0x13c, 0x158, 0x15c, 0x164, 0x168, 0x16c, 0x170, 0x174, 0x178, 0x17c, 0x200, 0x204, 0x2e4, 0x2e8, 0x2ec, 0x2f4, 0x2f8, 0x310, 0x314, 0x320, 0x328, 0x344, 0x348, 0x370, 0x374, 0x37c, 0x380, 0x390, 0x394, 0x398, 0x3ac, 0x3b8, 0x3bc, 0x3c0, 0x3c4, 0x3d8, 0x3e8, 0x41c, 0x420, 0x424, 0x428, 0x42c, 0x430, 0x44c, 0x47c, 0x480, 0x484, 0x50c, 0x554, 0x558, 0x55c, 0x670, 0x674, 0x690, 0x694, 0x698, 0x69c, 0x6a0, 0x6a4, 0x6c0, 0x6c4, 0x6f0, 0x6f4, 0x960, 0x970, 0x974, 0xa20, 0xa24, 0xb88, 0xb8c, 0xbc4, 0xbc8, 0xbcc, 0xbd0, 0xbd4, 0xbd8, 0xbdc, 0xbe0, 0xbe4, 0xbe8, 0xbec, 0xc00, 0xc5c, 0xcac&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] Whitelist was extended with &amp;lt;code&amp;gt;0x4c4, 0x4c8, 0x4cc, 0x584, 0x588, 0x58c.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] The IO registers in range 0x7000E400 (PMC) size 0xC00 skip the whitelist, and do a TrustZone call using [[SMC]] Id1 0xC3000008(ReadWriteRegister).&lt;br /&gt;
&lt;br /&gt;
== svcCreateSharedMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;My Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;Other Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1|| u64 || &amp;lt;code&amp;gt;Shared Memory Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other perm can be used to enforce permission 1, 3, or 0x10000000 if don&#039;t care.&lt;br /&gt;
&lt;br /&gt;
== svcMapTransferMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Transfer Mem Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The newly mapped pages will have [[#MemoryState]] type 0xE.&lt;br /&gt;
&lt;br /&gt;
You must pass same size and permissions as given in svcCreateMemoryMirror, otherwise error.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapTransferMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Transfer Mem Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Size must match size given in map syscall, otherwise there&#039;s an invalid-size error.&lt;br /&gt;
&lt;br /&gt;
== svcQueryPhysicalAddress ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]]|| &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || u64 || &amp;lt;code&amp;gt;Out0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X2 || u64 || &amp;lt;code&amp;gt;Out1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X3 || u64 || &amp;lt;code&amp;gt;Out2&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The inverse operation of [[#svcQueryIoMapping]].&lt;br /&gt;
&lt;br /&gt;
== svcQueryIoMapping ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Physical Address&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || u64 || &amp;lt;code&amp;gt;Virtual Address&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Returns a virtual address mapped to a given IO range.&lt;br /&gt;
&lt;br /&gt;
== svcCreateDeviceAddressSpace ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Device as Start Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Device as End Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Device as Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Creates a virtual address space for binding device address spaces and returns a handle.&lt;br /&gt;
&lt;br /&gt;
dev_as_start_addr is normally set to 0 and dev_as_end_addr is normally set to 0xFFFFFFFF.&lt;br /&gt;
&lt;br /&gt;
== svcAttachDeviceAddressSpace ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Device&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Device as Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Attaches a device address space to a [[#DeviceName|device]].&lt;br /&gt;
&lt;br /&gt;
== svcDetachDeviceAddressSpace ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Device&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Device as Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Detaches a device address space from a [[#DeviceName|device]].&lt;br /&gt;
&lt;br /&gt;
== svcMapDeviceAddressSpaceByForce ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Device as Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || u64 || &amp;lt;code&amp;gt;Process Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Device Map Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Device as Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X4 || u64 || &amp;lt;code&amp;gt;Device as Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W5 || u64 || &amp;lt;code&amp;gt;Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Maps an attached device address space to an userspace address.&lt;br /&gt;
&lt;br /&gt;
dev_map_addr is the userspace destination address, while dev_as_addr is the source address between dev_as_start_addr and dev_as_end_addr (passed to [[#svcCreateDeviceAddressSpace]]).&lt;br /&gt;
&lt;br /&gt;
The userspace destination address must have the [[SVC#MemoryState|MapDeviceAllowed]] bit set. Bit [[SVC#MemoryAttribute|IsDeviceMapped]] will be set after mapping.&lt;br /&gt;
&lt;br /&gt;
== svcMapDeviceAddressSpaceAligned ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Device as Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || u64 || &amp;lt;code&amp;gt;Process Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Device Map Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Device as Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X4 || u64 || &amp;lt;code&amp;gt;Device as Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W5 || u64 || &amp;lt;code&amp;gt;Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Maps an attached device address space to an userspace address.&lt;br /&gt;
&lt;br /&gt;
Same as [[#svcMapDeviceAddressSpaceByForce]], but the userspace destination address must have the [[SVC#MemoryState|MapDeviceAlignedAllowed]] bit set instead.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapDeviceAddressSpace ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Device as Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || u64 || &amp;lt;code&amp;gt;Process Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Device Map Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Device as Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X4 || u64 || &amp;lt;code&amp;gt;Device as Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Unmaps an attached device address space from an userspace address.&lt;br /&gt;
&lt;br /&gt;
== svcMapProcessMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Src Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || u64 || &amp;lt;code&amp;gt;Process Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Dest Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Maps the src address from the supplied process handle into the current process.&lt;br /&gt;
&lt;br /&gt;
This allows mapping code and rodata with RW- permission.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapProcessMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Process Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Dest Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Src Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unmaps what was mapped by [[#svcMapProcessMemory]].&lt;br /&gt;
&lt;br /&gt;
== svcQueryProcessMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Meminfo Pointer&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;Process Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || PageInfo || &amp;lt;code&amp;gt;Page Info&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equivalent to [[#svcQueryMemory]] except takes a process handle.&lt;br /&gt;
&lt;br /&gt;
== svcMapProcessCodeMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Process Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Dest Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Src Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Takes a process handle, and maps normal heap in that process as executable code in that process. Used when loading NROs.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapProcessCodeMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Process Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Dest Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Src Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unmaps what was mapped by [[#svcMapProcessCodeMemory]].&lt;br /&gt;
&lt;br /&gt;
== svcCreateProcess ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;ProcInfo Pointer&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Capabilities Pointer&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Capibility Num&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Process Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Takes a [[#CreateProcessInfo]] as input.&lt;br /&gt;
&lt;br /&gt;
== svcGetProcessInfo ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Process Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || [[#ProcessState]] || &amp;lt;code&amp;gt;Process State&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an enum with value 0-7.&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
[2.0.0+] Exactly 6 debug SVCs require that [[SPL_services#GetConfig|IsDebugMode]] is non-zero. Error 0x4201 is returned otherwise.&lt;br /&gt;
* svcBreakDebugProcess&lt;br /&gt;
* svcContinueDebugEvent&lt;br /&gt;
* svcWriteDebugProcessMemory&lt;br /&gt;
* svcSetDebugThreadContext&lt;br /&gt;
* svcTerminateDebugProcess&lt;br /&gt;
* svcSetHardwareBreakPoint&lt;br /&gt;
&lt;br /&gt;
svcDebugActiveProcess stops execution of the target process, the normal method for resuming it requires svcContinueDebugEvent(see above). Closing the debug handle also results in execution being resumed.&lt;br /&gt;
&lt;br /&gt;
= Structures =&lt;br /&gt;
== DeviceName ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || DeviceName_AFI&lt;br /&gt;
|-&lt;br /&gt;
| 1 || DeviceName_AVPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DeviceName_DC&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DeviceName_DCB&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeviceName_HC&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeviceName_HDA&lt;br /&gt;
|-&lt;br /&gt;
| 6 || DeviceName_ISP2&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeviceName_MSENCNVENC&lt;br /&gt;
|-&lt;br /&gt;
| 8 || DeviceName_NV&lt;br /&gt;
|-&lt;br /&gt;
| 9 || DeviceName_NV2&lt;br /&gt;
|-&lt;br /&gt;
| 10 || DeviceName_PPCS&lt;br /&gt;
|-&lt;br /&gt;
| 11 || DeviceName_SATA&lt;br /&gt;
|-&lt;br /&gt;
| 12 || DeviceName_VI&lt;br /&gt;
|-&lt;br /&gt;
| 13 || DeviceName_VIC&lt;br /&gt;
|-&lt;br /&gt;
| 14 || DeviceName_XUSB_HOST&lt;br /&gt;
|-&lt;br /&gt;
| 15 || DeviceName_XUSB_DEV&lt;br /&gt;
|-&lt;br /&gt;
| 16 || DeviceName_TSEC&lt;br /&gt;
|-&lt;br /&gt;
| 17 || DeviceName_PPCS1&lt;br /&gt;
|-&lt;br /&gt;
| 18 || DeviceName_DC1&lt;br /&gt;
|-&lt;br /&gt;
| 19 || DeviceName_SDMMC1A&lt;br /&gt;
|-&lt;br /&gt;
| 20 || DeviceName_SDMMC2A&lt;br /&gt;
|-&lt;br /&gt;
| 21 || DeviceName_SDMMC3A&lt;br /&gt;
|-&lt;br /&gt;
| 22 || DeviceName_SDMMC4A&lt;br /&gt;
|-&lt;br /&gt;
| 23 || DeviceName_ISP2B&lt;br /&gt;
|-&lt;br /&gt;
| 24 || DeviceName_GPU&lt;br /&gt;
|-&lt;br /&gt;
| 25 || DeviceName_GPUB&lt;br /&gt;
|-&lt;br /&gt;
| 26 || DeviceName_PPCS2&lt;br /&gt;
|-&lt;br /&gt;
| 27 || DeviceName_NVDEC&lt;br /&gt;
|-&lt;br /&gt;
| 28 || DeviceName_APE&lt;br /&gt;
|-&lt;br /&gt;
| 29 || DeviceName_SE&lt;br /&gt;
|-&lt;br /&gt;
| 30 || DeviceName_NVJPG&lt;br /&gt;
|-&lt;br /&gt;
| 31 || DeviceName_HC1&lt;br /&gt;
|-&lt;br /&gt;
| 32 || DeviceName_SE1&lt;br /&gt;
|-&lt;br /&gt;
| 33 || DeviceName_AXIAP&lt;br /&gt;
|-&lt;br /&gt;
| 34 || DeviceName_ETR&lt;br /&gt;
|-&lt;br /&gt;
| 35 || DeviceName_TSECB&lt;br /&gt;
|-&lt;br /&gt;
| 36 || DeviceName_TSEC1&lt;br /&gt;
|-&lt;br /&gt;
| 37 || DeviceName_TSECB1&lt;br /&gt;
|-&lt;br /&gt;
| 38 || DeviceName_NVDEC1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LimitableResource ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || LimitableResource_Memory&lt;br /&gt;
|-&lt;br /&gt;
| 1 || LimitableResource_Threads&lt;br /&gt;
|-&lt;br /&gt;
| 2 || LimitableResource_Events&lt;br /&gt;
|-&lt;br /&gt;
| 3 || LimitableResource_TransferMemories&lt;br /&gt;
|-&lt;br /&gt;
| 4 || LimitableResource_Sessions&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateProcessInfo ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 12 || || ProcessName (doesn&#039;t have to be null-terminated)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 4 || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 8 || || TitleId&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 8 || || CodeAddr&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 4 || || CodeNumPages&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 4 || || MmuFlags&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit0 || Is64bit&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit3-1 || [[#AddressSpaceType]]&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit4 ||&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit5 || EnableAslr&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit6 || IsSystem&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 4 || || ResourceLimitHandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 4 ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== AddressSpaceType ===&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Type || Name || Width || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Normal_32Bit || 32 ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Normal_36Bit || 36 ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || WithoutMap_32Bit || 32 || Appears to be missing map region [?]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [2.0.0+] Normal_39Bit || 39 ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryInfo ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 8 || BaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 8 || Size&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 4 || MemoryType: lower 8 bits of [[#MemoryState]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || 4 || [[#MemoryAttribute]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 4 || Permission (bit0: R, bit1: W, bit2: X)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || 4 || DeviceRefCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 4 || IpcRefCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 4 || Padding: always zero&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryAttribute ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IsBorrowed&lt;br /&gt;
|-&lt;br /&gt;
| 1 || IsIpcMapped: when IpcRefCount &amp;gt; 0.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || IsDeviceMapped: when DeviceRefCount &amp;gt; 0.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || IsUncached&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryState ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 7-0 || Type&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#svcSetMemoryPermission|PermissionChangeAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || IsUserWritable [?]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || IpcSendAllowed_Type0&lt;br /&gt;
|-&lt;br /&gt;
| 11 || IpcSendAllowed_Type3&lt;br /&gt;
|-&lt;br /&gt;
| 12 || IpcSendAllowed_Type1&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#svcSetProcessMemoryPermission|ProcessPermissionChangeAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [[#svcMapMemory|MapAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [[#svcUnmapProcessCodeMemory|UnmapProcessCodeMemoryAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [[#svcCreateTransferMemory|TransferMemoryAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 19 || MapDeviceAllowed ([[#svcMapDeviceAddressSpace]] and [[#svcMapDeviceAddressSpaceByForce]])&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#svcMapDeviceAddressSpaceAligned|MapDeviceAlignedAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#svcSendSyncRequestWithUserBuffer|IpcBufferAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || IsPoolAllocated/IsReferenceCounted&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [[#svcMapProcessMemory|MapProcessAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [[#svcSetMemoryAttribute|AttributeChangeAllowed]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Type || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00000000&amp;lt;/code&amp;gt; || Unmapped ||&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00002001&amp;lt;/code&amp;gt; || IO || Mapped by kernel capability parsing in [[#svcCreateProcess]]. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00042002&amp;lt;/code&amp;gt; || Normal || Mapped by kernel capability parsing in [[#svcCreateProcess]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00DC7E03&amp;lt;/code&amp;gt; || Code static || Mapped during [[#svcCreateProcess]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x01FEBD04&amp;lt;/code&amp;gt; || Code || Transition from 0xDC7E03 performed by [[#svcSetProcessMemoryPermission]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x017EBD05&amp;lt;/code&amp;gt; || Heap || Mapped using [[#svcSetHeapSize]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00402006&amp;lt;/code&amp;gt; || Shared memory block || Mapped using [[#svcMapSharedMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00482907&amp;lt;/code&amp;gt; || [1.0.0] Weird mapped memory || Mapped using [[#svcMapMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00DD7E08&amp;lt;/code&amp;gt; || Module code static || Mapped using [[#svcMapProcessCodeMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x01FFBD09&amp;lt;/code&amp;gt; || Module code mutable || Transition from 0xDD7E08 performed by [[#svcSetProcessMemoryPermission]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C3C0A&amp;lt;/code&amp;gt; || [[IPC_Marshalling|IPC]] buffers || IPC buffers with descriptor flags=0.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C3C0B&amp;lt;/code&amp;gt; || Mapped memory || Mapped using [[#svcMapMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x0040200C&amp;lt;/code&amp;gt; || [[Thread Local Storage|Thread local storage]] || Mapped during [[#svcCreateThread]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x015C3C0D&amp;lt;/code&amp;gt; || Isolated transfer memory || Mapped using [[#svcMapTransferMemory]] when the owning process has perm=0.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C380E&amp;lt;/code&amp;gt; || Transfer memory || Mapped using [[#svcMapTransferMemory]] when the owning process has perm!=0.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x0040380F&amp;lt;/code&amp;gt; || Process memory || Mapped using [[#svcMapProcessMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00000010&amp;lt;/code&amp;gt; || Reserved ||&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C3811&amp;lt;/code&amp;gt; || [[IPC_Marshalling|IPC]] buffers || IPC buffers with descriptor flags=1.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x004C2812&amp;lt;/code&amp;gt; || [[IPC_Marshalling|IPC]] buffers || IPC buffers with descriptor flags=3.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00002013&amp;lt;/code&amp;gt; || Kernel per-thread stack || Mapped in kernel during [[#svcCreateThread]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Exception handling =&lt;br /&gt;
There is userland code for handling exceptions, however this doesn&#039;t seem to be executed on retail mode.&lt;br /&gt;
&lt;br /&gt;
When a usermode exception occurs, it jumps to the main code binary entrypoint (main_binary_address + 0 == &#039;&#039;&#039;_start&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
During normal boot &#039;&#039;&#039;_start&#039;&#039;&#039; is invoked with X0=0 and X1=main_thread_handle (triggering normal crt0 setup).&lt;br /&gt;
During an usermode exception &#039;&#039;&#039;_start&#039;&#039;&#039; is invoked with X0=exception_info0_ptr and X1=exception_info1_ptr instead.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;_start&#039;&#039;&#039; method determines whether to boot normally or handle an exception if X0 is set to 0 or not.&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=SVC&amp;diff=2805</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=SVC&amp;diff=2805"/>
		<updated>2017-10-14T09:49:00Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&lt;br /&gt;
= System calls =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
|  0x1 || [[#svcSetHeapSize]] || W1=size || W0=result, X1=outaddr&lt;br /&gt;
|-&lt;br /&gt;
|  0x2 || [[#svcSetMemoryPermission]] || X0=addr, X1=size, W2=prot || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x3 || [[#svcSetMemoryAttribute]] || X0=addr, X1=size, W2=state0, W3=state1 || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x4 || [[#svcMapMemory]] || X0=dstaddr, X1=srcaddr, X2=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x5 || [[#svcUnmapMemory]] || X0=dstaddr, X1=srcaddr, X2=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x6 || [[#svcQueryMemory]] || X0=MemoryInfo*, X2=addr || W0=result, W1=PageInfo                                                         &lt;br /&gt;
|-&lt;br /&gt;
|  0x7 || [[#svcExitProcess]] || None ||&lt;br /&gt;
|-&lt;br /&gt;
|  0x8 || [[#svcCreateThread]] || X1=entry, X2=arg, X3=stacktop, W4=prio, W5=processor_id  || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
|  0x9 || [[#svcStartThread]] || W0=thread_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0xA || [[#svcExitThread]] || None ||                                                         &lt;br /&gt;
|-&lt;br /&gt;
|  0xB || [[#svcSleepThread]] || X0=nano || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0xC || [[#svcGetThreadPriority]] || W1=thread_handle || W0=result, W1=prio&lt;br /&gt;
|-&lt;br /&gt;
|  0xD || [[#svcSetThreadPriority]] || W0=thread_handle, W1=prio || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0xE || [[#svcGetThreadCoreMask]] || W2=thread_handle || W0=result, W1=out, X2=out&lt;br /&gt;
|-&lt;br /&gt;
|  0xF || [[#svcSetThreadCoreMask]] || W0=thread_handle, W1=in, X2=in2 || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || [[#svcGetCurrentProcessorNumber]] || None || W0/X0=cpuid&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 || svcSignalEvent || W0=wevent_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || svcClearEvent || W0=wevent_or_revent_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || [[#svcMapSharedMemory]] || W0=shmem_handle, X1=addr, X2=size, W3=perm || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || svcUnmapSharedMemory || W0=shmem_handle, X1=addr, X2=size || W0=result                                                 &lt;br /&gt;
|-&lt;br /&gt;
| 0x15 || [[#svcCreateTransferMemory]] || X1=addr, X2=size, W3=perm || W0=result, W1=tmem_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || svcCloseHandle || W0=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 || svcResetSignal || W0=revent_or_process_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || [[#svcWaitSynchronization]] || X1=handles_ptr, W2=num_handles. X3=timeout || W0=result, W1=handle_idx&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 || svcCancelSynchronization || W0=thread_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A || svcArbitrateLock || W0=cur_thread_handle, X1=ptr, W2=req_thread_handle ||                                     &lt;br /&gt;
|-&lt;br /&gt;
| 0x1B || svcArbitrateUnlock || X0=ptr ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || svcWaitProcessWideKeyAtomic || X0=ptr0, X1=ptr, W2=thread_handle, X3=timeout || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D || svcSignalProcessWideKey || X0=ptr, W1=value || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E || svcGetSystemTick || None || X0={value of cntpct_el0}&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F || svcConnectToNamedPort || X1=port_name_str || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || svcSendSyncRequestLight || W0=light_session_handle, X1=? || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || svcSendSyncRequest || X0=normal_session_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 || [[#svcSendSyncRequestWithUserBuffer]] || X0=cmdbufptr, X1=size, X2=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 || svcSendAsyncRequestWithUserBuffer || X1=cmdbufptr, X2=size, X3=handle || W0=result, W1=event_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || svcGetProcessId || W0=thread_or_process_or_debug_handle || W0=result, X1=pid&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 || svcGetThreadId || W0=thread_handle || W0=result, X1=out&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 || svcBreak || X0,X1,X2=info || ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 || svcOutputDebugString || X0=str, X1=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || svcReturnFromException || X0=result || &lt;br /&gt;
|-&lt;br /&gt;
| 0x29 || [[#svcGetInfo]] || X1=info_id, X2=handle, X3=info_sub_id || W0=result, X1=out&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A || svcFlushEntireDataCache || None || None&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B || svcFlushDataCache || X0=addr, X1=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || [3.0.0+] svcMapPhysicalMemory ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D || [3.0.0+] svcUnmapPhysicalMemory||  ||&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x2F || svcGetLastThreadInfo || None || W0=result, W1,W2,W3,W4=unk, W5=truncated_u64, W6=bool&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || svcGetResourceLimitLimitValue || W1=reslimit_handle, W2=[[#LimitableResource]] || W0=result, X1=value&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 || svcGetResourceLimitCurrentValue || W1=reslimit_handle, W2=[[#LimitableResource]] || W0=result, X1=value&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || svcSetThreadActivity || W0=thread_handle, W1=bool || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 || svcGetThreadContext3 || W0=thread_handle, W1=[[#ThreadContext]]* || W0=result&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x3C || svcDumpInfo ||  || &lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x40 || svcCreateSession || W2=is_light, X3=? || W0=result, W1=client_handle, W2=server_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x41 || svcAcceptSession || W1=port_handle || W0=result, W1=session_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x42 || svcReplyAndReceiveLight || W0=light_session_handle || W0=result, W1,W2,W3,W4,W5,W6,W7=out&lt;br /&gt;
|-&lt;br /&gt;
| 0x43 || svcReplyAndReceive || X1=ptr_handles, W2=num_handles, X3=replytarget_handle(0=none), X4=timeout || W0=result, W1=handle_idx&lt;br /&gt;
|-&lt;br /&gt;
| 0x44 || svcReplyAndReceiveWithUserBuffer|| X1=buf, X2=sz, X3=ptr_handles, W4=num_handles, X5=replytarget_handle(0=none), X6=timeout || W0=result, W1=handle_idx&lt;br /&gt;
|-&lt;br /&gt;
| 0x45 || svcCreateEvent || None || W0=result, W1=client_handle ?, W2=server_handle ?&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x4D || svcSleepSystem || None || None&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E || [[#svcReadWriteRegister]] || X1=reg_addr, W2=rw_mask, W3=in_val || W0=result, W1=out_val&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F || svcSetProcessActivity || W0=process_handle, W1=bool || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 || [[#svcCreateSharedMemory]] || W1=size, W2=myperm, W3=otherperm || W0=result, W1=shmem_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 || [[#svcMapTransferMemory]] || X0=tmem_handle, X1=addr, X2=size, W3=perm || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 || [[#svcUnmapTransferMemory]] || W0=tmemhandle, X1=addr, X2=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 || svcCreateInterruptEvent || X1=irq_id, W2=flag || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 || [[#svcQueryPhysicalAddress]] || X1=addr || W0=result, X1=out0, X2=out1, X3=out2&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 || [[#svcQueryIoMapping]] || X1=physaddr, X2=size || W0=result, X1=virtaddr&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 || [[#svcCreateDeviceAddressSpace]] || X1=dev_as_start_addr, X2=dev_as_end_addr || W0=result, W1=dev_as_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 || [[#svcAttachDeviceAddressSpace]] || W0=device, X1=dev_as_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x58 || [[#svcDetachDeviceAddressSpace]] || W0=device, X1=dev_as_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x59 || [[#svcMapDeviceAddressSpaceByForce]] || W0=dev_as_handle, W1=proc_handle, X2=dev_map_addr, X3=dev_as_size, X4=dev_as_addr, W5=perm || W0=result &lt;br /&gt;
|-&lt;br /&gt;
| 0x5A || [[#svcMapDeviceAddressSpaceAligned]] || W0=dev_as_handle, W1=proc_handle, X2=dev_map_addr, X3=dev_as_size, X4=dev_as_addr, W5=perm || W0=result &lt;br /&gt;
|-&lt;br /&gt;
| 0x5B || svcMapDeviceAddressSpace || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x5C || [[#svcUnmapDeviceAddressSpace]] || W0=dev_as_handle, W1=proc_handle, X2=dev_map_addr, X3=dev_as_size, X4=dev_as_addr || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x5D || svcInvalidateProcessDataCache || W0=process_handle, X1=addr, X2=size || W0=size&lt;br /&gt;
|-&lt;br /&gt;
| 0x5E || svcStoreProcessDataCache || W0=process_handle, X1=addr, X2=size || W0=size&lt;br /&gt;
|-&lt;br /&gt;
| 0x5F || svcFlushProcessDataCache || W0=process_handle, X1=addr, X2=size || W0=size&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || svcDebugActiveProcess || X1=pid || W0=result, W1=debug_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 || svcBreakDebugProcess || W0=debug_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 || svcTerminateDebugProcess || W0=debug_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 || svcGetDebugEvent || X0=DebugEventInfo*, W1=debug_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 || svcContinueDebugEvent || W0=debug_handle, W1=flags, X2=? || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 || svcGetProcessList || X1=pids_out_ptr, W2=max_out || W0=result, W1=num_out &lt;br /&gt;
|-&lt;br /&gt;
| 0x66 || svcGetThreadList || X1=tids_out_ptr, W2=max_out, W3=debug_handle_or_zero || W0=result, X1=num_out&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 || svcGetDebugThreadContext || X0=ThreadContext*, X1=debug_handle, X2=?, W3=? || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || svcSetDebugThreadContext || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x69 || svcQueryDebugProcessMemory || X0=[[#MemoryInfo]]*, X2=debug_handle, X3=addr || W0=result, W1=PageInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A || svcReadDebugProcessMemory || X0=buffer*, X1=debug_handle, X2=src_addr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B || svcWriteDebugProcessMemory || X0=debug_handle, X1=buffer*, X2=dst_addr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C || svcSetHardwareBreakPoint || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x6D || svcGetDebugThreadParam || X2=debug_handle, X3=thread_id, W4=DebugThreadParam || W0=result, X1=out0, W2=out1&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x70 || svcCreatePort || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x71 || svcManageNamedPort || X1=name_ptr, W2=max_sessions(?) || W0=result, W1=serverport_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x72 || svcConnectToPort || W1=clientport_handle || W0=result, W1=session_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x73 || svcSetProcessMemoryPermission || X0=addr, X1=size, W2=perm || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x74 || [[#svcMapProcessMemory]] || X0=srcaddr, W1=process_handle, X2=dstaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x75 || [[#svcUnmapProcessMemory]] || W0=process_handle, X1=dstaddr, X2=srcaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x76 || [[#svcQueryProcessMemory]] || X0=meminfo_ptr, W2=process_handle, X3=addr || W0=result, W1=pageinfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x77 || [[#svcMapProcessCodeMemory]] || W0=process_handle, X2=dstaddr, X2=srcaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x78 || [[#svcUnmapProcessCodeMemory]] || W0=process_handle, X1=dstaddr, X2=srcaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x79 || [[#svcCreateProcess]] || X1=procinfo_ptr, X2=caps_ptr, W3=cap_num ||  W0=result, W1=process_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A || svcStartProcess || W0=process_handle, W1=main_thread_prio, W2=default_cpuid, W3=main_thread_stacksz || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x7B || svcTerminateProcess || W0=process_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C || [[#svcGetProcessInfo]] || W0=process_handle || W0=result, X1=[[#ProcessState]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D || svcCreateResourceLimit || None || W0=result, W1=reslimit_handle &lt;br /&gt;
|-&lt;br /&gt;
| 0x7E || svcSetResourceLimitLimitValue || W0=reslimit_handle, W1=[[#LimitableResource]], X2=value || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x7F || svcCallSecureMonitor || || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== svcSetHeapSize ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || u64 || &amp;lt;code&amp;gt;OutAddr&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Set the process heap to a given &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;. It can both extend and shrink the heap.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt; must be a multiple of 0x2000000.&lt;br /&gt;
&lt;br /&gt;
On success, the heap base-address (which is fixed by kernel, aslr&#039;d) is written to &amp;lt;code&amp;gt;OutAddr&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt; must be less than 0x18000000.&lt;br /&gt;
&lt;br /&gt;
== svcSetMemoryPermission ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;Prot&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Change permission of page-aligned memory region.&lt;br /&gt;
&lt;br /&gt;
Bit2 of permission (exec) is not allowed. Setting write-only is not allowed either (bit1).&lt;br /&gt;
&lt;br /&gt;
This can be used to move back and forth between ---, r-- and rw-.&lt;br /&gt;
&lt;br /&gt;
== svcSetMemoryAttribute ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;State0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;State1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Change attribute of page-aligned memory region. &lt;br /&gt;
&lt;br /&gt;
This is used to turn on/off caching for a given memory area. Useful when talking to devices such as the GPU.&lt;br /&gt;
&lt;br /&gt;
What happens &amp;quot;under the hood&amp;quot; is the &amp;quot;Memory Attribute Indirection Register&amp;quot; index is changed from 2 to 3 in the MMU descriptor.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! State0 || State1 || Action&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || Clear bit3 in [[#MemoryAttribute]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 0 || Clear bit3 in [[#MemoryAttribute]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 8 || Set bit3 in [[#MemoryAttribute]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== svcMapMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Dst&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Src&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Maps a memory range into a different range.&lt;br /&gt;
&lt;br /&gt;
Mainly used for adding guard pages around stack.&lt;br /&gt;
&lt;br /&gt;
Source range gets reprotected to --- (it can no longer be accessed), and bit0 is set in the source [[#MemoryAttribute]].&lt;br /&gt;
&lt;br /&gt;
If dstaddr &amp;gt;= LowerTreshold, the dst-range is enforced to be within the process&#039; &amp;quot;MapRegion&amp;quot;. Code can get the range of this region from [[#svcGetInfo]] id0=2,3.&lt;br /&gt;
&lt;br /&gt;
In this case, the mapped memory will have state &amp;lt;code&amp;gt;0x5C3C0B&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As long as (dstaddr+size) &amp;lt; LowerThreshold, then you can map anywhere but the mapped memory will have state &amp;lt;code&amp;gt;0x482907&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
LowerTreshold is 0x80000000 for 36-bit address spaces, and 0x40000000 for 32-bit ones.&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] Support for the &amp;lt;code&amp;gt;0x482907&amp;lt;/code&amp;gt; mappings outside the &amp;quot;MapRegion&amp;quot; were removed.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Dst&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Src&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Unmaps a region that was previously mapped with [[#svcMapMemory]].&lt;br /&gt;
&lt;br /&gt;
It&#039;s possible to unmap ranges partially, you don&#039;t need to unmap the entire range &amp;quot;in one go&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The srcaddr/dstaddr must match what was given when the pages were originally mapped.&lt;br /&gt;
&lt;br /&gt;
== svcQueryMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || MemoryInfo*|| &amp;lt;code&amp;gt;Mem Info&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || PageInfo || &amp;lt;code&amp;gt;Page Info&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Query information about an address. Will always fetch the lowest page-aligned mapping that contains the provided address.&lt;br /&gt;
&lt;br /&gt;
Outputs a [[#MemoryInfo]] struct.&lt;br /&gt;
&lt;br /&gt;
== svcExitProcess ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Exits the current process.&lt;br /&gt;
&lt;br /&gt;
== svcCreateThread ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Entry&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Arg&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Stack Top&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W4 || u64 || &amp;lt;code&amp;gt;Priority&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W5 || u64 || &amp;lt;code&amp;gt;Processor ID&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Create a thread in the current process.&lt;br /&gt;
&lt;br /&gt;
Processor_id must be 0,1,2,3 or -2, where -2 uses the default cpuid for process.&lt;br /&gt;
&lt;br /&gt;
== svcStartThread ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0|| u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) None ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Starts the thread for the provided handle.&lt;br /&gt;
&lt;br /&gt;
== svcExitThread ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Exits the current thread.&lt;br /&gt;
&lt;br /&gt;
== svcSleepThread ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Nano&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Sleep for a specified amount of time, or yield thread.&lt;br /&gt;
&lt;br /&gt;
Setting nano=0 means &amp;quot;yield thread&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== svcGetThreadPriority ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1|| u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Priority&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Get priority of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== svcSetThreadPriority ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0|| u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1|| u64 || &amp;lt;code&amp;gt;Priority&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Set priority of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
Priority is a number 0-0x3F. Lower value means higher priority.&lt;br /&gt;
&lt;br /&gt;
== svcGetThreadCoreMask ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Out&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X2 || u64 || &amp;lt;code&amp;gt;Out&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Get affinity mask of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== svcSetThreadCoreMask ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || u64 || &amp;lt;code&amp;gt;In&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;In&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Set affinity mask of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== svcGetCurrentProcessorNumber ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0/X0 || u64 || &amp;lt;code&amp;gt;CPU ID&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Get which cpu is executing the current thread.&lt;br /&gt;
&lt;br /&gt;
Cpu-id is an integer in the range 0-3.&lt;br /&gt;
&lt;br /&gt;
== svcMapSharedMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Mem Block Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Maps the block supplied by the handle. The required permissions are different for the process that created the handle and all other processes.&lt;br /&gt;
&lt;br /&gt;
Increases reference count for the KSharedMemory object. Thus in order to release the memory associated with the object, all handles to it must be closed and all mappings must be unmapped.&lt;br /&gt;
&lt;br /&gt;
== svcCreateTransferMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one reprotects the src block with perms you give it. It also sets bit0 into [[#MemoryAttribute]].&lt;br /&gt;
&lt;br /&gt;
Executable bit perm not allowed.&lt;br /&gt;
&lt;br /&gt;
Closing all handles automatically causes the bit0 in [[#MemoryAttribute]] to clear, and the permission to reset.&lt;br /&gt;
&lt;br /&gt;
== svcWaitSynchronization ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Handles Pointer&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;Number of Handles&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Timeout&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Handle Index&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Works with num_handles &amp;lt;= 0x40, error on num_handles == 0.&lt;br /&gt;
&lt;br /&gt;
Does not accept 0xFFFF8001 or 0xFFFF8000 as handles.&lt;br /&gt;
&lt;br /&gt;
== svcSendSyncRequestWithUserBuffer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Command Buffer Pointer&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Size must be 0x1000-aligned.&lt;br /&gt;
&lt;br /&gt;
== svcBreak ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 ||&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 ||&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Info&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) ? || ? || &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used on retail where inx0 bit31 is clear, the system will throw a [[Error_codes|fatal-error]]. Otherwise when bit31 is set, it will return 0.&lt;br /&gt;
&lt;br /&gt;
== svcGetInfo ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Info ID&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Info Sub ID&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || u64 || &amp;lt;code&amp;gt;Out&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Handle type || Id0 || Id1 || Description&lt;br /&gt;
|-&lt;br /&gt;
| Process || 0 || 0 || AllowedCpuIdBitmask&lt;br /&gt;
|-&lt;br /&gt;
| Process || 1 || 0 || AllowedThreadPrioBitmask&lt;br /&gt;
|-&lt;br /&gt;
| Process || 2 || 0 || ReservedMapRegionBaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 3 || 0 || ReservedMapRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 4 || 0 || ReservedHeapRegionBaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 5 || 0 || ReservedHeapRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 6 || 0 || TotalMemoryUsage&lt;br /&gt;
|-&lt;br /&gt;
| Process || 7 || 0 || TotalHeapUsage&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 8 || 0 || IsCurrentProcessBeingDebugged&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 9 || 0 || Returns ResourceLimit handle for current process. Used by [[Process_Manager_services|PM]].&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 10 || -1, {current coreid} || Unknown. Output data changes each time this SVC is used. Global and core-specific tick-count?&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 11 || 0-3 || RandomEntropy from current process. TRNG. Used to seed usermode PRNGs.&lt;br /&gt;
|-&lt;br /&gt;
| Process || 12 || 0 || [2.0.0+] AddressSpaceStart&lt;br /&gt;
|-&lt;br /&gt;
| Process || 13 || 0 || [2.0.0+] AddressSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 14 || 0 || [2.0.0+] NewReservedRegionStartAddr&lt;br /&gt;
|-&lt;br /&gt;
| Process || 15 || 0 || [2.0.0+] NewReservedRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 18 || 0 || [3.0.0+] Title-id.&lt;br /&gt;
|-&lt;br /&gt;
| Thread || 0xF0000002 || 0 || Performance counter related.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== svcDumpInfo ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Does nothing, just returns with registers set to all-zero.&lt;br /&gt;
&lt;br /&gt;
== svcReadWriteRegister ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Reg Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;RW Mask&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;In Value&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1|| u64 || &amp;lt;code&amp;gt;Out Value&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Read/write IO registers with a hardcoded whitelist. Input address is physical-address and must be aligned to 4.&lt;br /&gt;
&lt;br /&gt;
rw_mask is 0 for reading and 0xffffffff for writing. You can also write individual bits by using a mask value.&lt;br /&gt;
&lt;br /&gt;
You can only write to registers inside physical pages 0x70019000 (MC), 0x7001C000 (MC0), 0x7001D000 (MC1), and they all share the same whitelist.&lt;br /&gt;
&lt;br /&gt;
The whitelist is same for writing as for reading.&lt;br /&gt;
&lt;br /&gt;
The whitelist is:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
0x054, 0x090, 0x094, 0x098, 0x09c, 0x0a0, 0x0a4, 0x0a8, 0x0ac, 0x0b0, 0x0b4, 0x0b8, 0x0bc, 0x0c0, 0x0c4, 0x0c8, 0x0d0, 0x0d4, 0x0d8, 0x0dc, 0x0e0, 0x100, 0x108, 0x10c, 0x118, 0x11c, 0x124, 0x128, 0x12c, 0x130, 0x134, 0x138, 0x13c, 0x158, 0x15c, 0x164, 0x168, 0x16c, 0x170, 0x174, 0x178, 0x17c, 0x200, 0x204, 0x2e4, 0x2e8, 0x2ec, 0x2f4, 0x2f8, 0x310, 0x314, 0x320, 0x328, 0x344, 0x348, 0x370, 0x374, 0x37c, 0x380, 0x390, 0x394, 0x398, 0x3ac, 0x3b8, 0x3bc, 0x3c0, 0x3c4, 0x3d8, 0x3e8, 0x41c, 0x420, 0x424, 0x428, 0x42c, 0x430, 0x44c, 0x47c, 0x480, 0x484, 0x50c, 0x554, 0x558, 0x55c, 0x670, 0x674, 0x690, 0x694, 0x698, 0x69c, 0x6a0, 0x6a4, 0x6c0, 0x6c4, 0x6f0, 0x6f4, 0x960, 0x970, 0x974, 0xa20, 0xa24, 0xb88, 0xb8c, 0xbc4, 0xbc8, 0xbcc, 0xbd0, 0xbd4, 0xbd8, 0xbdc, 0xbe0, 0xbe4, 0xbe8, 0xbec, 0xc00, 0xc5c, 0xcac&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] Whitelist was extended with &amp;lt;code&amp;gt;0x4c4, 0x4c8, 0x4cc, 0x584, 0x588, 0x58c.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] The IO registers in range 0x7000E400 (PMC) size 0xC00 skip the whitelist, and do a TrustZone call using [[SMC]] Id1 0xC3000008(ReadWriteRegister).&lt;br /&gt;
&lt;br /&gt;
== svcCreateSharedMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;My Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;Other Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1|| u64 || &amp;lt;code&amp;gt;Shared Memory Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other perm can be used to enforce permission 1, 3, or 0x10000000 if don&#039;t care.&lt;br /&gt;
&lt;br /&gt;
== svcMapTransferMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Transfer Mem Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The newly mapped pages will have [[#MemoryState]] type 0xE.&lt;br /&gt;
&lt;br /&gt;
You must pass same size and permissions as given in svcCreateMemoryMirror, otherwise error.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapTransferMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Transfer Mem Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Size must match size given in map syscall, otherwise there&#039;s an invalid-size error.&lt;br /&gt;
&lt;br /&gt;
== svcQueryPhysicalAddress ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]]|| &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || u64 || &amp;lt;code&amp;gt;Out0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X2 || u64 || &amp;lt;code&amp;gt;Out1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X3 || u64 || &amp;lt;code&amp;gt;Out2&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The inverse operation of [[#svcQueryIoMapping]].&lt;br /&gt;
&lt;br /&gt;
== svcQueryIoMapping ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Physical Address&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || u64 || &amp;lt;code&amp;gt;Virtual Address&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Returns a virtual address mapped to a given IO range.&lt;br /&gt;
&lt;br /&gt;
== svcCreateDeviceAddressSpace ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Device as Start Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Device as End Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Device as Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Creates a virtual address space for binding device address spaces and returns a handle.&lt;br /&gt;
&lt;br /&gt;
dev_as_start_addr is normally set to 0 and dev_as_end_addr is normally set to 0xFFFFFFFF.&lt;br /&gt;
&lt;br /&gt;
== svcAttachDeviceAddressSpace ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Device&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Device as Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Attaches a device address space to a [[#DeviceName|device]].&lt;br /&gt;
&lt;br /&gt;
== svcDetachDeviceAddressSpace ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Device&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Device as Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Detaches a device address space from a [[#DeviceName|device]].&lt;br /&gt;
&lt;br /&gt;
== svcMapDeviceAddressSpaceByForce ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Device as Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || u64 || &amp;lt;code&amp;gt;Process Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Device Map Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Device as Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X4 || u64 || &amp;lt;code&amp;gt;Device as Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W5 || u64 || &amp;lt;code&amp;gt;Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Maps an attached device address space to an userspace address.&lt;br /&gt;
&lt;br /&gt;
dev_map_addr is the userspace destination address, while dev_as_addr is the source address between dev_as_start_addr and dev_as_end_addr (passed to [[#svcCreateDeviceAddressSpace]]).&lt;br /&gt;
&lt;br /&gt;
The userspace destination address must have the [[SVC#MemoryState|MapDeviceAllowed]] bit set. Bit [[SVC#MemoryAttribute|IsDeviceMapped]] will be set after mapping.&lt;br /&gt;
&lt;br /&gt;
== svcMapDeviceAddressSpaceAligned ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Device as Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || u64 || &amp;lt;code&amp;gt;Process Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Device Map Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Device as Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X4 || u64 || &amp;lt;code&amp;gt;Device as Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W5 || u64 || &amp;lt;code&amp;gt;Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Maps an attached device address space to an userspace address.&lt;br /&gt;
&lt;br /&gt;
Same as [[#svcMapDeviceAddressSpaceByForce]], but the userspace destination address must have the [[SVC#MemoryState|MapDeviceAlignedAllowed]] bit set instead.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapDeviceAddressSpace ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Device as Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || u64 || &amp;lt;code&amp;gt;Process Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Device Map Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Device as Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X4 || u64 || &amp;lt;code&amp;gt;Device as Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Unmaps an attached device address space from an userspace address.&lt;br /&gt;
&lt;br /&gt;
== svcMapProcessMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Src Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || u64 || &amp;lt;code&amp;gt;Process Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Dest Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Maps the src address from the supplied process handle into the current process.&lt;br /&gt;
&lt;br /&gt;
This allows mapping code and rodata with RW- permission.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapProcessMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Process Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Dest Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Src Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unmaps what was mapped by [[#svcMapProcessMemory]].&lt;br /&gt;
&lt;br /&gt;
== svcQueryProcessMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Meminfo Pointer&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;Process Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || PageInfo || &amp;lt;code&amp;gt;Page Info&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equivalent to [[#svcQueryMemory]] except takes a process handle.&lt;br /&gt;
&lt;br /&gt;
== svcMapProcessCodeMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Process Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Dest Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Src Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Takes a process handle, and maps normal heap in that process as executable code in that process. Used when loading NROs.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapProcessCodeMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Process Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Dest Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Src Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unmaps what was mapped by [[#svcMapProcessCodeMemory]].&lt;br /&gt;
&lt;br /&gt;
== svcCreateProcess ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;ProcInfo Pointer&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Capabilities Pointer&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Capibility Num&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Process Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Takes a [[#CreateProcessInfo]] as input.&lt;br /&gt;
&lt;br /&gt;
== svcGetProcessInfo ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Process Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || [[#ProcessState|| &amp;lt;code&amp;gt;Process State&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns an enum with value 0-7.&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
[2.0.0+] Exactly 6 debug SVCs require that [[SPL_services#GetConfig|IsDebugMode]] is non-zero. Error 0x4201 is returned otherwise.&lt;br /&gt;
* svcBreakDebugProcess&lt;br /&gt;
* svcContinueDebugEvent&lt;br /&gt;
* svcWriteDebugProcessMemory&lt;br /&gt;
* svcSetDebugThreadContext&lt;br /&gt;
* svcTerminateDebugProcess&lt;br /&gt;
* svcSetHardwareBreakPoint&lt;br /&gt;
&lt;br /&gt;
svcDebugActiveProcess stops execution of the target process, the normal method for resuming it requires svcContinueDebugEvent(see above). Closing the debug handle also results in execution being resumed.&lt;br /&gt;
&lt;br /&gt;
= Structures =&lt;br /&gt;
== DeviceName ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || DeviceName_AFI&lt;br /&gt;
|-&lt;br /&gt;
| 1 || DeviceName_AVPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DeviceName_DC&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DeviceName_DCB&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeviceName_HC&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeviceName_HDA&lt;br /&gt;
|-&lt;br /&gt;
| 6 || DeviceName_ISP2&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeviceName_MSENCNVENC&lt;br /&gt;
|-&lt;br /&gt;
| 8 || DeviceName_NV&lt;br /&gt;
|-&lt;br /&gt;
| 9 || DeviceName_NV2&lt;br /&gt;
|-&lt;br /&gt;
| 10 || DeviceName_PPCS&lt;br /&gt;
|-&lt;br /&gt;
| 11 || DeviceName_SATA&lt;br /&gt;
|-&lt;br /&gt;
| 12 || DeviceName_VI&lt;br /&gt;
|-&lt;br /&gt;
| 13 || DeviceName_VIC&lt;br /&gt;
|-&lt;br /&gt;
| 14 || DeviceName_XUSB_HOST&lt;br /&gt;
|-&lt;br /&gt;
| 15 || DeviceName_XUSB_DEV&lt;br /&gt;
|-&lt;br /&gt;
| 16 || DeviceName_TSEC&lt;br /&gt;
|-&lt;br /&gt;
| 17 || DeviceName_PPCS1&lt;br /&gt;
|-&lt;br /&gt;
| 18 || DeviceName_DC1&lt;br /&gt;
|-&lt;br /&gt;
| 19 || DeviceName_SDMMC1A&lt;br /&gt;
|-&lt;br /&gt;
| 20 || DeviceName_SDMMC2A&lt;br /&gt;
|-&lt;br /&gt;
| 21 || DeviceName_SDMMC3A&lt;br /&gt;
|-&lt;br /&gt;
| 22 || DeviceName_SDMMC4A&lt;br /&gt;
|-&lt;br /&gt;
| 23 || DeviceName_ISP2B&lt;br /&gt;
|-&lt;br /&gt;
| 24 || DeviceName_GPU&lt;br /&gt;
|-&lt;br /&gt;
| 25 || DeviceName_GPUB&lt;br /&gt;
|-&lt;br /&gt;
| 26 || DeviceName_PPCS2&lt;br /&gt;
|-&lt;br /&gt;
| 27 || DeviceName_NVDEC&lt;br /&gt;
|-&lt;br /&gt;
| 28 || DeviceName_APE&lt;br /&gt;
|-&lt;br /&gt;
| 29 || DeviceName_SE&lt;br /&gt;
|-&lt;br /&gt;
| 30 || DeviceName_NVJPG&lt;br /&gt;
|-&lt;br /&gt;
| 31 || DeviceName_HC1&lt;br /&gt;
|-&lt;br /&gt;
| 32 || DeviceName_SE1&lt;br /&gt;
|-&lt;br /&gt;
| 33 || DeviceName_AXIAP&lt;br /&gt;
|-&lt;br /&gt;
| 34 || DeviceName_ETR&lt;br /&gt;
|-&lt;br /&gt;
| 35 || DeviceName_TSECB&lt;br /&gt;
|-&lt;br /&gt;
| 36 || DeviceName_TSEC1&lt;br /&gt;
|-&lt;br /&gt;
| 37 || DeviceName_TSECB1&lt;br /&gt;
|-&lt;br /&gt;
| 38 || DeviceName_NVDEC1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LimitableResource ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || LimitableResource_Memory&lt;br /&gt;
|-&lt;br /&gt;
| 1 || LimitableResource_Threads&lt;br /&gt;
|-&lt;br /&gt;
| 2 || LimitableResource_Events&lt;br /&gt;
|-&lt;br /&gt;
| 3 || LimitableResource_TransferMemories&lt;br /&gt;
|-&lt;br /&gt;
| 4 || LimitableResource_Sessions&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateProcessInfo ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 12 || || ProcessName (doesn&#039;t have to be null-terminated)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 4 || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 8 || || TitleId&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 8 || || CodeAddr&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 4 || || CodeNumPages&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 4 || || MmuFlags&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit0 || Is64bit&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit3-1 || [[#AddressSpaceType]]&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit4 ||&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit5 || EnableAslr&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit6 || IsSystem&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 4 || || ResourceLimitHandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 4 ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== AddressSpaceType ===&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Type || Name || Width || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Normal_32Bit || 32 ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Normal_36Bit || 36 ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || WithoutMap_32Bit || 32 || Appears to be missing map region [?]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [2.0.0+] Normal_39Bit || 39 ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryInfo ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 8 || BaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 8 || Size&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 4 || MemoryType: lower 8 bits of [[#MemoryState]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || 4 || [[#MemoryAttribute]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 4 || Permission (bit0: R, bit1: W, bit2: X)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || 4 || DeviceRefCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 4 || IpcRefCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 4 || Padding: always zero&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryAttribute ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IsBorrowed&lt;br /&gt;
|-&lt;br /&gt;
| 1 || IsIpcMapped: when IpcRefCount &amp;gt; 0.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || IsDeviceMapped: when DeviceRefCount &amp;gt; 0.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || IsUncached&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryState ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 7-0 || Type&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#svcSetMemoryPermission|PermissionChangeAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || IsUserWritable [?]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || IpcSendAllowed_Type0&lt;br /&gt;
|-&lt;br /&gt;
| 11 || IpcSendAllowed_Type3&lt;br /&gt;
|-&lt;br /&gt;
| 12 || IpcSendAllowed_Type1&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#svcSetProcessMemoryPermission|ProcessPermissionChangeAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [[#svcMapMemory|MapAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [[#svcUnmapProcessCodeMemory|UnmapProcessCodeMemoryAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [[#svcCreateTransferMemory|TransferMemoryAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 19 || MapDeviceAllowed ([[#svcMapDeviceAddressSpace]] and [[#svcMapDeviceAddressSpaceByForce]])&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#svcMapDeviceAddressSpaceAligned|MapDeviceAlignedAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#svcSendSyncRequestWithUserBuffer|IpcBufferAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || IsPoolAllocated/IsReferenceCounted&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [[#svcMapProcessMemory|MapProcessAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [[#svcSetMemoryAttribute|AttributeChangeAllowed]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Type || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00000000&amp;lt;/code&amp;gt; || Unmapped ||&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00002001&amp;lt;/code&amp;gt; || IO || Mapped by kernel capability parsing in [[#svcCreateProcess]]. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00042002&amp;lt;/code&amp;gt; || Normal || Mapped by kernel capability parsing in [[#svcCreateProcess]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00DC7E03&amp;lt;/code&amp;gt; || Code static || Mapped during [[#svcCreateProcess]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x01FEBD04&amp;lt;/code&amp;gt; || Code || Transition from 0xDC7E03 performed by [[#svcSetProcessMemoryPermission]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x017EBD05&amp;lt;/code&amp;gt; || Heap || Mapped using [[#svcSetHeapSize]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00402006&amp;lt;/code&amp;gt; || Shared memory block || Mapped using [[#svcMapSharedMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00482907&amp;lt;/code&amp;gt; || [1.0.0] Weird mapped memory || Mapped using [[#svcMapMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00DD7E08&amp;lt;/code&amp;gt; || Module code static || Mapped using [[#svcMapProcessCodeMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x01FFBD09&amp;lt;/code&amp;gt; || Module code mutable || Transition from 0xDD7E08 performed by [[#svcSetProcessMemoryPermission]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C3C0A&amp;lt;/code&amp;gt; || [[IPC_Marshalling|IPC]] buffers || IPC buffers with descriptor flags=0.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C3C0B&amp;lt;/code&amp;gt; || Mapped memory || Mapped using [[#svcMapMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x0040200C&amp;lt;/code&amp;gt; || [[Thread Local Storage|Thread local storage]] || Mapped during [[#svcCreateThread]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x015C3C0D&amp;lt;/code&amp;gt; || Isolated transfer memory || Mapped using [[#svcMapTransferMemory]] when the owning process has perm=0.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C380E&amp;lt;/code&amp;gt; || Transfer memory || Mapped using [[#svcMapTransferMemory]] when the owning process has perm!=0.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x0040380F&amp;lt;/code&amp;gt; || Process memory || Mapped using [[#svcMapProcessMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00000010&amp;lt;/code&amp;gt; || Reserved ||&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C3811&amp;lt;/code&amp;gt; || [[IPC_Marshalling|IPC]] buffers || IPC buffers with descriptor flags=1.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x004C2812&amp;lt;/code&amp;gt; || [[IPC_Marshalling|IPC]] buffers || IPC buffers with descriptor flags=3.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00002013&amp;lt;/code&amp;gt; || Kernel per-thread stack || Mapped in kernel during [[#svcCreateThread]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Exception handling =&lt;br /&gt;
There is userland code for handling exceptions, however this doesn&#039;t seem to be executed on retail mode.&lt;br /&gt;
&lt;br /&gt;
When a usermode exception occurs, it jumps to the main code binary entrypoint (main_binary_address + 0 == &#039;&#039;&#039;_start&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
During normal boot &#039;&#039;&#039;_start&#039;&#039;&#039; is invoked with X0=0 and X1=main_thread_handle (triggering normal crt0 setup).&lt;br /&gt;
During an usermode exception &#039;&#039;&#039;_start&#039;&#039;&#039; is invoked with X0=exception_info0_ptr and X1=exception_info1_ptr instead.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;_start&#039;&#039;&#039; method determines whether to boot normally or handle an exception if X0 is set to 0 or not.&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=SVC&amp;diff=2804</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=SVC&amp;diff=2804"/>
		<updated>2017-10-14T04:58:56Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&lt;br /&gt;
= System calls =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
|  0x1 || [[#svcSetHeapSize]] || W1=size || W0=result, X1=outaddr&lt;br /&gt;
|-&lt;br /&gt;
|  0x2 || [[#svcSetMemoryPermission]] || X0=addr, X1=size, W2=prot || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x3 || [[#svcSetMemoryAttribute]] || X0=addr, X1=size, W2=state0, W3=state1 || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x4 || [[#svcMapMemory]] || X0=dstaddr, X1=srcaddr, X2=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x5 || [[#svcUnmapMemory]] || X0=dstaddr, X1=srcaddr, X2=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x6 || [[#svcQueryMemory]] || X0=MemoryInfo*, X2=addr || W0=result, W1=PageInfo                                                         &lt;br /&gt;
|-&lt;br /&gt;
|  0x7 || [[#svcExitProcess]] || None ||&lt;br /&gt;
|-&lt;br /&gt;
|  0x8 || [[#svcCreateThread]] || X1=entry, X2=arg, X3=stacktop, W4=prio, W5=processor_id  || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
|  0x9 || [[#svcStartThread]] || W0=thread_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0xA || [[#svcExitThread]] || None ||                                                         &lt;br /&gt;
|-&lt;br /&gt;
|  0xB || [[#svcSleepThread]] || X0=nano || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0xC || [[#svcGetThreadPriority]] || W1=thread_handle || W0=result, W1=prio&lt;br /&gt;
|-&lt;br /&gt;
|  0xD || [[#svcSetThreadPriority]] || W0=thread_handle, W1=prio || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0xE || [[#svcGetThreadCoreMask]] || W2=thread_handle || W0=result, W1=out, X2=out&lt;br /&gt;
|-&lt;br /&gt;
|  0xF || [[#svcSetThreadCoreMask]] || W0=thread_handle, W1=in, X2=in2 || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || [[#svcGetCurrentProcessorNumber]] || None || W0/X0=cpuid&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 || svcSignalEvent || W0=wevent_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || svcClearEvent || W0=wevent_or_revent_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || [[#svcMapSharedMemory]] || W0=shmem_handle, X1=addr, X2=size, W3=perm || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || svcUnmapSharedMemory || W0=shmem_handle, X1=addr, X2=size || W0=result                                                 &lt;br /&gt;
|-&lt;br /&gt;
| 0x15 || [[#svcCreateTransferMemory]] || X1=addr, X2=size, W3=perm || W0=result, W1=tmem_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || svcCloseHandle || W0=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 || svcResetSignal || W0=revent_or_process_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || [[#svcWaitSynchronization]] || X1=handles_ptr, W2=num_handles. X3=timeout || W0=result, W1=handle_idx&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 || svcCancelSynchronization || W0=thread_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A || svcArbitrateLock || W0=cur_thread_handle, X1=ptr, W2=req_thread_handle ||                                     &lt;br /&gt;
|-&lt;br /&gt;
| 0x1B || svcArbitrateUnlock || X0=ptr ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || svcWaitProcessWideKeyAtomic || X0=ptr0, X1=ptr, W2=thread_handle, X3=timeout || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D || svcSignalProcessWideKey || X0=ptr, W1=value || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E || svcGetSystemTick || None || X0={value of cntpct_el0}&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F || svcConnectToNamedPort || X1=port_name_str || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || svcSendSyncRequestLight || W0=light_session_handle, X1=? || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || svcSendSyncRequest || X0=normal_session_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 || [[#svcSendSyncRequestWithUserBuffer]] || X0=cmdbufptr, X1=size, X2=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 || svcSendAsyncRequestWithUserBuffer || X1=cmdbufptr, X2=size, X3=handle || W0=result, W1=event_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || svcGetProcessId || W0=thread_or_process_or_debug_handle || W0=result, X1=pid&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 || svcGetThreadId || W0=thread_handle || W0=result, X1=out&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 || svcBreak || X0,X1,X2=info || ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 || svcOutputDebugString || X0=str, X1=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || svcReturnFromException || X0=result || &lt;br /&gt;
|-&lt;br /&gt;
| 0x29 || [[#svcGetInfo]] || X1=info_id, X2=handle, X3=info_sub_id || W0=result, X1=out&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A || svcFlushEntireDataCache || None || None&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B || svcFlushDataCache || X0=addr, X1=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || [3.0.0+] svcMapPhysicalMemory ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D || [3.0.0+] svcUnmapPhysicalMemory||  ||&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x2F || svcGetLastThreadInfo || None || W0=result, W1,W2,W3,W4=unk, W5=truncated_u64, W6=bool&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || svcGetResourceLimitLimitValue || W1=reslimit_handle, W2=[[#LimitableResource]] || W0=result, X1=value&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 || svcGetResourceLimitCurrentValue || W1=reslimit_handle, W2=[[#LimitableResource]] || W0=result, X1=value&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || svcSetThreadActivity || W0=thread_handle, W1=bool || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 || svcGetThreadContext3 || W0=thread_handle, W1=[[#ThreadContext]]* || W0=result&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x3C || svcDumpInfo ||  || &lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x40 || svcCreateSession || W2=is_light, X3=? || W0=result, W1=client_handle, W2=server_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x41 || svcAcceptSession || W1=port_handle || W0=result, W1=session_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x42 || svcReplyAndReceiveLight || W0=light_session_handle || W0=result, W1,W2,W3,W4,W5,W6,W7=out&lt;br /&gt;
|-&lt;br /&gt;
| 0x43 || svcReplyAndReceive || X1=ptr_handles, W2=num_handles, X3=replytarget_handle(0=none), X4=timeout || W0=result, W1=handle_idx&lt;br /&gt;
|-&lt;br /&gt;
| 0x44 || svcReplyAndReceiveWithUserBuffer|| X1=buf, X2=sz, X3=ptr_handles, W4=num_handles, X5=replytarget_handle(0=none), X6=timeout || W0=result, W1=handle_idx&lt;br /&gt;
|-&lt;br /&gt;
| 0x45 || svcCreateEvent || None || W0=result, W1=client_handle ?, W2=server_handle ?&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x4D || svcSleepSystem || None || None&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E || [[#svcReadWriteRegister]] || X1=reg_addr, W2=rw_mask, W3=in_val || W0=result, W1=out_val&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F || svcSetProcessActivity || W0=process_handle, W1=bool || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 || [[#svcCreateSharedMemory]] || W1=size, W2=myperm, W3=otherperm || W0=result, W1=shmem_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 || [[#svcMapTransferMemory]] || X0=tmem_handle, X1=addr, X2=size, W3=perm || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 || [[#svcUnmapTransferMemory]] || W0=tmemhandle, X1=addr, X2=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 || svcCreateInterruptEvent || X1=irq_id, W2=flag || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 || [[#svcQueryPhysicalAddress]] || X1=addr || W0=result, X1=out0, X2=out1, X3=out2&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 || [[#svcQueryIoMapping]] || X1=physaddr, X2=size || W0=result, X1=virtaddr&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 || [[#svcCreateDeviceAddressSpace]] || X1=dev_as_start_addr, X2=dev_as_end_addr || W0=result, W1=dev_as_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 || [[#svcAttachDeviceAddressSpace]] || W0=device, X1=dev_as_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x58 || [[#svcDetachDeviceAddressSpace]] || W0=device, X1=dev_as_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x59 || [[#svcMapDeviceAddressSpaceByForce]] || W0=dev_as_handle, W1=proc_handle, X2=dev_map_addr, X3=dev_as_size, X4=dev_as_addr, W5=perm || W0=result &lt;br /&gt;
|-&lt;br /&gt;
| 0x5A || [[#svcMapDeviceAddressSpaceAligned]] || W0=dev_as_handle, W1=proc_handle, X2=dev_map_addr, X3=dev_as_size, X4=dev_as_addr, W5=perm || W0=result &lt;br /&gt;
|-&lt;br /&gt;
| 0x5B || svcMapDeviceAddressSpace || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x5C || [[#svcUnmapDeviceAddressSpace]] || W0=dev_as_handle, W1=proc_handle, X2=dev_map_addr, X3=dev_as_size, X4=dev_as_addr || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x5D || svcInvalidateProcessDataCache || W0=process_handle, X1=addr, X2=size || W0=size&lt;br /&gt;
|-&lt;br /&gt;
| 0x5E || svcStoreProcessDataCache || W0=process_handle, X1=addr, X2=size || W0=size&lt;br /&gt;
|-&lt;br /&gt;
| 0x5F || svcFlushProcessDataCache || W0=process_handle, X1=addr, X2=size || W0=size&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || svcDebugActiveProcess || X1=pid || W0=result, W1=debug_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 || svcBreakDebugProcess || W0=debug_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 || svcTerminateDebugProcess || W0=debug_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 || svcGetDebugEvent || X0=DebugEventInfo*, W1=debug_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 || svcContinueDebugEvent || W0=debug_handle, W1=flags, X2=? || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 || svcGetProcessList || X1=pids_out_ptr, W2=max_out || W0=result, W1=num_out &lt;br /&gt;
|-&lt;br /&gt;
| 0x66 || svcGetThreadList || X1=tids_out_ptr, W2=max_out, W3=debug_handle_or_zero || W0=result, X1=num_out&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 || svcGetDebugThreadContext || X0=ThreadContext*, X1=debug_handle, X2=?, W3=? || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || svcSetDebugThreadContext || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x69 || svcQueryDebugProcessMemory || X0=[[#MemoryInfo]]*, X2=debug_handle, X3=addr || W0=result, W1=PageInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A || svcReadDebugProcessMemory || X0=buffer*, X1=debug_handle, X2=src_addr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B || svcWriteDebugProcessMemory || X0=debug_handle, X1=buffer*, X2=dst_addr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C || svcSetHardwareBreakPoint || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x6D || svcGetDebugThreadParam || X2=debug_handle, X3=thread_id, W4=DebugThreadParam || W0=result, X1=out0, W2=out1&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x70 || svcCreatePort || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x71 || svcManageNamedPort || X1=name_ptr, W2=max_sessions(?) || W0=result, W1=serverport_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x72 || svcConnectToPort || W1=clientport_handle || W0=result, W1=session_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x73 || svcSetProcessMemoryPermission || X0=addr, X1=size, W2=perm || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x74 || [[#svcMapProcessMemory]] || X0=srcaddr, W1=process_handle, X2=dstaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x75 || [[#svcUnmapProcessMemory]] || W0=process_handle, X1=dstaddr, X2=srcaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x76 || [[#svcQueryProcessMemory]] || X0=meminfo_ptr, W2=process_handle, X3=addr || W0=result, W1=pageinfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x77 || [[#svcMapProcessCodeMemory]] || W0=process_handle, X2=dstaddr, X2=srcaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x78 || [[#svcUnmapProcessCodeMemory]] || W0=process_handle, X1=dstaddr, X2=srcaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x79 || [[#svcCreateProcess]] || X1=procinfo_ptr, X2=caps_ptr, W3=cap_num ||  W0=result, W1=process_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A || svcStartProcess || W0=process_handle, W1=main_thread_prio, W2=default_cpuid, W3=main_thread_stacksz || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x7B || svcTerminateProcess || W0=process_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C || [[#svcGetProcessInfo]] || W0=process_handle || W0=result, X1=[[#ProcessState]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D || svcCreateResourceLimit || None || W0=result, W1=reslimit_handle &lt;br /&gt;
|-&lt;br /&gt;
| 0x7E || svcSetResourceLimitLimitValue || W0=reslimit_handle, W1=[[#LimitableResource]], X2=value || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x7F || svcCallSecureMonitor || || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== svcSetHeapSize ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || u64 || &amp;lt;code&amp;gt;OutAddr&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Set the process heap to a given &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;. It can both extend and shrink the heap.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt; must be a multiple of 0x2000000.&lt;br /&gt;
&lt;br /&gt;
On success, the heap base-address (which is fixed by kernel, aslr&#039;d) is written to &amp;lt;code&amp;gt;OutAddr&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt; must be less than 0x18000000.&lt;br /&gt;
&lt;br /&gt;
== svcSetMemoryPermission ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;Prot&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Change permission of page-aligned memory region.&lt;br /&gt;
&lt;br /&gt;
Bit2 of permission (exec) is not allowed. Setting write-only is not allowed either (bit1).&lt;br /&gt;
&lt;br /&gt;
This can be used to move back and forth between ---, r-- and rw-.&lt;br /&gt;
&lt;br /&gt;
== svcSetMemoryAttribute ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;State0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;State1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Change attribute of page-aligned memory region. &lt;br /&gt;
&lt;br /&gt;
This is used to turn on/off caching for a given memory area. Useful when talking to devices such as the GPU.&lt;br /&gt;
&lt;br /&gt;
What happens &amp;quot;under the hood&amp;quot; is the &amp;quot;Memory Attribute Indirection Register&amp;quot; index is changed from 2 to 3 in the MMU descriptor.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! State0 || State1 || Action&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || Clear bit3 in [[#MemoryAttribute]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 0 || Clear bit3 in [[#MemoryAttribute]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 8 || Set bit3 in [[#MemoryAttribute]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== svcMapMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Dst&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Src&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Maps a memory range into a different range.&lt;br /&gt;
&lt;br /&gt;
Mainly used for adding guard pages around stack.&lt;br /&gt;
&lt;br /&gt;
Source range gets reprotected to --- (it can no longer be accessed), and bit0 is set in the source [[#MemoryAttribute]].&lt;br /&gt;
&lt;br /&gt;
If dstaddr &amp;gt;= LowerTreshold, the dst-range is enforced to be within the process&#039; &amp;quot;MapRegion&amp;quot;. Code can get the range of this region from [[#svcGetInfo]] id0=2,3.&lt;br /&gt;
&lt;br /&gt;
In this case, the mapped memory will have state &amp;lt;code&amp;gt;0x5C3C0B&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As long as (dstaddr+size) &amp;lt; LowerThreshold, then you can map anywhere but the mapped memory will have state &amp;lt;code&amp;gt;0x482907&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
LowerTreshold is 0x80000000 for 36-bit address spaces, and 0x40000000 for 32-bit ones.&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] Support for the &amp;lt;code&amp;gt;0x482907&amp;lt;/code&amp;gt; mappings outside the &amp;quot;MapRegion&amp;quot; were removed.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Dst&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Src&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Unmaps a region that was previously mapped with [[#svcMapMemory]].&lt;br /&gt;
&lt;br /&gt;
It&#039;s possible to unmap ranges partially, you don&#039;t need to unmap the entire range &amp;quot;in one go&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The srcaddr/dstaddr must match what was given when the pages were originally mapped.&lt;br /&gt;
&lt;br /&gt;
== svcQueryMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || MemoryInfo*|| &amp;lt;code&amp;gt;Mem Info&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || PageInfo || &amp;lt;code&amp;gt;Page Info&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Query information about an address. Will always fetch the lowest page-aligned mapping that contains the provided address.&lt;br /&gt;
&lt;br /&gt;
Outputs a [[#MemoryInfo]] struct.&lt;br /&gt;
&lt;br /&gt;
== svcExitProcess ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Exits the current process.&lt;br /&gt;
&lt;br /&gt;
== svcCreateThread ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Entry&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Arg&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Stack Top&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W4 || u64 || &amp;lt;code&amp;gt;Priority&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W5 || u64 || &amp;lt;code&amp;gt;Processor ID&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Create a thread in the current process.&lt;br /&gt;
&lt;br /&gt;
Processor_id must be 0,1,2,3 or -2, where -2 uses the default cpuid for process.&lt;br /&gt;
&lt;br /&gt;
== svcStartThread ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0|| u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) None ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Starts the thread for the provided handle.&lt;br /&gt;
&lt;br /&gt;
== svcExitThread ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Exits the current thread.&lt;br /&gt;
&lt;br /&gt;
== svcSleepThread ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Nano&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Sleep for a specified amount of time, or yield thread.&lt;br /&gt;
&lt;br /&gt;
Setting nano=0 means &amp;quot;yield thread&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== svcGetThreadPriority ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1|| u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Priority&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Get priority of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== svcSetThreadPriority ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0|| u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1|| u64 || &amp;lt;code&amp;gt;Priority&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Set priority of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
Priority is a number 0-0x3F. Lower value means higher priority.&lt;br /&gt;
&lt;br /&gt;
== svcGetThreadCoreMask ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Out&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X2 || u64 || &amp;lt;code&amp;gt;Out&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Get affinity mask of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== svcSetThreadCoreMask ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || u64 || &amp;lt;code&amp;gt;In&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;In&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Set affinity mask of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== svcGetCurrentProcessorNumber ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0/X0 || u64 || &amp;lt;code&amp;gt;CPU ID&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Get which cpu is executing the current thread.&lt;br /&gt;
&lt;br /&gt;
Cpu-id is an integer in the range 0-3.&lt;br /&gt;
&lt;br /&gt;
== svcMapSharedMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Mem Block Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Maps the block supplied by the handle. The required permissions are different for the process that created the handle and all other processes.&lt;br /&gt;
&lt;br /&gt;
Increases reference count for the KSharedMemory object. Thus in order to release the memory associated with the object, all handles to it must be closed and all mappings must be unmapped.&lt;br /&gt;
&lt;br /&gt;
== svcCreateTransferMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one reprotects the src block with perms you give it. It also sets bit0 into [[#MemoryAttribute]].&lt;br /&gt;
&lt;br /&gt;
Executable bit perm not allowed.&lt;br /&gt;
&lt;br /&gt;
Closing all handles automatically causes the bit0 in [[#MemoryAttribute]] to clear, and the permission to reset.&lt;br /&gt;
&lt;br /&gt;
== svcWaitSynchronization ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Handles Pointer&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;Number of Handles&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Timeout&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Handle Index&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Works with num_handles &amp;lt;= 0x40, error on num_handles == 0.&lt;br /&gt;
&lt;br /&gt;
Does not accept 0xFFFF8001 or 0xFFFF8000 as handles.&lt;br /&gt;
&lt;br /&gt;
== svcSendSyncRequestWithUserBuffer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Command Buffer Pointer&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Size must be 0x1000-aligned.&lt;br /&gt;
&lt;br /&gt;
== svcBreak ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 ||&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 ||&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Info&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) ? || ? || &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used on retail where inx0 bit31 is clear, the system will throw a [[Error_codes|fatal-error]]. Otherwise when bit31 is set, it will return 0.&lt;br /&gt;
&lt;br /&gt;
== svcGetInfo ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Info ID&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Info Sub ID&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || u64 || &amp;lt;code&amp;gt;Out&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Handle type || Id0 || Id1 || Description&lt;br /&gt;
|-&lt;br /&gt;
| Process || 0 || 0 || AllowedCpuIdBitmask&lt;br /&gt;
|-&lt;br /&gt;
| Process || 1 || 0 || AllowedThreadPrioBitmask&lt;br /&gt;
|-&lt;br /&gt;
| Process || 2 || 0 || ReservedMapRegionBaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 3 || 0 || ReservedMapRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 4 || 0 || ReservedHeapRegionBaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 5 || 0 || ReservedHeapRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 6 || 0 || TotalMemoryUsage&lt;br /&gt;
|-&lt;br /&gt;
| Process || 7 || 0 || TotalHeapUsage&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 8 || 0 || IsCurrentProcessBeingDebugged&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 9 || 0 || Returns ResourceLimit handle for current process. Used by [[Process_Manager_services|PM]].&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 10 || -1, {current coreid} || Unknown. Output data changes each time this SVC is used. Global and core-specific tick-count?&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 11 || 0-3 || RandomEntropy from current process. TRNG. Used to seed usermode PRNGs.&lt;br /&gt;
|-&lt;br /&gt;
| Process || 12 || 0 || [2.0.0+] AddressSpaceStart&lt;br /&gt;
|-&lt;br /&gt;
| Process || 13 || 0 || [2.0.0+] AddressSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 14 || 0 || [2.0.0+] NewReservedRegionStartAddr&lt;br /&gt;
|-&lt;br /&gt;
| Process || 15 || 0 || [2.0.0+] NewReservedRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 18 || 0 || [3.0.0+] Title-id.&lt;br /&gt;
|-&lt;br /&gt;
| Thread || 0xF0000002 || 0 || Performance counter related.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== svcDumpInfo ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Does nothing, just returns with registers set to all-zero.&lt;br /&gt;
&lt;br /&gt;
== svcReadWriteRegister ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Reg Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;RW Mask&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;In Value&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1|| u64 || &amp;lt;code&amp;gt;Out Value&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Read/write IO registers with a hardcoded whitelist. Input address is physical-address and must be aligned to 4.&lt;br /&gt;
&lt;br /&gt;
rw_mask is 0 for reading and 0xffffffff for writing. You can also write individual bits by using a mask value.&lt;br /&gt;
&lt;br /&gt;
You can only write to registers inside physical pages 0x70019000 (MC), 0x7001C000 (MC0), 0x7001D000 (MC1), and they all share the same whitelist.&lt;br /&gt;
&lt;br /&gt;
The whitelist is same for writing as for reading.&lt;br /&gt;
&lt;br /&gt;
The whitelist is:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
0x054, 0x090, 0x094, 0x098, 0x09c, 0x0a0, 0x0a4, 0x0a8, 0x0ac, 0x0b0, 0x0b4, 0x0b8, 0x0bc, 0x0c0, 0x0c4, 0x0c8, 0x0d0, 0x0d4, 0x0d8, 0x0dc, 0x0e0, 0x100, 0x108, 0x10c, 0x118, 0x11c, 0x124, 0x128, 0x12c, 0x130, 0x134, 0x138, 0x13c, 0x158, 0x15c, 0x164, 0x168, 0x16c, 0x170, 0x174, 0x178, 0x17c, 0x200, 0x204, 0x2e4, 0x2e8, 0x2ec, 0x2f4, 0x2f8, 0x310, 0x314, 0x320, 0x328, 0x344, 0x348, 0x370, 0x374, 0x37c, 0x380, 0x390, 0x394, 0x398, 0x3ac, 0x3b8, 0x3bc, 0x3c0, 0x3c4, 0x3d8, 0x3e8, 0x41c, 0x420, 0x424, 0x428, 0x42c, 0x430, 0x44c, 0x47c, 0x480, 0x484, 0x50c, 0x554, 0x558, 0x55c, 0x670, 0x674, 0x690, 0x694, 0x698, 0x69c, 0x6a0, 0x6a4, 0x6c0, 0x6c4, 0x6f0, 0x6f4, 0x960, 0x970, 0x974, 0xa20, 0xa24, 0xb88, 0xb8c, 0xbc4, 0xbc8, 0xbcc, 0xbd0, 0xbd4, 0xbd8, 0xbdc, 0xbe0, 0xbe4, 0xbe8, 0xbec, 0xc00, 0xc5c, 0xcac&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] Whitelist was extended with &amp;lt;code&amp;gt;0x4c4, 0x4c8, 0x4cc, 0x584, 0x588, 0x58c.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] The IO registers in range 0x7000E400 (PMC) size 0xC00 skip the whitelist, and do a TrustZone call using [[SMC]] Id1 0xC3000008(ReadWriteRegister).&lt;br /&gt;
&lt;br /&gt;
== svcCreateSharedMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;My Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;Other Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1|| u64 || &amp;lt;code&amp;gt;Shared Memory Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other perm can be used to enforce permission 1, 3, or 0x10000000 if don&#039;t care.&lt;br /&gt;
&lt;br /&gt;
== svcMapTransferMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Transfer Mem Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The newly mapped pages will have [[#MemoryState]] type 0xE.&lt;br /&gt;
&lt;br /&gt;
You must pass same size and permissions as given in svcCreateMemoryMirror, otherwise error.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapTransferMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Transfer Mem Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Size must match size given in map syscall, otherwise there&#039;s an invalid-size error.&lt;br /&gt;
&lt;br /&gt;
== svcQueryPhysicalAddress ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]]|| &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || u64 || &amp;lt;code&amp;gt;Out0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X2 || u64 || &amp;lt;code&amp;gt;Out1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X3 || u64 || &amp;lt;code&amp;gt;Out2&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The inverse operation of [[#svcQueryIoMapping]].&lt;br /&gt;
&lt;br /&gt;
== svcQueryIoMapping ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Physical Address&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || u64 || &amp;lt;code&amp;gt;Virtual Address&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Returns a virtual address mapped to a given IO range.&lt;br /&gt;
&lt;br /&gt;
== svcCreateDeviceAddressSpace ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Device as Start Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Device as End Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Device as Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Creates a virtual address space for binding device address spaces and returns a handle.&lt;br /&gt;
&lt;br /&gt;
dev_as_start_addr is normally set to 0 and dev_as_end_addr is normally set to 0xFFFFFFFF.&lt;br /&gt;
&lt;br /&gt;
== svcAttachDeviceAddressSpace ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Device&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Device as Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Attaches a device address space to a [[#DeviceName|device]].&lt;br /&gt;
&lt;br /&gt;
== svcDetachDeviceAddressSpace ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Device&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Device as Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Detaches a device address space from a [[#DeviceName|device]].&lt;br /&gt;
&lt;br /&gt;
== svcMapDeviceAddressSpaceByForce ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Maps an attached device address space to an userspace address.&lt;br /&gt;
&lt;br /&gt;
dev_map_addr is the userspace destination address, while dev_as_addr is the source address between dev_as_start_addr and dev_as_end_addr (passed to [[#svcCreateDeviceAddressSpace]]).&lt;br /&gt;
&lt;br /&gt;
The userspace destination address must have the [[SVC#MemoryState|MapDeviceAllowed]] bit set. Bit [[SVC#MemoryAttribute|IsDeviceMapped]] will be set after mapping.&lt;br /&gt;
&lt;br /&gt;
== svcMapDeviceAddressSpaceAligned ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Maps an attached device address space to an userspace address.&lt;br /&gt;
&lt;br /&gt;
Same as [[#svcMapDeviceAddressSpaceByForce]], but the userspace destination address must have the [[SVC#MemoryState|MapDeviceAlignedAllowed]] bit set instead.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapDeviceAddressSpace ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Unmaps an attached device address space from an userspace address.&lt;br /&gt;
&lt;br /&gt;
== svcMapProcessMemory ==&lt;br /&gt;
Maps the src address from the supplied process handle into the current process.&lt;br /&gt;
&lt;br /&gt;
This allows mapping code and rodata with RW- permission.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapProcessMemory ==&lt;br /&gt;
Unmaps what was mapped by [[#svcMapProcessMemory]].&lt;br /&gt;
&lt;br /&gt;
== svcQueryProcessMemory ==&lt;br /&gt;
Equivalent to [[#svcQueryMemory]] except takes a process handle.&lt;br /&gt;
&lt;br /&gt;
== svcMapProcessCodeMemory ==&lt;br /&gt;
Takes a process handle, and maps normal heap in that process as executable code in that process. Used when loading NROs.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapProcessCodeMemory ==&lt;br /&gt;
Unmaps what was mapped by [[#svcMapProcessCodeMemory]].&lt;br /&gt;
&lt;br /&gt;
== svcCreateProcess ==&lt;br /&gt;
Takes a [[#CreateProcessInfo]] as input.&lt;br /&gt;
&lt;br /&gt;
== svcGetProcessInfo ==&lt;br /&gt;
Returns an enum with value 0-7.&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
[2.0.0+] Exactly 6 debug SVCs require that [[SPL_services#GetConfig|IsDebugMode]] is non-zero. Error 0x4201 is returned otherwise.&lt;br /&gt;
* svcBreakDebugProcess&lt;br /&gt;
* svcContinueDebugEvent&lt;br /&gt;
* svcWriteDebugProcessMemory&lt;br /&gt;
* svcSetDebugThreadContext&lt;br /&gt;
* svcTerminateDebugProcess&lt;br /&gt;
* svcSetHardwareBreakPoint&lt;br /&gt;
&lt;br /&gt;
svcDebugActiveProcess stops execution of the target process, the normal method for resuming it requires svcContinueDebugEvent(see above). Closing the debug handle also results in execution being resumed.&lt;br /&gt;
&lt;br /&gt;
= Structures =&lt;br /&gt;
== DeviceName ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || DeviceName_AFI&lt;br /&gt;
|-&lt;br /&gt;
| 1 || DeviceName_AVPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DeviceName_DC&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DeviceName_DCB&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeviceName_HC&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeviceName_HDA&lt;br /&gt;
|-&lt;br /&gt;
| 6 || DeviceName_ISP2&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeviceName_MSENCNVENC&lt;br /&gt;
|-&lt;br /&gt;
| 8 || DeviceName_NV&lt;br /&gt;
|-&lt;br /&gt;
| 9 || DeviceName_NV2&lt;br /&gt;
|-&lt;br /&gt;
| 10 || DeviceName_PPCS&lt;br /&gt;
|-&lt;br /&gt;
| 11 || DeviceName_SATA&lt;br /&gt;
|-&lt;br /&gt;
| 12 || DeviceName_VI&lt;br /&gt;
|-&lt;br /&gt;
| 13 || DeviceName_VIC&lt;br /&gt;
|-&lt;br /&gt;
| 14 || DeviceName_XUSB_HOST&lt;br /&gt;
|-&lt;br /&gt;
| 15 || DeviceName_XUSB_DEV&lt;br /&gt;
|-&lt;br /&gt;
| 16 || DeviceName_TSEC&lt;br /&gt;
|-&lt;br /&gt;
| 17 || DeviceName_PPCS1&lt;br /&gt;
|-&lt;br /&gt;
| 18 || DeviceName_DC1&lt;br /&gt;
|-&lt;br /&gt;
| 19 || DeviceName_SDMMC1A&lt;br /&gt;
|-&lt;br /&gt;
| 20 || DeviceName_SDMMC2A&lt;br /&gt;
|-&lt;br /&gt;
| 21 || DeviceName_SDMMC3A&lt;br /&gt;
|-&lt;br /&gt;
| 22 || DeviceName_SDMMC4A&lt;br /&gt;
|-&lt;br /&gt;
| 23 || DeviceName_ISP2B&lt;br /&gt;
|-&lt;br /&gt;
| 24 || DeviceName_GPU&lt;br /&gt;
|-&lt;br /&gt;
| 25 || DeviceName_GPUB&lt;br /&gt;
|-&lt;br /&gt;
| 26 || DeviceName_PPCS2&lt;br /&gt;
|-&lt;br /&gt;
| 27 || DeviceName_NVDEC&lt;br /&gt;
|-&lt;br /&gt;
| 28 || DeviceName_APE&lt;br /&gt;
|-&lt;br /&gt;
| 29 || DeviceName_SE&lt;br /&gt;
|-&lt;br /&gt;
| 30 || DeviceName_NVJPG&lt;br /&gt;
|-&lt;br /&gt;
| 31 || DeviceName_HC1&lt;br /&gt;
|-&lt;br /&gt;
| 32 || DeviceName_SE1&lt;br /&gt;
|-&lt;br /&gt;
| 33 || DeviceName_AXIAP&lt;br /&gt;
|-&lt;br /&gt;
| 34 || DeviceName_ETR&lt;br /&gt;
|-&lt;br /&gt;
| 35 || DeviceName_TSECB&lt;br /&gt;
|-&lt;br /&gt;
| 36 || DeviceName_TSEC1&lt;br /&gt;
|-&lt;br /&gt;
| 37 || DeviceName_TSECB1&lt;br /&gt;
|-&lt;br /&gt;
| 38 || DeviceName_NVDEC1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LimitableResource ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || LimitableResource_Memory&lt;br /&gt;
|-&lt;br /&gt;
| 1 || LimitableResource_Threads&lt;br /&gt;
|-&lt;br /&gt;
| 2 || LimitableResource_Events&lt;br /&gt;
|-&lt;br /&gt;
| 3 || LimitableResource_TransferMemories&lt;br /&gt;
|-&lt;br /&gt;
| 4 || LimitableResource_Sessions&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateProcessInfo ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 12 || || ProcessName (doesn&#039;t have to be null-terminated)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 4 || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 8 || || TitleId&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 8 || || CodeAddr&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 4 || || CodeNumPages&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 4 || || MmuFlags&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit0 || Is64bit&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit3-1 || [[#AddressSpaceType]]&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit4 ||&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit5 || EnableAslr&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit6 || IsSystem&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 4 || || ResourceLimitHandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 4 ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== AddressSpaceType ===&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Type || Name || Width || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Normal_32Bit || 32 ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Normal_36Bit || 36 ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || WithoutMap_32Bit || 32 || Appears to be missing map region [?]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [2.0.0+] Normal_39Bit || 39 ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryInfo ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 8 || BaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 8 || Size&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 4 || MemoryType: lower 8 bits of [[#MemoryState]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || 4 || [[#MemoryAttribute]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 4 || Permission (bit0: R, bit1: W, bit2: X)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || 4 || DeviceRefCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 4 || IpcRefCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 4 || Padding: always zero&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryAttribute ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IsBorrowed&lt;br /&gt;
|-&lt;br /&gt;
| 1 || IsIpcMapped: when IpcRefCount &amp;gt; 0.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || IsDeviceMapped: when DeviceRefCount &amp;gt; 0.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || IsUncached&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryState ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 7-0 || Type&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#svcSetMemoryPermission|PermissionChangeAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || IsUserWritable [?]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || IpcSendAllowed_Type0&lt;br /&gt;
|-&lt;br /&gt;
| 11 || IpcSendAllowed_Type3&lt;br /&gt;
|-&lt;br /&gt;
| 12 || IpcSendAllowed_Type1&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#svcSetProcessMemoryPermission|ProcessPermissionChangeAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [[#svcMapMemory|MapAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [[#svcUnmapProcessCodeMemory|UnmapProcessCodeMemoryAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [[#svcCreateTransferMemory|TransferMemoryAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 19 || MapDeviceAllowed ([[#svcMapDeviceAddressSpace]] and [[#svcMapDeviceAddressSpaceByForce]])&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#svcMapDeviceAddressSpaceAligned|MapDeviceAlignedAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#svcSendSyncRequestWithUserBuffer|IpcBufferAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || IsPoolAllocated/IsReferenceCounted&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [[#svcMapProcessMemory|MapProcessAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [[#svcSetMemoryAttribute|AttributeChangeAllowed]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Type || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00000000&amp;lt;/code&amp;gt; || Unmapped ||&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00002001&amp;lt;/code&amp;gt; || IO || Mapped by kernel capability parsing in [[#svcCreateProcess]]. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00042002&amp;lt;/code&amp;gt; || Normal || Mapped by kernel capability parsing in [[#svcCreateProcess]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00DC7E03&amp;lt;/code&amp;gt; || Code static || Mapped during [[#svcCreateProcess]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x01FEBD04&amp;lt;/code&amp;gt; || Code || Transition from 0xDC7E03 performed by [[#svcSetProcessMemoryPermission]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x017EBD05&amp;lt;/code&amp;gt; || Heap || Mapped using [[#svcSetHeapSize]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00402006&amp;lt;/code&amp;gt; || Shared memory block || Mapped using [[#svcMapSharedMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00482907&amp;lt;/code&amp;gt; || [1.0.0] Weird mapped memory || Mapped using [[#svcMapMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00DD7E08&amp;lt;/code&amp;gt; || Module code static || Mapped using [[#svcMapProcessCodeMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x01FFBD09&amp;lt;/code&amp;gt; || Module code mutable || Transition from 0xDD7E08 performed by [[#svcSetProcessMemoryPermission]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C3C0A&amp;lt;/code&amp;gt; || [[IPC_Marshalling|IPC]] buffers || IPC buffers with descriptor flags=0.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C3C0B&amp;lt;/code&amp;gt; || Mapped memory || Mapped using [[#svcMapMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x0040200C&amp;lt;/code&amp;gt; || [[Thread Local Storage|Thread local storage]] || Mapped during [[#svcCreateThread]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x015C3C0D&amp;lt;/code&amp;gt; || Isolated transfer memory || Mapped using [[#svcMapTransferMemory]] when the owning process has perm=0.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C380E&amp;lt;/code&amp;gt; || Transfer memory || Mapped using [[#svcMapTransferMemory]] when the owning process has perm!=0.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x0040380F&amp;lt;/code&amp;gt; || Process memory || Mapped using [[#svcMapProcessMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00000010&amp;lt;/code&amp;gt; || Reserved ||&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C3811&amp;lt;/code&amp;gt; || [[IPC_Marshalling|IPC]] buffers || IPC buffers with descriptor flags=1.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x004C2812&amp;lt;/code&amp;gt; || [[IPC_Marshalling|IPC]] buffers || IPC buffers with descriptor flags=3.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00002013&amp;lt;/code&amp;gt; || Kernel per-thread stack || Mapped in kernel during [[#svcCreateThread]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Exception handling =&lt;br /&gt;
There is userland code for handling exceptions, however this doesn&#039;t seem to be executed on retail mode.&lt;br /&gt;
&lt;br /&gt;
When a usermode exception occurs, it jumps to the main code binary entrypoint (main_binary_address + 0 == &#039;&#039;&#039;_start&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
During normal boot &#039;&#039;&#039;_start&#039;&#039;&#039; is invoked with X0=0 and X1=main_thread_handle (triggering normal crt0 setup).&lt;br /&gt;
During an usermode exception &#039;&#039;&#039;_start&#039;&#039;&#039; is invoked with X0=exception_info0_ptr and X1=exception_info1_ptr instead.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;_start&#039;&#039;&#039; method determines whether to boot normally or handle an exception if X0 is set to 0 or not.&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=SVC&amp;diff=2796</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=SVC&amp;diff=2796"/>
		<updated>2017-10-13T22:43:51Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&lt;br /&gt;
= System calls =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
|  0x1 || [[#svcSetHeapSize]] || W1=size || W0=result, X1=outaddr&lt;br /&gt;
|-&lt;br /&gt;
|  0x2 || [[#svcSetMemoryPermission]] || X0=addr, X1=size, W2=prot || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x3 || [[#svcSetMemoryAttribute]] || X0=addr, X1=size, W2=state0, W3=state1 || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x4 || [[#svcMapMemory]] || X0=dstaddr, X1=srcaddr, X2=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x5 || [[#svcUnmapMemory]] || X0=dstaddr, X1=srcaddr, X2=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x6 || [[#svcQueryMemory]] || X0=MemoryInfo*, X2=addr || W0=result, W1=PageInfo                                                         &lt;br /&gt;
|-&lt;br /&gt;
|  0x7 || [[#svcExitProcess]] || None ||&lt;br /&gt;
|-&lt;br /&gt;
|  0x8 || [[#svcCreateThread]] || X1=entry, X2=arg, X3=stacktop, W4=prio, W5=processor_id  || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
|  0x9 || [[#svcStartThread]] || W0=thread_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0xA || [[#svcExitThread]] || None ||                                                         &lt;br /&gt;
|-&lt;br /&gt;
|  0xB || [[#svcSleepThread]] || X0=nano || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0xC || [[#svcGetThreadPriority]] || W1=thread_handle || W0=result, W1=prio&lt;br /&gt;
|-&lt;br /&gt;
|  0xD || [[#svcSetThreadPriority]] || W0=thread_handle, W1=prio || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0xE || [[#svcGetThreadCoreMask]] || W2=thread_handle || W0=result, W1=out, X2=out&lt;br /&gt;
|-&lt;br /&gt;
|  0xF || [[#svcSetThreadCoreMask]] || W0=thread_handle, W1=in, X2=in2 || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || [[#svcGetCurrentProcessorNumber]] || None || W0/X0=cpuid&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 || svcSignalEvent || W0=wevent_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || svcClearEvent || W0=wevent_or_revent_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || [[#svcMapSharedMemory]] || W0=memblk_handle, X1=addr, X2=size, W3=perm || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || svcUnmapSharedMemory || W0=memblk_handle, X1=addr, X2=size || W0=result                                                 &lt;br /&gt;
|-&lt;br /&gt;
| 0x15 || [[#svcCreateTransferMemory]] || X1=addr, X2=size, W3=perm || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || svcCloseHandle || W0=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 || svcResetSignal || W0=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || [[#svcWaitSynchronization]] || X1=handles_ptr, W2=num_handles. X3=timeout || W0=result, W1=handle_idx&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 || svcCancelSynchronization || W0=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A || svcArbitrateLock || W0=cur_thread_handle, X1=ptr, W2=req_thread_handle ||                                     &lt;br /&gt;
|-&lt;br /&gt;
| 0x1B || svcArbitrateUnlock || X0=ptr ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || svcWaitProcessWideKeyAtomic || X0=ptr0, X1=ptr, W2=thread_handle, X3=timeout || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D || svcSignalProcessWideKey || X0=ptr, W1=value || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E || svcGetSystemTick ||  || X0={value of cntpct_el0}&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F || svcConnectToNamedPort || X1=port_name_str || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || svcSendSyncRequestLight ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || svcSendSyncRequest || X0=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 || [[#svcSendSyncRequestWithUserBuffer]] || X0=cmdbufptr, X1=size, X2=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 || svcSendAsyncRequestWithUserBuffer ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || svcGetProcessId ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x25 || svcGetThreadId || W0=thread_handle || W0=result, X1=out&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 || svcBreak || X0,X1,X2=info || ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 || svcOutputDebugString || X0=str, X1=size || &lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || svcReturnFromException || X0=result || &lt;br /&gt;
|-&lt;br /&gt;
| 0x29 || [[#svcGetInfo]] || X1=info_id, X2=handle, X3=info_sub_id || W0=result, X1=out&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A || svcFlushEntireDataCache ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x2B || svcFlushDataCache ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || [3.0.0+] svcMapPhysicalMemory ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D || [3.0.0+] svcUnmapPhysicalMemory||  ||&lt;br /&gt;
|-&lt;br /&gt;
| .... || ? || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F || svcGetLastThreadInfo ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || svcGetResourceLimitLimitValue ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x31 || svcGetResourceLimitCurrentValue ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || svcSetThreadActivity ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x33 || svcGetThreadContext3 ||  || &lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x3C || svcDumpInfo ||  || &lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x40 || svcCreateSession || W2=?, X3=? || W0=result, W1=client_handle, W2=server_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x41 || svcAcceptSession || W1=port_handle || W0=result, W1=session_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x42 || svcReplyAndReceiveLight ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x43 || svcReplyAndReceive || X1=ptr_handles, W2=num_handles, X3=replytarget_handle(0=none), X4=timeout || W0=result, W1=handle_idx&lt;br /&gt;
|-&lt;br /&gt;
| 0x44 || svcReplyAndReceiveWithUserBuffer|| X1=buf, X2=sz, X3=ptr_handles, W4=num_handles, X5=replytarget_handle(0=none), X6=timeout || W0=result, W1=handle_idx&lt;br /&gt;
|-&lt;br /&gt;
| 0x45 || svcCreateEvent || None || W0=result, W1=client_handle ?, W2=server_handle ?&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x4D || svcSleepSystem ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x4E || [[#svcReadWriteRegister]] || X1=reg_addr, W2=rw_mask, W3=in_val || W0=result, W1=out_val&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F || svcSetProcessActivity || W0=process_handle, W1=bool || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 || [[#svcCreateSharedMemory]] || W1=size?, W2=myperm, W3=otherperm || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 || [[#svcMapTransferMemory]] || X0=mirror_handle, X1=addr, X2=size, W3=perm || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 || [[#svcUnmapTransferMemory]] || W0=mirror_handle, X1=addr, X2=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 || svcCreateInterruptEvent || X1=irq_id, W2=flag || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 || [[#svcQueryPhysicalAddress]] || X1=addr || W0=result, X1=out0, X2=out1, X3=out2&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 || [[#svcQueryIoMapping]] || X1=physaddr, X2=size || W0=result, X1=virtaddr&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 || [[#svcCreateDeviceAddressSpace]] || X1=dev_as_start_addr, X2=dev_as_end_addr || W0=result, W1=dev_as_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 || [[#svcAttachDeviceAddressSpace]] || W0=device, X1=dev_as_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x58 || [[#svcDetachDeviceAddressSpace]] || W0=device, X1=dev_as_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x59 || [[#svcMapDeviceAddressSpaceByForce]] || W0=dev_as_handle, W1=proc_handle, X2=dev_map_addr, X3=dev_as_size, X4=dev_as_addr, W5=perm || W0=result &lt;br /&gt;
|-&lt;br /&gt;
| 0x5A || [[#svcMapDeviceAddressSpaceAligned]] || W0=dev_as_handle, W1=proc_handle, X2=dev_map_addr, X3=dev_as_size, X4=dev_as_addr, W5=perm || W0=result &lt;br /&gt;
|-&lt;br /&gt;
| 0x5B || svcMapDeviceAddressSpace || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x5C || [[#svcUnmapDeviceAddressSpace]] || W0=dev_as_handle, W1=proc_handle, X2=dev_map_addr, X3=dev_as_size, X4=dev_as_addr || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x5D || svcInvalidateProcessDataCache || W0=process_handle, X1=addr, X2=size || W0=size&lt;br /&gt;
|-&lt;br /&gt;
| 0x5E || svcStoreProcessDataCache || W0=process_handle, X1=addr, X2=size || W0=size&lt;br /&gt;
|-&lt;br /&gt;
| 0x5F || svcFlushProcessDataCache || W0=process_handle, X1=addr, X2=size || W0=size&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || svcDebugActiveProcess || X1=pid || W0=result, W1=debug_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 || svcBreakDebugProcess || W0=debug_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 || svcTerminateDebugProcess || W0=debug_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 || svcGetDebugEvent || X0=DebugEventInfo*, W1=debug_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 || svcContinueDebugEvent || W0=debug_handle, W1=flags, X2=? || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 || svcGetProcessList || X1=pids_out_ptr, W2=max_out || W0=result, W1=num_out &lt;br /&gt;
|-&lt;br /&gt;
| 0x66 || svcGetThreadList || X1=tids_out_ptr, W2=max_out, W3=debug_handle_or_zero || W0=result, X1=num_out&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 || svcGetDebugThreadContext || X0=ThreadContext*, X1=debug_handle, X2=?, W3=? || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || svcSetDebugThreadContext || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x69 || svcQueryDebugProcessMemory || X0=[[#MemoryInfo]]*, X2=debug_handle, X3=addr || W0=result, W1=PageInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A || svcReadDebugProcessMemory || X0=buffer*, X1=debug_handle, X2=src_addr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B || svcWriteDebugProcessMemory || X0=debug_handle, X1=buffer*, X2=dst_addr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C || svcSetHardwareBreakPoint || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x6D || svcGetDebugThreadParam || X2=debug_handle, X3=thread_id, W4=DebugThreadParam || W0=result, X1=out0, W2=out1&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x70 || svcCreatePort || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x71 || svcManageNamedPort || X1=name_ptr, W2=max_sessions(?) || W0=result, W1=serverport_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x72 || svcConnectToPort || W1=clientport_handle || W0=result, W1=session_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x73 || svcSetProcessMemoryPermission || X0=addr, X1=size, W2=perm || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x74 || [[#svcMapProcessMemory]] || X0=srcaddr, W1=process_handle, X2=dstaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x75 || [[#svcUnmapProcessMemory]] || W0=process_handle, X1=dstaddr, X2=srcaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x76 || [[#svcQueryProcessMemory]] || X0=meminfo_ptr, W2=process_handle, X3=addr || W0=result, W1=pageinfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x77 || [[#svcMapProcessCodeMemory]] || W0=process_handle, X2=dstaddr, X2=srcaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x78 || [[#svcUnmapProcessCodeMemory]] || W0=process_handle, X1=dstaddr, X2=srcaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x79 || [[#svcCreateProcess]] || X1=procinfo_ptr, X2=caps_ptr, W3=cap_num ||  W0=result, W1=process_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A || svcStartProcess || W0=process_handle, W1=main_thread_prio, W2=default_cpuid, W3=main_thread_stacksz || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x7B || svcTerminateProcess || W0=process_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C || [[#svcGetProcessInfo]] || W0=process_handle || W0=result, X1=[[#ProcessState]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D || svcCreateResourceLimit || None || W0=result, W1=reslimit_handle &lt;br /&gt;
|-&lt;br /&gt;
| 0x7E || svcSetResourceLimitLimitValue || W0=reslimit_handle, W1=[[#LimitableResource]], X2=value || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x7F || svcCallSecureMonitor || || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== svcSetHeapSize ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || u64 || &amp;lt;code&amp;gt;OutAddr&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Set the process heap to a given &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;. It can both extend and shrink the heap.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt; must be a multiple of 0x2000000.&lt;br /&gt;
&lt;br /&gt;
On success, the heap base-address (which is fixed by kernel, aslr&#039;d) is written to &amp;lt;code&amp;gt;OutAddr&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt; must be less than 0x18000000.&lt;br /&gt;
&lt;br /&gt;
== svcSetMemoryPermission ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;Prot&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Change permission of page-aligned memory region.&lt;br /&gt;
&lt;br /&gt;
Bit2 of permission (exec) is not allowed. Setting write-only is not allowed either (bit1).&lt;br /&gt;
&lt;br /&gt;
This can be used to move back and forth between ---, r-- and rw-.&lt;br /&gt;
&lt;br /&gt;
== svcSetMemoryAttribute ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;State0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;State1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Change attribute of page-aligned memory region. &lt;br /&gt;
&lt;br /&gt;
This is used to turn on/off caching for a given memory area. Useful when talking to devices such as the GPU.&lt;br /&gt;
&lt;br /&gt;
What happens &amp;quot;under the hood&amp;quot; is the &amp;quot;Memory Attribute Indirection Register&amp;quot; index is changed from 2 to 3 in the MMU descriptor.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! State0 || State1 || Action&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || Clear bit3 in [[#MemoryAttribute]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 0 || Clear bit3 in [[#MemoryAttribute]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 8 || Set bit3 in [[#MemoryAttribute]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== svcMapMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Dst&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Src&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Maps a memory range into a different range.&lt;br /&gt;
&lt;br /&gt;
Mainly used for adding guard pages around stack.&lt;br /&gt;
&lt;br /&gt;
Source range gets reprotected to --- (it can no longer be accessed), and bit0 is set in the source [[#MemoryAttribute]].&lt;br /&gt;
&lt;br /&gt;
If dstaddr &amp;gt;= LowerTreshold, the dst-range is enforced to be within the process&#039; &amp;quot;MapRegion&amp;quot;. Code can get the range of this region from [[#svcGetInfo]] id0=2,3.&lt;br /&gt;
&lt;br /&gt;
In this case, the mapped memory will have state &amp;lt;code&amp;gt;0x5C3C0B&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As long as (dstaddr+size) &amp;lt; LowerThreshold, then you can map anywhere but the mapped memory will have state &amp;lt;code&amp;gt;0x482907&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
LowerTreshold is 0x80000000 for 36-bit address spaces, and 0x40000000 for 32-bit ones.&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] Support for the &amp;lt;code&amp;gt;0x482907&amp;lt;/code&amp;gt; mappings outside the &amp;quot;MapRegion&amp;quot; were removed.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Dst&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Src&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Unmaps a region that was previously mapped with [[#svcMapMemory]].&lt;br /&gt;
&lt;br /&gt;
It&#039;s possible to unmap ranges partially, you don&#039;t need to unmap the entire range &amp;quot;in one go&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The srcaddr/dstaddr must match what was given when the pages were originally mapped.&lt;br /&gt;
&lt;br /&gt;
== svcQueryMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || MemoryInfo*|| &amp;lt;code&amp;gt;Mem Info&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || PageInfo || &amp;lt;code&amp;gt;Page Info&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Query information about an address. Will always fetch the lowest page-aligned mapping that contains the provided address.&lt;br /&gt;
&lt;br /&gt;
Outputs a [[#MemoryInfo]] struct.&lt;br /&gt;
&lt;br /&gt;
== svcExitProcess ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Exits the current process.&lt;br /&gt;
&lt;br /&gt;
== svcCreateThread ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Entry&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Arg&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Stack Top&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W4 || u64 || &amp;lt;code&amp;gt;Priority&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W5 || u64 || &amp;lt;code&amp;gt;Processor ID&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Create a thread in the current process.&lt;br /&gt;
&lt;br /&gt;
Processor_id must be 0,1,2,3 or -2, where -2 uses the default cpuid for process.&lt;br /&gt;
&lt;br /&gt;
== svcStartThread ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0|| u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) None ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Starts the thread for the provided handle.&lt;br /&gt;
&lt;br /&gt;
== svcExitThread ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Exits the current thread.&lt;br /&gt;
&lt;br /&gt;
== svcSleepThread ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Nano&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Sleep for a specified amount of time, or yield thread.&lt;br /&gt;
&lt;br /&gt;
Setting nano=0 means &amp;quot;yield thread&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== svcGetThreadPriority ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1|| u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Priority&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Get priority of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== svcSetThreadPriority ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0|| u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1|| u64 || &amp;lt;code&amp;gt;Priority&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Set priority of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
Priority is a number 0-0x3F. Lower value means higher priority.&lt;br /&gt;
&lt;br /&gt;
== svcGetThreadCoreMask ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Out&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X2 || u64 || &amp;lt;code&amp;gt;Out&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Get affinity mask of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== svcSetThreadCoreMask ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || u64 || &amp;lt;code&amp;gt;In&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;In&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Set affinity mask of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== svcGetCurrentProcessorNumber ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0/X0 || u64 || &amp;lt;code&amp;gt;CPU ID&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Get which cpu is executing the current thread.&lt;br /&gt;
&lt;br /&gt;
Cpu-id is an integer in the range 0-3.&lt;br /&gt;
&lt;br /&gt;
== svcMapSharedMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Mem Block Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Maps the block supplied by the handle. The required permissions are different for the process that created the handle and all other processes.&lt;br /&gt;
&lt;br /&gt;
Increases reference count for the KSharedMemory object. Thus in order to release the memory associated with the object, all handles to it must be closed and all mappings must be unmapped.&lt;br /&gt;
&lt;br /&gt;
== svcCreateTransferMemory ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one reprotects the src block with perms you give it. It also sets bit0 into [[#MemoryAttribute]].&lt;br /&gt;
&lt;br /&gt;
Executable bit perm not allowed.&lt;br /&gt;
&lt;br /&gt;
Closing all handles automatically causes the bit0 in [[#MemoryAttribute]] to clear, and the permission to reset.&lt;br /&gt;
&lt;br /&gt;
== svcWaitSynchronization ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Handles Pointer&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;Number of Handles&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Timeout&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Handle Index&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Works with num_handles &amp;lt;= 0x40, error on num_handles == 0.&lt;br /&gt;
&lt;br /&gt;
Does not accept 0xFFFF8001 or 0xFFFF8000 as handles.&lt;br /&gt;
&lt;br /&gt;
== svcSendSyncRequestWithUserBuffer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Command Buffer Pointer&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Size must be 0x1000-aligned.&lt;br /&gt;
&lt;br /&gt;
== svcBreak ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 ||&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 ||&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Info&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) ? || ? || &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When used on retail where inx0 bit31 is clear, the system will throw a [[Error_codes|fatal-error]]. Otherwise when bit31 is set, it will return 0.&lt;br /&gt;
&lt;br /&gt;
== svcGetInfo ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Handle type || Id0 || Id1 || Description&lt;br /&gt;
|-&lt;br /&gt;
| Process || 0 || 0 || AllowedCpuIdBitmask&lt;br /&gt;
|-&lt;br /&gt;
| Process || 1 || 0 || AllowedThreadPrioBitmask&lt;br /&gt;
|-&lt;br /&gt;
| Process || 2 || 0 || ReservedMapRegionBaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 3 || 0 || ReservedMapRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 4 || 0 || ReservedHeapRegionBaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 5 || 0 || ReservedHeapRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 6 || 0 || TotalMemoryUsage&lt;br /&gt;
|-&lt;br /&gt;
| Process || 7 || 0 || TotalHeapUsage&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 8 || 0 || IsCurrentProcessBeingDebugged&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 9 || 0 || Returns ResourceLimit handle for current process. Used by [[Process_Manager_services|PM]].&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 10 || -1, {current coreid} || Unknown. Output data changes each time this SVC is used. Global and core-specific tick-count?&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 11 || 0-3 || RandomEntropy from current process. TRNG. Used to seed usermode PRNGs.&lt;br /&gt;
|-&lt;br /&gt;
| Process || 12 || 0 || [2.0.0+] AddressSpaceStart&lt;br /&gt;
|-&lt;br /&gt;
| Process || 13 || 0 || [2.0.0+] AddressSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 14 || 0 || [2.0.0+] NewReservedRegionStartAddr&lt;br /&gt;
|-&lt;br /&gt;
| Process || 15 || 0 || [2.0.0+] NewReservedRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 18 || 0 || [3.0.0+] Title-id.&lt;br /&gt;
|-&lt;br /&gt;
| Thread || 0xF0000002 || 0 || Performance counter related.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== svcDumpInfo ==&lt;br /&gt;
Does nothing, just returns with registers set to all-zero.&lt;br /&gt;
&lt;br /&gt;
== svcReadWriteRegister ==&lt;br /&gt;
Read/write IO registers with a hardcoded whitelist. Input address is physical-address and must be aligned to 4.&lt;br /&gt;
&lt;br /&gt;
rw_mask is 0 for reading and 0xffffffff for writing. You can also write individual bits by using a mask value.&lt;br /&gt;
&lt;br /&gt;
You can only write to registers inside physical pages 0x70019000 (MC), 0x7001C000 (MC0), 0x7001D000 (MC1), and they all share the same whitelist.&lt;br /&gt;
&lt;br /&gt;
The whitelist is same for writing as for reading.&lt;br /&gt;
&lt;br /&gt;
The whitelist is:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
0x054, 0x090, 0x094, 0x098, 0x09c, 0x0a0, 0x0a4, 0x0a8, 0x0ac, 0x0b0, 0x0b4, 0x0b8, 0x0bc, 0x0c0, 0x0c4, 0x0c8, 0x0d0, 0x0d4, 0x0d8, 0x0dc, 0x0e0, 0x100, 0x108, 0x10c, 0x118, 0x11c, 0x124, 0x128, 0x12c, 0x130, 0x134, 0x138, 0x13c, 0x158, 0x15c, 0x164, 0x168, 0x16c, 0x170, 0x174, 0x178, 0x17c, 0x200, 0x204, 0x2e4, 0x2e8, 0x2ec, 0x2f4, 0x2f8, 0x310, 0x314, 0x320, 0x328, 0x344, 0x348, 0x370, 0x374, 0x37c, 0x380, 0x390, 0x394, 0x398, 0x3ac, 0x3b8, 0x3bc, 0x3c0, 0x3c4, 0x3d8, 0x3e8, 0x41c, 0x420, 0x424, 0x428, 0x42c, 0x430, 0x44c, 0x47c, 0x480, 0x484, 0x50c, 0x554, 0x558, 0x55c, 0x670, 0x674, 0x690, 0x694, 0x698, 0x69c, 0x6a0, 0x6a4, 0x6c0, 0x6c4, 0x6f0, 0x6f4, 0x960, 0x970, 0x974, 0xa20, 0xa24, 0xb88, 0xb8c, 0xbc4, 0xbc8, 0xbcc, 0xbd0, 0xbd4, 0xbd8, 0xbdc, 0xbe0, 0xbe4, 0xbe8, 0xbec, 0xc00, 0xc5c, 0xcac&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] Whitelist was extended with &amp;lt;code&amp;gt;0x4c4, 0x4c8, 0x4cc, 0x584, 0x588, 0x58c.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] The IO registers in range 0x7000E400 (PMC) size 0xC00 skip the whitelist, and do a TrustZone call using [[SMC]] Id1 0xC3000008(ReadWriteRegister).&lt;br /&gt;
&lt;br /&gt;
== svcCreateSharedMemory ==&lt;br /&gt;
Other perm can be used to enforce permission 1, 3, or 0x10000000 if don&#039;t care.&lt;br /&gt;
&lt;br /&gt;
== svcMapTransferMemory ==&lt;br /&gt;
The newly mapped pages will have [[#MemoryState]] type 0xE.&lt;br /&gt;
&lt;br /&gt;
You must pass same size and permissions as given in svcCreateMemoryMirror, otherwise error.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapTransferMemory ==&lt;br /&gt;
Size must match size given in map syscall, otherwise there&#039;s an invalid-size error.&lt;br /&gt;
&lt;br /&gt;
== svcQueryPhysicalAddress ==&lt;br /&gt;
The inverse operation of [[#svcQueryIoMapping]].&lt;br /&gt;
&lt;br /&gt;
== svcQueryIoMapping ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Returns a virtual address mapped to a given IO range.&lt;br /&gt;
&lt;br /&gt;
== svcCreateDeviceAddressSpace ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Creates a virtual address space for binding device address spaces and returns a handle.&lt;br /&gt;
&lt;br /&gt;
dev_as_start_addr is normally set to 0 and dev_as_end_addr is normally set to 0xFFFFFFFF.&lt;br /&gt;
&lt;br /&gt;
== svcAttachDeviceAddressSpace ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Attaches a device address space to a [[#DeviceName|device]].&lt;br /&gt;
&lt;br /&gt;
== svcDetachDeviceAddressSpace ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Detaches a device address space from a [[#DeviceName|device]].&lt;br /&gt;
&lt;br /&gt;
== svcMapDeviceAddressSpaceByForce ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Maps an attached device address space to an userspace address.&lt;br /&gt;
&lt;br /&gt;
dev_map_addr is the userspace destination address, while dev_as_addr is the source address between dev_as_start_addr and dev_as_end_addr (passed to [[#svcCreateDeviceAddressSpace]]).&lt;br /&gt;
&lt;br /&gt;
The userspace destination address must have the [[SVC#MemoryState|MapDeviceAllowed]] bit set. Bit [[SVC#MemoryAttribute|IsDeviceMapped]] will be set after mapping.&lt;br /&gt;
&lt;br /&gt;
== svcMapDeviceAddressSpaceAligned ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Maps an attached device address space to an userspace address.&lt;br /&gt;
&lt;br /&gt;
Same as [[#svcMapDeviceAddressSpaceByForce]], but the userspace destination address must have the [[SVC#MemoryState|MapDeviceAlignedAllowed]] bit set instead.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapDeviceAddressSpace ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Unmaps an attached device address space from an userspace address.&lt;br /&gt;
&lt;br /&gt;
== svcMapProcessMemory ==&lt;br /&gt;
Maps the src address from the supplied process handle into the current process.&lt;br /&gt;
&lt;br /&gt;
This allows mapping code and rodata with RW- permission.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapProcessMemory ==&lt;br /&gt;
Unmaps what was mapped by [[#svcMapProcessMemory]].&lt;br /&gt;
&lt;br /&gt;
== svcQueryProcessMemory ==&lt;br /&gt;
Equivalent to [[#svcQueryMemory]] except takes a process handle.&lt;br /&gt;
&lt;br /&gt;
== svcMapProcessCodeMemory ==&lt;br /&gt;
Takes a process handle, and maps normal heap in that process as executable code in that process. Used when loading NROs.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapProcessCodeMemory ==&lt;br /&gt;
Unmaps what was mapped by [[#svcMapProcessCodeMemory]].&lt;br /&gt;
&lt;br /&gt;
== svcCreateProcess ==&lt;br /&gt;
Takes a [[#CreateProcessInfo]] as input.&lt;br /&gt;
&lt;br /&gt;
== svcGetProcessInfo ==&lt;br /&gt;
Returns an enum with value 0-7.&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
[2.0.0+] Exactly 6 debug SVCs require that [[SPL_services#GetConfig|IsDebugMode]] is non-zero. Error 0x4201 is returned otherwise.&lt;br /&gt;
* svcBreakDebugProcess&lt;br /&gt;
* svcContinueDebugEvent&lt;br /&gt;
* svcWriteDebugProcessMemory&lt;br /&gt;
* svcSetDebugThreadContext&lt;br /&gt;
* svcTerminateDebugProcess&lt;br /&gt;
* svcSetHardwareBreakPoint&lt;br /&gt;
&lt;br /&gt;
svcDebugActiveProcess stops execution of the target process, the normal method for resuming it requires svcContinueDebugEvent(see above). Closing the debug handle also results in execution being resumed.&lt;br /&gt;
&lt;br /&gt;
= Structures =&lt;br /&gt;
== DeviceName ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || DeviceName_AFI&lt;br /&gt;
|-&lt;br /&gt;
| 1 || DeviceName_AVPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DeviceName_DC&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DeviceName_DCB&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeviceName_HC&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeviceName_HDA&lt;br /&gt;
|-&lt;br /&gt;
| 6 || DeviceName_ISP2&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeviceName_MSENCNVENC&lt;br /&gt;
|-&lt;br /&gt;
| 8 || DeviceName_NV&lt;br /&gt;
|-&lt;br /&gt;
| 9 || DeviceName_NV2&lt;br /&gt;
|-&lt;br /&gt;
| 10 || DeviceName_PPCS&lt;br /&gt;
|-&lt;br /&gt;
| 11 || DeviceName_SATA&lt;br /&gt;
|-&lt;br /&gt;
| 12 || DeviceName_VI&lt;br /&gt;
|-&lt;br /&gt;
| 13 || DeviceName_VIC&lt;br /&gt;
|-&lt;br /&gt;
| 14 || DeviceName_XUSB_HOST&lt;br /&gt;
|-&lt;br /&gt;
| 15 || DeviceName_XUSB_DEV&lt;br /&gt;
|-&lt;br /&gt;
| 16 || DeviceName_TSEC&lt;br /&gt;
|-&lt;br /&gt;
| 17 || DeviceName_PPCS1&lt;br /&gt;
|-&lt;br /&gt;
| 18 || DeviceName_DC1&lt;br /&gt;
|-&lt;br /&gt;
| 19 || DeviceName_SDMMC1A&lt;br /&gt;
|-&lt;br /&gt;
| 20 || DeviceName_SDMMC2A&lt;br /&gt;
|-&lt;br /&gt;
| 21 || DeviceName_SDMMC3A&lt;br /&gt;
|-&lt;br /&gt;
| 22 || DeviceName_SDMMC4A&lt;br /&gt;
|-&lt;br /&gt;
| 23 || DeviceName_ISP2B&lt;br /&gt;
|-&lt;br /&gt;
| 24 || DeviceName_GPU&lt;br /&gt;
|-&lt;br /&gt;
| 25 || DeviceName_GPUB&lt;br /&gt;
|-&lt;br /&gt;
| 26 || DeviceName_PPCS2&lt;br /&gt;
|-&lt;br /&gt;
| 27 || DeviceName_NVDEC&lt;br /&gt;
|-&lt;br /&gt;
| 28 || DeviceName_APE&lt;br /&gt;
|-&lt;br /&gt;
| 29 || DeviceName_SE&lt;br /&gt;
|-&lt;br /&gt;
| 30 || DeviceName_NVJPG&lt;br /&gt;
|-&lt;br /&gt;
| 31 || DeviceName_HC1&lt;br /&gt;
|-&lt;br /&gt;
| 32 || DeviceName_SE1&lt;br /&gt;
|-&lt;br /&gt;
| 33 || DeviceName_AXIAP&lt;br /&gt;
|-&lt;br /&gt;
| 34 || DeviceName_ETR&lt;br /&gt;
|-&lt;br /&gt;
| 35 || DeviceName_TSECB&lt;br /&gt;
|-&lt;br /&gt;
| 36 || DeviceName_TSEC1&lt;br /&gt;
|-&lt;br /&gt;
| 37 || DeviceName_TSECB1&lt;br /&gt;
|-&lt;br /&gt;
| 38 || DeviceName_NVDEC1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LimitableResource ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || LimitableResource_Memory&lt;br /&gt;
|-&lt;br /&gt;
| 1 || LimitableResource_Threads&lt;br /&gt;
|-&lt;br /&gt;
| 2 || LimitableResource_Events&lt;br /&gt;
|-&lt;br /&gt;
| 3 || LimitableResource_TransferMemories&lt;br /&gt;
|-&lt;br /&gt;
| 4 || LimitableResource_Sessions&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateProcessInfo ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 12 || || ProcessName (doesn&#039;t have to be null-terminated)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 4 || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 8 || || TitleId&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 8 || || CodeAddr&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 4 || || CodeNumPages&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 4 || || MmuFlags&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit0 || Is64bit&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit3-1 || [[#AddressSpaceType]]&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit4 ||&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit5 || EnableAslr&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit6 || IsSystem&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 4 || || ResourceLimitHandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 4 ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== AddressSpaceType ===&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Type || Name || Width || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Normal_32Bit || 32 ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Normal_36Bit || 36 ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || WithoutMap_32Bit || 32 || Appears to be missing map region [?]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [2.0.0+] Normal_39Bit || 39 ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryInfo ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 8 || BaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 8 || Size&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 4 || MemoryType: lower 8 bits of [[#MemoryState]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || 4 || [[#MemoryAttribute]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 4 || Permission (bit0: R, bit1: W, bit2: X)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || 4 || DeviceRefCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 4 || IpcRefCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 4 || Padding: always zero&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryAttribute ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IsBorrowed&lt;br /&gt;
|-&lt;br /&gt;
| 1 || IsIpcMapped: when IpcRefCount &amp;gt; 0.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || IsDeviceMapped: when DeviceRefCount &amp;gt; 0.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || IsUncached&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryState ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 7-0 || Type&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#svcSetMemoryPermission|PermissionChangeAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || IsUserWritable [?]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || IpcSendAllowed_Type0&lt;br /&gt;
|-&lt;br /&gt;
| 11 || IpcSendAllowed_Type3&lt;br /&gt;
|-&lt;br /&gt;
| 12 || IpcSendAllowed_Type1&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#svcSetProcessMemoryPermission|ProcessPermissionChangeAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [[#svcMapMemory|MapAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [[#svcUnmapProcessCodeMemory|UnmapProcessCodeMemoryAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [[#svcCreateTransferMemory|TransferMemoryAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 19 || MapDeviceAllowed ([[#svcMapDeviceAddressSpace]] and [[#svcMapDeviceAddressSpaceByForce]])&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#svcMapDeviceAddressSpaceAligned|MapDeviceAlignedAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#svcSendSyncRequestWithUserBuffer|IpcBufferAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || IsPoolAllocated/IsReferenceCounted&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [[#svcMapProcessMemory|MapProcessAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [[#svcSetMemoryAttribute|AttributeChangeAllowed]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Type || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00000000&amp;lt;/code&amp;gt; || Unmapped ||&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00002001&amp;lt;/code&amp;gt; || IO || Mapped by kernel capability parsing in [[#svcCreateProcess]]. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00042002&amp;lt;/code&amp;gt; || Normal || Mapped by kernel capability parsing in [[#svcCreateProcess]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00DC7E03&amp;lt;/code&amp;gt; || Code static || Mapped during [[#svcCreateProcess]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x01FEBD04&amp;lt;/code&amp;gt; || Code || Transition from 0xDC7E03 performed by [[#svcSetProcessMemoryPermission]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x017EBD05&amp;lt;/code&amp;gt; || Heap || Mapped using [[#svcSetHeapSize]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00402006&amp;lt;/code&amp;gt; || Shared memory block || Mapped using [[#svcMapSharedMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00482907&amp;lt;/code&amp;gt; || [1.0.0] Weird mapped memory || Mapped using [[#svcMapMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00DD7E08&amp;lt;/code&amp;gt; || Module code static || Mapped using [[#svcMapProcessCodeMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x01FFBD09&amp;lt;/code&amp;gt; || Module code mutable || Transition from 0xDD7E08 performed by [[#svcSetProcessMemoryPermission]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C3C0A&amp;lt;/code&amp;gt; || [[IPC_Marshalling|IPC]] buffers || IPC buffers with descriptor flags=0.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C3C0B&amp;lt;/code&amp;gt; || Mapped memory || Mapped using [[#svcMapMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x0040200C&amp;lt;/code&amp;gt; || [[Thread Local Storage|Thread local storage]] || Mapped during [[#svcCreateThread]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x015C3C0D&amp;lt;/code&amp;gt; || Isolated transfer memory || Mapped using [[#svcMapTransferMemory]] when the owning process has perm=0.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C380E&amp;lt;/code&amp;gt; || Transfer memory || Mapped using [[#svcMapTransferMemory]] when the owning process has perm!=0.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x0040380F&amp;lt;/code&amp;gt; || Process memory || Mapped using [[#svcMapProcessMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00000010&amp;lt;/code&amp;gt; || Reserved ||&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C3811&amp;lt;/code&amp;gt; || [[IPC_Marshalling|IPC]] buffers || IPC buffers with descriptor flags=1.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x004C2812&amp;lt;/code&amp;gt; || [[IPC_Marshalling|IPC]] buffers || IPC buffers with descriptor flags=3.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00002013&amp;lt;/code&amp;gt; || Kernel per-thread stack || Mapped in kernel during [[#svcCreateThread]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Exception handling =&lt;br /&gt;
There is userland code for handling exceptions, however this doesn&#039;t seem to be executed on retail mode.&lt;br /&gt;
&lt;br /&gt;
When a usermode exception occurs, it jumps to the main code binary entrypoint (main_binary_address + 0 == &#039;&#039;&#039;_start&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
During normal boot &#039;&#039;&#039;_start&#039;&#039;&#039; is invoked with X0=0 and X1=main_thread_handle (triggering normal crt0 setup).&lt;br /&gt;
During an usermode exception &#039;&#039;&#039;_start&#039;&#039;&#039; is invoked with X0=exception_info0_ptr and X1=exception_info1_ptr instead.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;_start&#039;&#039;&#039; method determines whether to boot normally or handle an exception if X0 is set to 0 or not.&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=SVC&amp;diff=2795</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=SVC&amp;diff=2795"/>
		<updated>2017-10-13T22:38:49Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&lt;br /&gt;
= System calls =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
|  0x1 || [[#svcSetHeapSize]] || W1=size || W0=result, X1=outaddr&lt;br /&gt;
|-&lt;br /&gt;
|  0x2 || [[#svcSetMemoryPermission]] || X0=addr, X1=size, W2=prot || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x3 || [[#svcSetMemoryAttribute]] || X0=addr, X1=size, W2=state0, W3=state1 || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x4 || [[#svcMapMemory]] || X0=dstaddr, X1=srcaddr, X2=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x5 || [[#svcUnmapMemory]] || X0=dstaddr, X1=srcaddr, X2=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x6 || [[#svcQueryMemory]] || X0=MemoryInfo*, X2=addr || W0=result, W1=PageInfo                                                         &lt;br /&gt;
|-&lt;br /&gt;
|  0x7 || [[#svcExitProcess]] || None ||&lt;br /&gt;
|-&lt;br /&gt;
|  0x8 || [[#svcCreateThread]] || X1=entry, X2=arg, X3=stacktop, W4=prio, W5=processor_id  || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
|  0x9 || [[#svcStartThread]] || W0=thread_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0xA || [[#svcExitThread]] || None ||                                                         &lt;br /&gt;
|-&lt;br /&gt;
|  0xB || [[#svcSleepThread]] || X0=nano || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0xC || [[#svcGetThreadPriority]] || W1=thread_handle || W0=result, W1=prio&lt;br /&gt;
|-&lt;br /&gt;
|  0xD || [[#svcSetThreadPriority]] || W0=thread_handle, W1=prio || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0xE || [[#svcGetThreadCoreMask]] || W2=thread_handle || W0=result, W1=out, X2=out&lt;br /&gt;
|-&lt;br /&gt;
|  0xF || [[#svcSetThreadCoreMask]] || W0=thread_handle, W1=in, X2=in2 || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || [[#svcGetCurrentProcessorNumber]] || None || W0/X0=cpuid&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 || svcSignalEvent || W0=wevent_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || svcClearEvent || W0=wevent_or_revent_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || [[#svcMapSharedMemory]] || W0=memblk_handle, X1=addr, X2=size, W3=perm || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || svcUnmapSharedMemory || W0=memblk_handle, X1=addr, X2=size || W0=result                                                 &lt;br /&gt;
|-&lt;br /&gt;
| 0x15 || [[#svcCreateTransferMemory]] || X1=addr, X2=size, W3=perm || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || svcCloseHandle || W0=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 || svcResetSignal || W0=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || [[#svcWaitSynchronization]] || X1=handles_ptr, W2=num_handles. X3=timeout || W0=result, W1=handle_idx&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 || svcCancelSynchronization || W0=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A || svcArbitrateLock || W0=cur_thread_handle, X1=ptr, W2=req_thread_handle ||                                     &lt;br /&gt;
|-&lt;br /&gt;
| 0x1B || svcArbitrateUnlock || X0=ptr ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || svcWaitProcessWideKeyAtomic || X0=ptr0, X1=ptr, W2=thread_handle, X3=timeout || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D || svcSignalProcessWideKey || X0=ptr, W1=value || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E || svcGetSystemTick ||  || X0={value of cntpct_el0}&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F || svcConnectToNamedPort || X1=port_name_str || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || svcSendSyncRequestLight ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || svcSendSyncRequest || X0=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 || [[#svcSendSyncRequestWithUserBuffer]] || X0=cmdbufptr, X1=size, X2=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 || svcSendAsyncRequestWithUserBuffer ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || svcGetProcessId ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x25 || svcGetThreadId || W0=thread_handle || W0=result, X1=out&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 || svcBreak || X0,X1,X2=info || ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 || svcOutputDebugString || X0=str, X1=size || &lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || svcReturnFromException || X0=result || &lt;br /&gt;
|-&lt;br /&gt;
| 0x29 || [[#svcGetInfo]] || X1=info_id, X2=handle, X3=info_sub_id || W0=result, X1=out&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A || svcFlushEntireDataCache ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x2B || svcFlushDataCache ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || [3.0.0+] svcMapPhysicalMemory ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D || [3.0.0+] svcUnmapPhysicalMemory||  ||&lt;br /&gt;
|-&lt;br /&gt;
| .... || ? || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F || svcGetLastThreadInfo ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || svcGetResourceLimitLimitValue ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x31 || svcGetResourceLimitCurrentValue ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || svcSetThreadActivity ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x33 || svcGetThreadContext3 ||  || &lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x3C || svcDumpInfo ||  || &lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x40 || svcCreateSession || W2=?, X3=? || W0=result, W1=client_handle, W2=server_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x41 || svcAcceptSession || W1=port_handle || W0=result, W1=session_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x42 || svcReplyAndReceiveLight ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x43 || svcReplyAndReceive || X1=ptr_handles, W2=num_handles, X3=replytarget_handle(0=none), X4=timeout || W0=result, W1=handle_idx&lt;br /&gt;
|-&lt;br /&gt;
| 0x44 || svcReplyAndReceiveWithUserBuffer|| X1=buf, X2=sz, X3=ptr_handles, W4=num_handles, X5=replytarget_handle(0=none), X6=timeout || W0=result, W1=handle_idx&lt;br /&gt;
|-&lt;br /&gt;
| 0x45 || svcCreateEvent || None || W0=result, W1=client_handle ?, W2=server_handle ?&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x4D || svcSleepSystem ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x4E || [[#svcReadWriteRegister]] || X1=reg_addr, W2=rw_mask, W3=in_val || W0=result, W1=out_val&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F || svcSetProcessActivity || W0=process_handle, W1=bool || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 || [[#svcCreateSharedMemory]] || W1=size?, W2=myperm, W3=otherperm || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 || [[#svcMapTransferMemory]] || X0=mirror_handle, X1=addr, X2=size, W3=perm || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 || [[#svcUnmapTransferMemory]] || W0=mirror_handle, X1=addr, X2=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 || svcCreateInterruptEvent || X1=irq_id, W2=flag || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 || [[#svcQueryPhysicalAddress]] || X1=addr || W0=result, X1=out0, X2=out1, X3=out2&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 || [[#svcQueryIoMapping]] || X1=physaddr, X2=size || W0=result, X1=virtaddr&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 || [[#svcCreateDeviceAddressSpace]] || X1=dev_as_start_addr, X2=dev_as_end_addr || W0=result, W1=dev_as_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 || [[#svcAttachDeviceAddressSpace]] || W0=device, X1=dev_as_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x58 || [[#svcDetachDeviceAddressSpace]] || W0=device, X1=dev_as_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x59 || [[#svcMapDeviceAddressSpaceByForce]] || W0=dev_as_handle, W1=proc_handle, X2=dev_map_addr, X3=dev_as_size, X4=dev_as_addr, W5=perm || W0=result &lt;br /&gt;
|-&lt;br /&gt;
| 0x5A || [[#svcMapDeviceAddressSpaceAligned]] || W0=dev_as_handle, W1=proc_handle, X2=dev_map_addr, X3=dev_as_size, X4=dev_as_addr, W5=perm || W0=result &lt;br /&gt;
|-&lt;br /&gt;
| 0x5B || svcMapDeviceAddressSpace || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x5C || [[#svcUnmapDeviceAddressSpace]] || W0=dev_as_handle, W1=proc_handle, X2=dev_map_addr, X3=dev_as_size, X4=dev_as_addr || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x5D || svcInvalidateProcessDataCache || W0=process_handle, X1=addr, X2=size || W0=size&lt;br /&gt;
|-&lt;br /&gt;
| 0x5E || svcStoreProcessDataCache || W0=process_handle, X1=addr, X2=size || W0=size&lt;br /&gt;
|-&lt;br /&gt;
| 0x5F || svcFlushProcessDataCache || W0=process_handle, X1=addr, X2=size || W0=size&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || svcDebugActiveProcess || X1=pid || W0=result, W1=debug_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 || svcBreakDebugProcess || W0=debug_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 || svcTerminateDebugProcess || W0=debug_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 || svcGetDebugEvent || X0=DebugEventInfo*, W1=debug_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 || svcContinueDebugEvent || W0=debug_handle, W1=flags, X2=? || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 || svcGetProcessList || X1=pids_out_ptr, W2=max_out || W0=result, W1=num_out &lt;br /&gt;
|-&lt;br /&gt;
| 0x66 || svcGetThreadList || X1=tids_out_ptr, W2=max_out, W3=debug_handle_or_zero || W0=result, X1=num_out&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 || svcGetDebugThreadContext || X0=ThreadContext*, X1=debug_handle, X2=?, W3=? || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || svcSetDebugThreadContext || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x69 || svcQueryDebugProcessMemory || X0=[[#MemoryInfo]]*, X2=debug_handle, X3=addr || W0=result, W1=PageInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A || svcReadDebugProcessMemory || X0=buffer*, X1=debug_handle, X2=src_addr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B || svcWriteDebugProcessMemory || X0=debug_handle, X1=buffer*, X2=dst_addr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C || svcSetHardwareBreakPoint || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x6D || svcGetDebugThreadParam || X2=debug_handle, X3=thread_id, W4=DebugThreadParam || W0=result, X1=out0, W2=out1&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x70 || svcCreatePort || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x71 || svcManageNamedPort || X1=name_ptr, W2=max_sessions(?) || W0=result, W1=serverport_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x72 || svcConnectToPort || W1=clientport_handle || W0=result, W1=session_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x73 || svcSetProcessMemoryPermission || X0=addr, X1=size, W2=perm || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x74 || [[#svcMapProcessMemory]] || X0=srcaddr, W1=process_handle, X2=dstaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x75 || [[#svcUnmapProcessMemory]] || W0=process_handle, X1=dstaddr, X2=srcaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x76 || [[#svcQueryProcessMemory]] || X0=meminfo_ptr, W2=process_handle, X3=addr || W0=result, W1=pageinfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x77 || [[#svcMapProcessCodeMemory]] || W0=process_handle, X2=dstaddr, X2=srcaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x78 || [[#svcUnmapProcessCodeMemory]] || W0=process_handle, X1=dstaddr, X2=srcaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x79 || [[#svcCreateProcess]] || X1=procinfo_ptr, X2=caps_ptr, W3=cap_num ||  W0=result, W1=process_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A || svcStartProcess || W0=process_handle, W1=main_thread_prio, W2=default_cpuid, W3=main_thread_stacksz || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x7B || svcTerminateProcess || W0=process_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C || [[#svcGetProcessInfo]] || W0=process_handle || W0=result, X1=[[#ProcessState]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D || svcCreateResourceLimit || None || W0=result, W1=reslimit_handle &lt;br /&gt;
|-&lt;br /&gt;
| 0x7E || svcSetResourceLimitLimitValue || W0=reslimit_handle, W1=[[#LimitableResource]], X2=value || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x7F || svcCallSecureMonitor || || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== svcSetHeapSize ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || u64 || &amp;lt;code&amp;gt;OutAddr&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Set the process heap to a given &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;. It can both extend and shrink the heap.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt; must be a multiple of 0x2000000.&lt;br /&gt;
&lt;br /&gt;
On success, the heap base-address (which is fixed by kernel, aslr&#039;d) is written to &amp;lt;code&amp;gt;OutAddr&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt; must be less than 0x18000000.&lt;br /&gt;
&lt;br /&gt;
== svcSetMemoryPermission ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Change permission of page-aligned memory region.&lt;br /&gt;
&lt;br /&gt;
Bit2 of permission (exec) is not allowed. Setting write-only is not allowed either (bit1).&lt;br /&gt;
&lt;br /&gt;
This can be used to move back and forth between ---, r-- and rw-.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;Prot&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcSetMemoryAttribute ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Change attribute of page-aligned memory region. &lt;br /&gt;
&lt;br /&gt;
This is used to turn on/off caching for a given memory area. Useful when talking to devices such as the GPU.&lt;br /&gt;
&lt;br /&gt;
What happens &amp;quot;under the hood&amp;quot; is the &amp;quot;Memory Attribute Indirection Register&amp;quot; index is changed from 2 to 3 in the MMU descriptor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;State0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;State1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! State0 || State1 || Action&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || Clear bit3 in [[#MemoryAttribute]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 0 || Clear bit3 in [[#MemoryAttribute]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 8 || Set bit3 in [[#MemoryAttribute]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== svcMapMemory ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Maps a memory range into a different range.&lt;br /&gt;
&lt;br /&gt;
Mainly used for adding guard pages around stack.&lt;br /&gt;
&lt;br /&gt;
Source range gets reprotected to --- (it can no longer be accessed), and bit0 is set in the source [[#MemoryAttribute]].&lt;br /&gt;
&lt;br /&gt;
If dstaddr &amp;gt;= LowerTreshold, the dst-range is enforced to be within the process&#039; &amp;quot;MapRegion&amp;quot;. Code can get the range of this region from [[#svcGetInfo]] id0=2,3.&lt;br /&gt;
&lt;br /&gt;
In this case, the mapped memory will have state &amp;lt;code&amp;gt;0x5C3C0B&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As long as (dstaddr+size) &amp;lt; LowerThreshold, then you can map anywhere but the mapped memory will have state &amp;lt;code&amp;gt;0x482907&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
LowerTreshold is 0x80000000 for 36-bit address spaces, and 0x40000000 for 32-bit ones.&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] Support for the &amp;lt;code&amp;gt;0x482907&amp;lt;/code&amp;gt; mappings outside the &amp;quot;MapRegion&amp;quot; were removed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Dst&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Src&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcUnmapMemory ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Unmaps a region that was previously mapped with [[#svcMapMemory]].&lt;br /&gt;
&lt;br /&gt;
It&#039;s possible to unmap ranges partially, you don&#039;t need to unmap the entire range &amp;quot;in one go&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The srcaddr/dstaddr must match what was given when the pages were originally mapped.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Dst&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Src&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcQueryMemory ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Query information about an address. Will always fetch the lowest page-aligned mapping that contains the provided address.&lt;br /&gt;
&lt;br /&gt;
Outputs a [[#MemoryInfo]] struct.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || MemoryInfo*|| &amp;lt;code&amp;gt;Mem Info&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || PageInfo || &amp;lt;code&amp;gt;Page Info&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcExitProcess ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Exits the current process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcCreateThread ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Create a thread in the current process.&lt;br /&gt;
&lt;br /&gt;
Processor_id must be 0,1,2,3 or -2, where -2 uses the default cpuid for process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Entry&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Arg&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Stack Top&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W4 || u64 || &amp;lt;code&amp;gt;Priority&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W5 || u64 || &amp;lt;code&amp;gt;Processor ID&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcStartThread ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Starts the thread for the provided handle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0|| u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) None ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcExitThread ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Exits the current thread.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcSleepThread ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Sleep for a specified amount of time, or yield thread.&lt;br /&gt;
&lt;br /&gt;
Setting nano=0 means &amp;quot;yield thread&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Nano&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcGetThreadPriority ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Get priority of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1|| u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Priority&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcSetThreadPriority ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Set priority of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
Priority is a number 0-0x3F. Lower value means higher priority.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0|| u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1|| u64 || &amp;lt;code&amp;gt;Priority&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcGetThreadCoreMask ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Get affinity mask of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Out&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X2 || u64 || &amp;lt;code&amp;gt;Out&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcSetThreadCoreMask ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Set affinity mask of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || u64 || &amp;lt;code&amp;gt;In&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;In&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcGetCurrentProcessorNumber ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Get which cpu is executing the current thread.&lt;br /&gt;
&lt;br /&gt;
Cpu-id is an integer in the range 0-3.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0/X0 || u64 || &amp;lt;code&amp;gt;CPU ID&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcMapSharedMemory ==&lt;br /&gt;
Maps the block supplied by the handle. The required permissions are different for the process that created the handle and all other processes.&lt;br /&gt;
&lt;br /&gt;
Increases reference count for the KSharedMemory object. Thus in order to release the memory associated with the object, all handles to it must be closed and all mappings must be unmapped.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0 || u64 || &amp;lt;code&amp;gt;Mem Block Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcCreateTransferMemory ==&lt;br /&gt;
This one reprotects the src block with perms you give it. It also sets bit0 into [[#MemoryAttribute]].&lt;br /&gt;
&lt;br /&gt;
Executable bit perm not allowed.&lt;br /&gt;
&lt;br /&gt;
Closing all handles automatically causes the bit0 in [[#MemoryAttribute]] to clear, and the permission to reset.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;Permissions&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcWaitSynchronization ==&lt;br /&gt;
Works with num_handles &amp;lt;= 0x40, error on num_handles == 0.&lt;br /&gt;
&lt;br /&gt;
Does not accept 0xFFFF8001 or 0xFFFF8000 as handles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Handles Pointer&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;Number of Handles&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Timeout&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || u64 || &amp;lt;code&amp;gt;Handle Index&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcSendSyncRequestWithUserBuffer ==&lt;br /&gt;
Size must be 0x1000-aligned.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Command Buffer Pointer&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcBreak ==&lt;br /&gt;
When used on retail where inx0 bit31 is clear, the system will throw a [[Error_codes|fatal-error]]. Otherwise when bit31 is set, it will return 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 ||&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 ||&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Info&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) ? || ? || &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcGetInfo ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Handle type || Id0 || Id1 || Description&lt;br /&gt;
|-&lt;br /&gt;
| Process || 0 || 0 || AllowedCpuIdBitmask&lt;br /&gt;
|-&lt;br /&gt;
| Process || 1 || 0 || AllowedThreadPrioBitmask&lt;br /&gt;
|-&lt;br /&gt;
| Process || 2 || 0 || ReservedMapRegionBaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 3 || 0 || ReservedMapRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 4 || 0 || ReservedHeapRegionBaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 5 || 0 || ReservedHeapRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 6 || 0 || TotalMemoryUsage&lt;br /&gt;
|-&lt;br /&gt;
| Process || 7 || 0 || TotalHeapUsage&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 8 || 0 || IsCurrentProcessBeingDebugged&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 9 || 0 || Returns ResourceLimit handle for current process. Used by [[Process_Manager_services|PM]].&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 10 || -1, {current coreid} || Unknown. Output data changes each time this SVC is used. Global and core-specific tick-count?&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 11 || 0-3 || RandomEntropy from current process. TRNG. Used to seed usermode PRNGs.&lt;br /&gt;
|-&lt;br /&gt;
| Process || 12 || 0 || [2.0.0+] AddressSpaceStart&lt;br /&gt;
|-&lt;br /&gt;
| Process || 13 || 0 || [2.0.0+] AddressSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 14 || 0 || [2.0.0+] NewReservedRegionStartAddr&lt;br /&gt;
|-&lt;br /&gt;
| Process || 15 || 0 || [2.0.0+] NewReservedRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 18 || 0 || [3.0.0+] Title-id.&lt;br /&gt;
|-&lt;br /&gt;
| Thread || 0xF0000002 || 0 || Performance counter related.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== svcDumpInfo ==&lt;br /&gt;
Does nothing, just returns with registers set to all-zero.&lt;br /&gt;
&lt;br /&gt;
== svcReadWriteRegister ==&lt;br /&gt;
Read/write IO registers with a hardcoded whitelist. Input address is physical-address and must be aligned to 4.&lt;br /&gt;
&lt;br /&gt;
rw_mask is 0 for reading and 0xffffffff for writing. You can also write individual bits by using a mask value.&lt;br /&gt;
&lt;br /&gt;
You can only write to registers inside physical pages 0x70019000 (MC), 0x7001C000 (MC0), 0x7001D000 (MC1), and they all share the same whitelist.&lt;br /&gt;
&lt;br /&gt;
The whitelist is same for writing as for reading.&lt;br /&gt;
&lt;br /&gt;
The whitelist is:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
0x054, 0x090, 0x094, 0x098, 0x09c, 0x0a0, 0x0a4, 0x0a8, 0x0ac, 0x0b0, 0x0b4, 0x0b8, 0x0bc, 0x0c0, 0x0c4, 0x0c8, 0x0d0, 0x0d4, 0x0d8, 0x0dc, 0x0e0, 0x100, 0x108, 0x10c, 0x118, 0x11c, 0x124, 0x128, 0x12c, 0x130, 0x134, 0x138, 0x13c, 0x158, 0x15c, 0x164, 0x168, 0x16c, 0x170, 0x174, 0x178, 0x17c, 0x200, 0x204, 0x2e4, 0x2e8, 0x2ec, 0x2f4, 0x2f8, 0x310, 0x314, 0x320, 0x328, 0x344, 0x348, 0x370, 0x374, 0x37c, 0x380, 0x390, 0x394, 0x398, 0x3ac, 0x3b8, 0x3bc, 0x3c0, 0x3c4, 0x3d8, 0x3e8, 0x41c, 0x420, 0x424, 0x428, 0x42c, 0x430, 0x44c, 0x47c, 0x480, 0x484, 0x50c, 0x554, 0x558, 0x55c, 0x670, 0x674, 0x690, 0x694, 0x698, 0x69c, 0x6a0, 0x6a4, 0x6c0, 0x6c4, 0x6f0, 0x6f4, 0x960, 0x970, 0x974, 0xa20, 0xa24, 0xb88, 0xb8c, 0xbc4, 0xbc8, 0xbcc, 0xbd0, 0xbd4, 0xbd8, 0xbdc, 0xbe0, 0xbe4, 0xbe8, 0xbec, 0xc00, 0xc5c, 0xcac&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] Whitelist was extended with &amp;lt;code&amp;gt;0x4c4, 0x4c8, 0x4cc, 0x584, 0x588, 0x58c.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] The IO registers in range 0x7000E400 (PMC) size 0xC00 skip the whitelist, and do a TrustZone call using [[SMC]] Id1 0xC3000008(ReadWriteRegister).&lt;br /&gt;
&lt;br /&gt;
== svcCreateSharedMemory ==&lt;br /&gt;
Other perm can be used to enforce permission 1, 3, or 0x10000000 if don&#039;t care.&lt;br /&gt;
&lt;br /&gt;
== svcMapTransferMemory ==&lt;br /&gt;
The newly mapped pages will have [[#MemoryState]] type 0xE.&lt;br /&gt;
&lt;br /&gt;
You must pass same size and permissions as given in svcCreateMemoryMirror, otherwise error.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapTransferMemory ==&lt;br /&gt;
Size must match size given in map syscall, otherwise there&#039;s an invalid-size error.&lt;br /&gt;
&lt;br /&gt;
== svcQueryPhysicalAddress ==&lt;br /&gt;
The inverse operation of [[#svcQueryIoMapping]].&lt;br /&gt;
&lt;br /&gt;
== svcQueryIoMapping ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Returns a virtual address mapped to a given IO range.&lt;br /&gt;
&lt;br /&gt;
== svcCreateDeviceAddressSpace ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Creates a virtual address space for binding device address spaces and returns a handle.&lt;br /&gt;
&lt;br /&gt;
dev_as_start_addr is normally set to 0 and dev_as_end_addr is normally set to 0xFFFFFFFF.&lt;br /&gt;
&lt;br /&gt;
== svcAttachDeviceAddressSpace ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Attaches a device address space to a [[#DeviceName|device]].&lt;br /&gt;
&lt;br /&gt;
== svcDetachDeviceAddressSpace ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Detaches a device address space from a [[#DeviceName|device]].&lt;br /&gt;
&lt;br /&gt;
== svcMapDeviceAddressSpaceByForce ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Maps an attached device address space to an userspace address.&lt;br /&gt;
&lt;br /&gt;
dev_map_addr is the userspace destination address, while dev_as_addr is the source address between dev_as_start_addr and dev_as_end_addr (passed to [[#svcCreateDeviceAddressSpace]]).&lt;br /&gt;
&lt;br /&gt;
The userspace destination address must have the [[SVC#MemoryState|MapDeviceAllowed]] bit set. Bit [[SVC#MemoryAttribute|IsDeviceMapped]] will be set after mapping.&lt;br /&gt;
&lt;br /&gt;
== svcMapDeviceAddressSpaceAligned ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Maps an attached device address space to an userspace address.&lt;br /&gt;
&lt;br /&gt;
Same as [[#svcMapDeviceAddressSpaceByForce]], but the userspace destination address must have the [[SVC#MemoryState|MapDeviceAlignedAllowed]] bit set instead.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapDeviceAddressSpace ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Unmaps an attached device address space from an userspace address.&lt;br /&gt;
&lt;br /&gt;
== svcMapProcessMemory ==&lt;br /&gt;
Maps the src address from the supplied process handle into the current process.&lt;br /&gt;
&lt;br /&gt;
This allows mapping code and rodata with RW- permission.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapProcessMemory ==&lt;br /&gt;
Unmaps what was mapped by [[#svcMapProcessMemory]].&lt;br /&gt;
&lt;br /&gt;
== svcQueryProcessMemory ==&lt;br /&gt;
Equivalent to [[#svcQueryMemory]] except takes a process handle.&lt;br /&gt;
&lt;br /&gt;
== svcMapProcessCodeMemory ==&lt;br /&gt;
Takes a process handle, and maps normal heap in that process as executable code in that process. Used when loading NROs.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapProcessCodeMemory ==&lt;br /&gt;
Unmaps what was mapped by [[#svcMapProcessCodeMemory]].&lt;br /&gt;
&lt;br /&gt;
== svcCreateProcess ==&lt;br /&gt;
Takes a [[#CreateProcessInfo]] as input.&lt;br /&gt;
&lt;br /&gt;
== svcGetProcessInfo ==&lt;br /&gt;
Returns an enum with value 0-7.&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
[2.0.0+] Exactly 6 debug SVCs require that [[SPL_services#GetConfig|IsDebugMode]] is non-zero. Error 0x4201 is returned otherwise.&lt;br /&gt;
* svcBreakDebugProcess&lt;br /&gt;
* svcContinueDebugEvent&lt;br /&gt;
* svcWriteDebugProcessMemory&lt;br /&gt;
* svcSetDebugThreadContext&lt;br /&gt;
* svcTerminateDebugProcess&lt;br /&gt;
* svcSetHardwareBreakPoint&lt;br /&gt;
&lt;br /&gt;
svcDebugActiveProcess stops execution of the target process, the normal method for resuming it requires svcContinueDebugEvent(see above). Closing the debug handle also results in execution being resumed.&lt;br /&gt;
&lt;br /&gt;
= Structures =&lt;br /&gt;
== DeviceName ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || DeviceName_AFI&lt;br /&gt;
|-&lt;br /&gt;
| 1 || DeviceName_AVPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DeviceName_DC&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DeviceName_DCB&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeviceName_HC&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeviceName_HDA&lt;br /&gt;
|-&lt;br /&gt;
| 6 || DeviceName_ISP2&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeviceName_MSENCNVENC&lt;br /&gt;
|-&lt;br /&gt;
| 8 || DeviceName_NV&lt;br /&gt;
|-&lt;br /&gt;
| 9 || DeviceName_NV2&lt;br /&gt;
|-&lt;br /&gt;
| 10 || DeviceName_PPCS&lt;br /&gt;
|-&lt;br /&gt;
| 11 || DeviceName_SATA&lt;br /&gt;
|-&lt;br /&gt;
| 12 || DeviceName_VI&lt;br /&gt;
|-&lt;br /&gt;
| 13 || DeviceName_VIC&lt;br /&gt;
|-&lt;br /&gt;
| 14 || DeviceName_XUSB_HOST&lt;br /&gt;
|-&lt;br /&gt;
| 15 || DeviceName_XUSB_DEV&lt;br /&gt;
|-&lt;br /&gt;
| 16 || DeviceName_TSEC&lt;br /&gt;
|-&lt;br /&gt;
| 17 || DeviceName_PPCS1&lt;br /&gt;
|-&lt;br /&gt;
| 18 || DeviceName_DC1&lt;br /&gt;
|-&lt;br /&gt;
| 19 || DeviceName_SDMMC1A&lt;br /&gt;
|-&lt;br /&gt;
| 20 || DeviceName_SDMMC2A&lt;br /&gt;
|-&lt;br /&gt;
| 21 || DeviceName_SDMMC3A&lt;br /&gt;
|-&lt;br /&gt;
| 22 || DeviceName_SDMMC4A&lt;br /&gt;
|-&lt;br /&gt;
| 23 || DeviceName_ISP2B&lt;br /&gt;
|-&lt;br /&gt;
| 24 || DeviceName_GPU&lt;br /&gt;
|-&lt;br /&gt;
| 25 || DeviceName_GPUB&lt;br /&gt;
|-&lt;br /&gt;
| 26 || DeviceName_PPCS2&lt;br /&gt;
|-&lt;br /&gt;
| 27 || DeviceName_NVDEC&lt;br /&gt;
|-&lt;br /&gt;
| 28 || DeviceName_APE&lt;br /&gt;
|-&lt;br /&gt;
| 29 || DeviceName_SE&lt;br /&gt;
|-&lt;br /&gt;
| 30 || DeviceName_NVJPG&lt;br /&gt;
|-&lt;br /&gt;
| 31 || DeviceName_HC1&lt;br /&gt;
|-&lt;br /&gt;
| 32 || DeviceName_SE1&lt;br /&gt;
|-&lt;br /&gt;
| 33 || DeviceName_AXIAP&lt;br /&gt;
|-&lt;br /&gt;
| 34 || DeviceName_ETR&lt;br /&gt;
|-&lt;br /&gt;
| 35 || DeviceName_TSECB&lt;br /&gt;
|-&lt;br /&gt;
| 36 || DeviceName_TSEC1&lt;br /&gt;
|-&lt;br /&gt;
| 37 || DeviceName_TSECB1&lt;br /&gt;
|-&lt;br /&gt;
| 38 || DeviceName_NVDEC1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LimitableResource ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || LimitableResource_Memory&lt;br /&gt;
|-&lt;br /&gt;
| 1 || LimitableResource_Threads&lt;br /&gt;
|-&lt;br /&gt;
| 2 || LimitableResource_Events&lt;br /&gt;
|-&lt;br /&gt;
| 3 || LimitableResource_TransferMemories&lt;br /&gt;
|-&lt;br /&gt;
| 4 || LimitableResource_Sessions&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateProcessInfo ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 12 || || ProcessName (doesn&#039;t have to be null-terminated)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 4 || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 8 || || TitleId&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 8 || || CodeAddr&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 4 || || CodeNumPages&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 4 || || MmuFlags&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit0 || Is64bit&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit3-1 || [[#AddressSpaceType]]&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit4 ||&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit5 || EnableAslr&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit6 || IsSystem&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 4 || || ResourceLimitHandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 4 ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== AddressSpaceType ===&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Type || Name || Width || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Normal_32Bit || 32 ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Normal_36Bit || 36 ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || WithoutMap_32Bit || 32 || Appears to be missing map region [?]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [2.0.0+] Normal_39Bit || 39 ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryInfo ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 8 || BaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 8 || Size&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 4 || MemoryType: lower 8 bits of [[#MemoryState]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || 4 || [[#MemoryAttribute]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 4 || Permission (bit0: R, bit1: W, bit2: X)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || 4 || DeviceRefCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 4 || IpcRefCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 4 || Padding: always zero&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryAttribute ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IsBorrowed&lt;br /&gt;
|-&lt;br /&gt;
| 1 || IsIpcMapped: when IpcRefCount &amp;gt; 0.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || IsDeviceMapped: when DeviceRefCount &amp;gt; 0.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || IsUncached&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryState ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 7-0 || Type&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#svcSetMemoryPermission|PermissionChangeAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || IsUserWritable [?]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || IpcSendAllowed_Type0&lt;br /&gt;
|-&lt;br /&gt;
| 11 || IpcSendAllowed_Type3&lt;br /&gt;
|-&lt;br /&gt;
| 12 || IpcSendAllowed_Type1&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#svcSetProcessMemoryPermission|ProcessPermissionChangeAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [[#svcMapMemory|MapAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [[#svcUnmapProcessCodeMemory|UnmapProcessCodeMemoryAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [[#svcCreateTransferMemory|TransferMemoryAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 19 || MapDeviceAllowed ([[#svcMapDeviceAddressSpace]] and [[#svcMapDeviceAddressSpaceByForce]])&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#svcMapDeviceAddressSpaceAligned|MapDeviceAlignedAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#svcSendSyncRequestWithUserBuffer|IpcBufferAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || IsPoolAllocated/IsReferenceCounted&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [[#svcMapProcessMemory|MapProcessAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [[#svcSetMemoryAttribute|AttributeChangeAllowed]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Type || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00000000&amp;lt;/code&amp;gt; || Unmapped ||&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00002001&amp;lt;/code&amp;gt; || IO || Mapped by kernel capability parsing in [[#svcCreateProcess]]. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00042002&amp;lt;/code&amp;gt; || Normal || Mapped by kernel capability parsing in [[#svcCreateProcess]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00DC7E03&amp;lt;/code&amp;gt; || Code static || Mapped during [[#svcCreateProcess]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x01FEBD04&amp;lt;/code&amp;gt; || Code || Transition from 0xDC7E03 performed by [[#svcSetProcessMemoryPermission]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x017EBD05&amp;lt;/code&amp;gt; || Heap || Mapped using [[#svcSetHeapSize]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00402006&amp;lt;/code&amp;gt; || Shared memory block || Mapped using [[#svcMapSharedMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00482907&amp;lt;/code&amp;gt; || [1.0.0] Weird mapped memory || Mapped using [[#svcMapMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00DD7E08&amp;lt;/code&amp;gt; || Module code static || Mapped using [[#svcMapProcessCodeMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x01FFBD09&amp;lt;/code&amp;gt; || Module code mutable || Transition from 0xDD7E08 performed by [[#svcSetProcessMemoryPermission]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C3C0A&amp;lt;/code&amp;gt; || [[IPC_Marshalling|IPC]] buffers || IPC buffers with descriptor flags=0.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C3C0B&amp;lt;/code&amp;gt; || Mapped memory || Mapped using [[#svcMapMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x0040200C&amp;lt;/code&amp;gt; || [[Thread Local Storage|Thread local storage]] || Mapped during [[#svcCreateThread]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x015C3C0D&amp;lt;/code&amp;gt; || Isolated transfer memory || Mapped using [[#svcMapTransferMemory]] when the owning process has perm=0.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C380E&amp;lt;/code&amp;gt; || Transfer memory || Mapped using [[#svcMapTransferMemory]] when the owning process has perm!=0.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x0040380F&amp;lt;/code&amp;gt; || Process memory || Mapped using [[#svcMapProcessMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00000010&amp;lt;/code&amp;gt; || Reserved ||&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C3811&amp;lt;/code&amp;gt; || [[IPC_Marshalling|IPC]] buffers || IPC buffers with descriptor flags=1.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x004C2812&amp;lt;/code&amp;gt; || [[IPC_Marshalling|IPC]] buffers || IPC buffers with descriptor flags=3.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00002013&amp;lt;/code&amp;gt; || Kernel per-thread stack || Mapped in kernel during [[#svcCreateThread]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Exception handling =&lt;br /&gt;
There is userland code for handling exceptions, however this doesn&#039;t seem to be executed on retail mode.&lt;br /&gt;
&lt;br /&gt;
When a usermode exception occurs, it jumps to the main code binary entrypoint (main_binary_address + 0 == &#039;&#039;&#039;_start&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
During normal boot &#039;&#039;&#039;_start&#039;&#039;&#039; is invoked with X0=0 and X1=main_thread_handle (triggering normal crt0 setup).&lt;br /&gt;
During an usermode exception &#039;&#039;&#039;_start&#039;&#039;&#039; is invoked with X0=exception_info0_ptr and X1=exception_info1_ptr instead.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;_start&#039;&#039;&#039; method determines whether to boot normally or handle an exception if X0 is set to 0 or not.&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=SVC&amp;diff=2788</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=SVC&amp;diff=2788"/>
		<updated>2017-10-13T22:11:03Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&lt;br /&gt;
= System calls =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
|  0x1 || [[#svcSetHeapSize]] || W1=size || W0=result, X1=outaddr&lt;br /&gt;
|-&lt;br /&gt;
|  0x2 || [[#svcSetMemoryPermission]] || X0=addr, X1=size, W2=prot || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x3 || [[#svcSetMemoryAttribute]] || X0=addr, X1=size, W2=state0, W3=state1 || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x4 || [[#svcMapMemory]] || X0=dstaddr, X1=srcaddr, X2=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x5 || [[#svcUnmapMemory]] || X0=dstaddr, X1=srcaddr, X2=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x6 || [[#svcQueryMemory]] || X0=MemoryInfo*, X2=addr || W0=result, W1=PageInfo                                                         &lt;br /&gt;
|-&lt;br /&gt;
|  0x7 || [[#svcExitProcess]] || None ||&lt;br /&gt;
|-&lt;br /&gt;
|  0x8 || [[#svcCreateThread]] || X1=entry, X2=arg, X3=stacktop, W4=prio, W5=processor_id  || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
|  0x9 || [[#svcStartThread]] || W0=thread_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0xA || [[#svcExitThread]] || None ||                                                         &lt;br /&gt;
|-&lt;br /&gt;
|  0xB || [[#svcSleepThread]] || X0=nano || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0xC || [[#svcGetThreadPriority]] || W1=thread_handle || W0=result, W1=prio&lt;br /&gt;
|-&lt;br /&gt;
|  0xD || [[#svcSetThreadPriority]] || W0=thread_handle, W1=prio || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0xE || [[#svcGetThreadCoreMask]] || W2=thread_handle || W0=result, W1=out, X2=out&lt;br /&gt;
|-&lt;br /&gt;
|  0xF || [[#svcSetThreadCoreMask]] || W0=thread_handle, W1=in, X2=in2 || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || [[#svcGetCurrentProcessorNumber]] || None || W0/X0=cpuid&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 || svcSignalEvent || W0=wevent_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || svcClearEvent || W0=wevent_or_revent_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || [[#svcMapSharedMemory]] || W0=memblk_handle, X1=addr, X2=size, W3=perm || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || svcUnmapSharedMemory || W0=memblk_handle, X1=addr, X2=size || W0=result                                                 &lt;br /&gt;
|-&lt;br /&gt;
| 0x15 || [[#svcCreateTransferMemory]] || X1=addr, X2=size, W3=perm || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || svcCloseHandle || W0=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 || svcResetSignal || W0=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || [[#svcWaitSynchronization]] || X1=handles_ptr, W2=num_handles. X3=timeout || W0=result, W1=handle_idx&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 || svcCancelSynchronization || W0=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A || svcArbitrateLock || W0=cur_thread_handle, X1=ptr, W2=req_thread_handle ||                                     &lt;br /&gt;
|-&lt;br /&gt;
| 0x1B || svcArbitrateUnlock || X0=ptr ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || svcWaitProcessWideKeyAtomic || X0=ptr0, X1=ptr, W2=thread_handle, X3=timeout || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D || svcSignalProcessWideKey || X0=ptr, W1=value || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E || svcGetSystemTick ||  || X0={value of cntpct_el0}&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F || svcConnectToNamedPort || X1=port_name_str || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || svcSendSyncRequestLight ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || svcSendSyncRequest || X0=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 || [[#svcSendSyncRequestWithUserBuffer]] || X0=cmdbufptr, X1=size, X2=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 || svcSendAsyncRequestWithUserBuffer ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || svcGetProcessId ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x25 || svcGetThreadId || W0=thread_handle || W0=result, X1=out&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 || svcBreak || X0,X1,X2=info || ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 || svcOutputDebugString || X0=str, X1=size || &lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || svcReturnFromException || X0=result || &lt;br /&gt;
|-&lt;br /&gt;
| 0x29 || [[#svcGetInfo]] || X1=info_id, X2=handle, X3=info_sub_id || W0=result, X1=out&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A || svcFlushEntireDataCache ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x2B || svcFlushDataCache ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || [3.0.0+] svcMapPhysicalMemory ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D || [3.0.0+] svcUnmapPhysicalMemory||  ||&lt;br /&gt;
|-&lt;br /&gt;
| .... || ? || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F || svcGetLastThreadInfo ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || svcGetResourceLimitLimitValue ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x31 || svcGetResourceLimitCurrentValue ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || svcSetThreadActivity ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x33 || svcGetThreadContext3 ||  || &lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x3C || svcDumpInfo ||  || &lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x40 || svcCreateSession || W2=?, X3=? || W0=result, W1=client_handle, W2=server_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x41 || svcAcceptSession || W1=port_handle || W0=result, W1=session_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x42 || svcReplyAndReceiveLight ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x43 || svcReplyAndReceive || X1=ptr_handles, W2=num_handles, X3=replytarget_handle(0=none), X4=timeout || W0=result, W1=handle_idx&lt;br /&gt;
|-&lt;br /&gt;
| 0x44 || svcReplyAndReceiveWithUserBuffer|| X1=buf, X2=sz, X3=ptr_handles, W4=num_handles, X5=replytarget_handle(0=none), X6=timeout || W0=result, W1=handle_idx&lt;br /&gt;
|-&lt;br /&gt;
| 0x45 || svcCreateEvent || None || W0=result, W1=client_handle ?, W2=server_handle ?&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x4D || svcSleepSystem ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x4E || [[#svcReadWriteRegister]] || X1=reg_addr, W2=rw_mask, W3=in_val || W0=result, W1=out_val&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F || svcSetProcessActivity ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x50 || [[#svcCreateSharedMemory]] || W1=size?, W2=myperm, W3=otherperm || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 || [[#svcMapTransferMemory]] || X0=mirror_handle, X1=addr, X2=size, W3=perm || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 || [[#svcUnmapTransferMemory]] || W0=mirror_handle, X1=addr, X2=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 || svcCreateInterruptEvent || X1=irq_id, W2=flag || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 || [[#svcQueryPhysicalAddress]] ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x55 || [[#svcQueryIoMapping]] || X1=physaddr, X2=size || W0=result, X1=virtaddr&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 || [[#svcCreateDeviceAddressSpace]] || X1=dev_as_start_addr, X2=dev_as_end_addr || W0=result, W1=dev_as_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 || [[#svcAttachDeviceAddressSpace]] || W0=device, X1=dev_as_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x58 || [[#svcDetachDeviceAddressSpace]] || W0=device, X1=dev_as_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x59 || [[#svcMapDeviceAddressSpaceByForce]] || W0=dev_as_handle, W1=proc_handle, X2=dev_map_addr, X3=dev_as_size, X4=dev_as_addr, W5=perm || W0=result &lt;br /&gt;
|-&lt;br /&gt;
| 0x5A || [[#svcMapDeviceAddressSpaceAligned]] || W0=dev_as_handle, W1=proc_handle, X2=dev_map_addr, X3=dev_as_size, X4=dev_as_addr, W5=perm || W0=result &lt;br /&gt;
|-&lt;br /&gt;
| 0x5B || svcMapDeviceAddressSpace || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x5C || [[#svcUnmapDeviceAddressSpace]] || W0=dev_as_handle, W1=proc_handle, X2=dev_map_addr, X3=dev_as_size, X4=dev_as_addr || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x5D || svcInvalidateProcessDataCache || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x5E || svcStoreProcessDataCache || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x5F || svcFlushProcessDataCache || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || svcDebugActiveProcess || X1=processID || W0=result, W1=out_debughandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 || svcBreakDebugProcess || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x62 || svcTerminateDebugProcess || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x63 || svcGetDebugEvent || X0=DebugEventInfo*, W1=debughandle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 || svcContinueDebugEvent || W0=debughandle, W1=flags, X2=? || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 || svcGetProcessList || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x66 || svcGetThreadList || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x67 || svcGetDebugThreadContext || X0=ThreadContext*, X1=debughandle, X2=?, W3=? || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || svcSetDebugThreadContext || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x69 || svcQueryDebugProcessMemory || X0=[[#MemoryInfo]]*, X2=debug_handle, X3=addr || W0=result, W1=PageInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A || svcReadDebugProcessMemory || X0=buffer*, X1=debug_handle, X2=src_addr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B || svcWriteDebugProcessMemory || X0=debug_handle, X1=buffer*, X2=dst_addr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C || svcSetHardwareBreakPoint || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x6D || svcGetDebugThreadParam || X2=debug_handle, X3=thread_id, W4=DebugThreadParam || W0=result, X1=out0, W2=out1&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x70 || svcCreatePort || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x71 || svcManageNamedPort || X1=name_ptr, W2=max_sessions(?) || W0=result, W1=serverport_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x72 || svcConnectToPort || W1=clientport_handle || W0=result, W1=session_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x73 || svcSetProcessMemoryPermission || X0=addr, X1=size, W2=perm || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x74 || [[#svcMapProcessMemory]] || X0=srcaddr, W1=process_handle, X2=dstaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x75 || [[#svcUnmapProcessMemory]] || W0=process_handle, X1=dstaddr, X2=srcaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x76 || [[#svcQueryProcessMemory]] || X0=meminfo_ptr, W2=process_handle, X3=addr || W0=result, W1=pageinfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x77 || [[#svcMapProcessCodeMemory]] || W0=process_handle, X2=dstaddr, X2=srcaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x78 || [[#svcUnmapProcessCodeMemory]] || W0=process_handle, X1=dstaddr, X2=srcaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x79 || [[#svcCreateProcess]] || X1=procinfo_ptr, X2=caps_ptr, W3=cap_num ||  W0=result, W1=process_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A || svcStartProcess || W0=process_handle, W1=main_thread_prio, W2=default_cpuid, W3=main_thread_stacksz || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x7B || svcTerminateProcess || W0=process_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C || [[#svcGetProcessInfo]] || W0=process_handle || W0=result, X1=[[#ProcessState]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D || svcCreateResourceLimit || None || W0=result, W1=reslimit_handle &lt;br /&gt;
|-&lt;br /&gt;
| 0x7E || svcSetResourceLimitLimitValue || W0=reslimit_handle, W1=[[#LimitableResource]], X2=value || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x7F || svcCallSecureMonitor || || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== svcSetHeapSize ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || u64 || &amp;lt;code&amp;gt;OutAddr&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Set the process heap to a given &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;. It can both extend and shrink the heap.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt; must be a multiple of 0x2000000.&lt;br /&gt;
&lt;br /&gt;
On success, the heap base-address (which is fixed by kernel, aslr&#039;d) is written to &amp;lt;code&amp;gt;OutAddr&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt; must be less than 0x18000000.&lt;br /&gt;
&lt;br /&gt;
== svcSetMemoryPermission ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Change permission of page-aligned memory region.&lt;br /&gt;
&lt;br /&gt;
Bit2 of permission (exec) is not allowed. Setting write-only is not allowed either (bit1).&lt;br /&gt;
&lt;br /&gt;
This can be used to move back and forth between ---, r-- and rw-.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;Prot&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcSetMemoryAttribute ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Change attribute of page-aligned memory region. &lt;br /&gt;
&lt;br /&gt;
This is used to turn on/off caching for a given memory area. Useful when talking to devices such as the GPU.&lt;br /&gt;
&lt;br /&gt;
What happens &amp;quot;under the hood&amp;quot; is the &amp;quot;Memory Attribute Indirection Register&amp;quot; index is changed from 2 to 3 in the MMU descriptor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W2 || u64 || &amp;lt;code&amp;gt;State0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W3 || u64 || &amp;lt;code&amp;gt;State1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! State0 || State1 || Action&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || Clear bit3 in [[#MemoryAttribute]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 0 || Clear bit3 in [[#MemoryAttribute]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 8 || Set bit3 in [[#MemoryAttribute]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== svcMapMemory ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Maps a memory range into a different range.&lt;br /&gt;
&lt;br /&gt;
Mainly used for adding guard pages around stack.&lt;br /&gt;
&lt;br /&gt;
Source range gets reprotected to --- (it can no longer be accessed), and bit0 is set in the source [[#MemoryAttribute]].&lt;br /&gt;
&lt;br /&gt;
If dstaddr &amp;gt;= LowerTreshold, the dst-range is enforced to be within the process&#039; &amp;quot;MapRegion&amp;quot;. Code can get the range of this region from [[#svcGetInfo]] id0=2,3.&lt;br /&gt;
&lt;br /&gt;
In this case, the mapped memory will have state &amp;lt;code&amp;gt;0x5C3C0B&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As long as (dstaddr+size) &amp;lt; LowerThreshold, then you can map anywhere but the mapped memory will have state &amp;lt;code&amp;gt;0x482907&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
LowerTreshold is 0x80000000 for 36-bit address spaces, and 0x40000000 for 32-bit ones.&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] Support for the &amp;lt;code&amp;gt;0x482907&amp;lt;/code&amp;gt; mappings outside the &amp;quot;MapRegion&amp;quot; were removed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Dst&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Src&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcUnmapMemory ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Unmaps a region that was previously mapped with [[#svcMapMemory]].&lt;br /&gt;
&lt;br /&gt;
It&#039;s possible to unmap ranges partially, you don&#039;t need to unmap the entire range &amp;quot;in one go&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The srcaddr/dstaddr must match what was given when the pages were originally mapped.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Dst&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Src&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcQueryMemory ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Query information about an address. Will always fetch the lowest page-aligned mapping that contains the provided address.&lt;br /&gt;
&lt;br /&gt;
Outputs a [[#MemoryInfo]] struct.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || MemoryInfo*|| &amp;lt;code&amp;gt;Mem Info&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Addr&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || PageInfo || &amp;lt;code&amp;gt;Page Info&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcExitProcess ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Exits the current process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcCreateThread ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Create a thread in the current process.&lt;br /&gt;
&lt;br /&gt;
Processor_id must be 0,1,2,3 or -2, where -2 uses the default cpuid for process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X1 || u64 || &amp;lt;code&amp;gt;Entry&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X2 || u64 || &amp;lt;code&amp;gt;Arg&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) X3 || u64 || &amp;lt;code&amp;gt;Stack Top&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W4 || u64 || &amp;lt;code&amp;gt;Priority&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (In) W5 || u64 || &amp;lt;code&amp;gt;Processor ID&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W1 || Handle || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcStartThread ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Starts the thread for the provided handle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) W0|| u64 || &amp;lt;code&amp;gt;Handle&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) None ||  ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcExitThread ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Exits the current thread.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) None || ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcSleepThread ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Sleep for a specified amount of time, or yield thread.&lt;br /&gt;
&lt;br /&gt;
Setting nano=0 means &amp;quot;yield thread&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== svcGetThreadPriority ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Get priority of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== svcSetThreadPriority ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Set priority of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
Priority is a number 0-0x3F. Lower value means higher priority.&lt;br /&gt;
&lt;br /&gt;
== svcGetThreadCoreMask ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Get affinity mask of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== svcSetThreadCoreMask ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Set affinity mask of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== svcGetCurrentProcessorNumber ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Get which cpu is executing the current thread.&lt;br /&gt;
&lt;br /&gt;
Cpu-id is an integer in the range 0-3.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) None || || &lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0/X0 || u64 || &amp;lt;code&amp;gt;CPU ID&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== svcMapSharedMemory ==&lt;br /&gt;
Maps the block supplied by the handle. The required permissions are different for the process that created the handle and all other processes.&lt;br /&gt;
&lt;br /&gt;
Increases reference count for the KSharedMemory object. Thus in order to release the memory associated with the object, all handles to it must be closed and all mappings must be unmapped.&lt;br /&gt;
&lt;br /&gt;
== svcCreateTransferMemory ==&lt;br /&gt;
This one reprotects the src block with perms you give it. It also sets bit0 into [[#MemoryAttribute]].&lt;br /&gt;
&lt;br /&gt;
Executable bit perm not allowed.&lt;br /&gt;
&lt;br /&gt;
Closing all handles automatically causes the bit0 in [[#MemoryAttribute]] to clear, and the permission to reset.&lt;br /&gt;
&lt;br /&gt;
== svcWaitSynchronization ==&lt;br /&gt;
Works with num_handles &amp;lt;= 0x40, error on num_handles == 0.&lt;br /&gt;
&lt;br /&gt;
Does not accept 0xFFFF8001 or 0xFFFF8000 as handles.&lt;br /&gt;
&lt;br /&gt;
== svcSendSyncRequestWithUserBuffer ==&lt;br /&gt;
Size must be 0x1000-aligned.&lt;br /&gt;
&lt;br /&gt;
== svcBreak ==&lt;br /&gt;
When used on retail where inx0 bit31 is clear, the system will throw a [[Error_codes|fatal-error]]. Otherwise when bit31 is set, it will return 0.&lt;br /&gt;
&lt;br /&gt;
== svcGetInfo ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Handle type || Id0 || Id1 || Description&lt;br /&gt;
|-&lt;br /&gt;
| Process || 0 || 0 || AllowedCpuIdBitmask&lt;br /&gt;
|-&lt;br /&gt;
| Process || 1 || 0 || AllowedThreadPrioBitmask&lt;br /&gt;
|-&lt;br /&gt;
| Process || 2 || 0 || ReservedMapRegionBaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 3 || 0 || ReservedMapRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 4 || 0 || ReservedHeapRegionBaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 5 || 0 || ReservedHeapRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 6 || 0 || TotalMemoryUsage&lt;br /&gt;
|-&lt;br /&gt;
| Process || 7 || 0 || TotalHeapUsage&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 8 || 0 || IsCurrentProcessBeingDebugged&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 9 || 0 || Returns ResourceLimit handle for current process. Used by [[Process_Manager_services|PM]].&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 10 || -1, {current coreid} || Unknown. Output data changes each time this SVC is used. Global and core-specific tick-count?&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 11 || 0-3 || RandomEntropy from current process. TRNG. Used to seed usermode PRNGs.&lt;br /&gt;
|-&lt;br /&gt;
| Process || 12 || 0 || [2.0.0+] AddressSpaceStart&lt;br /&gt;
|-&lt;br /&gt;
| Process || 13 || 0 || [2.0.0+] AddressSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 14 || 0 || [2.0.0+] NewReservedRegionStartAddr&lt;br /&gt;
|-&lt;br /&gt;
| Process || 15 || 0 || [2.0.0+] NewReservedRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 18 || 0 || [3.0.0+] Title-id.&lt;br /&gt;
|-&lt;br /&gt;
| Thread || 0xF0000002 || 0 || Performance counter related.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== svcDumpInfo ==&lt;br /&gt;
Does nothing, just returns with registers set to all-zero.&lt;br /&gt;
&lt;br /&gt;
== svcReadWriteRegister ==&lt;br /&gt;
Read/write IO registers with a hardcoded whitelist. Input address is physical-address and must be aligned to 4.&lt;br /&gt;
&lt;br /&gt;
rw_mask is 0 for reading and 0xffffffff for writing. You can also write individual bits by using a mask value.&lt;br /&gt;
&lt;br /&gt;
You can only write to registers inside physical pages 0x70019000 (MC), 0x7001C000 (MC0), 0x7001D000 (MC1), and they all share the same whitelist.&lt;br /&gt;
&lt;br /&gt;
The whitelist is same for writing as for reading.&lt;br /&gt;
&lt;br /&gt;
The whitelist is:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
0x054, 0x090, 0x094, 0x098, 0x09c, 0x0a0, 0x0a4, 0x0a8, 0x0ac, 0x0b0, 0x0b4, 0x0b8, 0x0bc, 0x0c0, 0x0c4, 0x0c8, 0x0d0, 0x0d4, 0x0d8, 0x0dc, 0x0e0, 0x100, 0x108, 0x10c, 0x118, 0x11c, 0x124, 0x128, 0x12c, 0x130, 0x134, 0x138, 0x13c, 0x158, 0x15c, 0x164, 0x168, 0x16c, 0x170, 0x174, 0x178, 0x17c, 0x200, 0x204, 0x2e4, 0x2e8, 0x2ec, 0x2f4, 0x2f8, 0x310, 0x314, 0x320, 0x328, 0x344, 0x348, 0x370, 0x374, 0x37c, 0x380, 0x390, 0x394, 0x398, 0x3ac, 0x3b8, 0x3bc, 0x3c0, 0x3c4, 0x3d8, 0x3e8, 0x41c, 0x420, 0x424, 0x428, 0x42c, 0x430, 0x44c, 0x47c, 0x480, 0x484, 0x50c, 0x554, 0x558, 0x55c, 0x670, 0x674, 0x690, 0x694, 0x698, 0x69c, 0x6a0, 0x6a4, 0x6c0, 0x6c4, 0x6f0, 0x6f4, 0x960, 0x970, 0x974, 0xa20, 0xa24, 0xb88, 0xb8c, 0xbc4, 0xbc8, 0xbcc, 0xbd0, 0xbd4, 0xbd8, 0xbdc, 0xbe0, 0xbe4, 0xbe8, 0xbec, 0xc00, 0xc5c, 0xcac&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] Whitelist was extended with &amp;lt;code&amp;gt;0x4c4, 0x4c8, 0x4cc, 0x584, 0x588, 0x58c.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] The IO registers in range 0x7000E400 (PMC) size 0xC00 skip the whitelist, and do a TrustZone call using [[SMC]] Id1 0xC3000008(ReadWriteRegister).&lt;br /&gt;
&lt;br /&gt;
== svcCreateSharedMemory ==&lt;br /&gt;
Other perm can be used to enforce permission 1, 3, or 0x10000000 if don&#039;t care.&lt;br /&gt;
&lt;br /&gt;
== svcMapTransferMemory ==&lt;br /&gt;
The newly mapped pages will have [[#MemoryState]] type 0xE.&lt;br /&gt;
&lt;br /&gt;
You must pass same size and permissions as given in svcCreateMemoryMirror, otherwise error.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapTransferMemory ==&lt;br /&gt;
Size must match size given in map syscall, otherwise there&#039;s an invalid-size error.&lt;br /&gt;
&lt;br /&gt;
== svcQueryPhysicalAddress ==&lt;br /&gt;
The inverse operation of [[#svcQueryIoMapping]].&lt;br /&gt;
&lt;br /&gt;
== svcQueryIoMapping ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Returns a virtual address mapped to a given IO range.&lt;br /&gt;
&lt;br /&gt;
== svcCreateDeviceAddressSpace ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Creates a virtual address space for binding device address spaces and returns a handle.&lt;br /&gt;
&lt;br /&gt;
dev_as_start_addr is normally set to 0 and dev_as_end_addr is normally set to 0xFFFFFFFF.&lt;br /&gt;
&lt;br /&gt;
== svcAttachDeviceAddressSpace ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Attaches a device address space to a [[#DeviceName|device]].&lt;br /&gt;
&lt;br /&gt;
== svcDetachDeviceAddressSpace ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Detaches a device address space from a [[#DeviceName|device]].&lt;br /&gt;
&lt;br /&gt;
== svcMapDeviceAddressSpaceByForce ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Maps an attached device address space to an userspace address.&lt;br /&gt;
&lt;br /&gt;
dev_map_addr is the userspace destination address, while dev_as_addr is the source address between dev_as_start_addr and dev_as_end_addr (passed to [[#svcCreateDeviceAddressSpace]]).&lt;br /&gt;
&lt;br /&gt;
The userspace destination address must have the [[SVC#MemoryState|MapDeviceAllowed]] bit set. Bit [[SVC#MemoryAttribute|IsDeviceMapped]] will be set after mapping.&lt;br /&gt;
&lt;br /&gt;
== svcMapDeviceAddressSpaceAligned ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Maps an attached device address space to an userspace address.&lt;br /&gt;
&lt;br /&gt;
Same as [[#svcMapDeviceAddressSpaceByForce]], but the userspace destination address must have the [[SVC#MemoryState|MapDeviceAlignedAllowed]] bit set instead.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapDeviceAddressSpace ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Unmaps an attached device address space from an userspace address.&lt;br /&gt;
&lt;br /&gt;
== svcMapProcessMemory ==&lt;br /&gt;
Maps the src address from the supplied process handle into the current process.&lt;br /&gt;
&lt;br /&gt;
This allows mapping code and rodata with RW- permission.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapProcessMemory ==&lt;br /&gt;
Unmaps what was mapped by [[#svcMapProcessMemory]].&lt;br /&gt;
&lt;br /&gt;
== svcQueryProcessMemory ==&lt;br /&gt;
Equivalent to [[#svcQueryMemory]] except takes a process handle.&lt;br /&gt;
&lt;br /&gt;
== svcMapProcessCodeMemory ==&lt;br /&gt;
Takes a process handle, and maps normal heap in that process as executable code in that process. Used when loading NROs.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapProcessCodeMemory ==&lt;br /&gt;
Unmaps what was mapped by [[#svcMapProcessCodeMemory]].&lt;br /&gt;
&lt;br /&gt;
== svcCreateProcess ==&lt;br /&gt;
Takes a [[#CreateProcessInfo]] as input.&lt;br /&gt;
&lt;br /&gt;
== svcGetProcessInfo ==&lt;br /&gt;
Returns an enum with value 0-7.&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
[2.0.0+] Exactly 6 debug SVCs require that [[SPL_services#GetConfig|IsDebugMode]] is non-zero. Error 0x4201 is returned otherwise.&lt;br /&gt;
* svcBreakDebugProcess&lt;br /&gt;
* svcContinueDebugEvent&lt;br /&gt;
* svcWriteDebugProcessMemory&lt;br /&gt;
* svcSetDebugThreadContext&lt;br /&gt;
* svcTerminateDebugProcess&lt;br /&gt;
* svcSetHardwareBreakPoint&lt;br /&gt;
&lt;br /&gt;
svcDebugActiveProcess stops execution of the target process, the normal method for resuming it requires svcContinueDebugEvent(see above). Closing the debug handle also results in execution being resumed.&lt;br /&gt;
&lt;br /&gt;
= Structures =&lt;br /&gt;
== DeviceName ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || DeviceName_AFI&lt;br /&gt;
|-&lt;br /&gt;
| 1 || DeviceName_AVPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DeviceName_DC&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DeviceName_DCB&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeviceName_HC&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeviceName_HDA&lt;br /&gt;
|-&lt;br /&gt;
| 6 || DeviceName_ISP2&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeviceName_MSENCNVENC&lt;br /&gt;
|-&lt;br /&gt;
| 8 || DeviceName_NV&lt;br /&gt;
|-&lt;br /&gt;
| 9 || DeviceName_NV2&lt;br /&gt;
|-&lt;br /&gt;
| 10 || DeviceName_PPCS&lt;br /&gt;
|-&lt;br /&gt;
| 11 || DeviceName_SATA&lt;br /&gt;
|-&lt;br /&gt;
| 12 || DeviceName_VI&lt;br /&gt;
|-&lt;br /&gt;
| 13 || DeviceName_VIC&lt;br /&gt;
|-&lt;br /&gt;
| 14 || DeviceName_XUSB_HOST&lt;br /&gt;
|-&lt;br /&gt;
| 15 || DeviceName_XUSB_DEV&lt;br /&gt;
|-&lt;br /&gt;
| 16 || DeviceName_TSEC&lt;br /&gt;
|-&lt;br /&gt;
| 17 || DeviceName_PPCS1&lt;br /&gt;
|-&lt;br /&gt;
| 18 || DeviceName_DC1&lt;br /&gt;
|-&lt;br /&gt;
| 19 || DeviceName_SDMMC1A&lt;br /&gt;
|-&lt;br /&gt;
| 20 || DeviceName_SDMMC2A&lt;br /&gt;
|-&lt;br /&gt;
| 21 || DeviceName_SDMMC3A&lt;br /&gt;
|-&lt;br /&gt;
| 22 || DeviceName_SDMMC4A&lt;br /&gt;
|-&lt;br /&gt;
| 23 || DeviceName_ISP2B&lt;br /&gt;
|-&lt;br /&gt;
| 24 || DeviceName_GPU&lt;br /&gt;
|-&lt;br /&gt;
| 25 || DeviceName_GPUB&lt;br /&gt;
|-&lt;br /&gt;
| 26 || DeviceName_PPCS2&lt;br /&gt;
|-&lt;br /&gt;
| 27 || DeviceName_NVDEC&lt;br /&gt;
|-&lt;br /&gt;
| 28 || DeviceName_APE&lt;br /&gt;
|-&lt;br /&gt;
| 29 || DeviceName_SE&lt;br /&gt;
|-&lt;br /&gt;
| 30 || DeviceName_NVJPG&lt;br /&gt;
|-&lt;br /&gt;
| 31 || DeviceName_HC1&lt;br /&gt;
|-&lt;br /&gt;
| 32 || DeviceName_SE1&lt;br /&gt;
|-&lt;br /&gt;
| 33 || DeviceName_AXIAP&lt;br /&gt;
|-&lt;br /&gt;
| 34 || DeviceName_ETR&lt;br /&gt;
|-&lt;br /&gt;
| 35 || DeviceName_TSECB&lt;br /&gt;
|-&lt;br /&gt;
| 36 || DeviceName_TSEC1&lt;br /&gt;
|-&lt;br /&gt;
| 37 || DeviceName_TSECB1&lt;br /&gt;
|-&lt;br /&gt;
| 38 || DeviceName_NVDEC1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LimitableResource ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || LimitableResource_Memory&lt;br /&gt;
|-&lt;br /&gt;
| 1 || LimitableResource_Threads&lt;br /&gt;
|-&lt;br /&gt;
| 2 || LimitableResource_Events&lt;br /&gt;
|-&lt;br /&gt;
| 3 || LimitableResource_TransferMemories&lt;br /&gt;
|-&lt;br /&gt;
| 4 || LimitableResource_Sessions&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateProcessInfo ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 12 || || ProcessName (doesn&#039;t have to be null-terminated)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 4 || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 8 || || TitleId&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 8 || || CodeAddr&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 4 || || CodeNumPages&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 4 || || MmuFlags&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit0 || Is64bit&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit3-1 || [[#AddressSpaceType]]&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit4 ||&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit5 || EnableAslr&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit6 || IsSystem&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 4 || || ResourceLimitHandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 4 ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== AddressSpaceType ===&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Type || Name || Width || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Normal_32Bit || 32 ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Normal_36Bit || 36 ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || WithoutMap_32Bit || 32 || Appears to be missing map region [?]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [2.0.0+] Normal_39Bit || 39 ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryInfo ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 8 || BaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 8 || Size&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 4 || MemoryType: lower 8 bits of [[#MemoryState]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || 4 || [[#MemoryAttribute]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 4 || Permission (bit0: R, bit1: W, bit2: X)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || 4 || DeviceRefCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 4 || IpcRefCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 4 || Padding: always zero&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryAttribute ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IsBorrowed&lt;br /&gt;
|-&lt;br /&gt;
| 1 || IsIpcMapped: when IpcRefCount &amp;gt; 0.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || IsDeviceMapped: when DeviceRefCount &amp;gt; 0.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || IsUncached&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryState ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 7-0 || Type&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#svcSetMemoryPermission|PermissionChangeAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || IsUserWritable [?]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || IpcSendAllowed_Type0&lt;br /&gt;
|-&lt;br /&gt;
| 11 || IpcSendAllowed_Type3&lt;br /&gt;
|-&lt;br /&gt;
| 12 || IpcSendAllowed_Type1&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#svcSetProcessMemoryPermission|ProcessPermissionChangeAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [[#svcMapMemory|MapAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [[#svcUnmapProcessCodeMemory|UnmapProcessCodeMemoryAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [[#svcCreateTransferMemory|TransferMemoryAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 19 || MapDeviceAllowed ([[#svcMapDeviceAddressSpace]] and [[#svcMapDeviceAddressSpaceByForce]])&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#svcMapDeviceAddressSpaceAligned|MapDeviceAlignedAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#svcSendSyncRequestWithUserBuffer|IpcBufferAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || IsPoolAllocated/IsReferenceCounted&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [[#svcMapProcessMemory|MapProcessAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [[#svcSetMemoryAttribute|AttributeChangeAllowed]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Type || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00000000&amp;lt;/code&amp;gt; || Unmapped ||&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00002001&amp;lt;/code&amp;gt; || IO || Mapped by kernel capability parsing in [[#svcCreateProcess]]. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00042002&amp;lt;/code&amp;gt; || Normal || Mapped by kernel capability parsing in [[#svcCreateProcess]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00DC7E03&amp;lt;/code&amp;gt; || Code static || Mapped during [[#svcCreateProcess]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x01FEBD04&amp;lt;/code&amp;gt; || Code || Transition from 0xDC7E03 performed by [[#svcSetProcessMemoryPermission]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x017EBD05&amp;lt;/code&amp;gt; || Heap || Mapped using [[#svcSetHeapSize]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00402006&amp;lt;/code&amp;gt; || Shared memory block || Mapped using [[#svcMapSharedMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00482907&amp;lt;/code&amp;gt; || [1.0.0] Weird mapped memory || Mapped using [[#svcMapMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00DD7E08&amp;lt;/code&amp;gt; || Module code static || Mapped using [[#svcMapProcessCodeMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x01FFBD09&amp;lt;/code&amp;gt; || Module code mutable || Transition from 0xDD7E08 performed by [[#svcSetProcessMemoryPermission]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C3C0A&amp;lt;/code&amp;gt; || [[IPC_Marshalling|IPC]] buffers || IPC buffers with descriptor flags=0.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C3C0B&amp;lt;/code&amp;gt; || Mapped memory || Mapped using [[#svcMapMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x0040200C&amp;lt;/code&amp;gt; || [[Thread Local Storage|Thread local storage]] || Mapped during [[#svcCreateThread]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x015C3C0D&amp;lt;/code&amp;gt; || Isolated transfer memory || Mapped using [[#svcMapTransferMemory]] when the owning process has perm=0.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C380E&amp;lt;/code&amp;gt; || Transfer memory || Mapped using [[#svcMapTransferMemory]] when the owning process has perm!=0.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x0040380F&amp;lt;/code&amp;gt; || Process memory || Mapped using [[#svcMapProcessMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00000010&amp;lt;/code&amp;gt; || Reserved ||&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C3811&amp;lt;/code&amp;gt; || [[IPC_Marshalling|IPC]] buffers || IPC buffers with descriptor flags=1.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x004C2812&amp;lt;/code&amp;gt; || [[IPC_Marshalling|IPC]] buffers || IPC buffers with descriptor flags=3.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00002013&amp;lt;/code&amp;gt; || Kernel per-thread stack || Mapped in kernel during [[#svcCreateThread]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Exception handling =&lt;br /&gt;
There is userland code for handling exceptions, however this doesn&#039;t seem to be executed on retail mode.&lt;br /&gt;
&lt;br /&gt;
When a usermode exception occurs, it jumps to the main code binary entrypoint (main_binary_address + 0 == &#039;&#039;&#039;_start&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
During normal boot &#039;&#039;&#039;_start&#039;&#039;&#039; is invoked with X0=0 and X1=main_thread_handle (triggering normal crt0 setup).&lt;br /&gt;
During an usermode exception &#039;&#039;&#039;_start&#039;&#039;&#039; is invoked with X0=exception_info0_ptr and X1=exception_info1_ptr instead.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;_start&#039;&#039;&#039; method determines whether to boot normally or handle an exception if X0 is set to 0 or not.&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=SVC&amp;diff=2786</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=SVC&amp;diff=2786"/>
		<updated>2017-10-13T21:46:43Z</updated>

		<summary type="html">&lt;p&gt;Adubbz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&lt;br /&gt;
= System calls =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Id || Name || In || Out&lt;br /&gt;
|-&lt;br /&gt;
|  0x1 || [[#svcSetHeapSize]] || W1=size || W0=result, X1=outaddr&lt;br /&gt;
|-&lt;br /&gt;
|  0x2 || [[#svcSetMemoryPermission]] || X0=addr, X1=size, W2=prot || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x3 || [[#svcSetMemoryAttribute]] || X0=addr, X1=size, W2=state0, W3=state1 || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x4 || [[#svcMapMemory]] || X0=dstaddr, X1=srcaddr, X2=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x5 || [[#svcUnmapMemory]] || X0=dstaddr, X1=srcaddr, X2=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0x6 || [[#svcQueryMemory]] || X0=MemoryInfo*, X2=addr || W0=result, W1=PageInfo                                                         &lt;br /&gt;
|-&lt;br /&gt;
|  0x7 || [[#svcExitProcess]] || None ||&lt;br /&gt;
|-&lt;br /&gt;
|  0x8 || [[#svcCreateThread]] || X1=entry, X2=arg, X3=stacktop, W4=prio, W5=processor_id  || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
|  0x9 || [[#svcStartThread]] || W0=thread_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0xA || [[#svcExitThread]] || None ||                                                         &lt;br /&gt;
|-&lt;br /&gt;
|  0xB || [[#svcSleepThread]] || X0=nano || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0xC || [[#svcGetThreadPriority]] || W1=thread_handle || W0=result, W1=prio&lt;br /&gt;
|-&lt;br /&gt;
|  0xD || [[#svcSetThreadPriority]] || W0=thread_handle, W1=prio || W0=result&lt;br /&gt;
|-&lt;br /&gt;
|  0xE || [[#svcGetThreadCoreMask]] || W2=thread_handle || W0=result, W1=out, X2=out&lt;br /&gt;
|-&lt;br /&gt;
|  0xF || [[#svcSetThreadCoreMask]] || W0=thread_handle, W1=in, X2=in2 || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || [[#svcGetCurrentProcessorNumber]] || None || W0/X0=cpuid&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 || svcSignalEvent || W0=wevent_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || svcClearEvent || W0=wevent_or_revent_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || [[#svcMapSharedMemory]] || W0=memblk_handle, X1=addr, X2=size, W3=perm || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || svcUnmapSharedMemory || W0=memblk_handle, X1=addr, X2=size || W0=result                                                 &lt;br /&gt;
|-&lt;br /&gt;
| 0x15 || [[#svcCreateTransferMemory]] || X1=addr, X2=size, W3=perm || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || svcCloseHandle || W0=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 || svcResetSignal || W0=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || [[#svcWaitSynchronization]] || X1=handles_ptr, W2=num_handles. X3=timeout || W0=result, W1=handle_idx&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 || svcCancelSynchronization || W0=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A || svcArbitrateLock || W0=cur_thread_handle, X1=ptr, W2=req_thread_handle ||                                     &lt;br /&gt;
|-&lt;br /&gt;
| 0x1B || svcArbitrateUnlock || X0=ptr ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || svcWaitProcessWideKeyAtomic || X0=ptr0, X1=ptr, W2=thread_handle, X3=timeout || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D || svcSignalProcessWideKey || X0=ptr, W1=value || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E || svcGetSystemTick ||  || X0={value of cntpct_el0}&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F || svcConnectToNamedPort || X1=port_name_str || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || svcSendSyncRequestLight ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || svcSendSyncRequest || X0=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 || [[#svcSendSyncRequestWithUserBuffer]] || X0=cmdbufptr, X1=size, X2=handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 || svcSendAsyncRequestWithUserBuffer ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || svcGetProcessId ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x25 || svcGetThreadId || W0=thread_handle || W0=result, X1=out&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 || svcBreak || X0,X1,X2=info || ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 || svcOutputDebugString || X0=str, X1=size || &lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || svcReturnFromException || X0=result || &lt;br /&gt;
|-&lt;br /&gt;
| 0x29 || [[#svcGetInfo]] || X1=info_id, X2=handle, X3=info_sub_id || W0=result, X1=out&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A || svcFlushEntireDataCache ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x2B || svcFlushDataCache ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || [3.0.0+] svcMapPhysicalMemory ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D || [3.0.0+] svcUnmapPhysicalMemory||  ||&lt;br /&gt;
|-&lt;br /&gt;
| .... || ? || ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F || svcGetLastThreadInfo ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || svcGetResourceLimitLimitValue ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x31 || svcGetResourceLimitCurrentValue ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || svcSetThreadActivity ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x33 || svcGetThreadContext3 ||  || &lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x3C || svcDumpInfo ||  || &lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x40 || svcCreateSession || W2=?, X3=? || W0=result, W1=client_handle, W2=server_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x41 || svcAcceptSession || W1=port_handle || W0=result, W1=session_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x42 || svcReplyAndReceiveLight ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x43 || svcReplyAndReceive || X1=ptr_handles, W2=num_handles, X3=replytarget_handle(0=none), X4=timeout || W0=result, W1=handle_idx&lt;br /&gt;
|-&lt;br /&gt;
| 0x44 || svcReplyAndReceiveWithUserBuffer|| X1=buf, X2=sz, X3=ptr_handles, W4=num_handles, X5=replytarget_handle(0=none), X6=timeout || W0=result, W1=handle_idx&lt;br /&gt;
|-&lt;br /&gt;
| 0x45 || svcCreateEvent || None || W0=result, W1=client_handle ?, W2=server_handle ?&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x4D || svcSleepSystem ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x4E || [[#svcReadWriteRegister]] || X1=reg_addr, W2=rw_mask, W3=in_val || W0=result, W1=out_val&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F || svcSetProcessActivity ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x50 || [[#svcCreateSharedMemory]] || W1=size?, W2=myperm, W3=otherperm || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 || [[#svcMapTransferMemory]] || X0=mirror_handle, X1=addr, X2=size, W3=perm || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 || [[#svcUnmapTransferMemory]] || W0=mirror_handle, X1=addr, X2=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 || svcCreateInterruptEvent || X1=irq_id, W2=flag || W0=result, W1=handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 || [[#svcQueryPhysicalAddress]] ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x55 || [[#svcQueryIoMapping]] || X1=physaddr, X2=size || W0=result, X1=virtaddr&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 || [[#svcCreateDeviceAddressSpace]] || X1=dev_as_start_addr, X2=dev_as_end_addr || W0=result, W1=dev_as_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 || [[#svcAttachDeviceAddressSpace]] || W0=device, X1=dev_as_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x58 || [[#svcDetachDeviceAddressSpace]] || W0=device, X1=dev_as_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x59 || [[#svcMapDeviceAddressSpaceByForce]] || W0=dev_as_handle, W1=proc_handle, X2=dev_map_addr, X3=dev_as_size, X4=dev_as_addr, W5=perm || W0=result &lt;br /&gt;
|-&lt;br /&gt;
| 0x5A || [[#svcMapDeviceAddressSpaceAligned]] || W0=dev_as_handle, W1=proc_handle, X2=dev_map_addr, X3=dev_as_size, X4=dev_as_addr, W5=perm || W0=result &lt;br /&gt;
|-&lt;br /&gt;
| 0x5B || svcMapDeviceAddressSpace || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x5C || [[#svcUnmapDeviceAddressSpace]] || W0=dev_as_handle, W1=proc_handle, X2=dev_map_addr, X3=dev_as_size, X4=dev_as_addr || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x5D || svcInvalidateProcessDataCache || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x5E || svcStoreProcessDataCache || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x5F || svcFlushProcessDataCache || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || svcDebugActiveProcess || X1=processID || W0=result, W1=out_debughandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 || svcBreakDebugProcess || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x62 || svcTerminateDebugProcess || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x63 || svcGetDebugEvent || X0=DebugEventInfo*, W1=debughandle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 || svcContinueDebugEvent || W0=debughandle, W1=flags, X2=? || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 || svcGetProcessList || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x66 || svcGetThreadList || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x67 || svcGetDebugThreadContext || X0=ThreadContext*, X1=debughandle, X2=?, W3=? || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || svcSetDebugThreadContext || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x69 || svcQueryDebugProcessMemory || X0=MemoryInfo*, X2=debughandle, X3=addr || W0=result, W1=PageInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A || svcReadDebugProcessMemory || X0=buffer*, X1=debughandle, X2=src_addr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B || svcWriteDebugProcessMemory || X0=debughandle, X1=buffer*, X2=dst_addr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C || svcSetHardwareBreakPoint || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x6D || svcGetDebugThreadParam || X2=debughandle, X3=?, W4=DebugThreadParam || W0=result, X1=out0, W2=out1&lt;br /&gt;
|- style=&amp;quot;border-top: double&amp;quot;&lt;br /&gt;
| 0x70 || svcCreatePort || || &lt;br /&gt;
|-&lt;br /&gt;
| 0x71 || svcManageNamedPort || X1=name_ptr, W2=max_sessions(?) || W0=result, W1=serverport_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x72 || svcConnectToPort || W1=clientport_handle || W0=result, W1=session_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x73 || svcSetProcessMemoryPermission || X0=addr, X1=size, W2=perm || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x74 || [[#svcMapProcessMemory]] || X0=srcaddr, W1=process_handle, X2=dstaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x75 || [[#svcUnmapProcessMemory]] || W0=process_handle, X1=dstaddr, X2=srcaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x76 || [[#svcQueryProcessMemory]] || X0=meminfo_ptr, W2=process_handle, X3=addr || W0=result, W1=pageinfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x77 || [[#svcMapProcessCodeMemory]] || W0=process_handle, X2=dstaddr, X2=srcaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x78 || [[#svcUnmapProcessCodeMemory]] || W0=process_handle, X1=dstaddr, X2=srcaddr, X3=size || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x79 || [[#svcCreateProcess]] || X1=procinfo_ptr, X2=caps_ptr, W3=cap_num ||  W0=result, W1=process_handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A || svcStartProcess || W0=process_handle, W1=main_thread_prio, W2=default_cpuid, W3=main_thread_stacksz || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x7B || svcTerminateProcess || W0=process_handle || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C || [[#svcGetProcessInfo]] || W0=process_handle || W0=result, X1=[[#ProcessState]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D || svcCreateResourceLimit || None || W0=result, W1=reslimit_handle &lt;br /&gt;
|-&lt;br /&gt;
| 0x7E || svcSetResourceLimitLimitValue || W0=reslimit_handle, W1=[[#LimitableResource]], X2=value || W0=result&lt;br /&gt;
|-&lt;br /&gt;
| 0x7F || svcCallSecureMonitor || || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== svcSetHeapSize ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Argument || Type || Name&lt;br /&gt;
|-&lt;br /&gt;
| (In) X0 || u64 || &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) W0 || [[#Result]] || &amp;lt;code&amp;gt;Ret&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| (Out) X1 || u64 || &amp;lt;code&amp;gt;OutAddr&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Set the process heap to a given &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt;. It can both extend and shrink the heap.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt; must be a multiple of 0x2000000.&lt;br /&gt;
&lt;br /&gt;
On success, the heap base-address (which is fixed by kernel, aslr&#039;d) is written to &amp;lt;code&amp;gt;OutAddr&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] &amp;lt;code&amp;gt;Size&amp;lt;/code&amp;gt; must be less than 0x18000000.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== svcSetMemoryPermission ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Change permission of page-aligned memory region.&lt;br /&gt;
&lt;br /&gt;
Bit2 of permission (exec) is not allowed. Setting write-only is not allowed either (bit1).&lt;br /&gt;
&lt;br /&gt;
This can be used to move back and forth between ---, r-- and rw-.&lt;br /&gt;
&lt;br /&gt;
== svcSetMemoryAttribute ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Change attribute of page-aligned memory region. &lt;br /&gt;
&lt;br /&gt;
This is used to turn on/off caching for a given memory area. Useful when talking to devices such as the GPU.&lt;br /&gt;
&lt;br /&gt;
What happens &amp;quot;under the hood&amp;quot; is the &amp;quot;Memory Attribute Indirection Register&amp;quot; index is changed from 2 to 3 in the MMU descriptor.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! State0 || State1 || Action&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || Clear bit3 in [[#MemoryAttribute]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 0 || Clear bit3 in [[#MemoryAttribute]].&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 8 || Set bit3 in [[#MemoryAttribute]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== svcMapMemory ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Maps a memory range into a different range.&lt;br /&gt;
&lt;br /&gt;
Mainly used for adding guard pages around stack.&lt;br /&gt;
&lt;br /&gt;
Source range gets reprotected to --- (it can no longer be accessed), and bit0 is set in the source [[#MemoryAttribute]].&lt;br /&gt;
&lt;br /&gt;
If dstaddr &amp;gt;= LowerTreshold, the dst-range is enforced to be within the process&#039; &amp;quot;MapRegion&amp;quot;. Code can get the range of this region from [[#svcGetInfo]] id0=2,3.&lt;br /&gt;
&lt;br /&gt;
In this case, the mapped memory will have state &amp;lt;code&amp;gt;0x5C3C0B&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As long as (dstaddr+size) &amp;lt; LowerThreshold, then you can map anywhere but the mapped memory will have state &amp;lt;code&amp;gt;0x482907&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
LowerTreshold is 0x80000000 for 36-bit address spaces, and 0x40000000 for 32-bit ones.&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] Support for the &amp;lt;code&amp;gt;0x482907&amp;lt;/code&amp;gt; mappings outside the &amp;quot;MapRegion&amp;quot; were removed.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapMemory ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Unmaps a region that was previously mapped with [[#svcMapMemory]].&lt;br /&gt;
&lt;br /&gt;
It&#039;s possible to unmap ranges partially, you don&#039;t need to unmap the entire range &amp;quot;in one go&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The srcaddr/dstaddr must match what was given when the pages were originally mapped.&lt;br /&gt;
&lt;br /&gt;
== svcQueryMemory ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Query information about an address. Will always fetch the lowest page-aligned mapping that contains the provided address.&lt;br /&gt;
&lt;br /&gt;
Outputs a [[#MemoryInfo]] struct.&lt;br /&gt;
&lt;br /&gt;
== svcExitProcess ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Exits the current process.&lt;br /&gt;
&lt;br /&gt;
== svcCreateThread ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Create a thread in the current process.&lt;br /&gt;
&lt;br /&gt;
Processor_id must be 0,1,2,3 or -2, where -2 uses the default cpuid for process.&lt;br /&gt;
&lt;br /&gt;
== svcStartThread ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Starts the thread for the provided handle.&lt;br /&gt;
&lt;br /&gt;
== svcExitThread ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Exits the current thread.&lt;br /&gt;
&lt;br /&gt;
== svcSleepThread ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Sleep for a specified amount of time, or yield thread.&lt;br /&gt;
&lt;br /&gt;
Setting nano=0 means &amp;quot;yield thread&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== svcGetThreadPriority ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Get priority of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== svcSetThreadPriority ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Set priority of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
Priority is a number 0-0x3F. Lower value means higher priority.&lt;br /&gt;
&lt;br /&gt;
== svcGetThreadCoreMask ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Get affinity mask of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== svcSetThreadCoreMask ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Set affinity mask of provided thread handle.&lt;br /&gt;
&lt;br /&gt;
== svcGetCurrentProcessorNumber ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Get which cpu is executing the current thread.&lt;br /&gt;
&lt;br /&gt;
Cpu-id is an integer in the range 0-3.&lt;br /&gt;
&lt;br /&gt;
== svcMapSharedMemory ==&lt;br /&gt;
Maps the block supplied by the handle. The required permissions are different for the process that created the handle and all other processes.&lt;br /&gt;
&lt;br /&gt;
Increases reference count for the KSharedMemory object. Thus in order to release the memory associated with the object, all handles to it must be closed and all mappings must be unmapped.&lt;br /&gt;
&lt;br /&gt;
== svcCreateTransferMemory ==&lt;br /&gt;
This one reprotects the src block with perms you give it. It also sets bit0 into [[#MemoryAttribute]].&lt;br /&gt;
&lt;br /&gt;
Executable bit perm not allowed.&lt;br /&gt;
&lt;br /&gt;
Closing all handles automatically causes the bit0 in [[#MemoryAttribute]] to clear, and the permission to reset.&lt;br /&gt;
&lt;br /&gt;
== svcWaitSynchronization ==&lt;br /&gt;
Works with num_handles &amp;lt;= 0x40, error on num_handles == 0.&lt;br /&gt;
&lt;br /&gt;
Does not accept 0xFFFF8001 or 0xFFFF8000 as handles.&lt;br /&gt;
&lt;br /&gt;
== svcSendSyncRequestWithUserBuffer ==&lt;br /&gt;
Size must be 0x1000-aligned.&lt;br /&gt;
&lt;br /&gt;
== svcBreak ==&lt;br /&gt;
When used on retail where inx0 bit31 is clear, the system will throw a [[Error_codes|fatal-error]]. Otherwise when bit31 is set, it will return 0.&lt;br /&gt;
&lt;br /&gt;
== svcGetInfo ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Handle type || Id0 || Id1 || Description&lt;br /&gt;
|-&lt;br /&gt;
| Process || 0 || 0 || AllowedCpuIdBitmask&lt;br /&gt;
|-&lt;br /&gt;
| Process || 1 || 0 || AllowedThreadPrioBitmask&lt;br /&gt;
|-&lt;br /&gt;
| Process || 2 || 0 || ReservedMapRegionBaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 3 || 0 || ReservedMapRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 4 || 0 || ReservedHeapRegionBaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| Process || 5 || 0 || ReservedHeapRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 6 || 0 || TotalMemoryUsage&lt;br /&gt;
|-&lt;br /&gt;
| Process || 7 || 0 || TotalHeapUsage&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 8 || 0 || IsCurrentProcessBeingDebugged&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 9 || 0 || Returns ResourceLimit handle for current process. Used by [[Process_Manager_services|PM]].&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 10 || -1, {current coreid} || Unknown. Output data changes each time this SVC is used. Global and core-specific tick-count?&lt;br /&gt;
|-&lt;br /&gt;
| Zero    || 11 || 0-3 || RandomEntropy from current process. TRNG. Used to seed usermode PRNGs.&lt;br /&gt;
|-&lt;br /&gt;
| Process || 12 || 0 || [2.0.0+] AddressSpaceStart&lt;br /&gt;
|-&lt;br /&gt;
| Process || 13 || 0 || [2.0.0+] AddressSpaceSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 14 || 0 || [2.0.0+] NewReservedRegionStartAddr&lt;br /&gt;
|-&lt;br /&gt;
| Process || 15 || 0 || [2.0.0+] NewReservedRegionSize&lt;br /&gt;
|-&lt;br /&gt;
| Process || 18 || 0 || [3.0.0+] Title-id.&lt;br /&gt;
|-&lt;br /&gt;
| Thread || 0xF0000002 || 0 || Performance counter related.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== svcDumpInfo ==&lt;br /&gt;
Does nothing, just returns with registers set to all-zero.&lt;br /&gt;
&lt;br /&gt;
== svcReadWriteRegister ==&lt;br /&gt;
Read/write IO registers with a hardcoded whitelist. Input address is physical-address and must be aligned to 4.&lt;br /&gt;
&lt;br /&gt;
rw_mask is 0 for reading and 0xffffffff for writing. You can also write individual bits by using a mask value.&lt;br /&gt;
&lt;br /&gt;
You can only write to registers inside physical pages 0x70019000 (MC), 0x7001C000 (MC0), 0x7001D000 (MC1), and they all share the same whitelist.&lt;br /&gt;
&lt;br /&gt;
The whitelist is same for writing as for reading.&lt;br /&gt;
&lt;br /&gt;
The whitelist is:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
0x054, 0x090, 0x094, 0x098, 0x09c, 0x0a0, 0x0a4, 0x0a8, 0x0ac, 0x0b0, 0x0b4, 0x0b8, 0x0bc, 0x0c0, 0x0c4, 0x0c8, 0x0d0, 0x0d4, 0x0d8, 0x0dc, 0x0e0, 0x100, 0x108, 0x10c, 0x118, 0x11c, 0x124, 0x128, 0x12c, 0x130, 0x134, 0x138, 0x13c, 0x158, 0x15c, 0x164, 0x168, 0x16c, 0x170, 0x174, 0x178, 0x17c, 0x200, 0x204, 0x2e4, 0x2e8, 0x2ec, 0x2f4, 0x2f8, 0x310, 0x314, 0x320, 0x328, 0x344, 0x348, 0x370, 0x374, 0x37c, 0x380, 0x390, 0x394, 0x398, 0x3ac, 0x3b8, 0x3bc, 0x3c0, 0x3c4, 0x3d8, 0x3e8, 0x41c, 0x420, 0x424, 0x428, 0x42c, 0x430, 0x44c, 0x47c, 0x480, 0x484, 0x50c, 0x554, 0x558, 0x55c, 0x670, 0x674, 0x690, 0x694, 0x698, 0x69c, 0x6a0, 0x6a4, 0x6c0, 0x6c4, 0x6f0, 0x6f4, 0x960, 0x970, 0x974, 0xa20, 0xa24, 0xb88, 0xb8c, 0xbc4, 0xbc8, 0xbcc, 0xbd0, 0xbd4, 0xbd8, 0xbdc, 0xbe0, 0xbe4, 0xbe8, 0xbec, 0xc00, 0xc5c, 0xcac&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] Whitelist was extended with &amp;lt;code&amp;gt;0x4c4, 0x4c8, 0x4cc, 0x584, 0x588, 0x58c.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[2.0.0+] The IO registers in range 0x7000E400 (PMC) size 0xC00 skip the whitelist, and do a TrustZone call using [[SMC]] Id1 0xC3000008(ReadWriteRegister).&lt;br /&gt;
&lt;br /&gt;
== svcCreateSharedMemory ==&lt;br /&gt;
Other perm can be used to enforce permission 1, 3, or 0x10000000 if don&#039;t care.&lt;br /&gt;
&lt;br /&gt;
== svcMapTransferMemory ==&lt;br /&gt;
The newly mapped pages will have [[#MemoryState]] type 0xE.&lt;br /&gt;
&lt;br /&gt;
You must pass same size and permissions as given in svcCreateMemoryMirror, otherwise error.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapTransferMemory ==&lt;br /&gt;
Size must match size given in map syscall, otherwise there&#039;s an invalid-size error.&lt;br /&gt;
&lt;br /&gt;
== svcQueryPhysicalAddress ==&lt;br /&gt;
The inverse operation of [[#svcQueryIoMapping]].&lt;br /&gt;
&lt;br /&gt;
== svcQueryIoMapping ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Returns a virtual address mapped to a given IO range.&lt;br /&gt;
&lt;br /&gt;
== svcCreateDeviceAddressSpace ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Creates a virtual address space for binding device address spaces and returns a handle.&lt;br /&gt;
&lt;br /&gt;
dev_as_start_addr is normally set to 0 and dev_as_end_addr is normally set to 0xFFFFFFFF.&lt;br /&gt;
&lt;br /&gt;
== svcAttachDeviceAddressSpace ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Attaches a device address space to a [[#DeviceName|device]].&lt;br /&gt;
&lt;br /&gt;
== svcDetachDeviceAddressSpace ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Detaches a device address space from a [[#DeviceName|device]].&lt;br /&gt;
&lt;br /&gt;
== svcMapDeviceAddressSpaceByForce ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Maps an attached device address space to an userspace address.&lt;br /&gt;
&lt;br /&gt;
dev_map_addr is the userspace destination address, while dev_as_addr is the source address between dev_as_start_addr and dev_as_end_addr (passed to [[#svcCreateDeviceAddressSpace]]).&lt;br /&gt;
&lt;br /&gt;
The userspace destination address must have the [[SVC#MemoryState|MapDeviceAllowed]] bit set. Bit [[SVC#MemoryAttribute|IsDeviceMapped]] will be set after mapping.&lt;br /&gt;
&lt;br /&gt;
== svcMapDeviceAddressSpaceAligned ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Maps an attached device address space to an userspace address.&lt;br /&gt;
&lt;br /&gt;
Same as [[#svcMapDeviceAddressSpaceByForce]], but the userspace destination address must have the [[SVC#MemoryState|MapDeviceAlignedAllowed]] bit set instead.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapDeviceAddressSpace ==&lt;br /&gt;
&#039;&#039;&#039;Description:&#039;&#039;&#039; Unmaps an attached device address space from an userspace address.&lt;br /&gt;
&lt;br /&gt;
== svcMapProcessMemory ==&lt;br /&gt;
Maps the src address from the supplied process handle into the current process.&lt;br /&gt;
&lt;br /&gt;
This allows mapping code and rodata with RW- permission.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapProcessMemory ==&lt;br /&gt;
Unmaps what was mapped by [[#svcMapProcessMemory]].&lt;br /&gt;
&lt;br /&gt;
== svcQueryProcessMemory ==&lt;br /&gt;
Equivalent to [[#svcQueryMemory]] except takes a process handle.&lt;br /&gt;
&lt;br /&gt;
== svcMapProcessCodeMemory ==&lt;br /&gt;
Takes a process handle, and maps normal heap in that process as executable code in that process. Used when loading NROs.&lt;br /&gt;
&lt;br /&gt;
== svcUnmapProcessCodeMemory ==&lt;br /&gt;
Unmaps what was mapped by [[#svcMapProcessCodeMemory]].&lt;br /&gt;
&lt;br /&gt;
== svcCreateProcess ==&lt;br /&gt;
Takes a [[#CreateProcessInfo]] as input.&lt;br /&gt;
&lt;br /&gt;
== svcGetProcessInfo ==&lt;br /&gt;
Returns an enum with value 0-7.&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
[2.0.0+] Exactly 6 debug SVCs require that [[SPL_services#GetConfig|IsDebugMode]] is non-zero. Error 0x4201 is returned otherwise.&lt;br /&gt;
* svcBreakDebugProcess&lt;br /&gt;
* svcContinueDebugEvent&lt;br /&gt;
* svcWriteDebugProcessMemory&lt;br /&gt;
* svcSetDebugThreadContext&lt;br /&gt;
* svcTerminateDebugProcess&lt;br /&gt;
* svcSetHardwareBreakPoint&lt;br /&gt;
&lt;br /&gt;
svcDebugActiveProcess stops execution of the target process, the normal method for resuming it requires svcContinueDebugEvent(see above). Closing the debug handle also results in execution being resumed.&lt;br /&gt;
&lt;br /&gt;
= Structures =&lt;br /&gt;
== DeviceName ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || DeviceName_AFI&lt;br /&gt;
|-&lt;br /&gt;
| 1 || DeviceName_AVPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || DeviceName_DC&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DeviceName_DCB&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DeviceName_HC&lt;br /&gt;
|-&lt;br /&gt;
| 5 || DeviceName_HDA&lt;br /&gt;
|-&lt;br /&gt;
| 6 || DeviceName_ISP2&lt;br /&gt;
|-&lt;br /&gt;
| 7 || DeviceName_MSENCNVENC&lt;br /&gt;
|-&lt;br /&gt;
| 8 || DeviceName_NV&lt;br /&gt;
|-&lt;br /&gt;
| 9 || DeviceName_NV2&lt;br /&gt;
|-&lt;br /&gt;
| 10 || DeviceName_PPCS&lt;br /&gt;
|-&lt;br /&gt;
| 11 || DeviceName_SATA&lt;br /&gt;
|-&lt;br /&gt;
| 12 || DeviceName_VI&lt;br /&gt;
|-&lt;br /&gt;
| 13 || DeviceName_VIC&lt;br /&gt;
|-&lt;br /&gt;
| 14 || DeviceName_XUSB_HOST&lt;br /&gt;
|-&lt;br /&gt;
| 15 || DeviceName_XUSB_DEV&lt;br /&gt;
|-&lt;br /&gt;
| 16 || DeviceName_TSEC&lt;br /&gt;
|-&lt;br /&gt;
| 17 || DeviceName_PPCS1&lt;br /&gt;
|-&lt;br /&gt;
| 18 || DeviceName_DC1&lt;br /&gt;
|-&lt;br /&gt;
| 19 || DeviceName_SDMMC1A&lt;br /&gt;
|-&lt;br /&gt;
| 20 || DeviceName_SDMMC2A&lt;br /&gt;
|-&lt;br /&gt;
| 21 || DeviceName_SDMMC3A&lt;br /&gt;
|-&lt;br /&gt;
| 22 || DeviceName_SDMMC4A&lt;br /&gt;
|-&lt;br /&gt;
| 23 || DeviceName_ISP2B&lt;br /&gt;
|-&lt;br /&gt;
| 24 || DeviceName_GPU&lt;br /&gt;
|-&lt;br /&gt;
| 25 || DeviceName_GPUB&lt;br /&gt;
|-&lt;br /&gt;
| 26 || DeviceName_PPCS2&lt;br /&gt;
|-&lt;br /&gt;
| 27 || DeviceName_NVDEC&lt;br /&gt;
|-&lt;br /&gt;
| 28 || DeviceName_APE&lt;br /&gt;
|-&lt;br /&gt;
| 29 || DeviceName_SE&lt;br /&gt;
|-&lt;br /&gt;
| 30 || DeviceName_NVJPG&lt;br /&gt;
|-&lt;br /&gt;
| 31 || DeviceName_HC1&lt;br /&gt;
|-&lt;br /&gt;
| 32 || DeviceName_SE1&lt;br /&gt;
|-&lt;br /&gt;
| 33 || DeviceName_AXIAP&lt;br /&gt;
|-&lt;br /&gt;
| 34 || DeviceName_ETR&lt;br /&gt;
|-&lt;br /&gt;
| 35 || DeviceName_TSECB&lt;br /&gt;
|-&lt;br /&gt;
| 36 || DeviceName_TSEC1&lt;br /&gt;
|-&lt;br /&gt;
| 37 || DeviceName_TSECB1&lt;br /&gt;
|-&lt;br /&gt;
| 38 || DeviceName_NVDEC1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LimitableResource ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || LimitableResource_Memory&lt;br /&gt;
|-&lt;br /&gt;
| 1 || LimitableResource_Threads&lt;br /&gt;
|-&lt;br /&gt;
| 2 || LimitableResource_Events&lt;br /&gt;
|-&lt;br /&gt;
| 3 || LimitableResource_TransferMemories&lt;br /&gt;
|-&lt;br /&gt;
| 4 || LimitableResource_Sessions&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateProcessInfo ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 12 || || ProcessName (doesn&#039;t have to be null-terminated)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 4 || ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 8 || || TitleId&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 8 || || CodeAddr&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 4 || || CodeNumPages&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 4 || || MmuFlags&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit0 || Is64bit&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit3-1 || [[#AddressSpaceType]]&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit4 ||&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit5 || EnableAslr&lt;br /&gt;
|-&lt;br /&gt;
| || || Bit6 || IsSystem&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 4 || || ResourceLimitHandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 4 ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== AddressSpaceType ===&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Type || Name || Width || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Normal_32Bit || 32 ||&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Normal_36Bit || 36 ||&lt;br /&gt;
|-&lt;br /&gt;
| 2 || WithoutMap_32Bit || 32 || Appears to be missing map region [?]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [2.0.0+] Normal_39Bit || 39 ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryInfo ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Offset || Length || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 8 || BaseAddress&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 8 || Size&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 4 || MemoryType: lower 8 bits of [[#MemoryState]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || 4 || [[#MemoryAttribute]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 4 || Permission (bit0: R, bit1: W, bit2: X)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || 4 || DeviceRefCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 4 || IpcRefCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 4 || Padding: always zero&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryAttribute ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || IsBorrowed&lt;br /&gt;
|-&lt;br /&gt;
| 1 || IsIpcMapped: when IpcRefCount &amp;gt; 0.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || IsDeviceMapped: when DeviceRefCount &amp;gt; 0.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || IsUncached&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MemoryState ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Description&lt;br /&gt;
|-&lt;br /&gt;
| 7-0 || Type&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#svcSetMemoryPermission|PermissionChangeAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 9 || IsUserWritable [?]&lt;br /&gt;
|-&lt;br /&gt;
| 10 || IpcSendAllowed_Type0&lt;br /&gt;
|-&lt;br /&gt;
| 11 || IpcSendAllowed_Type3&lt;br /&gt;
|-&lt;br /&gt;
| 12 || IpcSendAllowed_Type1&lt;br /&gt;
|-&lt;br /&gt;
| 14 || [[#svcSetProcessMemoryPermission|ProcessPermissionChangeAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 15 || [[#svcMapMemory|MapAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || [[#svcUnmapProcessCodeMemory|UnmapProcessCodeMemoryAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 17 || [[#svcCreateTransferMemory|TransferMemoryAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 19 || MapDeviceAllowed ([[#svcMapDeviceAddressSpace]] and [[#svcMapDeviceAddressSpaceByForce]])&lt;br /&gt;
|-&lt;br /&gt;
| 20 || [[#svcMapDeviceAddressSpaceAligned|MapDeviceAlignedAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 21 || [[#svcSendSyncRequestWithUserBuffer|IpcBufferAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 22 || IsPoolAllocated/IsReferenceCounted&lt;br /&gt;
|-&lt;br /&gt;
| 23 || [[#svcMapProcessMemory|MapProcessAllowed]]&lt;br /&gt;
|-&lt;br /&gt;
| 24 || [[#svcSetMemoryAttribute|AttributeChangeAllowed]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Type || Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00000000&amp;lt;/code&amp;gt; || Unmapped ||&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00002001&amp;lt;/code&amp;gt; || IO || Mapped by kernel capability parsing in [[#svcCreateProcess]]. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00042002&amp;lt;/code&amp;gt; || Normal || Mapped by kernel capability parsing in [[#svcCreateProcess]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00DC7E03&amp;lt;/code&amp;gt; || Code static || Mapped during [[#svcCreateProcess]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x01FEBD04&amp;lt;/code&amp;gt; || Code || Transition from 0xDC7E03 performed by [[#svcSetProcessMemoryPermission]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x017EBD05&amp;lt;/code&amp;gt; || Heap || Mapped using [[#svcSetHeapSize]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00402006&amp;lt;/code&amp;gt; || Shared memory block || Mapped using [[#svcMapSharedMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00482907&amp;lt;/code&amp;gt; || [1.0.0] Weird mapped memory || Mapped using [[#svcMapMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00DD7E08&amp;lt;/code&amp;gt; || Module code static || Mapped using [[#svcMapProcessCodeMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x01FFBD09&amp;lt;/code&amp;gt; || Module code mutable || Transition from 0xDD7E08 performed by [[#svcSetProcessMemoryPermission]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C3C0A&amp;lt;/code&amp;gt; || [[IPC_Marshalling|IPC]] buffers || IPC buffers with descriptor flags=0.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C3C0B&amp;lt;/code&amp;gt; || Mapped memory || Mapped using [[#svcMapMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x0040200C&amp;lt;/code&amp;gt; || [[Thread Local Storage|Thread local storage]] || Mapped during [[#svcCreateThread]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x015C3C0D&amp;lt;/code&amp;gt; || Isolated transfer memory || Mapped using [[#svcMapTransferMemory]] when the owning process has perm=0.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C380E&amp;lt;/code&amp;gt; || Transfer memory || Mapped using [[#svcMapTransferMemory]] when the owning process has perm!=0.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x0040380F&amp;lt;/code&amp;gt; || Process memory || Mapped using [[#svcMapProcessMemory]].&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00000010&amp;lt;/code&amp;gt; || Reserved ||&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x005C3811&amp;lt;/code&amp;gt; || [[IPC_Marshalling|IPC]] buffers || IPC buffers with descriptor flags=1.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x004C2812&amp;lt;/code&amp;gt; || [[IPC_Marshalling|IPC]] buffers || IPC buffers with descriptor flags=3.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0x00002013&amp;lt;/code&amp;gt; || Kernel per-thread stack || Mapped in kernel during [[#svcCreateThread]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Exception handling =&lt;br /&gt;
There is userland code for handling exceptions, however this doesn&#039;t seem to be executed on retail mode.&lt;br /&gt;
&lt;br /&gt;
When a usermode exception occurs, it jumps to the main code binary entrypoint (main_binary_address + 0 == &#039;&#039;&#039;_start&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
During normal boot &#039;&#039;&#039;_start&#039;&#039;&#039; is invoked with X0=0 and X1=main_thread_handle (triggering normal crt0 setup).&lt;br /&gt;
During an usermode exception &#039;&#039;&#039;_start&#039;&#039;&#039; is invoked with X0=exception_info0_ptr and X1=exception_info1_ptr instead.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;_start&#039;&#039;&#039; method determines whether to boot normally or handle an exception if X0 is set to 0 or not.&lt;/div&gt;</summary>
		<author><name>Adubbz</name></author>
	</entry>
</feed>