<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.3dbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Neimod</id>
	<title>3dbrew - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.3dbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Neimod"/>
	<link rel="alternate" type="text/html" href="https://www.3dbrew.org/wiki/Special:Contributions/Neimod"/>
	<updated>2026-04-22T03:38:14Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Nintendo_OpenGL&amp;diff=11220</id>
		<title>Nintendo OpenGL</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Nintendo_OpenGL&amp;diff=11220"/>
		<updated>2014-12-21T04:11:01Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page&#039;s goal is to describe parts of Nintendo&#039;s OpenGL implementation for the 3DS as we reverse engineer it to better understand how to use the PICA200.&lt;br /&gt;
Some of the information on this page is specific to Steeldiver : Sub Wars. The reason for this is that it&#039;s a fairly graphics-heavy game that&#039;s available on the eShop for &#039;&#039;&#039;free&#039;&#039;&#039;, so it seems like a good target for a community REing effort.&lt;br /&gt;
&lt;br /&gt;
== Rendering pipeline ==&lt;br /&gt;
&amp;lt;!-- [[Image:Renderpipeline.png]] --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
The PICA200 is an opengl ES 1.1 compliant GPU manufactured by DMP. It comes loaded with a number of extensions that make it similar to an openGL ES 2.0 compliant GPU (ability to run programmable vertex/geometry shaders, for instance). Because of this, Nintendo wrapped GPU access into an openGL ES 2.0 implementation with some limitations. As the fragment stage of the pipeline is non-programmable, Nintendo instead gives developers the ability to configure a number of fragment-related values through glGetUniformLocation and glUniformXX. See below for the full list.&lt;br /&gt;
&lt;br /&gt;
== Shader program structure ==&lt;br /&gt;
&lt;br /&gt;
When uniform values are set (in shm_uniformfv/shm_uniformiv), they are attached to the current shader program and stored into the corresponding shader program structure. They are later written to the GPU command buffer in __shv_validateShaderValidator or equivalent.&lt;br /&gt;
&lt;br /&gt;
Shader program struct :&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x000&lt;br /&gt;
| 0x04&lt;br /&gt;
| Value 0x0 ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x004&lt;br /&gt;
| 0x04&lt;br /&gt;
| Program ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x008&lt;br /&gt;
| 0x04&lt;br /&gt;
| Value -1 ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x01C&lt;br /&gt;
| 0x04&lt;br /&gt;
| Pointer to program-specific uniform table&lt;br /&gt;
|-&lt;br /&gt;
| 0x020&lt;br /&gt;
| 0x04&lt;br /&gt;
| Total number of uniforms for program&lt;br /&gt;
|-&lt;br /&gt;
| 0x028&lt;br /&gt;
| 0x04&lt;br /&gt;
| Number of program-specific uniforms&lt;br /&gt;
|-&lt;br /&gt;
| 0x414&lt;br /&gt;
| 0x04&lt;br /&gt;
| Pointer to vertex shader struct&lt;br /&gt;
|-&lt;br /&gt;
| 0x64C&lt;br /&gt;
| 0x04&lt;br /&gt;
| Value for GPU register 0x0104&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C0&lt;br /&gt;
| 0x04&lt;br /&gt;
| Bitfield containing dmp_FragmentLightSource[n].shadowed values&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x04&lt;br /&gt;
| Bitfield containing dmp_FragmentLightSource[n].geomFactor0 / dmp_FragmentLightSource[n].geomFactor1 / dmp_FragmentLightSource[n].twoSideDiffuse values&lt;br /&gt;
|-&lt;br /&gt;
| 0xA20&lt;br /&gt;
| 0x70*8&lt;br /&gt;
| Table of structs for 8 dmp_FragmentLightSource&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
dmp_FragmentLightSource struct:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x01&lt;br /&gt;
| dmp_FragmentLightSource[k].enabled&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 0x10&lt;br /&gt;
| dmp_FragmentLightSource[k].ambient (float[4])&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 0x10&lt;br /&gt;
| dmp_FragmentLightSource[k].diffuse (float[4])&lt;br /&gt;
|-&lt;br /&gt;
| 0x24&lt;br /&gt;
| 0x10&lt;br /&gt;
| dmp_FragmentLightSource[k].specular0 (float[4])&lt;br /&gt;
|-&lt;br /&gt;
| 0x34&lt;br /&gt;
| 0x10&lt;br /&gt;
| dmp_FragmentLightSource[k].specular1 (float[4])&lt;br /&gt;
|-&lt;br /&gt;
| 0x44&lt;br /&gt;
| 0x10&lt;br /&gt;
| dmp_FragmentLightSource[k].position (float[4])&lt;br /&gt;
|-&lt;br /&gt;
| 0x54&lt;br /&gt;
| 0x10&lt;br /&gt;
| dmp_FragmentLightSource[k].spotDirection (float[3])&lt;br /&gt;
|-&lt;br /&gt;
| 0x60&lt;br /&gt;
| 0x04&lt;br /&gt;
| dmp_FragmentLightSource[k].samplerSP (u32)&lt;br /&gt;
|-&lt;br /&gt;
| 0x64&lt;br /&gt;
| 0x04&lt;br /&gt;
| dmp_FragmentLightSource[k].distanceAttenuationBias (float)&lt;br /&gt;
|-&lt;br /&gt;
| 0x68&lt;br /&gt;
| 0x04&lt;br /&gt;
| dmp_FragmentLightSource[k].distanceAttenuationScale (float)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
vertex/geometry shader struct:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Offset&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x4&lt;br /&gt;
| Pointer to shader code data&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
| Size of shader code (in words)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x4&lt;br /&gt;
| Pointer to shader opdesc data&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 0x4&lt;br /&gt;
| Size of shader opdescs (in words)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Proposed REing methodology ==&lt;br /&gt;
&lt;br /&gt;
1. Choose a &amp;quot;uniform&amp;quot; you want to RE below&lt;br /&gt;
&lt;br /&gt;
2. Take note of its ID and type !&lt;br /&gt;
&lt;br /&gt;
3. Depending on whether its a float or not, go through the gigantic switches in shm_uniformfv or shm_uniformiv (non-float) based on the ID of your uniform (in the case of &#039;&#039;&#039;steeldiver: sub wars&#039;&#039;&#039; you can now just go directly to the handler as it&#039;s listed in the table below)&lt;br /&gt;
&lt;br /&gt;
4. Once you find the piece of code specific to your uniform, take note of how the values passed to shm_uniformfv/shm_uniformiv are written to the shader object&lt;br /&gt;
&lt;br /&gt;
5. Go through __shv_validateShaderValidator looking for where those fields written to in shm_uniformfv/shm_uniformiv are used and written to the GPU command buffer either directly or through __cb_writeRegs, __cb_multiWriteReg or __cb_fillRegs.&lt;br /&gt;
&lt;br /&gt;
6. Document findings on 3Dbrew ! (that&#039;s the most important step)&lt;br /&gt;
&lt;br /&gt;
== Fragment &amp;quot;uniform&amp;quot; list ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Uniform ID&lt;br /&gt;
!  Type&lt;br /&gt;
!  Name&lt;br /&gt;
!  Handler address (Steeldiver : Sub Wars)&lt;br /&gt;
!  Shader Program struct offset&lt;br /&gt;
!  GPU Register&lt;br /&gt;
|- &lt;br /&gt;
| 0x0&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_Texture[0].perspectiveShadow&lt;br /&gt;
| 0x0012A504&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x1&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_Texture[0].shadowZBias&lt;br /&gt;
| 0x00155584&lt;br /&gt;
| 0xE44&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x2&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_Texture[0].shadowZScale&lt;br /&gt;
| 0x001556A0&lt;br /&gt;
| 0xE48&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x3&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_Texture[0].samplerType&lt;br /&gt;
| 0x0012A5D0&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x4&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_Texture[1].samplerType&lt;br /&gt;
| 0x0012A6F8&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x5&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_Texture[2].samplerType&lt;br /&gt;
| 0x0012A774&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x6&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_Texture[3].samplerType&lt;br /&gt;
| 0x0012A7F0&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x7&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_Texture[2].texcoord&lt;br /&gt;
| 0x0012A8B4&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x8&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_Texture[3].texcoord&lt;br /&gt;
| 0x0012A97C&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x9&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_Texture[3].ptRgbMap&lt;br /&gt;
| 0x0012AA54&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xA&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_Texture[3].ptAlphaMap&lt;br /&gt;
| 0x0012AB94&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xB&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_Texture[3].ptAlphaSeparate&lt;br /&gt;
| 0x0012ACD4&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xC&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_Texture[3].ptClampU&lt;br /&gt;
| 0x0012ADB8&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xD&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_Texture[3].ptClampV&lt;br /&gt;
| 0x0012AEC0&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xE&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_Texture[3].ptShiftU&lt;br /&gt;
| 0x0012AFD0&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xF&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_Texture[3].ptShiftV&lt;br /&gt;
| 0x0012B0A0&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x10&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_Texture[3].ptMinFilter&lt;br /&gt;
| 0x0012B168&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x11&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_Texture[3].ptTexWidth&lt;br /&gt;
| 0x0012B270&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x12&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_Texture[3].ptTexOffset&lt;br /&gt;
| 0x0012B334&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x13&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_Texture[3].ptTexBias&lt;br /&gt;
| 0x001556B4&lt;br /&gt;
| 0xE10&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x14&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_Texture[3].ptNoiseEnable&lt;br /&gt;
| 0x0012B3E0&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x15&lt;br /&gt;
| GL_FLOAT_VEC3&lt;br /&gt;
| dmp_Texture[3].ptNoiseU&lt;br /&gt;
| 0x00155878&lt;br /&gt;
| 0xE14&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x16&lt;br /&gt;
| GL_FLOAT_VEC3&lt;br /&gt;
| dmp_Texture[3].ptNoiseV&lt;br /&gt;
| 0x00155A7C&lt;br /&gt;
| 0xE20&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x17&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_Texture[3].ptSamplerRgbMap&lt;br /&gt;
| 0x0012B4B0&lt;br /&gt;
| 0xDF0&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x18&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_Texture[3].ptSamplerAlphaMap&lt;br /&gt;
| 0x0012B4F4&lt;br /&gt;
| 0xDF4&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x19&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_Texture[3].ptSamplerNoiseMap&lt;br /&gt;
| 0x0012B540&lt;br /&gt;
| 0xDF8&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x1A&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_Texture[3].ptSamplerR&lt;br /&gt;
| 0x0012B58C&lt;br /&gt;
| 0xDFC&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x1B&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_Texture[3].ptSamplerG&lt;br /&gt;
| 0x0012B5D8&lt;br /&gt;
| 0xE00&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x1C&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_Texture[3].ptSamplerB&lt;br /&gt;
| 0x0012B624&lt;br /&gt;
| 0xE04&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x1D&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_Texture[3].ptSamplerA&lt;br /&gt;
| 0x0012B670&lt;br /&gt;
| 0xE08&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x1E&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_FragOperation.mode&lt;br /&gt;
| 0x0012B6BC&lt;br /&gt;
| 0xE38&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x1F&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_FragOperation.penumbraScale&lt;br /&gt;
| 0x00155C98&lt;br /&gt;
| 0xE40&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x20&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_FragOperation.penumbraBias&lt;br /&gt;
| 0x00155D8C&lt;br /&gt;
| 0xE3C&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x21&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_FragOperation.wScale&lt;br /&gt;
| 0x00155E9C&lt;br /&gt;
| 0xE4C&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x22&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragOperation.enableClippingPlane&lt;br /&gt;
| 0x0012EAEC&lt;br /&gt;
| 0x568&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x23&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragOperation.clippingPlane&lt;br /&gt;
| 0x00159474&lt;br /&gt;
| 0xE50&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x24&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragOperation.enableAlphaTest&lt;br /&gt;
| 0x0012EBAC&lt;br /&gt;
| 0x64C&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x25&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_FragOperation.alphaTestFunc&lt;br /&gt;
| 0x0012EC64&lt;br /&gt;
| 0x64C&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x26&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_FragOperation.alphaRefValue&lt;br /&gt;
| 0x0015971C&lt;br /&gt;
| 0x64C ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x27&lt;br /&gt;
| GL_FLOAT_VEC3&lt;br /&gt;
| dmp_Gas.lightXY&lt;br /&gt;
| 0x001560EC&lt;br /&gt;
| 0xE84&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x28&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_Gas.lightZ&lt;br /&gt;
| 0x00156268&lt;br /&gt;
| 0xE90&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x29&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_Gas.deltaZ&lt;br /&gt;
| 0x001564D4&lt;br /&gt;
| 0xEA0&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x2A&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_Gas.accMax&lt;br /&gt;
| 0x001565C0&lt;br /&gt;
| 0xEA4&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x2B&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_Gas.autoAcc&lt;br /&gt;
| 0x0012B790&lt;br /&gt;
| 0xE74&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x2C&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_Gas.attenuation&lt;br /&gt;
| 0x00156684&lt;br /&gt;
| 0xEA8&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x2D&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_Gas.colorLutInput&lt;br /&gt;
| 0x0012B7A4&lt;br /&gt;
| 0x640&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x2E&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_Gas.shadingDensitySrc&lt;br /&gt;
| 0x0012B854&lt;br /&gt;
| 0x624&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x2F&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_Gas.samplerTR&lt;br /&gt;
| 0x0012B910&lt;br /&gt;
| 0xE78&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x30&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_Gas.samplerTG&lt;br /&gt;
| 0x0012B95C&lt;br /&gt;
| 0xE7C&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x31&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_Gas.samplerTB&lt;br /&gt;
| 0x0012B9A8&lt;br /&gt;
| 0xE80&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x32&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLighting.enabled&lt;br /&gt;
| 0x0012B9F4&lt;br /&gt;
| 0x590&lt;br /&gt;
| 0x00A8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x33&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLighting.ambient&lt;br /&gt;
| 0x00156744&lt;br /&gt;
| 0xA10&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x34&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentMaterial.emission&lt;br /&gt;
| 0x00156E1C&lt;br /&gt;
| 0xDE0&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x35&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentMaterial.ambient&lt;br /&gt;
| 0x0015696C&lt;br /&gt;
| 0xDA0&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x36&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentMaterial.diffuse&lt;br /&gt;
| 0x00157048&lt;br /&gt;
| 0xDB0&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x37&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentMaterial.specular0&lt;br /&gt;
| 0x001572E0&lt;br /&gt;
| 0xDC0&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x38&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentMaterial.specular1&lt;br /&gt;
| 0x0015756C&lt;br /&gt;
| 0xDD0&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x39&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[0].enabled&lt;br /&gt;
| 0x0012BD24&lt;br /&gt;
| 0xA20+0*0x70+0x00&lt;br /&gt;
| 0x01C5&lt;br /&gt;
|- &lt;br /&gt;
| 0x3A&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[1].enabled&lt;br /&gt;
| 0x0012BD24&lt;br /&gt;
| 0xA20+1*0x70+0x00&lt;br /&gt;
| 0x01C5&lt;br /&gt;
|- &lt;br /&gt;
| 0x3B&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[2].enabled&lt;br /&gt;
| 0x0012BD24&lt;br /&gt;
| 0xA20+2*0x70+0x00&lt;br /&gt;
| 0x01C5&lt;br /&gt;
|- &lt;br /&gt;
| 0x3C&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[3].enabled&lt;br /&gt;
| 0x0012BD24&lt;br /&gt;
| 0xA20+3*0x70+0x00&lt;br /&gt;
| 0x01C5&lt;br /&gt;
|- &lt;br /&gt;
| 0x3D&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[4].enabled&lt;br /&gt;
| 0x0012BD24&lt;br /&gt;
| 0xA20+4*0x70+0x00&lt;br /&gt;
| 0x01C5&lt;br /&gt;
|- &lt;br /&gt;
| 0x3E&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[5].enabled&lt;br /&gt;
| 0x0012BD24&lt;br /&gt;
| 0xA20+5*0x70+0x00&lt;br /&gt;
| 0x01C5&lt;br /&gt;
|- &lt;br /&gt;
| 0x3F&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[6].enabled&lt;br /&gt;
| 0x0012BD24&lt;br /&gt;
| 0xA20+6*0x70+0x00&lt;br /&gt;
| 0x01C5&lt;br /&gt;
|- &lt;br /&gt;
| 0x40&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[7].enabled&lt;br /&gt;
| 0x0012BD24&lt;br /&gt;
| 0xA20+7*0x70+0x00&lt;br /&gt;
| 0x01C5&lt;br /&gt;
|- &lt;br /&gt;
| 0x41&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[0].ambient&lt;br /&gt;
| 0x001579CC&lt;br /&gt;
| 0xA20+0*0x70+0x04&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x42&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[1].ambient&lt;br /&gt;
| 0x001579CC&lt;br /&gt;
| 0xA20+1*0x70+0x04&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x43&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[2].ambient&lt;br /&gt;
| 0x001579CC&lt;br /&gt;
| 0xA20+2*0x70+0x04&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x44&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[3].ambient&lt;br /&gt;
| 0x001579CC&lt;br /&gt;
| 0xA20+3*0x70+0x04&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x45&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[4].ambient&lt;br /&gt;
| 0x001579CC&lt;br /&gt;
| 0xA20+4*0x70+0x04&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x46&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[5].ambient&lt;br /&gt;
| 0x001579CC&lt;br /&gt;
| 0xA20+5*0x70+0x04&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x47&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[6].ambient&lt;br /&gt;
| 0x001579CC&lt;br /&gt;
| 0xA20+6*0x70+0x04&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x48&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[7].ambient&lt;br /&gt;
| 0x001579CC&lt;br /&gt;
| 0xA20+7*0x70+0x04&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x49&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[0].diffuse&lt;br /&gt;
| 0x00157C10&lt;br /&gt;
| 0xA20+0*0x70+0x14&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x4A&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[1].diffuse&lt;br /&gt;
| 0x00157C10&lt;br /&gt;
| 0xA20+1*0x70+0x14&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x4B&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[2].diffuse&lt;br /&gt;
| 0x00157C10&lt;br /&gt;
| 0xA20+2*0x70+0x14&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x4C&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[3].diffuse&lt;br /&gt;
| 0x00157C10&lt;br /&gt;
| 0xA20+3*0x70+0x14&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x4D&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[4].diffuse&lt;br /&gt;
| 0x00157C10&lt;br /&gt;
| 0xA20+4*0x70+0x14&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x4E&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[5].diffuse&lt;br /&gt;
| 0x00157C10&lt;br /&gt;
| 0xA20+5*0x70+0x14&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x4F&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[6].diffuse&lt;br /&gt;
| 0x00157C10&lt;br /&gt;
| 0xA20+6*0x70+0x14&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x50&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[7].diffuse&lt;br /&gt;
| 0x00157C10&lt;br /&gt;
| 0xA20+7*0x70+0x14&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x51&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[0].specular0&lt;br /&gt;
| 0x00157E5C&lt;br /&gt;
| 0xA20+0*0x70+0x24&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x52&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[1].specular0&lt;br /&gt;
| 0x00157E5C&lt;br /&gt;
| 0xA20+1*0x70+0x24&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x53&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[2].specular0&lt;br /&gt;
| 0x00157E5C&lt;br /&gt;
| 0xA20+2*0x70+0x24&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x54&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[3].specular0&lt;br /&gt;
| 0x00157E5C&lt;br /&gt;
| 0xA20+3*0x70+0x24&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x55&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[4].specular0&lt;br /&gt;
| 0x00157E5C&lt;br /&gt;
| 0xA20+4*0x70+0x24&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x56&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[5].specular0&lt;br /&gt;
| 0x00157E5C&lt;br /&gt;
| 0xA20+5*0x70+0x24&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x57&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[6].specular0&lt;br /&gt;
| 0x00157E5C&lt;br /&gt;
| 0xA20+6*0x70+0x24&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x58&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[7].specular0&lt;br /&gt;
| 0x00157E5C&lt;br /&gt;
| 0xA20+7*0x70+0x24&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x59&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[0].specular1&lt;br /&gt;
| 0x001580B4&lt;br /&gt;
| 0xA20+0*0x70+0x34&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x5A&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[1].specular1&lt;br /&gt;
| 0x001580B4&lt;br /&gt;
| 0xA20+1*0x70+0x34&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x5B&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[2].specular1&lt;br /&gt;
| 0x001580B4&lt;br /&gt;
| 0xA20+2*0x70+0x34&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x5C&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[3].specular1&lt;br /&gt;
| 0x001580B4&lt;br /&gt;
| 0xA20+3*0x70+0x34&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x5D&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[4].specular1&lt;br /&gt;
| 0x001580B4&lt;br /&gt;
| 0xA20+4*0x70+0x34&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x5E&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[5].specular1&lt;br /&gt;
| 0x001580B4&lt;br /&gt;
| 0xA20+5*0x70+0x34&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x5F&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[6].specular1&lt;br /&gt;
| 0x001580B4&lt;br /&gt;
| 0xA20+6*0x70+0x34&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x60&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[7].specular1&lt;br /&gt;
| 0x001580B4&lt;br /&gt;
| 0xA20+7*0x70+0x34&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x61&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[0].position&lt;br /&gt;
| 0x001584B0&lt;br /&gt;
| 0xA20+0*0x70+0x44&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x62&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[1].position&lt;br /&gt;
| 0x001584B0&lt;br /&gt;
| 0xA20+1*0x70+0x44&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x63&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[2].position&lt;br /&gt;
| 0x001584B0&lt;br /&gt;
| 0xA20+2*0x70+0x44&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x64&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[3].position&lt;br /&gt;
| 0x001584B0&lt;br /&gt;
| 0xA20+3*0x70+0x44&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x65&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[4].position&lt;br /&gt;
| 0x001584B0&lt;br /&gt;
| 0xA20+4*0x70+0x44&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x66&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[5].position&lt;br /&gt;
| 0x001584B0&lt;br /&gt;
| 0xA20+5*0x70+0x44&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x67&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[6].position&lt;br /&gt;
| 0x001584B0&lt;br /&gt;
| 0xA20+6*0x70+0x44&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x68&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_FragmentLightSource[7].position&lt;br /&gt;
| 0x001584B0&lt;br /&gt;
| 0xA20+7*0x70+0x44&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x69&lt;br /&gt;
| GL_FLOAT_VEC3&lt;br /&gt;
| dmp_FragmentLightSource[0].spotDirection&lt;br /&gt;
| 0x001587E4&lt;br /&gt;
| 0xA20+0*0x70+0x54&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x6A&lt;br /&gt;
| GL_FLOAT_VEC3&lt;br /&gt;
| dmp_FragmentLightSource[1].spotDirection&lt;br /&gt;
| 0x001587E4&lt;br /&gt;
| 0xA20+1*0x70+0x54&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x6B&lt;br /&gt;
| GL_FLOAT_VEC3&lt;br /&gt;
| dmp_FragmentLightSource[2].spotDirection&lt;br /&gt;
| 0x001587E4&lt;br /&gt;
| 0xA20+2*0x70+0x54&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x6C&lt;br /&gt;
| GL_FLOAT_VEC3&lt;br /&gt;
| dmp_FragmentLightSource[3].spotDirection&lt;br /&gt;
| 0x001587E4&lt;br /&gt;
| 0xA20+3*0x70+0x54&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x6D&lt;br /&gt;
| GL_FLOAT_VEC3&lt;br /&gt;
| dmp_FragmentLightSource[4].spotDirection&lt;br /&gt;
| 0x001587E4&lt;br /&gt;
| 0xA20+4*0x70+0x54&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x6E&lt;br /&gt;
| GL_FLOAT_VEC3&lt;br /&gt;
| dmp_FragmentLightSource[5].spotDirection&lt;br /&gt;
| 0x001587E4&lt;br /&gt;
| 0xA20+5*0x70+0x54&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x6F&lt;br /&gt;
| GL_FLOAT_VEC3&lt;br /&gt;
| dmp_FragmentLightSource[6].spotDirection&lt;br /&gt;
| 0x001587E4&lt;br /&gt;
| 0xA20+6*0x70+0x54&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x70&lt;br /&gt;
| GL_FLOAT_VEC3&lt;br /&gt;
| dmp_FragmentLightSource[7].spotDirection&lt;br /&gt;
| 0x001587E4&lt;br /&gt;
| 0xA20+7*0x70+0x54&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x71&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[0].shadowed&lt;br /&gt;
| 0x0012C20C&lt;br /&gt;
| 0x7C0&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x72&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[1].shadowed&lt;br /&gt;
| 0x0012C20C&lt;br /&gt;
| 0x7C0&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x73&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[2].shadowed&lt;br /&gt;
| 0x0012C20C&lt;br /&gt;
| 0x7C0&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x74&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[3].shadowed&lt;br /&gt;
| 0x0012C20C&lt;br /&gt;
| 0x7C0&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x75&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[4].shadowed&lt;br /&gt;
| 0x0012C20C&lt;br /&gt;
| 0x7C0&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x76&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[5].shadowed&lt;br /&gt;
| 0x0012C20C&lt;br /&gt;
| 0x7C0&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x77&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[6].shadowed&lt;br /&gt;
| 0x0012C20C&lt;br /&gt;
| 0x7C0&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x78&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[7].shadowed&lt;br /&gt;
| 0x0012C20C&lt;br /&gt;
| 0x7C0&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x79&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[0].geomFactor0&lt;br /&gt;
| 0x0012C018&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x7A&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[1].geomFactor0&lt;br /&gt;
| 0x0012C018&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x7B&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[2].geomFactor0&lt;br /&gt;
| 0x0012C018&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x7C&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[3].geomFactor0&lt;br /&gt;
| 0x0012C018&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x7D&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[4].geomFactor0&lt;br /&gt;
| 0x0012C018&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x7E&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[5].geomFactor0&lt;br /&gt;
| 0x0012C018&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x7F&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[6].geomFactor0&lt;br /&gt;
| 0x0012C018&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x80&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[7].geomFactor0&lt;br /&gt;
| 0x0012C018&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x81&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[0].geomFactor1&lt;br /&gt;
| 0x0012C114&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x82&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[1].geomFactor1&lt;br /&gt;
| 0x0012C114&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x83&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[2].geomFactor1&lt;br /&gt;
| 0x0012C114&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x84&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[3].geomFactor1&lt;br /&gt;
| 0x0012C114&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x85&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[4].geomFactor1&lt;br /&gt;
| 0x0012C114&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x86&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[5].geomFactor1&lt;br /&gt;
| 0x0012C114&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x87&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[6].geomFactor1&lt;br /&gt;
| 0x0012C114&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x88&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[7].geomFactor1&lt;br /&gt;
| 0x0012C114&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x89&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[0].twoSideDiffuse&lt;br /&gt;
| 0x0012BF10&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x8A&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[1].twoSideDiffuse&lt;br /&gt;
| 0x0012BF10&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x8B&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[2].twoSideDiffuse&lt;br /&gt;
| 0x0012BF10&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x8C&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[3].twoSideDiffuse&lt;br /&gt;
| 0x0012BF10&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x8D&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[4].twoSideDiffuse&lt;br /&gt;
| 0x0012BF10&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x8E&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[5].twoSideDiffuse&lt;br /&gt;
| 0x0012BF10&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x8F&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[6].twoSideDiffuse&lt;br /&gt;
| 0x0012BF10&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x90&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[7].twoSideDiffuse&lt;br /&gt;
| 0x0012BF10&lt;br /&gt;
| 0x7D8&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x91&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_FragmentLightSource[0].samplerSP&lt;br /&gt;
| 0x0012C31C&lt;br /&gt;
| 0xA20+0*0x70+0x60&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x92&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_FragmentLightSource[1].samplerSP&lt;br /&gt;
| 0x0012C31C&lt;br /&gt;
| 0xA20+1*0x70+0x60&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x93&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_FragmentLightSource[2].samplerSP&lt;br /&gt;
| 0x0012C31C&lt;br /&gt;
| 0xA20+2*0x70+0x60&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x94&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_FragmentLightSource[3].samplerSP&lt;br /&gt;
| 0x0012C31C&lt;br /&gt;
| 0xA20+3*0x70+0x60&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x95&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_FragmentLightSource[4].samplerSP&lt;br /&gt;
| 0x0012C31C&lt;br /&gt;
| 0xA20+4*0x70+0x60&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x96&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_FragmentLightSource[5].samplerSP&lt;br /&gt;
| 0x0012C31C&lt;br /&gt;
| 0xA20+5*0x70+0x60&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x97&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_FragmentLightSource[6].samplerSP&lt;br /&gt;
| 0x0012C31C&lt;br /&gt;
| 0xA20+6*0x70+0x60&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x98&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_FragmentLightSource[7].samplerSP&lt;br /&gt;
| 0x0012C31C&lt;br /&gt;
| 0xA20+7*0x70+0x60&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x99&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[0].spotEnabled&lt;br /&gt;
| 0x0012C380&lt;br /&gt;
| ?&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x9A&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[1].spotEnabled&lt;br /&gt;
| 0x0012C380&lt;br /&gt;
| ?&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x9B&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[2].spotEnabled&lt;br /&gt;
| 0x0012C380&lt;br /&gt;
| ?&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x9C&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[3].spotEnabled&lt;br /&gt;
| 0x0012C380&lt;br /&gt;
| ?&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x9D&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[4].spotEnabled&lt;br /&gt;
| 0x0012C380&lt;br /&gt;
| ?&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x9E&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[5].spotEnabled&lt;br /&gt;
| 0x0012C380&lt;br /&gt;
| ?&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x9F&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[6].spotEnabled&lt;br /&gt;
| 0x0012C380&lt;br /&gt;
| ?&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xA0&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[7].spotEnabled&lt;br /&gt;
| 0x0012C380&lt;br /&gt;
| ?&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xA1&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_FragmentLightSource[0].distanceAttenuationBias&lt;br /&gt;
| 0x00158AE8&lt;br /&gt;
| 0xA20+0*0x70+0x64&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xA2&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_FragmentLightSource[1].distanceAttenuationBias&lt;br /&gt;
| 0x00158AE8&lt;br /&gt;
| 0xA20+1*0x70+0x64&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xA3&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_FragmentLightSource[2].distanceAttenuationBias&lt;br /&gt;
| 0x00158AE8&lt;br /&gt;
| 0xA20+2*0x70+0x64&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xA4&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_FragmentLightSource[3].distanceAttenuationBias&lt;br /&gt;
| 0x00158AE8&lt;br /&gt;
| 0xA20+3*0x70+0x64&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xA5&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_FragmentLightSource[4].distanceAttenuationBias&lt;br /&gt;
| 0x00158AE8&lt;br /&gt;
| 0xA20+4*0x70+0x64&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xA6&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_FragmentLightSource[5].distanceAttenuationBias&lt;br /&gt;
| 0x00158AE8&lt;br /&gt;
| 0xA20+5*0x70+0x64&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xA7&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_FragmentLightSource[6].distanceAttenuationBias&lt;br /&gt;
| 0x00158AE8&lt;br /&gt;
| 0xA20+6*0x70+0x64&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xA8&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_FragmentLightSource[7].distanceAttenuationBias&lt;br /&gt;
| 0x00158AE8&lt;br /&gt;
| 0xA20+7*0x70+0x64&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xA9&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_FragmentLightSource[0].distanceAttenuationScale&lt;br /&gt;
| 0x00158C44&lt;br /&gt;
| 0xA20+0*0x70+0x68&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xAA&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_FragmentLightSource[1].distanceAttenuationScale&lt;br /&gt;
| 0x00158C44&lt;br /&gt;
| 0xA20+1*0x70+0x68&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xAB&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_FragmentLightSource[2].distanceAttenuationScale&lt;br /&gt;
| 0x00158C44&lt;br /&gt;
| 0xA20+2*0x70+0x68&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xAC&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_FragmentLightSource[3].distanceAttenuationScale&lt;br /&gt;
| 0x00158C44&lt;br /&gt;
| 0xA20+3*0x70+0x68&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xAD&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_FragmentLightSource[4].distanceAttenuationScale&lt;br /&gt;
| 0x00158C44&lt;br /&gt;
| 0xA20+4*0x70+0x68&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xAE&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_FragmentLightSource[5].distanceAttenuationScale&lt;br /&gt;
| 0x00158C44&lt;br /&gt;
| 0xA20+5*0x70+0x68&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xAF&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_FragmentLightSource[6].distanceAttenuationScale&lt;br /&gt;
| 0x00158C44&lt;br /&gt;
| 0xA20+6*0x70+0x68&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xB0&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_FragmentLightSource[7].distanceAttenuationScale&lt;br /&gt;
| 0x00158C44&lt;br /&gt;
| 0xA20+7*0x70+0x68&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xB1&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[0].distanceAttenuationEnabled&lt;br /&gt;
| 0x0012C4A0&lt;br /&gt;
| ?&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xB2&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[1].distanceAttenuationEnabled&lt;br /&gt;
| 0x0012C4A0&lt;br /&gt;
| ?&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xB3&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[2].distanceAttenuationEnabled&lt;br /&gt;
| 0x0012C4A0&lt;br /&gt;
| ?&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xB4&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[3].distanceAttenuationEnabled&lt;br /&gt;
| 0x0012C4A0&lt;br /&gt;
| ?&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xB5&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[4].distanceAttenuationEnabled&lt;br /&gt;
| 0x0012C4A0&lt;br /&gt;
| ?&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xB6&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[5].distanceAttenuationEnabled&lt;br /&gt;
| 0x0012C4A0&lt;br /&gt;
| ?&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xB7&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[6].distanceAttenuationEnabled&lt;br /&gt;
| 0x0012C4A0&lt;br /&gt;
| ?&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xB8&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_FragmentLightSource[7].distanceAttenuationEnabled&lt;br /&gt;
| 0x0012C4A0&lt;br /&gt;
| ?&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xB9&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_FragmentLightSource[0].samplerDA&lt;br /&gt;
| 0x0012C578&lt;br /&gt;
| 0xA20+0*0x70+0x6C&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xBA&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_FragmentLightSource[1].samplerDA&lt;br /&gt;
| 0x0012C578&lt;br /&gt;
| 0xA20+1*0x70+0x6C&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xBB&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_FragmentLightSource[2].samplerDA&lt;br /&gt;
| 0x0012C578&lt;br /&gt;
| 0xA20+2*0x70+0x6C&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xBC&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_FragmentLightSource[3].samplerDA&lt;br /&gt;
| 0x0012C578&lt;br /&gt;
| 0xA20+3*0x70+0x6C&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xBD&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_FragmentLightSource[4].samplerDA&lt;br /&gt;
| 0x0012C578&lt;br /&gt;
| 0xA20+4*0x70+0x6C&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xBE&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_FragmentLightSource[5].samplerDA&lt;br /&gt;
| 0x0012C578&lt;br /&gt;
| 0xA20+5*0x70+0x6C&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xBF&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_FragmentLightSource[6].samplerDA&lt;br /&gt;
| 0x0012C578&lt;br /&gt;
| 0xA20+6*0x70+0x6C&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xC0&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_FragmentLightSource[7].samplerDA&lt;br /&gt;
| 0x0012C578&lt;br /&gt;
| 0xA20+7*0x70+0x6C&lt;br /&gt;
| 0x01C8 ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xC1&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_LightEnv.absLutInputD0&lt;br /&gt;
| 0x0012C5D8&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xC2&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_LightEnv.absLutInputD1&lt;br /&gt;
| 0x0012C5D8&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xC3&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_LightEnv.absLutInputSP&lt;br /&gt;
| 0x0012C5D8&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xC4&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_LightEnv.absLutInputFR&lt;br /&gt;
| 0x0012C5D8&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xC5&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_LightEnv.absLutInputRB&lt;br /&gt;
| 0x0012C5D8&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xC6&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_LightEnv.absLutInputRG&lt;br /&gt;
| 0x0012C5D8&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xC7&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_LightEnv.absLutInputRR&lt;br /&gt;
| 0x0012C5D8&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xC8&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_LightEnv.lutInputD0&lt;br /&gt;
| 0x0012C6E8&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xC9&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_LightEnv.lutInputD1&lt;br /&gt;
| 0x0012C6E8&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xCA&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_LightEnv.lutInputSP&lt;br /&gt;
| 0x0012C6E8&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xCB&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_LightEnv.lutInputFR&lt;br /&gt;
| 0x0012C6E8&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xCC&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_LightEnv.lutInputRB&lt;br /&gt;
| 0x0012C6E8&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xCD&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_LightEnv.lutInputRG&lt;br /&gt;
| 0x0012C6E8&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xCE&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_LightEnv.lutInputRR&lt;br /&gt;
| 0x0012C6E8&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xCF&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_LightEnv.lutScaleD0&lt;br /&gt;
| 0x00155404&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xD0&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_LightEnv.lutScaleD1&lt;br /&gt;
| 0x00155404&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xD1&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_LightEnv.lutScaleSP&lt;br /&gt;
| 0x00155404&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xD2&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_LightEnv.lutScaleFR&lt;br /&gt;
| 0x00155404&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xD3&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_LightEnv.lutScaleRB&lt;br /&gt;
| 0x00155404&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xD4&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_LightEnv.lutScaleRG&lt;br /&gt;
| 0x00155404&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xD5&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_LightEnv.lutScaleRR&lt;br /&gt;
| 0x00155404&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xD6&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_FragmentMaterial.samplerD0&lt;br /&gt;
| 0x0012C7D0&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xD7&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_FragmentMaterial.samplerD1&lt;br /&gt;
| 0x0012C7D0&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xD8&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_FragmentMaterial.samplerFR&lt;br /&gt;
| 0x0012C7D0&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xD9&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_FragmentMaterial.samplerRB&lt;br /&gt;
| 0x0012C7D0&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xDA&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_FragmentMaterial.samplerRG&lt;br /&gt;
| 0x0012C7D0&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xDB&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_FragmentMaterial.samplerRR&lt;br /&gt;
| 0x0012C7D0&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xDC&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_LightEnv.shadowSelector&lt;br /&gt;
| 0x0012CE44&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xDD&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_LightEnv.bumpSelector&lt;br /&gt;
| 0x0012CD88&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xDE&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_LightEnv.bumpMode&lt;br /&gt;
| 0x0012D4B4&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xDF&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_LightEnv.bumpRenorm&lt;br /&gt;
| 0x0012D8A0&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xE0&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_LightEnv.config&lt;br /&gt;
| 0x0012D5E4&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xE1&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_LightEnv.invertShadow&lt;br /&gt;
| 0x0012CF04&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xE2&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_LightEnv.shadowPrimary&lt;br /&gt;
| 0x0012CFD4&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xE3&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_LightEnv.shadowSecondary&lt;br /&gt;
| 0x0012D1B8&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xE4&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_LightEnv.shadowAlpha&lt;br /&gt;
| 0x0012D350&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xE5&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_LightEnv.fresnelSelector&lt;br /&gt;
| 0x0012D720&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xE6&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_LightEnv.clampHighlights&lt;br /&gt;
| 0x0012D9B0&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xE7&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_LightEnv.lutEnabledD0&lt;br /&gt;
| 0x0012DA80&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xE8&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_LightEnv.lutEnabledD1&lt;br /&gt;
| 0x0012DB58&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xE9&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_LightEnv.lutEnabledRefl&lt;br /&gt;
| 0x0012C83C&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0xEA&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_TexEnv[0].combineRgb&lt;br /&gt;
| 0x0012DC2C&lt;br /&gt;
| ?&lt;br /&gt;
| 0xC2&lt;br /&gt;
|- &lt;br /&gt;
| 0xEB&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_TexEnv[1].combineRgb&lt;br /&gt;
| 0x0012DC2C&lt;br /&gt;
| ?&lt;br /&gt;
| 0xCA&lt;br /&gt;
|- &lt;br /&gt;
| 0xEC&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_TexEnv[2].combineRgb&lt;br /&gt;
| 0x0012DC2C&lt;br /&gt;
| ?&lt;br /&gt;
| 0xD2&lt;br /&gt;
|- &lt;br /&gt;
| 0xED&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_TexEnv[3].combineRgb&lt;br /&gt;
| 0x0012DC2C&lt;br /&gt;
| ?&lt;br /&gt;
| 0xDA&lt;br /&gt;
|- &lt;br /&gt;
| 0xEE&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_TexEnv[4].combineRgb&lt;br /&gt;
| 0x0012DC2C&lt;br /&gt;
| ?&lt;br /&gt;
| 0xF2&lt;br /&gt;
|- &lt;br /&gt;
| 0xEF&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_TexEnv[5].combineRgb&lt;br /&gt;
| 0x0012DC2C&lt;br /&gt;
| ?&lt;br /&gt;
| 0xFA&lt;br /&gt;
|- &lt;br /&gt;
| 0xF0&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_TexEnv[0].combineAlpha&lt;br /&gt;
| 0x0012DD9C&lt;br /&gt;
| ?&lt;br /&gt;
| 0xC2&lt;br /&gt;
|- &lt;br /&gt;
| 0xF1&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_TexEnv[1].combineAlpha&lt;br /&gt;
| 0x0012DD9C&lt;br /&gt;
| ?&lt;br /&gt;
| 0xCA&lt;br /&gt;
|- &lt;br /&gt;
| 0xF2&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_TexEnv[2].combineAlpha&lt;br /&gt;
| 0x0012DD9C&lt;br /&gt;
| ?&lt;br /&gt;
| 0xD2&lt;br /&gt;
|- &lt;br /&gt;
| 0xF3&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_TexEnv[3].combineAlpha&lt;br /&gt;
| 0x0012DD9C&lt;br /&gt;
| ?&lt;br /&gt;
| 0xDA&lt;br /&gt;
|- &lt;br /&gt;
| 0xF4&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_TexEnv[4].combineAlpha&lt;br /&gt;
| 0x0012DD9C&lt;br /&gt;
| ?&lt;br /&gt;
| 0xF2&lt;br /&gt;
|- &lt;br /&gt;
| 0xF5&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_TexEnv[5].combineAlpha&lt;br /&gt;
| 0x0012DD9C&lt;br /&gt;
| ?&lt;br /&gt;
| 0xFA&lt;br /&gt;
|- &lt;br /&gt;
| 0xF6&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[0].srcRgb&lt;br /&gt;
| 0x0012DF08&lt;br /&gt;
| ?&lt;br /&gt;
| 0xC0&lt;br /&gt;
|- &lt;br /&gt;
| 0xF7&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[1].srcRgb&lt;br /&gt;
| 0x0012DF08&lt;br /&gt;
| ?&lt;br /&gt;
| 0xC8&lt;br /&gt;
|- &lt;br /&gt;
| 0xF8&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[2].srcRgb&lt;br /&gt;
| 0x0012DF08&lt;br /&gt;
| ?&lt;br /&gt;
| 0xD0&lt;br /&gt;
|- &lt;br /&gt;
| 0xF9&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[3].srcRgb&lt;br /&gt;
| 0x0012DF08&lt;br /&gt;
| ?&lt;br /&gt;
| 0xD8&lt;br /&gt;
|- &lt;br /&gt;
| 0xFA&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[4].srcRgb&lt;br /&gt;
| 0x0012DF08&lt;br /&gt;
| ?&lt;br /&gt;
| 0xF0&lt;br /&gt;
|- &lt;br /&gt;
| 0xFB&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[5].srcRgb&lt;br /&gt;
| 0x0012DF08&lt;br /&gt;
| ?&lt;br /&gt;
| 0xF8&lt;br /&gt;
|- &lt;br /&gt;
| 0xFC&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[0].srcAlpha&lt;br /&gt;
| 0x0012E0FC&lt;br /&gt;
| ?&lt;br /&gt;
| 0xC0&lt;br /&gt;
|- &lt;br /&gt;
| 0xFD&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[1].srcAlpha&lt;br /&gt;
| 0x0012E0FC&lt;br /&gt;
| ?&lt;br /&gt;
| 0xC8&lt;br /&gt;
|- &lt;br /&gt;
| 0xFE&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[2].srcAlpha&lt;br /&gt;
| 0x0012E0FC&lt;br /&gt;
| ?&lt;br /&gt;
| 0xD0&lt;br /&gt;
|- &lt;br /&gt;
| 0xFF&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[3].srcAlpha&lt;br /&gt;
| 0x0012E0FC&lt;br /&gt;
| ?&lt;br /&gt;
| 0xD8&lt;br /&gt;
|- &lt;br /&gt;
| 0x100&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[4].srcAlpha&lt;br /&gt;
| 0x0012E0FC&lt;br /&gt;
| ?&lt;br /&gt;
| 0xF0&lt;br /&gt;
|- &lt;br /&gt;
| 0x101&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[5].srcAlpha&lt;br /&gt;
| 0x0012E0FC&lt;br /&gt;
| ?&lt;br /&gt;
| 0xF8&lt;br /&gt;
|- &lt;br /&gt;
| 0x102&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[0].operandRgb&lt;br /&gt;
| 0x0012E2F0&lt;br /&gt;
| ?&lt;br /&gt;
| 0xC1&lt;br /&gt;
|- &lt;br /&gt;
| 0x103&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[1].operandRgb&lt;br /&gt;
| 0x0012E2F0&lt;br /&gt;
| ?&lt;br /&gt;
| 0xC9&lt;br /&gt;
|- &lt;br /&gt;
| 0x104&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[2].operandRgb&lt;br /&gt;
| 0x0012E2F0&lt;br /&gt;
| ?&lt;br /&gt;
| 0xD1&lt;br /&gt;
|- &lt;br /&gt;
| 0x105&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[3].operandRgb&lt;br /&gt;
| 0x0012E2F0&lt;br /&gt;
| ?&lt;br /&gt;
| 0xD9&lt;br /&gt;
|- &lt;br /&gt;
| 0x106&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[4].operandRgb&lt;br /&gt;
| 0x0012E2F0&lt;br /&gt;
| ?&lt;br /&gt;
| 0xF1&lt;br /&gt;
|- &lt;br /&gt;
| 0x107&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[5].operandRgb&lt;br /&gt;
| 0x0012E2F0&lt;br /&gt;
| ?&lt;br /&gt;
| 0xF9&lt;br /&gt;
|- &lt;br /&gt;
| 0x108&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[0].operandAlpha&lt;br /&gt;
| 0x0012E51C&lt;br /&gt;
| ?&lt;br /&gt;
| 0xC1&lt;br /&gt;
|- &lt;br /&gt;
| 0x109&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[1].operandAlpha&lt;br /&gt;
| 0x0012E51C&lt;br /&gt;
| ?&lt;br /&gt;
| 0xC9&lt;br /&gt;
|- &lt;br /&gt;
| 0x10A&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[2].operandAlpha&lt;br /&gt;
| 0x0012E51C&lt;br /&gt;
| ?&lt;br /&gt;
| 0xD1&lt;br /&gt;
|- &lt;br /&gt;
| 0x10B&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[3].operandAlpha&lt;br /&gt;
| 0x0012E51C&lt;br /&gt;
| ?&lt;br /&gt;
| 0xD9&lt;br /&gt;
|- &lt;br /&gt;
| 0x10C&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[4].operandAlpha&lt;br /&gt;
| 0x0012E51C&lt;br /&gt;
| ?&lt;br /&gt;
| 0xF1&lt;br /&gt;
|- &lt;br /&gt;
| 0x10D&lt;br /&gt;
| GL_INT_VEC3&lt;br /&gt;
| dmp_TexEnv[5].operandAlpha&lt;br /&gt;
| 0x0012E51C&lt;br /&gt;
| ?&lt;br /&gt;
| 0xF9&lt;br /&gt;
|- &lt;br /&gt;
| 0x10E&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_TexEnv[0].scaleRgb&lt;br /&gt;
| 0x00155464&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x10F&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_TexEnv[1].scaleRgb&lt;br /&gt;
| 0x00155464&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x110&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_TexEnv[2].scaleRgb&lt;br /&gt;
| 0x00155464&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x111&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_TexEnv[3].scaleRgb&lt;br /&gt;
| 0x00155464&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x112&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_TexEnv[4].scaleRgb&lt;br /&gt;
| 0x00155464&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x113&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_TexEnv[5].scaleRgb&lt;br /&gt;
| 0x00155464&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x114&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_TexEnv[0].scaleAlpha&lt;br /&gt;
| 0x00158EDC&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x115&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_TexEnv[1].scaleAlpha&lt;br /&gt;
| 0x00158EDC&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x116&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_TexEnv[2].scaleAlpha&lt;br /&gt;
| 0x00158EDC&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x117&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_TexEnv[3].scaleAlpha&lt;br /&gt;
| 0x00158EDC&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x118&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_TexEnv[4].scaleAlpha&lt;br /&gt;
| 0x00158EDC&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x119&lt;br /&gt;
| GL_FLOAT&lt;br /&gt;
| dmp_TexEnv[5].scaleAlpha&lt;br /&gt;
| 0x00158EDC&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x11A&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_TexEnv[0].constRgba&lt;br /&gt;
| 0x00158FF4&lt;br /&gt;
| ?&lt;br /&gt;
| 0xC3&lt;br /&gt;
|- &lt;br /&gt;
| 0x11B&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_TexEnv[1].constRgba&lt;br /&gt;
| 0x00158FF4&lt;br /&gt;
| ?&lt;br /&gt;
| 0xCB&lt;br /&gt;
|- &lt;br /&gt;
| 0x11C&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_TexEnv[2].constRgba&lt;br /&gt;
| 0x00158FF4&lt;br /&gt;
| ?&lt;br /&gt;
| 0xD3&lt;br /&gt;
|- &lt;br /&gt;
| 0x11D&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_TexEnv[3].constRgba&lt;br /&gt;
| 0x00158FF4&lt;br /&gt;
| ?&lt;br /&gt;
| 0xDB&lt;br /&gt;
|- &lt;br /&gt;
| 0x11E&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_TexEnv[4].constRgba&lt;br /&gt;
| 0x00158FF4&lt;br /&gt;
| ?&lt;br /&gt;
| 0xF3&lt;br /&gt;
|- &lt;br /&gt;
| 0x11F&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_TexEnv[5].constRgba&lt;br /&gt;
| 0x00158FF4&lt;br /&gt;
| ?&lt;br /&gt;
| 0xFB&lt;br /&gt;
|- &lt;br /&gt;
| 0x120&lt;br /&gt;
| GL_FLOAT_VEC4&lt;br /&gt;
| dmp_TexEnv[0].bufferColor&lt;br /&gt;
| 0x001591C0&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x121&lt;br /&gt;
| GL_INT_VEC2&lt;br /&gt;
| dmp_TexEnv[1].bufferInput&lt;br /&gt;
| 0x0012E6D0&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x122&lt;br /&gt;
| GL_INT_VEC2&lt;br /&gt;
| dmp_TexEnv[2].bufferInput&lt;br /&gt;
| 0x0012E6D0&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x123&lt;br /&gt;
| GL_INT_VEC2&lt;br /&gt;
| dmp_TexEnv[3].bufferInput&lt;br /&gt;
| 0x0012E6D0&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x124&lt;br /&gt;
| GL_INT_VEC2&lt;br /&gt;
| dmp_TexEnv[4].bufferInput&lt;br /&gt;
| 0x0012E6D0&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x125&lt;br /&gt;
| GL_INT&lt;br /&gt;
| dmp_Fog.mode&lt;br /&gt;
| 0x0012E7F8&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x126&lt;br /&gt;
| GL_FLOAT_VEC3&lt;br /&gt;
| dmp_Fog.color&lt;br /&gt;
| 0x00159338&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x127&lt;br /&gt;
| GL_BOOL&lt;br /&gt;
| dmp_Fog.zFlip&lt;br /&gt;
| 0x0012E9DC&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|- &lt;br /&gt;
| 0x128&lt;br /&gt;
| GL_SAMPLER_1D&lt;br /&gt;
| dmp_Fog.sampler&lt;br /&gt;
| 0x0012EAA4&lt;br /&gt;
| ?&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
On steeldiver&#039;s uniform handlers : R1 is a pointer to the current shader program object, R12 is a pointer to the data the uniform is being set to.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=3DS_System_Flaws&amp;diff=10418</id>
		<title>3DS System Flaws</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=3DS_System_Flaws&amp;diff=10418"/>
		<updated>2014-11-03T14:11:53Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Exploits are used to execute unofficial code (homebrew) on the Nintendo 3DS. This page is a list of known 3DS-mode exploits.&lt;br /&gt;
&lt;br /&gt;
==List of 3DS exploits==&lt;br /&gt;
&lt;br /&gt;
==Current Efforts==&lt;br /&gt;
There are people working on finding exploits and documenting the 3DS. Here&#039;s a list of some current efforts being made to make homebrew on the 3DS possible:&lt;br /&gt;
&lt;br /&gt;
* Smealum has a working exploit up to newest system version and has shown what seems to be viable proof that this is real. He says that he will be releasing the exploit when he believes all of the bundled software (HBC and others) are relatively bug free. In other words NO ETA.&lt;br /&gt;
&lt;br /&gt;
==Stale / Rejected Efforts==&lt;br /&gt;
* Neimod has been working on a RAM dumping setup for a little while now. He&#039;s desoldered the 3DS&#039;s RAM chip and hooked it and the RAM pinouts on the 3DS&#039;s PCB up to a custom RAM dumping setup. Recent photos show that the setup is working quite well, with the 3DS successfully booting up. Pictures of neimod&#039;s work can be found on [http://www.flickr.com/photos/neimod/ his Flickr stream].&lt;br /&gt;
&lt;br /&gt;
      Neimod&#039;s flickr stream is now private and his work is considered awesome&lt;br /&gt;
&lt;br /&gt;
* A loser has released CFW and CIA installers along with some other interesting stuff (and illegal stuff) most of which were created by others and stolen&lt;br /&gt;
&lt;br /&gt;
== Fixed vulnerabilities ==&lt;br /&gt;
* The following was fixed with [[7.0.0-13]], see here for [[7.0.0-13|details]]. Too long or corrupted strings (01Ah  2   Nickname length in characters     050h  2   Message length in characters) in the NVRAM DS user settings cause (System Settings-&amp;gt;Other Settings-&amp;gt;Profile-&amp;gt;Nintendo DS Profile) to crash in 3DS-mode due to a stack-smash. The DSi is not vulnerable to this, DSi launcher(menu) and DSi System Settings will reset the NVRAM user-settings if the length field values are too long(same result as when the CRCs are invalid).&lt;br /&gt;
&lt;br /&gt;
==Failed attempts==&lt;br /&gt;
Here are listed all attempts at exploiting 3DS software that have failed so far.&lt;br /&gt;
&lt;br /&gt;
* Pushmo (3DSWare), QR codes: level name is properly limited to 16 characters, game doesn&#039;t crash with a longer name. The only possible crashes are triggered by out-of-bounds values, these crashes are caused by the application attempting to load a ptr from a buffer located at NULL.&lt;br /&gt;
* Pyramids (3DSWare), QR codes: no strings. Only crashes are from out-of-bounds values (like background ID) and are not exploitable.&lt;br /&gt;
* 3DS browser, 2^32 characters long string: this is similar to the vuln fixed [http://git.chromium.org/gitweb/?p=external/Webkit.git;a=commitdiff;h=ec471f16fbd1f879cb631f9b022fd16acd75f4d4 here], concat-large-strings-crash2.html triggers a crash which is about the same as the one triggered by a 2^32 string. Most of the time this vuln will cause a memory page permissions fault, since the webkit code attempts to copy the string text data to the output buffer located in read-only [[CRO0|CRO]] heap memory. The only difference between a crash triggered by a 2^32 string and the concat-large-strings-crash2.html crash is that the former copies the string data using the original string length(like 1 text character for &amp;quot;x&amp;quot;, 4 for &amp;quot;xxxx&amp;quot;) while the latter attempts to copy &amp;gt;12MB. In some &#039;&#039;very&#039;&#039; rare cases a thread separate from the string data-copy thread will crash, this might be exploitable however this is useless since it rarely crashes this way.&lt;br /&gt;
&lt;br /&gt;
==Tips and info==&lt;br /&gt;
The 3DS uses the XN feature of the ARM processor, and only apps that have the necessary permissions in their headers can set memory to be executable. This means that although a usable buffer overflow exploit would still be useful, it would not go the entire way towards allowing code to be run in an easy/practical fashion (ie an actual homebrew launcher) - for that, an exploit in the system is required. A buffer overflow exploit does, however, provide enough wriggle room through the use of return-oriented programming to potentially trigger a system exploit.&lt;br /&gt;
&lt;br /&gt;
SD card [[extdata]] and SD savegames can be attacked, for consoles where the console-unique [[Nand/private/movable.sed|movable.sed]] was dumped.&lt;br /&gt;
&lt;br /&gt;
Note that the publicly-available &amp;lt;v5.0 total-control exploits are [[FIRM|Process9]] exploits, not &amp;quot;kernel exploits&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==System flaws==&lt;br /&gt;
=== ARM11 kernel ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Summary&lt;br /&gt;
!  Description&lt;br /&gt;
!  Fixed in system version&lt;br /&gt;
|-&lt;br /&gt;
|  [[SVC]] table too small&lt;br /&gt;
|  The table of function pointers for SVC&#039;s only contains entries up to 0x7D, but the biggest allowed SVC for the table is 0x7F. Thus, executing svc7E or svc7F would make the SVC-handler read after the buffer, and interpret some ARM instructions as function pointers.&lt;br /&gt;
&lt;br /&gt;
However this would require patching the kernel .text or modifying SVC-access-control. Even if you could get these to execute, they would still jump to memory that isn&#039;t mapped as executable.&lt;br /&gt;
|  None&lt;br /&gt;
|-&lt;br /&gt;
|  [[SVC|svcBackdoor (0x7B)]]&lt;br /&gt;
|  This backdoor allows executing SVC-mode code at the user-specified code-address. This is used by Process9, using this on the ARM11(with NATIVE_FIRM) requires patching the kernel .text or modifying SVC-access-control.&lt;br /&gt;
|  None&lt;br /&gt;
|-&lt;br /&gt;
| [[Memory_layout#ARM11_Detailed_virtual_memory_map|0xEFF00000]] / 0xDFF00000 ARM11 kernel virtual-memory&lt;br /&gt;
| The ARM11 kernel-mode 0xEFF00000/0xDFF00000 virtual-memory(size 0x100000) is mapped to phys-mem 0x1FF00000(entire DSP-mem + entire AXIWRAM), with permissions RW-. This is used during ARM11 kernel startup, this never seems to be used after that however.&lt;br /&gt;
| None&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcStartInterProcessDma]]&lt;br /&gt;
| For svcStartInterProcessDma, the kernel code had the following flaws:&lt;br /&gt;
&lt;br /&gt;
* Originally the ARM11-kernel read the input DmaConfig structure directly in kernel-mode(ldr(b/h) instructions), without checking whether the DmaConfig address is readable under userland. This was fixed by copying that structure to the SVC-mode stack, using the ldrbt instruction.&lt;br /&gt;
&lt;br /&gt;
* Integer overflows for srcaddr+size and dstaddr+size are now checked(with [[6.0.0-11]]), which were not checked before.&lt;br /&gt;
&lt;br /&gt;
* The kernel now also checks whether the srcaddr/dstaddr(+size) is within userland memory(0x20000000), the kernel now(with [[6.0.0-11]]) returns an error when the address is beyond userland memory. Using an address &amp;gt;=0x20000000 would result in the kernel reading from the process L1 MMU table, beyond the memory allocated for that MMU table(for vaddr-&amp;gt;physaddr conversion). &lt;br /&gt;
| [[6.0.0-11]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcControlMemory]] Parameter checks&lt;br /&gt;
| For svcControlMemory the parameter check had these two flaws:&lt;br /&gt;
&lt;br /&gt;
* The allowed range for addr0, addr1, size parameters depends on which MemoryOperation is being specified. The limitation for GSP heap was only checked if op=(u32)0x10003. By setting a random bit in op that has no meaning (like bit17?), op would instead be (u32)0x30003, and the range-check would be less strict and not accurate. However, the kernel doesn&#039;t actually use the input address for LINEAR memory-mapping at all besides the range-checks, so this isn&#039;t actually useful. This was fixed in the kernel by just checking for the LINEAR bit, instead of comparing the entire MemoryOperation value with 0x10003.&lt;br /&gt;
&lt;br /&gt;
* Integer overflows on (addr0+size) are now checked that previously weren&#039;t(this also applies to most other address checks elsewhere in the kernel).&lt;br /&gt;
&lt;br /&gt;
| [[5.0.0-11]]&lt;br /&gt;
|-&lt;br /&gt;
| [[RPC_Command_Structure|Command]] request/response buffer overflow&lt;br /&gt;
| Originally the kernel did not check the word-values from the command-header. Starting with [[5.0.0-11]], the kernel will trigger a kernelpanic() when the total word-size of the entire command(including the cmd-header) is larger than 0x40-words(0x100-bytes). This allows overwriting threadlocalstorage+0x180 in the destination thread, however since the data written there would be translate parameters(such as header-words + buffer addresses), exploiting this would likely be very difficult if possible at all.&lt;br /&gt;
&lt;br /&gt;
If the two words at threadlocalstorage+0x180 could be overwritten with controlled data this way, one could then use a command with a buffer-header of &amp;lt;nowiki&amp;gt;((size&amp;lt;&amp;lt;14) | 2)&amp;lt;/nowiki&amp;gt; to write arbitrary memory to any RW userland memory in the destination process.&lt;br /&gt;
| [[5.0.0-11]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|SVC stack allocation overflows]]&lt;br /&gt;
| &lt;br /&gt;
* Syscalls that allocate a variable-length array on stack, only checked bit31 before multiplying by 4/16 (when calculating how much memory to allocate). If a large integer was passed as input to one of these syscalls, an integer overflow would occur, and too little memory would have been allocated on stack resulting in a buffer overrun. &lt;br /&gt;
* The alignment (size+7)&amp;amp;~7 calucation before allocation was not checked for integer overflow.&lt;br /&gt;
&lt;br /&gt;
This might allow for ARM11 kernel code-execution.&lt;br /&gt;
&lt;br /&gt;
(Applies to svcSetResourceLimitValues, svcGetThreadList, svcGetProcessList, svcReplyAndReceive, svcWaitSynchronizationN.)&lt;br /&gt;
| [[5.0.0-11]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcControlMemory]] MemoryOperation MAP memory-permissions&lt;br /&gt;
| svcControlMemory with MemoryOperation=MAP allows mapping the already-mapped process virtual-mem at addr1, to addr0. The lowest address permitted for addr1 is 0x00100000. Originally the ARM11 kernel didn&#039;t check memory permissions for addr1. Therefore .text as addr1 could be mapped elsewhere as RW- memory, which allowed ARM11 userland code-execution.&lt;br /&gt;
| [[4.1.0-8]]&lt;br /&gt;
|-&lt;br /&gt;
| [[RPC_Command_Structure|Command]] input/output buffer permissions&lt;br /&gt;
| Originally the ARM11 kernel didn&#039;t check memory permissions for the input/output buffers for commands. Starting with [[4.0.0-7]] the ARM11 kernel will trigger a kernelpanic() if the input/output buffers don&#039;t have the required memory permissions. For example, this allowed a FSUSER file-read to .text, which therefore allowed ARM11-userland code execution.&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
|-&lt;br /&gt;
| [[SVC|svcReadProcessMemory/svcWriteProcessMemory memory]] permissions&lt;br /&gt;
| Originally the kernel only checked the first page(0x1000-bytes) of the src/dst buffers, for svcReadProcessMemory and svcWriteProcessMemory. There is no known retail processes which have access to these SVCs.&lt;br /&gt;
| [[4.0.0-7]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== FIRM ARM11 modules ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Summary&lt;br /&gt;
!  Description&lt;br /&gt;
!  Fixed in system version&lt;br /&gt;
|-&lt;br /&gt;
| [[Services|&amp;quot;srv:pm&amp;quot;]] process registration&lt;br /&gt;
| Originally any process had access to the port &amp;quot;srv:pm&amp;quot;. The PID&#039;s used for the (un)registration commands are not checked either. This allowed any process to re-register itself with &amp;quot;srv:pm&amp;quot;, and therefore allowed the process to give itself access to any service, bypassing the exheader service-access-control list.&lt;br /&gt;
&lt;br /&gt;
This was fixed in [[7.0.0-13]]: starting with [[7.0.0-13]] &amp;quot;srv:pm&amp;quot; is now a service instead of a globally accessible port. Only processes with PID&#039;s less than 6 (in other words: fs, ldr, sm, pm, pxi modules) have access to it. With [[7.0.0-13]] there can only be one session for &amp;quot;srv:pm&amp;quot; open at a time(this is used by pm module), svcBreak will be executed if more sessions are opened by the processes which can access this.&lt;br /&gt;
&lt;br /&gt;
This flaw was needed for exploiting the &amp;lt;=v4.x Process9 PXI vulnerabilities from ARM11 userland ROP, since most applications don&#039;t have access to those service(s).&lt;br /&gt;
| [[7.0.0-13]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=AES_Registers&amp;diff=10357</id>
		<title>AES Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=AES_Registers&amp;diff=10357"/>
		<updated>2014-10-28T17:57:12Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Registers ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  NAME&lt;br /&gt;
!  PHYSICAL ADDRESS&lt;br /&gt;
!  WIDTH&lt;br /&gt;
!  RW&lt;br /&gt;
|-&lt;br /&gt;
| REG_AESCNT&lt;br /&gt;
| 0x10009000&lt;br /&gt;
| 4&lt;br /&gt;
| RW&lt;br /&gt;
|-&lt;br /&gt;
| REG_AESBLKCNT&lt;br /&gt;
| 0x10009004&lt;br /&gt;
| 4&lt;br /&gt;
| W?&lt;br /&gt;
|-&lt;br /&gt;
| REG_AESWRFIFO&lt;br /&gt;
| 0x10009008&lt;br /&gt;
| 4&lt;br /&gt;
| W&lt;br /&gt;
|-&lt;br /&gt;
| REG_AESRDFIFO&lt;br /&gt;
| 0x1000900C&lt;br /&gt;
| 4&lt;br /&gt;
| R&lt;br /&gt;
|-&lt;br /&gt;
| REG_AESKEYSEL&lt;br /&gt;
| 0x10009010&lt;br /&gt;
| 1&lt;br /&gt;
| RW&lt;br /&gt;
|-&lt;br /&gt;
| REG_AESKEYCNT&lt;br /&gt;
| 0x10009011&lt;br /&gt;
| 1&lt;br /&gt;
| RW&lt;br /&gt;
|-&lt;br /&gt;
| REG_AESCTR&lt;br /&gt;
| 0x10009020&lt;br /&gt;
| 16&lt;br /&gt;
| W&lt;br /&gt;
|-&lt;br /&gt;
| REG_AESMAC&lt;br /&gt;
| 0x10009030&lt;br /&gt;
| 16&lt;br /&gt;
| W&lt;br /&gt;
|-&lt;br /&gt;
| REG_AESKEY0&lt;br /&gt;
| 0x10009040&lt;br /&gt;
| 48&lt;br /&gt;
| W&lt;br /&gt;
|-&lt;br /&gt;
| REG_AESKEY1&lt;br /&gt;
| 0x10009070&lt;br /&gt;
| 48&lt;br /&gt;
| W&lt;br /&gt;
|-&lt;br /&gt;
| REG_AESKEY2&lt;br /&gt;
| 0x100090A0&lt;br /&gt;
| 48&lt;br /&gt;
| W&lt;br /&gt;
|-&lt;br /&gt;
| REG_AESKEY3&lt;br /&gt;
| 0x100090D0&lt;br /&gt;
| 48&lt;br /&gt;
| W&lt;br /&gt;
|-&lt;br /&gt;
| REG_AESKEYFIFO&lt;br /&gt;
| 0x10009100&lt;br /&gt;
| 4&lt;br /&gt;
| W&lt;br /&gt;
|-&lt;br /&gt;
| REG_AESKEYXFIFO&lt;br /&gt;
| 0x10009104&lt;br /&gt;
| 4&lt;br /&gt;
| W&lt;br /&gt;
|-&lt;br /&gt;
| REG_AESKEYYFIFO&lt;br /&gt;
| 0x10009108&lt;br /&gt;
| 4&lt;br /&gt;
| W&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== REG_AESCNT ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 4-0&lt;br /&gt;
| Write fifo count (0..16)&lt;br /&gt;
|-&lt;br /&gt;
| 9-5&lt;br /&gt;
| Read fifo count (0..16)&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| Flush write fifo (1=Clear write fifo)&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| Flush read fifo (1=Clear read fifo)&lt;br /&gt;
|-&lt;br /&gt;
| 18-16&lt;br /&gt;
| MAC size (encoding = (maclen-2)/2)&lt;br /&gt;
|-&lt;br /&gt;
| 19&lt;br /&gt;
| ? (something MAC related)&lt;br /&gt;
|-&lt;br /&gt;
| 20&lt;br /&gt;
| MAC input control (0 = read MAC from FIFO, 1 = read from MAC register)&lt;br /&gt;
|-&lt;br /&gt;
| 21&lt;br /&gt;
| MAC status (0 = invalid, 1 = verified)&lt;br /&gt;
|-&lt;br /&gt;
| 22&lt;br /&gt;
| Output endianness (1=Big endian, 0=Little endian)&lt;br /&gt;
|-&lt;br /&gt;
| 23&lt;br /&gt;
| Input endianness (1=Big endian, 0=Little endian)&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| Output word order (1=Normal order, 0=Reversed order)&lt;br /&gt;
|-&lt;br /&gt;
| 25&lt;br /&gt;
| Input word order (1=Normal order, 0=Reversed order)&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| 26&lt;br /&gt;
| Update keyslot (set to 1 when the keyslot is changed)&lt;br /&gt;
|-&lt;br /&gt;
| 29-27&lt;br /&gt;
| Mode (0=CCM decrypt, 1=CCM encrypt, 2=CTR, 3=CTR, 4=CBC decrypt, 5=CBC encrypt, 6=ECB decrypt, 7=ECB encrypt)&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Interrupt enable (1=Enable, 0=Disable)&lt;br /&gt;
|-&lt;br /&gt;
| 31&lt;br /&gt;
| Start (1=Enable/Busy, 0=Idle)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== REG_AESBLKCNT ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 16-31&lt;br /&gt;
| (Data length)&amp;gt;&amp;gt;4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== REG_AESKEYCNT ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 5-0&lt;br /&gt;
| Keyslot&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Hardware key-generator type: 0 = 3DS, 1 = DSi.&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| This normally has value 1 written here when updating keys, however that&#039;s not actually needed(keydata gets updated regardless of whether this bit is set).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bit6 is only used when keyslots &amp;gt;=4 are used, value1 has the same affect as doing key-init with the TWL keyslots. Bit6 is checked when a keyY was written, for when the final-normalkey needs updated via the key-generator.&lt;br /&gt;
&lt;br /&gt;
== REG_AESCTR ==&lt;br /&gt;
This register specifies the counter (CTR mode), nonce (CCM mode) or the initialization vector (CBC mode) depending on the mode of operation.&lt;br /&gt;
For CBC and CTR mode this register takes up the full 16 bytes, but for CCM mode the nonce is only the first 12 bytes.&lt;br /&gt;
&lt;br /&gt;
== REG_AESMAC ==&lt;br /&gt;
This register specifies the message authentication code (MAC) for use in CCM mode.&lt;br /&gt;
&lt;br /&gt;
== Endianness and word order ==&lt;br /&gt;
When writing to the REG_AESCTR or REG_AESMAC register, the hardware will process the written data according to the current input endianness specified in AESCNT. However, the current specified input word order will not be honored for this register, and always defaults to reversed word order. Therefore, for normal word order, the reversal must be carried out manually if required.&lt;br /&gt;
&lt;br /&gt;
== Keyslots ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Keyslot&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00-0x03&lt;br /&gt;
| These are the TWL keyslots, the key-data for these can be set via the REG_AESKEY0-REG_AESKEY3 registers. These keyslots are initialized by NATIVE_FIRM. The console-unique portion of two of these keyslots are only [[CONFIG|initialized]] by NATIVE_FIRM during initial hard-boot.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0D&lt;br /&gt;
| See [[PSPXI:EncryptDecryptAes|EncryptDecryptAes]], this uses the hardware key-scrambler.&lt;br /&gt;
|-&lt;br /&gt;
| 0x11&lt;br /&gt;
| This is used for general normal-key crypto, where the normal-key is set by FIRM. This keyslot is also used by the New3DS [[FIRM]] arm9 binary loader.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| Starting with [[5.0.0-11]], NATIVE_FIRM Process9 now sets the keyY for this to the same one it uses for initializing 3 of the keyslots&#039; keyYs from [[PSPXI:EncryptDecryptAes|here]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x20..0x23&lt;br /&gt;
| All of these keyslots(initialized by bootrom) are set to the same key-data. These seem to be set to a regular normal-key?&lt;br /&gt;
|-&lt;br /&gt;
| 0x25&lt;br /&gt;
| The keyX and keyY initialized by bootrom for this keyslot are console-unique. This keyslot is used for the [[7.0.0-13|v7.0]] [[NCCH]] encryption, the keyX is initialized during NATIVE_FIRM [[Savegames#6.0.0-11_Savegame_keyY|boot]]. The keyY/CTR used for this keyslot is the same as keyslot 0x2C.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C&lt;br /&gt;
| Used to decrypt [[NCCH|NCCH]], the keyY is set by Process9(see [[NCCH|here]] regarding the keyY). Keyslots 0x2C..0x2F all use the same keyX, set by bootrom.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D&lt;br /&gt;
| See [[PSPXI:EncryptDecryptAes|EncryptDecryptAes]], this uses the hardware key-scrambler.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E&lt;br /&gt;
| See [[PSPXI:EncryptDecryptAes|EncryptDecryptAes]]. This keyY is set by NATIVE_FIRM.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F&lt;br /&gt;
| Initially this keyslot has the same keyY as keyslot 0x2D, initialized by bootrom. This keyY is initialized during NATIVE_FIRM [[Savegames#6.0.0-11_Savegame_keyY|boot]]. This is the keyslot used for calculating v6.0 gamecard savegames&#039; keyYs.&lt;br /&gt;
|-&lt;br /&gt;
| 0x31&lt;br /&gt;
| See [[PSPXI:EncryptDecryptAes|EncryptDecryptAes]], this uses the hardware key-scrambler. NATIVE_FIRM sets this keyY to the same one used for keyslot 0x2E.&lt;br /&gt;
|-&lt;br /&gt;
| 0x32&lt;br /&gt;
| See [[PSPXI:EncryptDecryptAes|EncryptDecryptAes]]. This keyslot keyX is the same keyX used for keyslot 0x31.&lt;br /&gt;
|-&lt;br /&gt;
| 0x34-0x37&lt;br /&gt;
| All four of these keyslots use the same keyX. Keyslots 0x35/0x36 use the same keyY, see [[PSPXI:EncryptDecryptAes|EncryptDecryptAes]] for keyslot 0x36.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38&lt;br /&gt;
| See [[PSPXI:EncryptDecryptAes|EncryptDecryptAes]], this uses the hardware key-scrambler.&lt;br /&gt;
|-&lt;br /&gt;
| 0x39&lt;br /&gt;
| See [[PSPXI:EncryptDecryptAes|EncryptDecryptAes]]. This keyslot keyX is the same keyX used for keyslot 0x38. NATIVE_FIRM sets this keyY to the same one used for keyslot 0x2E.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D&lt;br /&gt;
| This keyslot uses keyY. Used to decrypt title keys in [[Ticket]]. Used by Gateway.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E&lt;br /&gt;
| This keyslot uses an unique keyX/keyY.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F&lt;br /&gt;
| This keyslot uses an unique keyX/keyY.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Hardware key generator ===&lt;br /&gt;
Unless noted otherwise, all keyslots on retail units use the hardware key-scrambler, where the final normal-key is generated in hardware using the input keyX and keyY. This normal-key is then written to the hardware keyslot by the AES engine, all of the AES engine key registers are write-only. The internal normal-key keyslot is only updated when the keyY is written to, the keyslot&#039;s normal-key is not immediately updated when writing to the keyX.&lt;br /&gt;
&lt;br /&gt;
=== keyX ===&lt;br /&gt;
The ARM9 bootrom initializes the keyX for each 3DS keyslot, the ARM9 bootrom also initializes the keyY for the keyslots where NATIVE_FIRM doesn&#039;t set the keyY. In certain cases Process9 may also set the keyX.&lt;br /&gt;
&lt;br /&gt;
=== Updating keydata ===&lt;br /&gt;
After writing to a keyslot when the keyslot is already selected, the keyslot must be re-selected for the updated keyslot key-data to be used.&lt;br /&gt;
&lt;br /&gt;
Writing to the key FIFOs with byte writes results in the AES engine converting the byte to a word for setting the key word, with this: word = (byteval) | (byteval&amp;lt;&amp;lt;8) | (byteval&amp;lt;&amp;lt;16) | (byteval&amp;lt;&amp;lt;24). The result is the same regardless of which FIFO register byte was written to.&lt;br /&gt;
&lt;br /&gt;
=== FIRM-launch key clearing ===&lt;br /&gt;
Starting with [[9.0.0-20]] the Process9 FIRM-launch code now &amp;quot;clears&amp;quot; the following AES keyslots, with certain keydata by writing the normal-key: 0x15 and 0x18-0x20. These are the keyslots used by the New3DS [[FIRM]] arm9bin loader(minus keyslot 0x11), so the New3DS Process9 presumably does this too.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=AES_Registers&amp;diff=10356</id>
		<title>AES Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=AES_Registers&amp;diff=10356"/>
		<updated>2014-10-28T17:55:39Z</updated>

		<summary type="html">&lt;p&gt;Neimod: moved AES Registers to AES Registers2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[AES Registers2]]&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Main_Page/Header&amp;diff=8395</id>
		<title>Main Page/Header</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Main_Page/Header&amp;diff=8395"/>
		<updated>2014-01-12T20:44:46Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;background-color:#e7eef6; border: 1px solid #ccc; color:#000; margin-top: 15px; margin-bottom: 10px; padding: 8px; text-align:center;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size: 162%; border: none; margin: 0; padding:.1em;&amp;quot;&amp;gt;Welcome to [[3DBrew:About|3DBrew]],&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size: 95%&amp;quot;&amp;gt;a wiki dedicated to homebrew on the Nintendo 3DS.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size:85%;&amp;quot;&amp;gt;We have [[Special:Statistics|{{NUMBEROFARTICLES}}]] articles. Join our development conversations on the EFnet IRC channel &#039;&#039;#3dsdev&#039;&#039;. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size:200%;&amp;quot;&amp;gt;&amp;lt;br&amp;gt;[[Fundraiser|Chip Decapping Fundraiser]] currently suspended!&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Fundraiser&amp;diff=8394</id>
		<title>Fundraiser</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Fundraiser&amp;diff=8394"/>
		<updated>2014-01-12T20:43:28Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There has been alot of tinkering with the 3DS since launch, and although there have been leaps and bounds due to the combined efforts of many contributors, much of what we&#039;re doing would be expedited by extracting the boot code and other proprietary information (secrets) from the custom Nintendo SoC (System-On-a-Chip) of a retail 3DS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= UPDATE 12/01/2013 =&lt;br /&gt;
We are unable to contact user [[User:Jl12|Jl12]] for months now, if you can contact this user please let us know.  His email address gspeer012 (at) gmail (dot) com. For now the fundraiser is suspended.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
= UPDATE 06/07/2013 =&lt;br /&gt;
The fundraiser will remain open until it raises approximately 2,300 in order to pay for the decapping and the applicable taxes. Thus the fundraiser is still running. &lt;br /&gt;
&lt;br /&gt;
= What is chip decapping? = &lt;br /&gt;
For those that are unfamiliar: the CPU, GPU &amp;amp; DSP all exist on one proprietary SOC design used on the 3DS. Secure information is stored there partly, most likely burned onto the SoC during manufacturing and not readable by any other normal means or from outside of the SoC, in such a way that the secure information there, always stays there. In good design it will never reach the main memory of the 3DS and so sensitive data (like encryption keys or algorithms) stay secure.&lt;br /&gt;
&lt;br /&gt;
Extracting data from a proprietary chip to reverse-engineer it is typically done by decapping it, which is risky business and involves removing the epoxy, delayering the chip and taking high-resolution pictures of every layer to reconstruct logic from the images. Special equipment is used ( SEM / scanning electron microscope ) and it is rarely done outside of a professional context because it is very costly to an average enthusiast (&amp;quot;hacker&amp;quot;) and access to equipment and the expertise is hard to realize.&lt;br /&gt;
&lt;br /&gt;
Chip decapping has been used by the &amp;quot;emulation&amp;quot; community to reverse-engineer and recover data from special proprietary chips, such as those in SNES cartridges. It has also been used to to reverse-engineer other hardware to create emulators for other platforms besides the SNES.&lt;br /&gt;
&lt;br /&gt;
= Is this legal? =&lt;br /&gt;
Decapping a chip and reverse engineering it is in fact legal in the US, and most likely in other countries too. Check out the [http://en.wikipedia.org/wiki/Semiconductor_Chip_Protection_Act_of_1984 Semiconductor Chip Protection Act of 1984], which states reverse engineering a chip is not prohibited.&lt;br /&gt;
&lt;br /&gt;
However, we do not endorse piracy, and any information revealed by the chip decapping will be used to advance progress for homebrew applications and games on 3DS, not piracy.&lt;br /&gt;
&lt;br /&gt;
= How much? =&lt;br /&gt;
We have gotten a price quote from a professional lab on the deal (removal, decap, delayer, SEM imaging) and it came out to $400 per layer of the chip, which they estimate will come to &amp;quot;about $2000 total&amp;quot;. Plus the cost of the 3DS we will be donating for the hardware sample(s).&lt;br /&gt;
&lt;br /&gt;
The numbers of layers is approximate because they likely don&#039;t know how many layers are in the SoC until they actually decap it. In the worst case we estimate between 8 or 10 layers. For now we&#039;re trying to reach their initial quote of $2000 USD and send in the 3DS to get it started. Later on we can still decide to have the remaining layers imaged.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Why should I help? =&lt;br /&gt;
Kicking it around with other contributors on this site, we all agreed it would be interesting or valuable to us but $2000+ is simply a lot to ask of anyone to drop suddenly on a hobby project. Also $2000+ while a lot for an individual is a very achievable goal for a fund raising.&lt;br /&gt;
&lt;br /&gt;
We created this page here to raise awareness of the fundraiser for this purpose. Now is the chance for you, the viewers of this site, to contribute.&lt;br /&gt;
You will have the noble honor of helping the 3DS community progress forward.&lt;br /&gt;
We&#039;re also considering giving contributors a copy of the images produced as thanks.&lt;br /&gt;
&lt;br /&gt;
To reiterate, what we&#039;re trying to do is: send in initially 1 3DS to a professional lab to get delayered and imaged (covering the costs of doing so). The resulting SEM images will be reconstructed and used towards discovering more of the hardware secrets inside the 3DS. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How likely is this going to help progress? =&lt;br /&gt;
It is not possible to give a clear answer on this until the 3DS SoC chip has been decapped. But consider the success story about the SNES decapping [http://byuu.org/articles/emulation/decap here]. There is no 100% guarantee that we will have the same success story, since the technology is different and there might be more technological limitations. But we won&#039;t know until we try. We have a team of proven experts, anxious to have a very thorough look inside the SoC of the 3DS.&lt;br /&gt;
&lt;br /&gt;
The most likely focus points will be:&lt;br /&gt;
* the boot ROM, possibly containing flaws which allow us to take control of the system&lt;br /&gt;
* secret keys, hidden in hardware, used in cryptographic operations&lt;br /&gt;
* secret algorithms, implemented in hardware to obscure information&lt;br /&gt;
* and possibly much more&lt;br /&gt;
&lt;br /&gt;
= How can I help? =&lt;br /&gt;
If you&#039;d like to donate and help contribute to this cause you can do so by donating [http://n-dev.net/donate.php here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Contact information =&lt;br /&gt;
User [[User:Jl12|Jl12]] is in charge of collecting the donations, and will deliver the final samples to [http://www.eaglabs.com/about-eag.html the professional lab] for the chip decapping at the end of the fundraiser. Any more questions can be directed to him at his email address gspeer012 (at) gmail (dot) com&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Main_Page/OtherSites&amp;diff=8352</id>
		<title>Main Page/OtherSites</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Main_Page/OtherSites&amp;diff=8352"/>
		<updated>2013-12-30T07:05:26Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Main page box|Other Nintendo Homebrew Sites|:OtherSites}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: -.3em -1em -1em -1em;&amp;quot;&amp;gt;&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; bgcolor=&amp;quot;#fff&amp;quot; border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2px&amp;quot; cellspacing=&amp;quot;2px&amp;quot; style=&amp;quot;margin:auto;&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot; align=&amp;quot;left&amp;quot; style=&amp;quot;background: #F5FAFF;&amp;quot;&lt;br /&gt;
| DSiBrew [http://dsibrew.org] WiiBrew [http://wiibrew.org] WiiUBrew [http://wiiubrew.org]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{box-footer-empty}}&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=IO_Registers&amp;diff=7566</id>
		<title>IO Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=IO_Registers&amp;diff=7566"/>
		<updated>2013-07-08T00:40:09Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Category&lt;br /&gt;
!  Address start&lt;br /&gt;
! Virtual address&lt;br /&gt;
! Kernel address&lt;br /&gt;
|-&lt;br /&gt;
| [[CONFIG]]&lt;br /&gt;
| 0x10000000&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[IRQ]]&lt;br /&gt;
| 0x10001000&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[NDMA]]&lt;br /&gt;
| 0x10002000&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[TIMER]]&lt;br /&gt;
| 0x10003000&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[CTRCARD]]&lt;br /&gt;
| 0x10004000 / 0x10005000&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[SDMC]] / [[NAND]]&lt;br /&gt;
| 0x10006000 / 0x10007000&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[PXI]]&lt;br /&gt;
| 0x10008000&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[AES]]&lt;br /&gt;
| 0x10009000&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[SHA]]&lt;br /&gt;
| 0x1000A000&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[RSA]]&lt;br /&gt;
| 0x1000B000&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[XDMA]]&lt;br /&gt;
| 0x1000C000&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[SPICARD]]&lt;br /&gt;
| 0x1000D800&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[CONFIG]]&lt;br /&gt;
| 0x10010000&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[PDN]]&lt;br /&gt;
| 0x10141000&lt;br /&gt;
| 0x1EC41000&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[CODEC]]&lt;br /&gt;
| 0x10141000&lt;br /&gt;
| 0x1EC41000&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[SPI]]&lt;br /&gt;
| 0x10142000&lt;br /&gt;
| 0x1EC42000&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[I2C]]&lt;br /&gt;
| 0x10144000&lt;br /&gt;
| 0x1EC44000&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[HID]]&lt;br /&gt;
| 0x10146000&lt;br /&gt;
| 0x1EC46000&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[PAD]]&lt;br /&gt;
| 0x10146000&lt;br /&gt;
| 0x1EC46000&lt;br /&gt;
|&lt;br /&gt;
|- &lt;br /&gt;
| [[PTM]]&lt;br /&gt;
| 0x10146000&lt;br /&gt;
| 0x1EC46000&lt;br /&gt;
|&lt;br /&gt;
|- &lt;br /&gt;
| [[I2C]]&lt;br /&gt;
| 0x10148000&lt;br /&gt;
| 0x1EC48000&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[SPI]]&lt;br /&gt;
| 0x10160000&lt;br /&gt;
| 0x1EC60000&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[I2C]]&lt;br /&gt;
| 0x10161000&lt;br /&gt;
| 0x1EC61000&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[MIC]]&lt;br /&gt;
| 0x10162000&lt;br /&gt;
| 0x1EC62000&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[NTRCARD]]&lt;br /&gt;
| 0x10164000&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|- &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Summary=&lt;br /&gt;
&lt;br /&gt;
* [[PXI]]&lt;br /&gt;
* [[I2C]]&lt;br /&gt;
* [[LCD]]&lt;br /&gt;
* [[GPU]]&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=HID_Registers&amp;diff=7565</id>
		<title>HID Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=HID_Registers&amp;diff=7565"/>
		<updated>2013-07-08T00:31:19Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Registers ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  NAME&lt;br /&gt;
!  PHYSICAL ADDRESS&lt;br /&gt;
!  PROCESS ADDRESS&lt;br /&gt;
!  WIDTH&lt;br /&gt;
|-&lt;br /&gt;
| REG_HID???&lt;br /&gt;
| 0x10146000&lt;br /&gt;
| 0x1EC46000&lt;br /&gt;
| &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=HID_Registers&amp;diff=7564</id>
		<title>HID Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=HID_Registers&amp;diff=7564"/>
		<updated>2013-07-08T00:31:07Z</updated>

		<summary type="html">&lt;p&gt;Neimod: Created page with &amp;quot;== Registers == {| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; !  NAME !  PHYSICAL ADDRESS !  PROCESS ADDRESS !  WIDTH |- | REG_HID??? | 0x10146000 | 0x1EC46000 |}&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Registers ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  NAME&lt;br /&gt;
!  PHYSICAL ADDRESS&lt;br /&gt;
!  PROCESS ADDRESS&lt;br /&gt;
!  WIDTH&lt;br /&gt;
|-&lt;br /&gt;
| REG_HID???&lt;br /&gt;
| 0x10146000&lt;br /&gt;
| 0x1EC46000&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=I2C_Registers&amp;diff=7563</id>
		<title>I2C Registers</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=I2C_Registers&amp;diff=7563"/>
		<updated>2013-07-08T00:28:56Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Registers ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  NAME&lt;br /&gt;
!  PHYSICAL ADDRESS&lt;br /&gt;
!  PROCESS ADDRESS&lt;br /&gt;
!  WIDTH&lt;br /&gt;
|-&lt;br /&gt;
| REG_I2C1DATA&lt;br /&gt;
| 0x10161000&lt;br /&gt;
| 0x1EC61000&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| REG_I2C1CNT&lt;br /&gt;
| 0x10161001&lt;br /&gt;
| 0x1EC61001&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| REG_I2C1CNTEX&lt;br /&gt;
| 0x10161002&lt;br /&gt;
| 0x1EC61002&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| REG_I2C1SCL&lt;br /&gt;
| 0x10161004&lt;br /&gt;
| 0x1EC61004&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| REG_I2C2DATA&lt;br /&gt;
| 0x10144000&lt;br /&gt;
| 0x1EC44000&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| REG_I2C2CNT&lt;br /&gt;
| 0x10144001&lt;br /&gt;
| 0x1EC44001&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| REG_I2C2CNTEX&lt;br /&gt;
| 0x10144002&lt;br /&gt;
| 0x1EC44002&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| REG_I2C2SCL&lt;br /&gt;
| 0x10144004&lt;br /&gt;
| 0x1EC44004&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| REG_I2C3DATA&lt;br /&gt;
| 0x10148000&lt;br /&gt;
| 0x1EC48000&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| REG_I2C3CNT&lt;br /&gt;
| 0x10148001&lt;br /&gt;
| 0x1EC48001&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| REG_I2C3CNTEX&lt;br /&gt;
| 0x10148002&lt;br /&gt;
| 0x1EC48002&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| REG_I2C3SCL&lt;br /&gt;
| 0x10148004&lt;br /&gt;
| 0x1EC48004&lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== I2C Devices ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!   Device id&lt;br /&gt;
!   Device bus id&lt;br /&gt;
!   Device address&lt;br /&gt;
!   Device description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
| 0x4a&lt;br /&gt;
| Power management?(same device addr as the DSi power-management)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
| 0x7a&lt;br /&gt;
| Camera0?(same dev-addr as DSi cam0)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 1&lt;br /&gt;
| 0x78&lt;br /&gt;
| Camera1?(same dev-addr as DSi cam1)&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 2&lt;br /&gt;
| 0x4a&lt;br /&gt;
| MCU&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 2&lt;br /&gt;
| 0x78&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 2&lt;br /&gt;
| 0x2c&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 2&lt;br /&gt;
| 0x2e&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 2&lt;br /&gt;
| 0x40&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 2&lt;br /&gt;
| 0x44&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 9&lt;br /&gt;
| 3&lt;br /&gt;
| 0xa6&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 10&lt;br /&gt;
| 3&lt;br /&gt;
| 0xd0&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 11&lt;br /&gt;
| 3&lt;br /&gt;
| 0xd2&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| 3&lt;br /&gt;
| 0xa4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 13&lt;br /&gt;
| 3&lt;br /&gt;
| 0x9a&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 14&lt;br /&gt;
| 3&lt;br /&gt;
| 0xa0&lt;br /&gt;
| eeprom?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Device 3 ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  REGISTER&lt;br /&gt;
!  WIDTH&lt;br /&gt;
!  DESCRIPTION &lt;br /&gt;
|-&lt;br /&gt;
| 0x03&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 8&lt;br /&gt;
| Writing u8 value 4 here triggers a hardware system reboot.&lt;br /&gt;
|-&lt;br /&gt;
| 0x22&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x23&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x24&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x28&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x29&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x30&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x31&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x32&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x33&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x34&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x35&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x36&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x37&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x38&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x39&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x41&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x43&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x50&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x51&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x60&lt;br /&gt;
| 8&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= I2CCNT =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ REG_I2CxCNT&lt;br /&gt;
!  BIT&lt;br /&gt;
!  DESCRIPTION&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| HOLD (0=Last byte of transaction, 1=More bytes coming)&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Error flag/ack?&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Read mode related?&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Read mode?&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| IRQ enable?&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Enable?&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=File_talk:CTR_NAND_pinout_XL.jpg&amp;diff=7560</id>
		<title>File talk:CTR NAND pinout XL.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=File_talk:CTR_NAND_pinout_XL.jpg&amp;diff=7560"/>
		<updated>2013-07-07T16:06:57Z</updated>

		<summary type="html">&lt;p&gt;Neimod: Created page with &amp;quot;Image thanks to profi200 and friend&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Image thanks to profi200 and friend&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Hardware&amp;diff=7559</id>
		<title>Hardware</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Hardware&amp;diff=7559"/>
		<updated>2013-07-07T16:04:48Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{stub}}&lt;br /&gt;
&lt;br /&gt;
This page lists and describes the hardware found inside the Nintendo 3DS. Many of these parts are custom made and are expanded upon here or in other pages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Type !! Name !! Datasheet !! Source&lt;br /&gt;
|-&lt;br /&gt;
| SoC || Nintendo 1048 0H (Custom): CPU, GPU, VRAM &amp;amp; DSP all on one chip. || N/A || N/A&lt;br /&gt;
|-&lt;br /&gt;
| ARM11 Processor Core || ARM11 MPCore 2x 268MHz(~268123480 Hz) &amp;amp; 2x VFP Co-Processor || [http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0360f/index.html] || [11] &lt;br /&gt;
|-&lt;br /&gt;
| GPU || [http://en.wikipedia.org/wiki/PICA200 DMP PICA] 268MHz || N/A || [11] &lt;br /&gt;
|-&lt;br /&gt;
| DSP || 134Mhz. 24ch 32728Hz sampling rates. || N/A || [11]&lt;br /&gt;
|-&lt;br /&gt;
| VRAM || 6 MB within SoC. Independent of system memory (FCRAM). || N/A || [11]&lt;br /&gt;
|-&lt;br /&gt;
| FCRAM || 2x64MB Fujitsu MB82M8080-07L ||[http://crediar.no-ip.com/sg_/download.php?id=d67d1c][http://edevice.fujitsu.com/fj/DATASHEET/e-ds/e511463.pdf][http://edevice.fujitsu.com/jp/datasheet/j-ds/j511463.pdf]|| [5]&lt;br /&gt;
|-&lt;br /&gt;
| Storage || Toshiba THGBM2G3P1FBAI8 1GB NAND Flash || N/A || N/A&lt;br /&gt;
|-&lt;br /&gt;
| Power Management || Texas Instruments PAIC3010B 0AA37DW || N/A || FCC filing&lt;br /&gt;
|-&lt;br /&gt;
| Gyroscope || Invensense ITG-3270 MEMS Gyroscope || [http://dl-web.dropbox.com/u/20520664/references/PS-ITG-3200-00-01.4.pdf] || N/A&lt;br /&gt;
|-&lt;br /&gt;
| Accelerometer || ST Micro 2048 33DH X1MAQ Accelerometer Model LIS331DH || [http://dl.dropbox.com/u/20520664/references/CD00213470.pdf] || N/A&lt;br /&gt;
|-&lt;br /&gt;
| Wifi || 802.11b/g Atheros AR6014 || [http://www.db.pokestation.net/3DS/Wi-Fi%20module%20pinouts.pdf] || N/A&lt;br /&gt;
|-&lt;br /&gt;
| Infrared IC || NXP infrared IC, &amp;quot;S750 0803 TSD031C&amp;quot; || N/A || [10]&lt;br /&gt;
|-&lt;br /&gt;
| Auxiliary Microcontroller || Renesas Electronics UC CTR, custom Nintendo microcontroller || N/A || N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* [11] Official Documentation&lt;br /&gt;
&lt;br /&gt;
* [5],[10] According to iFixit.com ([http://www.ifixit.com/Teardown/Nintendo-3DS-Teardown/5029/1#s22696 source]):&lt;br /&gt;
&lt;br /&gt;
* Datasheet for memory is for a chip in the same series, it has less memory than the one inside the 3DS (128mbits vs 512mbits).&lt;br /&gt;
&lt;br /&gt;
* There is a trove of data on the FCC website at [https://fjallfoss.fcc.gov/oetcf/eas/reports/ViewExhibitReport.cfm?mode=Exhibits&amp;amp;RequestTimeout=500&amp;amp;calledFromFrame=N&amp;amp;application_id=462292&amp;amp;fcc_id=%27EW4DWMW028%27].&lt;br /&gt;
&lt;br /&gt;
== FCRAM ==&lt;br /&gt;
&lt;br /&gt;
There is one FCRAM (Fast Cycle RAM) IC in the 3DS, produced by Fujitsu and branded as MB82M8080-07L. The Fujitsu MB82M8080-07L chip internally contains 2 dies, where each die is branded MB81EDS516545 and MB82DBS08645.&lt;br /&gt;
&lt;br /&gt;
The MB81EDS516545 die is a CMOS Fast Cycle Random Access Memory (FCRAM) with Low Power Double Data Rate (LPDDR) SDRAM Interface containing 512MBit storage accessible in a 64-bit format. The MB81EDS516545 is suited for consumer applications requiring high data bandwidth with low power consumption.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SoC ==&lt;br /&gt;
&lt;br /&gt;
The 3DS has much of it&#039;s internals housed in a SoC (System on Chip) just like it&#039;s predecessors. This is done to reduce build costs, cut down on power consumption, as well as make the PCB layout less complex and make the system harder to tamper with. The SoC, branded as the Nintendo 1048 0H, contains the CPU, GPU, DSP and VRAM.&lt;br /&gt;
&lt;br /&gt;
According to official documents, the CPU used is a dual-core ARM11 CPU, clocked at 268MHz. One core is dedicated to system software, while the other is used for application programming, each known as the syscore and appcore, respectively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GPU ==&lt;br /&gt;
&lt;br /&gt;
As mentioned, DMP&#039;s (Digital Media Proffesionals) PICA 200, 268Mhz. This GPU supports OpenGL ES 1.1.&lt;br /&gt;
&lt;br /&gt;
[[File:Pica200BlockDiagram.png]]&lt;br /&gt;
&lt;br /&gt;
Block diagram of an ULTRAY2000 based architecture PICA200&lt;br /&gt;
&lt;br /&gt;
== Images ==&lt;br /&gt;
&lt;br /&gt;
=== Front ===&lt;br /&gt;
&lt;br /&gt;
[[Image:CTR_Front.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
[http://guide-images.ifixit.net/igi/ishJaSCOwLkvbLYK High Resolution]&lt;br /&gt;
&lt;br /&gt;
=== Back ===&lt;br /&gt;
&lt;br /&gt;
[[Image:CTR_Back.jpg]]&lt;br /&gt;
&lt;br /&gt;
[http://guide-images.ifixit.net/igi/n1CKAdbPrHyNPNuW High Resolution]&lt;br /&gt;
&lt;br /&gt;
=== NAND pinout ===&lt;br /&gt;
&lt;br /&gt;
NAND dumping has been successful, but the image is encrypted.&lt;br /&gt;
&lt;br /&gt;
==== Normal model ====&lt;br /&gt;
&lt;br /&gt;
[[Image:CTR_NAND_pinout.png]]&lt;br /&gt;
&lt;br /&gt;
==== XL model ====&lt;br /&gt;
&lt;br /&gt;
[[Image:CTR_NAND_pinout_XL.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== WiFi dongle pinout ===&lt;br /&gt;
[[Image:CTR_WiFiDongle_pinout.png|600px]]&lt;br /&gt;
&lt;br /&gt;
SDIO interface is colored red: &lt;br /&gt;
* CLK&lt;br /&gt;
* CMD&lt;br /&gt;
* D0, D1, D2, D3&lt;br /&gt;
&lt;br /&gt;
This is the interface for the &#039;NEW&#039; WiFi module (based on Atheros AR6002) first included in DSi.&lt;br /&gt;
&lt;br /&gt;
The proprietary and by now ancient DS-mode WiFi is colored yellow, pins are unknown.&lt;br /&gt;
&lt;br /&gt;
I2C eeprom is colored blue:&lt;br /&gt;
* SCL&lt;br /&gt;
* SDA&lt;br /&gt;
&lt;br /&gt;
SPI Flash is colored purple:&lt;br /&gt;
* CLK&lt;br /&gt;
* CS#&lt;br /&gt;
* SI&lt;br /&gt;
* SO&lt;br /&gt;
* WP#&lt;br /&gt;
* NC&lt;br /&gt;
&lt;br /&gt;
=== Auxiliary Microntroller ===&lt;br /&gt;
[[Image:CTR_UC.png|600px]]&lt;br /&gt;
&lt;br /&gt;
Monitors HOME button, WiFi switch, 3D slider, volume control slider.&lt;br /&gt;
Controls LEDs, various power supplies.&lt;br /&gt;
&lt;br /&gt;
Devices attached to I2C bus:&lt;br /&gt;
* UC (master?)&lt;br /&gt;
* Accelerometer (slave address 0x18)&lt;br /&gt;
* SoC (master? slave?)&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=File:CTR_NAND_pinout_XL.jpg&amp;diff=7558</id>
		<title>File:CTR NAND pinout XL.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=File:CTR_NAND_pinout_XL.jpg&amp;diff=7558"/>
		<updated>2013-07-07T16:02:29Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Fundraiser&amp;diff=7555</id>
		<title>Fundraiser</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Fundraiser&amp;diff=7555"/>
		<updated>2013-07-06T08:42:13Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There has been alot of tinkering with the 3DS since launch, and although there have been leaps and bounds due to the combined efforts of many contributors, much of what we&#039;re doing would be expedited by extracting the boot code and other proprietary information (secrets) from the custom Nintendo SoC (System-On-a-Chip) of a retail 3DS.&lt;br /&gt;
&lt;br /&gt;
= UPDATE 06/07/2013 =&lt;br /&gt;
The fundraiser will remain open until it raises approximately 2,300 in order to pay for the decapping and the applicable taxes. Thus the fundraiser is still running. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= What is chip decapping? = &lt;br /&gt;
For those that are unfamiliar: the CPU, GPU &amp;amp; DSP all exist on one proprietary SOC design used on the 3DS. Secure information is stored there partly, most likely burned onto the SoC during manufacturing and not readable by any other normal means or from outside of the SoC, in such a way that the secure information there, always stays there. In good design it will never reach the main memory of the 3DS and so sensitive data (like encryption keys or algorithms) stay secure.&lt;br /&gt;
&lt;br /&gt;
Extracting data from a proprietary chip to reverse-engineer it is typically done by decapping it, which is risky business and involves removing the epoxy, delayering the chip and taking high-resolution pictures of every layer to reconstruct logic from the images. Special equipment is used ( SEM / scanning electron microscope ) and it is rarely done outside of a professional context because it is very costly to an average enthusiast (&amp;quot;hacker&amp;quot;) and access to equipment and the expertise is hard to realize.&lt;br /&gt;
&lt;br /&gt;
Chip decapping has been used by the &amp;quot;emulation&amp;quot; community to reverse-engineer and recover data from special proprietary chips, such as those in SNES cartridges. It has also been used to to reverse-engineer other hardware to create emulators for other platforms besides the SNES.&lt;br /&gt;
&lt;br /&gt;
= Is this legal? =&lt;br /&gt;
Decapping a chip and reverse engineering it is in fact legal in the US, and most likely in other countries too. Check out the [http://en.wikipedia.org/wiki/Semiconductor_Chip_Protection_Act_of_1984 Semiconductor Chip Protection Act of 1984], which states reverse engineering a chip is not prohibited.&lt;br /&gt;
&lt;br /&gt;
However, we do not endorse piracy, and any information revealed by the chip decapping will be used to advance progress for homebrew applications and games on 3DS, not piracy.&lt;br /&gt;
&lt;br /&gt;
= How much? =&lt;br /&gt;
We have gotten a price quote from a professional lab on the deal (removal, decap, delayer, SEM imaging) and it came out to $400 per layer of the chip, which they estimate will come to &amp;quot;about $2000 total&amp;quot;. Plus the cost of the 3DS we will be donating for the hardware sample(s).&lt;br /&gt;
&lt;br /&gt;
The numbers of layers is approximate because they likely don&#039;t know how many layers are in the SoC until they actually decap it. In the worst case we estimate between 8 or 10 layers. For now we&#039;re trying to reach their initial quote of $2000 USD and send in the 3DS to get it started. Later on we can still decide to have the remaining layers imaged.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Why should I help? =&lt;br /&gt;
Kicking it around with other contributors on this site, we all agreed it would be interesting or valuable to us but $2000+ is simply a lot to ask of anyone to drop suddenly on a hobby project. Also $2000+ while a lot for an individual is a very achievable goal for a fund raising.&lt;br /&gt;
&lt;br /&gt;
We created this page here to raise awareness of the fundraiser for this purpose. Now is the chance for you, the viewers of this site, to contribute.&lt;br /&gt;
You will have the noble honor of helping the 3DS community progress forward.&lt;br /&gt;
We&#039;re also considering giving contributors a copy of the images produced as thanks.&lt;br /&gt;
&lt;br /&gt;
To reiterate, what we&#039;re trying to do is: send in initially 1 3DS to a professional lab to get delayered and imaged (covering the costs of doing so). The resulting SEM images will be reconstructed and used towards discovering more of the hardware secrets inside the 3DS. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How likely is this going to help progress? =&lt;br /&gt;
It is not possible to give a clear answer on this until the 3DS SoC chip has been decapped. But consider the success story about the SNES decapping [http://byuu.org/articles/emulation/decap here]. There is no 100% guarantee that we will have the same success story, since the technology is different and there might be more technological limitations. But we won&#039;t know until we try. We have a team of proven experts, anxious to have a very thorough look inside the SoC of the 3DS.&lt;br /&gt;
&lt;br /&gt;
The most likely focus points will be:&lt;br /&gt;
* the boot ROM, possibly containing flaws which allow us to take control of the system&lt;br /&gt;
* secret keys, hidden in hardware, used in cryptographic operations&lt;br /&gt;
* secret algorithms, implemented in hardware to obscure information&lt;br /&gt;
* and possibly much more&lt;br /&gt;
&lt;br /&gt;
= How can I help? =&lt;br /&gt;
If you&#039;d like to donate and help contribute to this cause you can do so by donating [http://n-dev.net/donate.php here].&lt;br /&gt;
&lt;br /&gt;
= Contact information =&lt;br /&gt;
User [[User:Jl12|Jl12]] is in charge of collecting the donations, and will deliver the final samples to [http://www.eaglabs.com/about-eag.html the professional lab] for the chip decapping at the end of the fundraiser. Any more questions can be directed to him at his email address gspeer012 (at) gmail (dot) com&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Virtual_address_mapping_FW26&amp;diff=5861</id>
		<title>Virtual address mapping FW26</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Virtual_address_mapping_FW26&amp;diff=5861"/>
		<updated>2013-05-03T18:02:46Z</updated>

		<summary type="html">&lt;p&gt;Neimod: Created page with &amp;quot; VA E8000000..E8600000 -&amp;gt; PA 18000000..18600000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]  VA EFF00000..F0000000 -&amp;gt; PA 1FF00000..20000000 [SYS:RW USR...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; VA E8000000..E8600000 -&amp;gt; PA 18000000..18600000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA EFF00000..F0000000 -&amp;gt; PA 1FF00000..20000000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA F0000000..F8000000 -&amp;gt; PA 20000000..28000000 [SYS:RW USR:-- XN TYP:NORMAL PRIVAT OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF401000..FF402000 -&amp;gt; PA 27FCD000..27FCE000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF403000..FF404000 -&amp;gt; PA 27FC8000..27FC9000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF405000..FF406000 -&amp;gt; PA 27FC1000..27FC2000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF407000..FF408000 -&amp;gt; PA 27FB9000..27FBA000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF409000..FF40A000 -&amp;gt; PA 27F9C000..27F9D000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF40B000..FF40C000 -&amp;gt; PA 27EB8000..27EB9000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF40D000..FF40E000 -&amp;gt; PA 27EB7000..27EB8000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF40F000..FF410000 -&amp;gt; PA 27EB6000..27EB7000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF411000..FF412000 -&amp;gt; PA 27EB5000..27EB6000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF413000..FF414000 -&amp;gt; PA 27EB0000..27EB1000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF415000..FF416000 -&amp;gt; PA 27EAF000..27EB0000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF417000..FF418000 -&amp;gt; PA 27EAE000..27EAF000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF419000..FF41A000 -&amp;gt; PA 27EAD000..27EAE000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF41B000..FF41C000 -&amp;gt; PA 27EAC000..27EAD000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF41D000..FF41E000 -&amp;gt; PA 27E98000..27E99000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF41F000..FF420000 -&amp;gt; PA 27E7A000..27E7B000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF421000..FF422000 -&amp;gt; PA 27E77000..27E78000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF423000..FF424000 -&amp;gt; PA 27E65000..27E66000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF425000..FF426000 -&amp;gt; PA 27E50000..27E51000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF427000..FF428000 -&amp;gt; PA 27E4D000..27E4E000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF429000..FF42A000 -&amp;gt; PA 27E4C000..27E4D000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF42B000..FF42C000 -&amp;gt; PA 27E46000..27E47000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF42D000..FF42E000 -&amp;gt; PA 27E44000..27E45000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF42F000..FF430000 -&amp;gt; PA 27E43000..27E44000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF431000..FF432000 -&amp;gt; PA 27E3B000..27E3C000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF433000..FF434000 -&amp;gt; PA 27E28000..27E29000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF435000..FF436000 -&amp;gt; PA 27E26000..27E27000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF437000..FF438000 -&amp;gt; PA 27E25000..27E26000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF439000..FF43A000 -&amp;gt; PA 27E23000..27E24000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF43B000..FF43C000 -&amp;gt; PA 27E22000..27E23000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF43D000..FF43E000 -&amp;gt; PA 27E21000..27E22000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF43F000..FF440000 -&amp;gt; PA 27E20000..27E21000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF441000..FF442000 -&amp;gt; PA 27E1F000..27E20000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF443000..FF444000 -&amp;gt; PA 27E1C000..27E1D000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF445000..FF446000 -&amp;gt; PA 27E1B000..27E1C000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF447000..FF448000 -&amp;gt; PA 27E1A000..27E1B000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF449000..FF44A000 -&amp;gt; PA 27E19000..27E1A000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF44B000..FF44C000 -&amp;gt; PA 27E0A000..27E0B000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF44D000..FF44E000 -&amp;gt; PA 27DF5000..27DF6000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF44F000..FF450000 -&amp;gt; PA 27DF2000..27DF3000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF451000..FF452000 -&amp;gt; PA 27DF1000..27DF2000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF453000..FF454000 -&amp;gt; PA 27DF0000..27DF1000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF455000..FF456000 -&amp;gt; PA 27DEF000..27DF0000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF457000..FF458000 -&amp;gt; PA 27DDF000..27DE0000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF459000..FF45A000 -&amp;gt; PA 27DDD000..27DDE000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF45B000..FF45C000 -&amp;gt; PA 27DDC000..27DDD000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF45D000..FF45E000 -&amp;gt; PA 27DDB000..27DDC000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF45F000..FF460000 -&amp;gt; PA 27DC7000..27DC8000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF461000..FF462000 -&amp;gt; PA 27DC1000..27DC2000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF463000..FF464000 -&amp;gt; PA 27DA2000..27DA3000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF465000..FF466000 -&amp;gt; PA 2779F000..277A0000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF467000..FF468000 -&amp;gt; PA 2779E000..2779F000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF469000..FF46A000 -&amp;gt; PA 2779D000..2779E000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF46B000..FF46C000 -&amp;gt; PA 2779C000..2779D000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF46D000..FF46E000 -&amp;gt; PA 2779B000..2779C000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF46F000..FF470000 -&amp;gt; PA 2779A000..2779B000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF471000..FF472000 -&amp;gt; PA 27799000..2779A000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF473000..FF474000 -&amp;gt; PA 27798000..27799000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF475000..FF476000 -&amp;gt; PA 27797000..27798000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF477000..FF478000 -&amp;gt; PA 27796000..27797000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF479000..FF47A000 -&amp;gt; PA 27795000..27796000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF47B000..FF47C000 -&amp;gt; PA 27794000..27795000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF47D000..FF47E000 -&amp;gt; PA 27793000..27794000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF47F000..FF480000 -&amp;gt; PA 27792000..27793000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF481000..FF482000 -&amp;gt; PA 27786000..27787000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF483000..FF484000 -&amp;gt; PA 27774000..27775000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF485000..FF486000 -&amp;gt; PA 27773000..27774000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF487000..FF488000 -&amp;gt; PA 27756000..27757000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF489000..FF48A000 -&amp;gt; PA 2774C000..2774D000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF48B000..FF48C000 -&amp;gt; PA 2774B000..2774C000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF48D000..FF48E000 -&amp;gt; PA 2774A000..2774B000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF48F000..FF490000 -&amp;gt; PA 27748000..27749000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF491000..FF492000 -&amp;gt; PA 27747000..27748000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF493000..FF494000 -&amp;gt; PA 27740000..27741000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF495000..FF496000 -&amp;gt; PA 2773D000..2773E000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF497000..FF498000 -&amp;gt; PA 2773C000..2773D000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF499000..FF49A000 -&amp;gt; PA 2772C000..2772D000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF49B000..FF49C000 -&amp;gt; PA 27729000..2772A000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF49D000..FF49E000 -&amp;gt; PA 27728000..27729000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF49F000..FF4A0000 -&amp;gt; PA 276C5000..276C6000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4A1000..FF4A2000 -&amp;gt; PA 276AE000..276AF000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4A3000..FF4A4000 -&amp;gt; PA 2768B000..2768C000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4A5000..FF4A6000 -&amp;gt; PA 27689000..2768A000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4A7000..FF4A8000 -&amp;gt; PA 27688000..27689000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4A9000..FF4AA000 -&amp;gt; PA 27687000..27688000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4AB000..FF4AC000 -&amp;gt; PA 27686000..27687000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4AD000..FF4AE000 -&amp;gt; PA 27685000..27686000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4AF000..FF4B0000 -&amp;gt; PA 27684000..27685000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4B1000..FF4B2000 -&amp;gt; PA 27645000..27646000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4B3000..FF4B4000 -&amp;gt; PA 27602000..27603000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4B5000..FF4B6000 -&amp;gt; PA 27601000..27602000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4B7000..FF4B8000 -&amp;gt; PA 27600000..27601000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4B9000..FF4BA000 -&amp;gt; PA 275FF000..27600000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4BB000..FF4BC000 -&amp;gt; PA 2757D000..2757E000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4BD000..FF4BE000 -&amp;gt; PA 2757A000..2757B000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4BF000..FF4C0000 -&amp;gt; PA 274A6000..274A7000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4C1000..FF4C2000 -&amp;gt; PA 274A5000..274A6000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4C3000..FF4C4000 -&amp;gt; PA 274A4000..274A5000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4C5000..FF4C6000 -&amp;gt; PA 274A3000..274A4000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4C7000..FF4C8000 -&amp;gt; PA 274A2000..274A3000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4C9000..FF4CA000 -&amp;gt; PA 274A1000..274A2000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4CB000..FF4CC000 -&amp;gt; PA 274A0000..274A1000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4CD000..FF4CE000 -&amp;gt; PA 2749F000..274A0000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4CF000..FF4D0000 -&amp;gt; PA 2749E000..2749F000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4D1000..FF4D2000 -&amp;gt; PA 2749D000..2749E000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4D3000..FF4D4000 -&amp;gt; PA 2749C000..2749D000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4D5000..FF4D6000 -&amp;gt; PA 2749B000..2749C000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4D7000..FF4D8000 -&amp;gt; PA 2749A000..2749B000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4D9000..FF4DA000 -&amp;gt; PA 27499000..2749A000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4DB000..FF4DC000 -&amp;gt; PA 27498000..27499000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4DD000..FF4DE000 -&amp;gt; PA 27496000..27497000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4DF000..FF4E0000 -&amp;gt; PA 27495000..27496000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4E1000..FF4E2000 -&amp;gt; PA 27493000..27494000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4E3000..FF4E4000 -&amp;gt; PA 27353000..27354000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4E5000..FF4E6000 -&amp;gt; PA 27351000..27352000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4E7000..FF4E8000 -&amp;gt; PA 27350000..27351000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4E9000..FF4EA000 -&amp;gt; PA 27310000..27311000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4EB000..FF4EC000 -&amp;gt; PA 2730A000..2730B000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4ED000..FF4EE000 -&amp;gt; PA 272F7000..272F8000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4EF000..FF4F0000 -&amp;gt; PA 272F6000..272F7000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4F1000..FF4F2000 -&amp;gt; PA 2720D000..2720E000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4F3000..FF4F4000 -&amp;gt; PA 271E4000..271E5000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4F5000..FF4F6000 -&amp;gt; PA 26FB2000..26FB3000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4F7000..FF4F8000 -&amp;gt; PA 271E2000..271E3000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4F9000..FF4FA000 -&amp;gt; PA 26FAF000..26FB0000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4FB000..FF4FC000 -&amp;gt; PA 26FA4000..26FA5000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4FD000..FF4FE000 -&amp;gt; PA 26FA3000..26FA4000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF4FF000..FF500000 -&amp;gt; PA 26FA2000..26FA3000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF501000..FF502000 -&amp;gt; PA 26FA1000..26FA2000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF503000..FF504000 -&amp;gt; PA 26FA0000..26FA1000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF505000..FF506000 -&amp;gt; PA 26F9F000..26FA0000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF507000..FF508000 -&amp;gt; PA 26F7D000..26F7E000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF509000..FF50A000 -&amp;gt; PA 26F7C000..26F7D000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF50B000..FF50C000 -&amp;gt; PA 26F7B000..26F7C000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF50D000..FF50E000 -&amp;gt; PA 26F7A000..26F7B000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF50F000..FF510000 -&amp;gt; PA 26F30000..26F31000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF511000..FF512000 -&amp;gt; PA 26F2F000..26F30000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF513000..FF514000 -&amp;gt; PA 26F2D000..26F2E000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF515000..FF516000 -&amp;gt; PA 26F2E000..26F2F000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF517000..FF518000 -&amp;gt; PA 26F2C000..26F2D000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF519000..FF51A000 -&amp;gt; PA 26F2B000..26F2C000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF51B000..FF51C000 -&amp;gt; PA 26F2A000..26F2B000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF51D000..FF51E000 -&amp;gt; PA 26F29000..26F2A000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF51F000..FF520000 -&amp;gt; PA 26F28000..26F29000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF521000..FF522000 -&amp;gt; PA 26F27000..26F28000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF523000..FF524000 -&amp;gt; PA 26F26000..26F27000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF525000..FF526000 -&amp;gt; PA 26F04000..26F05000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF527000..FF528000 -&amp;gt; PA 26F25000..26F26000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF529000..FF52A000 -&amp;gt; PA 26EFB000..26EFC000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF52B000..FF52C000 -&amp;gt; PA 26F23000..26F24000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF52D000..FF52E000 -&amp;gt; PA 26EFC000..26EFD000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF52F000..FF530000 -&amp;gt; PA 26EFA000..26EFB000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF531000..FF532000 -&amp;gt; PA 26EF8000..26EF9000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF533000..FF534000 -&amp;gt; PA 26EF5000..26EF6000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF535000..FF536000 -&amp;gt; PA 26EF6000..26EF7000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF537000..FF538000 -&amp;gt; PA 26EF3000..26EF4000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF539000..FF53A000 -&amp;gt; PA 26EF2000..26EF3000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF53B000..FF53C000 -&amp;gt; PA 26EF9000..26EFA000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FF53D000..FF53E000 -&amp;gt; PA 26EF7000..26EF8000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FFF00000..FFF3F000 -&amp;gt; PA 1FFA0000..1FFDF000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FFF50000..FFF70000 -&amp;gt; PA 1FF80000..1FFA0000 [SYS:RO USR:-- X  TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FFF70000..FFF7B000 -&amp;gt; PA 1FFDF000..1FFEA000 [SYS:RO USR:-- X  TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FFF7B000..FFF7C000 -&amp;gt; PA 1FFEA000..1FFEB000 [SYS:RO USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FFF7C000..FFF81000 -&amp;gt; PA 1FFEB000..1FFF0000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FFFCC000..FFFCD000 -&amp;gt; PA 10144000..10145000 [SYS:RW USR:-- XN TYP:DEVICE SHARED ]&lt;br /&gt;
 VA FFFCE000..FFFCF000 -&amp;gt; PA 10400000..10401000 [SYS:RW USR:-- XN TYP:DEVICE SHARED ]&lt;br /&gt;
 VA FFFD0000..FFFD1000 -&amp;gt; PA 10141000..10142000 [SYS:RW USR:-- XN TYP:DEVICE SHARED ]&lt;br /&gt;
 VA FFFD2000..FFFD3000 -&amp;gt; PA 10163000..10164000 [SYS:RW USR:-- XN TYP:DEVICE SHARED ]&lt;br /&gt;
 VA FFFD4000..FFFD5000 -&amp;gt; PA 10146000..10147000 [SYS:RW USR:-- XN TYP:DEVICE SHARED ]&lt;br /&gt;
 VA FFFD6000..FFFD7000 -&amp;gt; PA 10202000..10203000 [SYS:RW USR:-- XN TYP:DEVICE SHARED ]&lt;br /&gt;
 VA FFFD8000..FFFD9000 -&amp;gt; PA 10140000..10141000 [SYS:RW USR:-- XN TYP:DEVICE SHARED ]&lt;br /&gt;
 VA FFFDA000..FFFDB000 -&amp;gt; PA 10200000..10201000 [SYS:RW USR:-- XN TYP:DEVICE SHARED ]&lt;br /&gt;
 VA FFFDC000..FFFE0000 -&amp;gt; PA 1FFF8000..1FFFC000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FFFE1000..FFFE2000 -&amp;gt; PA 1FFF0000..1FFF1000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FFFE3000..FFFE4000 -&amp;gt; PA 1FFF2000..1FFF3000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FFFE5000..FFFE9000 -&amp;gt; PA 1FFFC000..20000000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FFFEA000..FFFEB000 -&amp;gt; PA 1FFF1000..1FFF2000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FFFEC000..FFFED000 -&amp;gt; PA 1FFF3000..1FFF4000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FFFEE000..FFFF0000 -&amp;gt; PA 17E00000..17E02000 [SYS:RW USR:-- XN TYP:DEVICE SHARED ]&lt;br /&gt;
 VA FFFF0000..FFFF1000 -&amp;gt; PA 1FFF4000..1FFF5000 [SYS:RO USR:-- X  TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FFFF2000..FFFF6000 -&amp;gt; PA 1FFF8000..1FFFC000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FFFF7000..FFFF8000 -&amp;gt; PA 1FFF0000..1FFF1000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FFFF9000..FFFFA000 -&amp;gt; PA 1FFF2000..1FFF3000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;br /&gt;
 VA FFFFB000..FFFFE000 -&amp;gt; PA 1FFF5000..1FFF8000 [SYS:RW USR:-- XN TYP:NORMAL SHARED OUTER NOCACHE, INNER CACHED WB WA]&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=GPU/Commands&amp;diff=5615</id>
		<title>GPU/Commands</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=GPU/Commands&amp;diff=5615"/>
		<updated>2013-04-18T23:51:09Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the structure of the buffer for [[GSP_Shared_Memory|GX command]] 1 with the registers at [[GPU|0x1EF018E0]]. This buffer is used for GPU commands including OpenGL commands, each 8-byte entry in the buffer is a command. Cmd+0 is the command parameter, and cmd+4 is the command header.&lt;br /&gt;
&lt;br /&gt;
Invalid GPU command parameters including NaN floats can cause the GPU to hang, this then causes the GSP module to hang as well.&lt;br /&gt;
&lt;br /&gt;
=== Command Header ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 19-0&lt;br /&gt;
| Command ID&lt;br /&gt;
|-&lt;br /&gt;
| 30-20&lt;br /&gt;
| Total words following the command, if any.&lt;br /&gt;
|-&lt;br /&gt;
| 31&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
The first word in the parameter data structure is the command parameter value, the rest of the data structure is from the data following the command. The word after the last data structure word is padding when needed for 8-byte alignment, for the following command.&lt;br /&gt;
&lt;br /&gt;
=== Commands ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  CommandID&lt;br /&gt;
!  Parameter&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0010&lt;br /&gt;
| Value is 0x12345678&lt;br /&gt;
| This command is always the last command in the buffer.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0110&lt;br /&gt;
| Value 0x1&lt;br /&gt;
| This command is immediately before CmdID 0x000F0010, this is also used elsewhere for beginning rendering of mesh(es) as well.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0111&lt;br /&gt;
| Value 0x1&lt;br /&gt;
| This command is immediately before CmdID 0x000F0110, however CmdID 0x000F0110 doesn&#039;t always follow this command.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0040&lt;br /&gt;
| u32, valid values are 0x1 and 0x2, values 0x0 and 0x3 have the same effect as value 0x2. Only bits 1-0 are used.&lt;br /&gt;
| Value 2 = GL_FRONT/GL_CW or GL_BACK/GL_CCW. Value 1 = GL_FRONT/GL_CCW or GL_BACK/GL_CW.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0041&lt;br /&gt;
| float24&lt;br /&gt;
| VIEWPORT_WIDTH. See command set 0x000F0041.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0042&lt;br /&gt;
| float32&lt;br /&gt;
| VIEWPORT_WIDTH_INV. See command set 0x000F0041.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0043&lt;br /&gt;
| float24&lt;br /&gt;
| VIEWPORT_HEIGHT. See command set 0x000F0041.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0044&lt;br /&gt;
| float32&lt;br /&gt;
| VIEWPORT_HEIGHT_INV. See command set 0x000F0041.&lt;br /&gt;
|-&lt;br /&gt;
| 0x801F004D&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x801F004D.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0068&lt;br /&gt;
| u32&lt;br /&gt;
| VIEWPORT Y/X. See command set 0x000F0041.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F006D&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x801F004D.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F006E&lt;br /&gt;
| u32&lt;br /&gt;
| See command set 0x000F0111.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00010080&lt;br /&gt;
| u32&lt;br /&gt;
| See command set 0x00030080.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030080&lt;br /&gt;
| u32&lt;br /&gt;
| See command set 0x00030080.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040080&lt;br /&gt;
| u32&lt;br /&gt;
| See command set 0x00030080.&lt;br /&gt;
|-&lt;br /&gt;
| 0x809F0081&lt;br /&gt;
| &lt;br /&gt;
| This is used to set the current texture info used for rendering, see command set [[GPU_Textures|0x809F0081]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F008E&lt;br /&gt;
| u32 color type&lt;br /&gt;
| This command sets the texture color type, see command set [[GPU_Textures|0x809F0081]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x805F0091&lt;br /&gt;
| &lt;br /&gt;
| This sets current texture info, see command [[GPU_Textures|0x805F0091]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x805F0099&lt;br /&gt;
| &lt;br /&gt;
| This sets current texture info, see command [[GPU_Textures|0x805F0099]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x800F00C3&lt;br /&gt;
| val&amp;lt;&amp;lt;24&lt;br /&gt;
| Val is usually 0xFF or 0x00, however 0x00-0xFF is valid as well. This is alpha-blending related?&lt;br /&gt;
|-&lt;br /&gt;
| 0x800F00CB&lt;br /&gt;
| val&amp;lt;&amp;lt;24&lt;br /&gt;
| Val is usually 0xFF or 0x00, however 0x00-0xFF is valid as well. This is alpha-blending related?&lt;br /&gt;
|-&lt;br /&gt;
| 0x80XF00C0&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x800F00C4&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80XF00C8&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x800F00CC&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80XF00D0&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x800F00D4&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80XF00D8&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x800F00DC&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80XF00F0&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x800F00F4&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80XF00F8&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x800F00FC&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000100E0&lt;br /&gt;
| Normally value zero.&lt;br /&gt;
| Unknown, fragment related?&lt;br /&gt;
|-&lt;br /&gt;
| 0x000500E0&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x000500E0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F00E1&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x000500E0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F00E6&lt;br /&gt;
| Value zero&lt;br /&gt;
| See command set 0x000F00E6.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F00E8&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x000F00E6.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020100&lt;br /&gt;
| u32, value is 0x00E40100&lt;br /&gt;
| See command set 0x00020100.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D0100&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;0x00E40000 | val&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
| Val0 = unknown, val1 = unknown, val3 = unknown. The default val used here is 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0101&lt;br /&gt;
| u32&lt;br /&gt;
| See command set 0x00020100.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0103&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x00020100.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0104&lt;br /&gt;
| u32&lt;br /&gt;
| glAlphaFunc()&lt;br /&gt;
|-&lt;br /&gt;
| 0x00010107&lt;br /&gt;
| &lt;br /&gt;
| See command set CmdID 0x00010107.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020107&lt;br /&gt;
| &lt;br /&gt;
| See command set CmdID 0x00010107.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030107&lt;br /&gt;
| &lt;br /&gt;
| See command set CmdID 0x00030107.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0116&lt;br /&gt;
| u32&lt;br /&gt;
| DEPTHBUFFER FORMAT. See command set 0x000F0111.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0117&lt;br /&gt;
| u32&lt;br /&gt;
| COLORBUFFER FORMAT/PIXEL. See command set 0x000F0111.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F011C&lt;br /&gt;
| Physical address&amp;gt;&amp;gt;3&lt;br /&gt;
| DEPTHBUFFER ADDRESS. See command set 0x000F0111.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F011D&lt;br /&gt;
| Physical address&amp;gt;&amp;gt;3&lt;br /&gt;
| COLORBUFFER ADDRESS. See command set 0x000F0111.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F011E&lt;br /&gt;
| u32&lt;br /&gt;
| COLORBUFFER HEIGHT/WIDTH. See command set 0x000F0111.&lt;br /&gt;
|-&lt;br /&gt;
| 0x803F0112&lt;br /&gt;
| &lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x826F0200&lt;br /&gt;
| &lt;br /&gt;
| See command set [[GPU_GL_Arrays|0x826F0200]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x00080126&lt;br /&gt;
| &lt;br /&gt;
| See command set CmdID 0x00030107.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0227&lt;br /&gt;
| u32&lt;br /&gt;
| This specifies the address of an array containing vertex array indices, and the data-type of the indices, used for rendering primitives. See command set [[GPU_GL_Arrays|glDrawElements()]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0228&lt;br /&gt;
| u32 total elements in the array to use for rendering.&lt;br /&gt;
| See command set [[GPU_GL_Arrays|glDrawElements()]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x803F0232&lt;br /&gt;
| &lt;br /&gt;
| See command set [[GPU_GL_Arrays|0x826F0200]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x0002025E&lt;br /&gt;
| u32, val&amp;lt;&amp;lt;8.&lt;br /&gt;
| This sets the GL rendering mode, see command set [[GPU_GL_Arrays|0x826F0200]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F02B0&lt;br /&gt;
| u32, value is &amp;lt;nowiki&amp;gt;0x7FFF0000 | val&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
| Texture related?&lt;br /&gt;
|-&lt;br /&gt;
| 0x801F02BB&lt;br /&gt;
| &lt;br /&gt;
| See command set [[GPU_GL_Arrays|0x826F0200]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F02C0&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;0x80000000 | Type&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| This is used immediately before CmdID 0xXXXF02C1. This type field controls the command parameter buffer type.&lt;br /&gt;
|-&lt;br /&gt;
| 0xXXXF02C1&lt;br /&gt;
| First word in the first entry&lt;br /&gt;
| A list of entries follow this command.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command Sets ====&lt;br /&gt;
&lt;br /&gt;
===== glDrawElements() =====&lt;br /&gt;
See [[GPU_GL_Arrays|GPU GL Arrays]].&lt;br /&gt;
&lt;br /&gt;
===== glClear() / glClearColor() =====&lt;br /&gt;
The GPU does not have dedicated commands for clearing the color buffer, therefore applications implement color buffer clearing by rendering a quad. Applications normally store this vertex and color [[GPU_GL_Arrays|array]] in the GSP application heap.&lt;br /&gt;
&lt;br /&gt;
===== CmdID 0x809F0081 =====&lt;br /&gt;
This sets current texture info, see [[GPU Textures|GPU textures]].&lt;br /&gt;
&lt;br /&gt;
===== CmdID 0x00030080 =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Command Index&lt;br /&gt;
!  CommandID&lt;br /&gt;
!  Parameter&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x00030080&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;0x11000 | val&amp;lt;/nowiki&amp;gt;, where only bits 2-1 are used in val.&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x00040080&lt;br /&gt;
| Same value as CmdID 0x00030080.&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x00010080&lt;br /&gt;
| Same value as CmdID 0x00030080.&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== CmdID 0x80XF00C0 =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Command Index&lt;br /&gt;
!  CommandID&lt;br /&gt;
!  Parameter&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;0x802F0000 | SlotCmdID&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;0x800F0000 | SlotCmdID + 4&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is used for glTexEnv(), for the slot indicated by the CmdID. There&#039;s a total of 6 slots, where each slot corresponds to the following u16 CmdIDs: 0xC0, 0xC8, 0xD0, 0xD8, 0xF0, 0xF8.&lt;br /&gt;
&lt;br /&gt;
===== CmdID 0x000500E0 =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Command Index&lt;br /&gt;
!  CommandID&lt;br /&gt;
!  Parameter&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x000500E0&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;5 | val&amp;lt;&amp;lt;16&amp;lt;/nowiki&amp;gt;, where val is 0 or 1.&lt;br /&gt;
| Val0 = enable, val1 = disable.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x000F00E1&lt;br /&gt;
| &lt;br /&gt;
| This specifies a color.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is usually used immediately after command set glDrawElements(). This is used to specify a color used for blending?&lt;br /&gt;
&lt;br /&gt;
===== CmdID 0x000F00E6 =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Command Index&lt;br /&gt;
!  CommandID&lt;br /&gt;
!  Parameter&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x000F00E6&lt;br /&gt;
| Value 0&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x000F00E8&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is usually the last command set used for rendering a mesh, when command set 0x000500E0 was used. This command set is used immediately after command set 0x000500E0.&lt;br /&gt;
&lt;br /&gt;
===== CmdID 0x00020100 =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Command Index&lt;br /&gt;
!  CommandID&lt;br /&gt;
!  Parameter&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x00020100&lt;br /&gt;
| Value 0x00E40100&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x000F0101&lt;br /&gt;
| 0x01010000 when disabled?&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0x000F0103&lt;br /&gt;
| This is set to zero when the Cmd 0x000F0101 parameter is value 0x01010000.&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is fragment related?&lt;br /&gt;
&lt;br /&gt;
===== CmdID 0x801F004D =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Command Index&lt;br /&gt;
!  CommandID&lt;br /&gt;
!  Parameter&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x801F004D&lt;br /&gt;
| &lt;br /&gt;
| glDepthRange()&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x000F006D&lt;br /&gt;
| 0 = unknown, 1 = unknown.&lt;br /&gt;
| Value zero causes the mesh to not be rendered.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== CmdID 0x000F0041 =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Command Index&lt;br /&gt;
!  CommandID&lt;br /&gt;
!  Parameter&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x000F0041&lt;br /&gt;
| float&lt;br /&gt;
| This corresponds to the framebuffer width.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x000F0043&lt;br /&gt;
| float&lt;br /&gt;
| This parameter value is calculated the same way as the CmdID 0x000F0041 parameter, except the framebuffer height is used instead.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0x000F0042&lt;br /&gt;
| float&lt;br /&gt;
| This corresponds to the framebuffer width.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 0x000F0044&lt;br /&gt;
| float&lt;br /&gt;
| This parameter value value is calculated the same way as the CmdID 0x000F0042 parameter, except the framebuffer height is used instead.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 0x000F0068&lt;br /&gt;
| u32&lt;br /&gt;
| This sets the X/Y coordinates used for glViewport().&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command set initializes the projection matrix. This command set is used twice when beginning rendering for each screen. The framebuffer width used here for the main screen is 240, however this is 480 with stereoscopy enabled for the second time this command set is used.&lt;br /&gt;
&lt;br /&gt;
===== CmdID 0x000F0111 =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Command Index&lt;br /&gt;
!  CommandID&lt;br /&gt;
!  Parameter&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x000F0111&lt;br /&gt;
| Value 1&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x000F0110&lt;br /&gt;
| Value 1&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0x000F0117&lt;br /&gt;
| Bits15-0 = unk, 31-16 = unk.&lt;br /&gt;
| Unknown, normally the input parameter is value 0x2.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 0x000F011D&lt;br /&gt;
| Physical address&amp;gt;&amp;gt;3&lt;br /&gt;
| This initializes the framebuffer address used for rendering, this framebuffer is used for the input framebuffer with [[GSP_Shared_Memory|GX command]] 3 and 4. This command is used immediately after CmdID 0x000F0117.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 0x000F0116&lt;br /&gt;
| &lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 0x000F011C&lt;br /&gt;
| Physical address&amp;gt;&amp;gt;3&lt;br /&gt;
| Unknown, normally this address is located in VRAM.&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 0x000F011E&lt;br /&gt;
| u32&lt;br /&gt;
| This sets the width and height for the framebuffer used for rendering. Therefore this is glViewport(), x/y are specified by CmdID 0x000F0068.&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 0x000F006E&lt;br /&gt;
| Same input parameter value as CmdID 0x000F011E.&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command set is normally used after the two 0x000F0041 command sets.&lt;br /&gt;
&lt;br /&gt;
===== CmdID 0x00030107 =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Command Index&lt;br /&gt;
!  CommandID&lt;br /&gt;
!  Parameter&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x00030107&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x00080126&lt;br /&gt;
| type&amp;lt;&amp;lt;24&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command set is used for disabling the alpha-blending info set by command set 0x00010107? The GL AlphaFunction used here is normally GL_ALWAYS.&lt;br /&gt;
&lt;br /&gt;
===== CmdID 0x00010107 =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Command Index&lt;br /&gt;
!  CommandID&lt;br /&gt;
!  Parameter&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x00010107&lt;br /&gt;
| Same format as CmdID 0x00030107.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x00080126&lt;br /&gt;
| type&amp;lt;&amp;lt;24&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x00020107&lt;br /&gt;
| Same value as CmdID 0x00010107.&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Parameter format for CmdIDs 0x00030107, 0x00020107, and 0x00010107 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0 = disable GL_ALPHA_TEST, 1 = enable GL_ALPHA_TEST&lt;br /&gt;
|-&lt;br /&gt;
| 3-1&lt;br /&gt;
| Unused?&lt;br /&gt;
|-&lt;br /&gt;
| 7-4&lt;br /&gt;
| Alpha function&lt;br /&gt;
|-&lt;br /&gt;
| 11-8&lt;br /&gt;
| Color to blend with?&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 31-13&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Alpha function values ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Value&lt;br /&gt;
!  GL AlphaFunction&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| GL_NEVER&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| GL_ALWAYS&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| GL_EQUAL&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| GL_NOTEQUAL&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| GL_LESS&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| GL_LEQUAL&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| GL_GREATER&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| GL_GEQUAL&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Alpha types for CmdID 0x00080126 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  GL AlphaFunction&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| GL_NEVER&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| GL_ALWAYS&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| GL_GREATER/GL_GEQUAL&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| The remaining GL alpha functions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Parameter value format for CmdID 0x000F0104 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0 = disable GL_ALPHA_TEST, 1 = enable GL_ALPHA_TEST&lt;br /&gt;
|-&lt;br /&gt;
| 3-1&lt;br /&gt;
| Unused?&lt;br /&gt;
|-&lt;br /&gt;
| 7-4&lt;br /&gt;
| Alpha function&lt;br /&gt;
|-&lt;br /&gt;
| 15-8&lt;br /&gt;
| u8 ref, range is 0-255&lt;br /&gt;
|-&lt;br /&gt;
| 31-16&lt;br /&gt;
| Unused?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is glAlphaFunc().&lt;br /&gt;
&lt;br /&gt;
=== Parameter value format for CmdID 0x000F011E ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 11-0&lt;br /&gt;
| Framebuffer/viewport width&lt;br /&gt;
|-&lt;br /&gt;
| 23-12&lt;br /&gt;
| Framebuffer/viewport height - 1&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| Must be set&lt;br /&gt;
|-&lt;br /&gt;
| 31-25&lt;br /&gt;
| Unused?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This specifies the width/height for glViewport(). Normally the framebuffer width and height is set to the same [[GPU|dimensions]] used with GX [[GSP_Shared_Memory|command]] 3 and 4.&lt;br /&gt;
&lt;br /&gt;
=== Parameter value format for CmdID 0x000F0068 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 15-0&lt;br /&gt;
| X&lt;br /&gt;
|-&lt;br /&gt;
| 31-16&lt;br /&gt;
| Y&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This specifies the X/Y coordinates for glViewport().&lt;br /&gt;
&lt;br /&gt;
=== Parameter structure for CmdID 0x804F00C0 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Value 0xFFF0FFF / 0x0&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Value 0x0&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Value 0x0&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Value 0xFFFFFFFF&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Value 0x0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This individual command is used instead of the 0x80XF00C0 command set when none of the associated rendering parameters for this slot are set.&lt;br /&gt;
&lt;br /&gt;
=== Parameter structure for CmdID 0x802F00C0 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Param0&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Param1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Param2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See command set 0x80XF00C0.&lt;br /&gt;
&lt;br /&gt;
==== Param0 format for CmdID 0x802F00C0 ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 3-0&lt;br /&gt;
| See below values.(Field0 index0)&lt;br /&gt;
|-&lt;br /&gt;
| 7-4&lt;br /&gt;
| See below values.(Field0 index1)&lt;br /&gt;
|-&lt;br /&gt;
| 11-8&lt;br /&gt;
| See below values.(Field0 index2)&lt;br /&gt;
|-&lt;br /&gt;
| 15-12&lt;br /&gt;
| Unused&lt;br /&gt;
|-&lt;br /&gt;
| 19-16&lt;br /&gt;
| See below values.(Field1 index0)&lt;br /&gt;
|-&lt;br /&gt;
| 23-20&lt;br /&gt;
| See below values.(Field1 index1)&lt;br /&gt;
|-&lt;br /&gt;
| 27-24&lt;br /&gt;
| See below values.(Field1 index2)&lt;br /&gt;
|-&lt;br /&gt;
| 31-28&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Param0 values for CmdID 0x802F00C0 ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Value&lt;br /&gt;
!  GL type&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| GL_PRIMARY_COLOR&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| GL_TEXTURE0&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| GL_TEXTURE1&lt;br /&gt;
|-&lt;br /&gt;
| 0x5&lt;br /&gt;
| GL_TEXTURE2&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| GL_TEXTURE3&lt;br /&gt;
|-&lt;br /&gt;
| 0xC-0x7&lt;br /&gt;
| GL_PRIMARY_COLOR&lt;br /&gt;
|-&lt;br /&gt;
| 0xD&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xE&lt;br /&gt;
| GL_CONSTANT&lt;br /&gt;
|-&lt;br /&gt;
| 0xF&lt;br /&gt;
| GL_PREVIOUS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Param1 format for CmdID 0x802F00C0 ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 3-0&lt;br /&gt;
| See below values for field0.(Index0)&lt;br /&gt;
|-&lt;br /&gt;
| 7-4&lt;br /&gt;
| See below values for field0.(Index1)&lt;br /&gt;
|-&lt;br /&gt;
| 11-8&lt;br /&gt;
| See below values for field0.(Index2)&lt;br /&gt;
|-&lt;br /&gt;
| 15-12&lt;br /&gt;
| See below values for field1.(Index0)&lt;br /&gt;
|-&lt;br /&gt;
| 19-16&lt;br /&gt;
| See below values for field1.(Index1)&lt;br /&gt;
|-&lt;br /&gt;
| 23-20&lt;br /&gt;
| See below values for field1.(Index2)&lt;br /&gt;
|-&lt;br /&gt;
| 31-24&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This specifies the pname for glTexEnv().&lt;br /&gt;
&lt;br /&gt;
==== Param1 field0 values for CmdID 0x802F00C0 ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Value&lt;br /&gt;
!  GL type&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| GL_SRC_COLOR&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| GL_ONE_MINUS_SRC_COLOR&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| GL_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| GL_ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| GL_SRC0_RGB&lt;br /&gt;
|-&lt;br /&gt;
| 0x5&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| GL_SRC_COLOR&lt;br /&gt;
|-&lt;br /&gt;
| 0x7&lt;br /&gt;
| GL_SRC_COLOR&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| GL_SRC1_RGB&lt;br /&gt;
|-&lt;br /&gt;
| 0x9&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xA&lt;br /&gt;
| GL_SRC_COLOR&lt;br /&gt;
|-&lt;br /&gt;
| 0xB&lt;br /&gt;
| GL_SRC_COLOR&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| GL_SRC2_RGB&lt;br /&gt;
|-&lt;br /&gt;
| 0xD&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Param1 field1 values for CmdID 0x802F00C0 ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Value&lt;br /&gt;
!  GL type&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| GL_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| GL_ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| GL_SRC0_RGB&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| GL_SRC1_RGB&lt;br /&gt;
|-&lt;br /&gt;
| 0x5&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| GL_SRC2_RGB&lt;br /&gt;
|-&lt;br /&gt;
| 0x7&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Param2 format for CmdID 0x802F00C0 ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 15-0&lt;br /&gt;
| See below field0 values.&lt;br /&gt;
|-&lt;br /&gt;
| 31-16&lt;br /&gt;
| See below field1 values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is used to specify the param for glTexEnv(..., ..., param).&lt;br /&gt;
&lt;br /&gt;
==== Param2 field0 values for CmdID 0x802F00C0 ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Value&lt;br /&gt;
!  GL type&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| GL_REPLACE&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| GL_MODULATE&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| GL_ADD&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| GL_ADD_SIGNED&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| GL_INTERPOLATE&lt;br /&gt;
|-&lt;br /&gt;
| 0x5&lt;br /&gt;
| GL_SUBTRACT&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| GL_DOT3_RGB&lt;br /&gt;
|-&lt;br /&gt;
| 0x7&lt;br /&gt;
| GL_DOT3_RGBA&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x9&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Param2 field1 values for CmdID 0x802F00C0 ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Value&lt;br /&gt;
!  GL type&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| GL_REPLACE&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| GL_MODULATE&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| GL_ADD&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| GL_ADD_SIGNED&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| GL_INTERPOLATE&lt;br /&gt;
|-&lt;br /&gt;
| 0x5&lt;br /&gt;
| GL_SUBTRACT&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| GL_REPLACE&lt;br /&gt;
|-&lt;br /&gt;
| 0x7&lt;br /&gt;
| GL_DOT3_RGB&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x9&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Parameter value format for CmdID 0x800F00C4 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 15-0&lt;br /&gt;
| Valid values: 0=unknown, 1=unknown, 2=unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 31-16&lt;br /&gt;
| Same format as bits15-0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See command set 0x80XF00C0.&lt;br /&gt;
&lt;br /&gt;
=== Parameter value format for CmdID 0x000F00E1 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 7-0&lt;br /&gt;
| Red component&lt;br /&gt;
|-&lt;br /&gt;
| 15-8&lt;br /&gt;
| Green component&lt;br /&gt;
|-&lt;br /&gt;
| 23-16&lt;br /&gt;
| Blue component&lt;br /&gt;
|-&lt;br /&gt;
| 31-24&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Parameter value format for CmdID 0x000F0101 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 7-0&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 15-8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 19-16&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 23-20&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 27-24&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 31-28&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Parameter structure for CmdID 0x801F004D ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| float far&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| float near&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is glDepthRange().&lt;br /&gt;
&lt;br /&gt;
=== Parameter structure for CmdID 0x000F00E8 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D-0x00&lt;br /&gt;
| Usually value 0x00FFE000.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7E&lt;br /&gt;
| Usually value 0x00FFFEE6?&lt;br /&gt;
|-&lt;br /&gt;
| 0x7F&lt;br /&gt;
| Usually value 0x00DCD919?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Parameter structure for CmdID 0x803F0112 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x0 = unknown, 0xF = unknown. Only bits 3-0 are used.(Values 0x1-0xF all have the same effect)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x0 = unknown, 0xF = unknown. Only bits 3-0 are used.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0x0 = unknown, 0x2 = unknown. Only bits 1-0 are used.(Values 0x1-0x3 all have the same effect)&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 0x0 = unknown, 0x2 = unknown. Only bits 1-0 are used.(Values 0x1-0x3 all have the same effect)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Entries for CmdID 0xXXXF02C1 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| float, the GPU handles this as the 4th word.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| float, the GPU handles this as the 3rd word.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| float, the GPU handles this as the 2nd word.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| float, the GPU handles this as the 1st word.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The below entry structure info is in the raw order used for the command, not the order used by the GPU.&lt;br /&gt;
&lt;br /&gt;
==== Color Entry ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| float Red component&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| float Blue component&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| float Green component&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| float Alpha&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Lighting Color Entry ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| float Alpha&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| float Blue component&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| float Green component&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| float Red component&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Types for CmdID 0x000F02C0 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Value&lt;br /&gt;
!  Entries per chunk&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4&lt;br /&gt;
| This specifies 16-floats for a 4x4 matrix, used for glLoadMatrix() for the projection matrix.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4&lt;br /&gt;
| This specifies a 4x4 matrix, used for glLoadMatrix() for the model-view matrix. This is usually an identity matrix.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| 2&lt;br /&gt;
| Sets the color.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A&lt;br /&gt;
| 4&lt;br /&gt;
| Specifies a 4x4 matrix, used for glLoadMatrix() for the texture matrix.(Index0)&lt;br /&gt;
|-&lt;br /&gt;
| 0x0E&lt;br /&gt;
| 3&lt;br /&gt;
| Specifies a 4x3 texture matrix.(Index1)&lt;br /&gt;
|-&lt;br /&gt;
| 0x11&lt;br /&gt;
| 3&lt;br /&gt;
| Specifies a 4x3 texture matrix.(Index2)&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| &amp;lt;=30&lt;br /&gt;
| Used to specify a 4xN matrix, where N is the total CmdID 0xXXXF02C1 entries. This is glMultMatrix() for the model-view matrix, except the input matrix is 4xN instead of 4x4.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C&lt;br /&gt;
| 4&lt;br /&gt;
| This specifies a 4x4 float matrix.&lt;br /&gt;
|-&lt;br /&gt;
| 0x50, 0x53, and 0x56&lt;br /&gt;
| 1&lt;br /&gt;
| This specifies the GL_LIGHT0-2 color for GL_AMBIENT?&lt;br /&gt;
|-&lt;br /&gt;
| 0x51, 0x54, and 0x57&lt;br /&gt;
| 1&lt;br /&gt;
| This specifies the GL_LIGHT0-2 color for GL_DIFFUSE?&lt;br /&gt;
|-&lt;br /&gt;
| 0x52, 0x55, and 0x58&lt;br /&gt;
| 1&lt;br /&gt;
| This specifies the GL_LIGHT0-2 color for GL_SPECULAR?&lt;br /&gt;
|-&lt;br /&gt;
| 0x59&lt;br /&gt;
| 1&lt;br /&gt;
| Unknown, the entry data is floats converted from s32s. Usually each entry word is zeros.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5A&lt;br /&gt;
| 2&lt;br /&gt;
| Color related?&lt;br /&gt;
|-&lt;br /&gt;
| 0x5C&lt;br /&gt;
| 1&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The matrices for types 0x00 and 0x04 use row-major order, instead of column-major order.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=GPU/Commands&amp;diff=5614</id>
		<title>GPU/Commands</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=GPU/Commands&amp;diff=5614"/>
		<updated>2013-04-18T23:43:12Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the structure of the buffer for [[GSP_Shared_Memory|GX command]] 1 with the registers at [[GPU|0x1EF018E0]]. This buffer is used for GPU commands including OpenGL commands, each 8-byte entry in the buffer is a command. Cmd+0 is the command parameter, and cmd+4 is the command header.&lt;br /&gt;
&lt;br /&gt;
Invalid GPU command parameters including NaN floats can cause the GPU to hang, this then causes the GSP module to hang as well.&lt;br /&gt;
&lt;br /&gt;
=== Command Header ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 19-0&lt;br /&gt;
| Command ID&lt;br /&gt;
|-&lt;br /&gt;
| 30-20&lt;br /&gt;
| Total words following the command, if any.&lt;br /&gt;
|-&lt;br /&gt;
| 31&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
The first word in the parameter data structure is the command parameter value, the rest of the data structure is from the data following the command. The word after the last data structure word is padding when needed for 8-byte alignment, for the following command.&lt;br /&gt;
&lt;br /&gt;
=== Commands ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  CommandID&lt;br /&gt;
!  Parameter&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0010&lt;br /&gt;
| Value is 0x12345678&lt;br /&gt;
| This command is always the last command in the buffer.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0110&lt;br /&gt;
| Value 0x1&lt;br /&gt;
| This command is immediately before CmdID 0x000F0010, this is also used elsewhere for beginning rendering of mesh(es) as well.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0111&lt;br /&gt;
| Value 0x1&lt;br /&gt;
| This command is immediately before CmdID 0x000F0110, however CmdID 0x000F0110 doesn&#039;t always follow this command.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0040&lt;br /&gt;
| u32, valid values are 0x1 and 0x2, values 0x0 and 0x3 have the same effect as value 0x2. Only bits 1-0 are used.&lt;br /&gt;
| Value 2 = GL_FRONT/GL_CW or GL_BACK/GL_CCW. Value 1 = GL_FRONT/GL_CCW or GL_BACK/GL_CW.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0041&lt;br /&gt;
| float24&lt;br /&gt;
| VIEWPORT_WIDTH. See command set 0x000F0041.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0042&lt;br /&gt;
| float32&lt;br /&gt;
| VIEWPORT_WIDTH_INV. See command set 0x000F0041.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0043&lt;br /&gt;
| float24&lt;br /&gt;
| VIEWPORT_HEIGHT. See command set 0x000F0041.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0044&lt;br /&gt;
| float32&lt;br /&gt;
| VIEWPORT_HEIGHT_INV. See command set 0x000F0041.&lt;br /&gt;
|-&lt;br /&gt;
| 0x801F004D&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x801F004D.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0068&lt;br /&gt;
| u32&lt;br /&gt;
| VIEWPORT X/Y. See command set 0x000F0041.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F006D&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x801F004D.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F006E&lt;br /&gt;
| u32&lt;br /&gt;
| See command set 0x000F0111.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00010080&lt;br /&gt;
| u32&lt;br /&gt;
| See command set 0x00030080.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030080&lt;br /&gt;
| u32&lt;br /&gt;
| See command set 0x00030080.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040080&lt;br /&gt;
| u32&lt;br /&gt;
| See command set 0x00030080.&lt;br /&gt;
|-&lt;br /&gt;
| 0x809F0081&lt;br /&gt;
| &lt;br /&gt;
| This is used to set the current texture info used for rendering, see command set [[GPU_Textures|0x809F0081]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F008E&lt;br /&gt;
| u32 color type&lt;br /&gt;
| This command sets the texture color type, see command set [[GPU_Textures|0x809F0081]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x805F0091&lt;br /&gt;
| &lt;br /&gt;
| This sets current texture info, see command [[GPU_Textures|0x805F0091]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x805F0099&lt;br /&gt;
| &lt;br /&gt;
| This sets current texture info, see command [[GPU_Textures|0x805F0099]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x800F00C3&lt;br /&gt;
| val&amp;lt;&amp;lt;24&lt;br /&gt;
| Val is usually 0xFF or 0x00, however 0x00-0xFF is valid as well. This is alpha-blending related?&lt;br /&gt;
|-&lt;br /&gt;
| 0x800F00CB&lt;br /&gt;
| val&amp;lt;&amp;lt;24&lt;br /&gt;
| Val is usually 0xFF or 0x00, however 0x00-0xFF is valid as well. This is alpha-blending related?&lt;br /&gt;
|-&lt;br /&gt;
| 0x80XF00C0&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x800F00C4&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80XF00C8&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x800F00CC&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80XF00D0&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x800F00D4&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80XF00D8&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x800F00DC&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80XF00F0&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x800F00F4&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80XF00F8&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x800F00FC&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x80XF00C0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000100E0&lt;br /&gt;
| Normally value zero.&lt;br /&gt;
| Unknown, fragment related?&lt;br /&gt;
|-&lt;br /&gt;
| 0x000500E0&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x000500E0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F00E1&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x000500E0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F00E6&lt;br /&gt;
| Value zero&lt;br /&gt;
| See command set 0x000F00E6.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F00E8&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x000F00E6.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020100&lt;br /&gt;
| u32, value is 0x00E40100&lt;br /&gt;
| See command set 0x00020100.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D0100&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;0x00E40000 | val&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
| Val0 = unknown, val1 = unknown, val3 = unknown. The default val used here is 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0101&lt;br /&gt;
| u32&lt;br /&gt;
| See command set 0x00020100.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0103&lt;br /&gt;
| &lt;br /&gt;
| See command set 0x00020100.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0104&lt;br /&gt;
| u32&lt;br /&gt;
| glAlphaFunc()&lt;br /&gt;
|-&lt;br /&gt;
| 0x00010107&lt;br /&gt;
| &lt;br /&gt;
| See command set CmdID 0x00010107.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020107&lt;br /&gt;
| &lt;br /&gt;
| See command set CmdID 0x00010107.&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030107&lt;br /&gt;
| &lt;br /&gt;
| See command set CmdID 0x00030107.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0116&lt;br /&gt;
| u32&lt;br /&gt;
| See command set 0x000F0111.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0117&lt;br /&gt;
| u32&lt;br /&gt;
| See command set 0x000F0111.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F011C&lt;br /&gt;
| Physical address&amp;gt;&amp;gt;3&lt;br /&gt;
| See command set 0x000F0111.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F011D&lt;br /&gt;
| Physical address&amp;gt;&amp;gt;3&lt;br /&gt;
| See command set 0x000F0111.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F011E&lt;br /&gt;
| u32&lt;br /&gt;
| See command set 0x000F0111.&lt;br /&gt;
|-&lt;br /&gt;
| 0x803F0112&lt;br /&gt;
| &lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x826F0200&lt;br /&gt;
| &lt;br /&gt;
| See command set [[GPU_GL_Arrays|0x826F0200]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x00080126&lt;br /&gt;
| &lt;br /&gt;
| See command set CmdID 0x00030107.&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0227&lt;br /&gt;
| u32&lt;br /&gt;
| This specifies the address of an array containing vertex array indices, and the data-type of the indices, used for rendering primitives. See command set [[GPU_GL_Arrays|glDrawElements()]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0228&lt;br /&gt;
| u32 total elements in the array to use for rendering.&lt;br /&gt;
| See command set [[GPU_GL_Arrays|glDrawElements()]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x803F0232&lt;br /&gt;
| &lt;br /&gt;
| See command set [[GPU_GL_Arrays|0x826F0200]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x0002025E&lt;br /&gt;
| u32, val&amp;lt;&amp;lt;8.&lt;br /&gt;
| This sets the GL rendering mode, see command set [[GPU_GL_Arrays|0x826F0200]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F02B0&lt;br /&gt;
| u32, value is &amp;lt;nowiki&amp;gt;0x7FFF0000 | val&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
| Texture related?&lt;br /&gt;
|-&lt;br /&gt;
| 0x801F02BB&lt;br /&gt;
| &lt;br /&gt;
| See command set [[GPU_GL_Arrays|0x826F0200]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F02C0&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;0x80000000 | Type&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| This is used immediately before CmdID 0xXXXF02C1. This type field controls the command parameter buffer type.&lt;br /&gt;
|-&lt;br /&gt;
| 0xXXXF02C1&lt;br /&gt;
| First word in the first entry&lt;br /&gt;
| A list of entries follow this command.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command Sets ====&lt;br /&gt;
&lt;br /&gt;
===== glDrawElements() =====&lt;br /&gt;
See [[GPU_GL_Arrays|GPU GL Arrays]].&lt;br /&gt;
&lt;br /&gt;
===== glClear() / glClearColor() =====&lt;br /&gt;
The GPU does not have dedicated commands for clearing the color buffer, therefore applications implement color buffer clearing by rendering a quad. Applications normally store this vertex and color [[GPU_GL_Arrays|array]] in the GSP application heap.&lt;br /&gt;
&lt;br /&gt;
===== CmdID 0x809F0081 =====&lt;br /&gt;
This sets current texture info, see [[GPU Textures|GPU textures]].&lt;br /&gt;
&lt;br /&gt;
===== CmdID 0x00030080 =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Command Index&lt;br /&gt;
!  CommandID&lt;br /&gt;
!  Parameter&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x00030080&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;0x11000 | val&amp;lt;/nowiki&amp;gt;, where only bits 2-1 are used in val.&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x00040080&lt;br /&gt;
| Same value as CmdID 0x00030080.&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x00010080&lt;br /&gt;
| Same value as CmdID 0x00030080.&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== CmdID 0x80XF00C0 =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Command Index&lt;br /&gt;
!  CommandID&lt;br /&gt;
!  Parameter&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;0x802F0000 | SlotCmdID&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;0x800F0000 | SlotCmdID + 4&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is used for glTexEnv(), for the slot indicated by the CmdID. There&#039;s a total of 6 slots, where each slot corresponds to the following u16 CmdIDs: 0xC0, 0xC8, 0xD0, 0xD8, 0xF0, 0xF8.&lt;br /&gt;
&lt;br /&gt;
===== CmdID 0x000500E0 =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Command Index&lt;br /&gt;
!  CommandID&lt;br /&gt;
!  Parameter&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x000500E0&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;5 | val&amp;lt;&amp;lt;16&amp;lt;/nowiki&amp;gt;, where val is 0 or 1.&lt;br /&gt;
| Val0 = enable, val1 = disable.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x000F00E1&lt;br /&gt;
| &lt;br /&gt;
| This specifies a color.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is usually used immediately after command set glDrawElements(). This is used to specify a color used for blending?&lt;br /&gt;
&lt;br /&gt;
===== CmdID 0x000F00E6 =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Command Index&lt;br /&gt;
!  CommandID&lt;br /&gt;
!  Parameter&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x000F00E6&lt;br /&gt;
| Value 0&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x000F00E8&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is usually the last command set used for rendering a mesh, when command set 0x000500E0 was used. This command set is used immediately after command set 0x000500E0.&lt;br /&gt;
&lt;br /&gt;
===== CmdID 0x00020100 =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Command Index&lt;br /&gt;
!  CommandID&lt;br /&gt;
!  Parameter&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x00020100&lt;br /&gt;
| Value 0x00E40100&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x000F0101&lt;br /&gt;
| 0x01010000 when disabled?&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0x000F0103&lt;br /&gt;
| This is set to zero when the Cmd 0x000F0101 parameter is value 0x01010000.&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is fragment related?&lt;br /&gt;
&lt;br /&gt;
===== CmdID 0x801F004D =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Command Index&lt;br /&gt;
!  CommandID&lt;br /&gt;
!  Parameter&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x801F004D&lt;br /&gt;
| &lt;br /&gt;
| glDepthRange()&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x000F006D&lt;br /&gt;
| 0 = unknown, 1 = unknown.&lt;br /&gt;
| Value zero causes the mesh to not be rendered.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== CmdID 0x000F0041 =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Command Index&lt;br /&gt;
!  CommandID&lt;br /&gt;
!  Parameter&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x000F0041&lt;br /&gt;
| float&lt;br /&gt;
| This corresponds to the framebuffer width.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x000F0043&lt;br /&gt;
| float&lt;br /&gt;
| This parameter value is calculated the same way as the CmdID 0x000F0041 parameter, except the framebuffer height is used instead.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0x000F0042&lt;br /&gt;
| float&lt;br /&gt;
| This corresponds to the framebuffer width.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 0x000F0044&lt;br /&gt;
| float&lt;br /&gt;
| This parameter value value is calculated the same way as the CmdID 0x000F0042 parameter, except the framebuffer height is used instead.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 0x000F0068&lt;br /&gt;
| u32&lt;br /&gt;
| This sets the X/Y coordinates used for glViewport().&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command set initializes the projection matrix. This command set is used twice when beginning rendering for each screen. The framebuffer width used here for the main screen is 240, however this is 480 with stereoscopy enabled for the second time this command set is used.&lt;br /&gt;
&lt;br /&gt;
===== CmdID 0x000F0111 =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Command Index&lt;br /&gt;
!  CommandID&lt;br /&gt;
!  Parameter&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x000F0111&lt;br /&gt;
| Value 1&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x000F0110&lt;br /&gt;
| Value 1&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0x000F0117&lt;br /&gt;
| Bits15-0 = unk, 31-16 = unk.&lt;br /&gt;
| Unknown, normally the input parameter is value 0x2.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 0x000F011D&lt;br /&gt;
| Physical address&amp;gt;&amp;gt;3&lt;br /&gt;
| This initializes the framebuffer address used for rendering, this framebuffer is used for the input framebuffer with [[GSP_Shared_Memory|GX command]] 3 and 4. This command is used immediately after CmdID 0x000F0117.&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| 0x000F0116&lt;br /&gt;
| &lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| 0x000F011C&lt;br /&gt;
| Physical address&amp;gt;&amp;gt;3&lt;br /&gt;
| Unknown, normally this address is located in VRAM.&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| 0x000F011E&lt;br /&gt;
| u32&lt;br /&gt;
| This sets the width and height for the framebuffer used for rendering. Therefore this is glViewport(), x/y are specified by CmdID 0x000F0068.&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| 0x000F006E&lt;br /&gt;
| Same input parameter value as CmdID 0x000F011E.&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command set is normally used after the two 0x000F0041 command sets.&lt;br /&gt;
&lt;br /&gt;
===== CmdID 0x00030107 =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Command Index&lt;br /&gt;
!  CommandID&lt;br /&gt;
!  Parameter&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x00030107&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x00080126&lt;br /&gt;
| type&amp;lt;&amp;lt;24&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command set is used for disabling the alpha-blending info set by command set 0x00010107? The GL AlphaFunction used here is normally GL_ALWAYS.&lt;br /&gt;
&lt;br /&gt;
===== CmdID 0x00010107 =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Command Index&lt;br /&gt;
!  CommandID&lt;br /&gt;
!  Parameter&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x00010107&lt;br /&gt;
| Same format as CmdID 0x00030107.&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x00080126&lt;br /&gt;
| type&amp;lt;&amp;lt;24&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x00020107&lt;br /&gt;
| Same value as CmdID 0x00010107.&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Parameter format for CmdIDs 0x00030107, 0x00020107, and 0x00010107 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0 = disable GL_ALPHA_TEST, 1 = enable GL_ALPHA_TEST&lt;br /&gt;
|-&lt;br /&gt;
| 3-1&lt;br /&gt;
| Unused?&lt;br /&gt;
|-&lt;br /&gt;
| 7-4&lt;br /&gt;
| Alpha function&lt;br /&gt;
|-&lt;br /&gt;
| 11-8&lt;br /&gt;
| Color to blend with?&lt;br /&gt;
|-&lt;br /&gt;
| 12&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 31-13&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Alpha function values ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Value&lt;br /&gt;
!  GL AlphaFunction&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| GL_NEVER&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| GL_ALWAYS&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| GL_EQUAL&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| GL_NOTEQUAL&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| GL_LESS&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| GL_LEQUAL&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| GL_GREATER&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| GL_GEQUAL&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Alpha types for CmdID 0x00080126 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  GL AlphaFunction&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| GL_NEVER&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| GL_ALWAYS&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| GL_GREATER/GL_GEQUAL&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| The remaining GL alpha functions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Parameter value format for CmdID 0x000F0104 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0 = disable GL_ALPHA_TEST, 1 = enable GL_ALPHA_TEST&lt;br /&gt;
|-&lt;br /&gt;
| 3-1&lt;br /&gt;
| Unused?&lt;br /&gt;
|-&lt;br /&gt;
| 7-4&lt;br /&gt;
| Alpha function&lt;br /&gt;
|-&lt;br /&gt;
| 15-8&lt;br /&gt;
| u8 ref, range is 0-255&lt;br /&gt;
|-&lt;br /&gt;
| 31-16&lt;br /&gt;
| Unused?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is glAlphaFunc().&lt;br /&gt;
&lt;br /&gt;
=== Parameter value format for CmdID 0x000F011E ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 11-0&lt;br /&gt;
| Framebuffer/viewport width&lt;br /&gt;
|-&lt;br /&gt;
| 23-12&lt;br /&gt;
| Framebuffer/viewport height - 1&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| Must be set&lt;br /&gt;
|-&lt;br /&gt;
| 31-25&lt;br /&gt;
| Unused?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This specifies the width/height for glViewport(). Normally the framebuffer width and height is set to the same [[GPU|dimensions]] used with GX [[GSP_Shared_Memory|command]] 3 and 4.&lt;br /&gt;
&lt;br /&gt;
=== Parameter value format for CmdID 0x000F0068 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 15-0&lt;br /&gt;
| X&lt;br /&gt;
|-&lt;br /&gt;
| 31-16&lt;br /&gt;
| Y&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This specifies the X/Y coordinates for glViewport().&lt;br /&gt;
&lt;br /&gt;
=== Parameter structure for CmdID 0x804F00C0 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Value 0xFFF0FFF / 0x0&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Value 0x0&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Value 0x0&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Value 0xFFFFFFFF&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Value 0x0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This individual command is used instead of the 0x80XF00C0 command set when none of the associated rendering parameters for this slot are set.&lt;br /&gt;
&lt;br /&gt;
=== Parameter structure for CmdID 0x802F00C0 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Param0&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Param1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Param2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See command set 0x80XF00C0.&lt;br /&gt;
&lt;br /&gt;
==== Param0 format for CmdID 0x802F00C0 ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 3-0&lt;br /&gt;
| See below values.(Field0 index0)&lt;br /&gt;
|-&lt;br /&gt;
| 7-4&lt;br /&gt;
| See below values.(Field0 index1)&lt;br /&gt;
|-&lt;br /&gt;
| 11-8&lt;br /&gt;
| See below values.(Field0 index2)&lt;br /&gt;
|-&lt;br /&gt;
| 15-12&lt;br /&gt;
| Unused&lt;br /&gt;
|-&lt;br /&gt;
| 19-16&lt;br /&gt;
| See below values.(Field1 index0)&lt;br /&gt;
|-&lt;br /&gt;
| 23-20&lt;br /&gt;
| See below values.(Field1 index1)&lt;br /&gt;
|-&lt;br /&gt;
| 27-24&lt;br /&gt;
| See below values.(Field1 index2)&lt;br /&gt;
|-&lt;br /&gt;
| 31-28&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Param0 values for CmdID 0x802F00C0 ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Value&lt;br /&gt;
!  GL type&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| GL_PRIMARY_COLOR&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| GL_TEXTURE0&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| GL_TEXTURE1&lt;br /&gt;
|-&lt;br /&gt;
| 0x5&lt;br /&gt;
| GL_TEXTURE2&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| GL_TEXTURE3&lt;br /&gt;
|-&lt;br /&gt;
| 0xC-0x7&lt;br /&gt;
| GL_PRIMARY_COLOR&lt;br /&gt;
|-&lt;br /&gt;
| 0xD&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xE&lt;br /&gt;
| GL_CONSTANT&lt;br /&gt;
|-&lt;br /&gt;
| 0xF&lt;br /&gt;
| GL_PREVIOUS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Param1 format for CmdID 0x802F00C0 ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 3-0&lt;br /&gt;
| See below values for field0.(Index0)&lt;br /&gt;
|-&lt;br /&gt;
| 7-4&lt;br /&gt;
| See below values for field0.(Index1)&lt;br /&gt;
|-&lt;br /&gt;
| 11-8&lt;br /&gt;
| See below values for field0.(Index2)&lt;br /&gt;
|-&lt;br /&gt;
| 15-12&lt;br /&gt;
| See below values for field1.(Index0)&lt;br /&gt;
|-&lt;br /&gt;
| 19-16&lt;br /&gt;
| See below values for field1.(Index1)&lt;br /&gt;
|-&lt;br /&gt;
| 23-20&lt;br /&gt;
| See below values for field1.(Index2)&lt;br /&gt;
|-&lt;br /&gt;
| 31-24&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This specifies the pname for glTexEnv().&lt;br /&gt;
&lt;br /&gt;
==== Param1 field0 values for CmdID 0x802F00C0 ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Value&lt;br /&gt;
!  GL type&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| GL_SRC_COLOR&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| GL_ONE_MINUS_SRC_COLOR&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| GL_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| GL_ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| GL_SRC0_RGB&lt;br /&gt;
|-&lt;br /&gt;
| 0x5&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| GL_SRC_COLOR&lt;br /&gt;
|-&lt;br /&gt;
| 0x7&lt;br /&gt;
| GL_SRC_COLOR&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| GL_SRC1_RGB&lt;br /&gt;
|-&lt;br /&gt;
| 0x9&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0xA&lt;br /&gt;
| GL_SRC_COLOR&lt;br /&gt;
|-&lt;br /&gt;
| 0xB&lt;br /&gt;
| GL_SRC_COLOR&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| GL_SRC2_RGB&lt;br /&gt;
|-&lt;br /&gt;
| 0xD&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Param1 field1 values for CmdID 0x802F00C0 ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Value&lt;br /&gt;
!  GL type&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| GL_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| GL_ONE_MINUS_SRC_ALPHA&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| GL_SRC0_RGB&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| GL_SRC1_RGB&lt;br /&gt;
|-&lt;br /&gt;
| 0x5&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| GL_SRC2_RGB&lt;br /&gt;
|-&lt;br /&gt;
| 0x7&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Param2 format for CmdID 0x802F00C0 ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 15-0&lt;br /&gt;
| See below field0 values.&lt;br /&gt;
|-&lt;br /&gt;
| 31-16&lt;br /&gt;
| See below field1 values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is used to specify the param for glTexEnv(..., ..., param).&lt;br /&gt;
&lt;br /&gt;
==== Param2 field0 values for CmdID 0x802F00C0 ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Value&lt;br /&gt;
!  GL type&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| GL_REPLACE&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| GL_MODULATE&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| GL_ADD&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| GL_ADD_SIGNED&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| GL_INTERPOLATE&lt;br /&gt;
|-&lt;br /&gt;
| 0x5&lt;br /&gt;
| GL_SUBTRACT&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| GL_DOT3_RGB&lt;br /&gt;
|-&lt;br /&gt;
| 0x7&lt;br /&gt;
| GL_DOT3_RGBA&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x9&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Param2 field1 values for CmdID 0x802F00C0 ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Value&lt;br /&gt;
!  GL type&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| GL_REPLACE&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| GL_MODULATE&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| GL_ADD&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| GL_ADD_SIGNED&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| GL_INTERPOLATE&lt;br /&gt;
|-&lt;br /&gt;
| 0x5&lt;br /&gt;
| GL_SUBTRACT&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| GL_REPLACE&lt;br /&gt;
|-&lt;br /&gt;
| 0x7&lt;br /&gt;
| GL_DOT3_RGB&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x9&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Parameter value format for CmdID 0x800F00C4 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 15-0&lt;br /&gt;
| Valid values: 0=unknown, 1=unknown, 2=unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 31-16&lt;br /&gt;
| Same format as bits15-0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See command set 0x80XF00C0.&lt;br /&gt;
&lt;br /&gt;
=== Parameter value format for CmdID 0x000F00E1 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 7-0&lt;br /&gt;
| Red component&lt;br /&gt;
|-&lt;br /&gt;
| 15-8&lt;br /&gt;
| Green component&lt;br /&gt;
|-&lt;br /&gt;
| 23-16&lt;br /&gt;
| Blue component&lt;br /&gt;
|-&lt;br /&gt;
| 31-24&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Parameter value format for CmdID 0x000F0101 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Bit&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 7-0&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 15-8&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 19-16&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 23-20&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 27-24&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 31-28&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Parameter structure for CmdID 0x801F004D ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| float far&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| float near&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is glDepthRange().&lt;br /&gt;
&lt;br /&gt;
=== Parameter structure for CmdID 0x000F00E8 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D-0x00&lt;br /&gt;
| Usually value 0x00FFE000.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7E&lt;br /&gt;
| Usually value 0x00FFFEE6?&lt;br /&gt;
|-&lt;br /&gt;
| 0x7F&lt;br /&gt;
| Usually value 0x00DCD919?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Parameter structure for CmdID 0x803F0112 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 0x0 = unknown, 0xF = unknown. Only bits 3-0 are used.(Values 0x1-0xF all have the same effect)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0x0 = unknown, 0xF = unknown. Only bits 3-0 are used.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 0x0 = unknown, 0x2 = unknown. Only bits 1-0 are used.(Values 0x1-0x3 all have the same effect)&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 0x0 = unknown, 0x2 = unknown. Only bits 1-0 are used.(Values 0x1-0x3 all have the same effect)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Entries for CmdID 0xXXXF02C1 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| float, the GPU handles this as the 4th word.&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| float, the GPU handles this as the 3rd word.&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| float, the GPU handles this as the 2nd word.&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| float, the GPU handles this as the 1st word.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The below entry structure info is in the raw order used for the command, not the order used by the GPU.&lt;br /&gt;
&lt;br /&gt;
==== Color Entry ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| float Red component&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| float Blue component&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| float Green component&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| float Alpha&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Lighting Color Entry ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| float Alpha&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| float Blue component&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| float Green component&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| float Red component&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Types for CmdID 0x000F02C0 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Value&lt;br /&gt;
!  Entries per chunk&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 4&lt;br /&gt;
| This specifies 16-floats for a 4x4 matrix, used for glLoadMatrix() for the projection matrix.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04&lt;br /&gt;
| 4&lt;br /&gt;
| This specifies a 4x4 matrix, used for glLoadMatrix() for the model-view matrix. This is usually an identity matrix.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08&lt;br /&gt;
| 2&lt;br /&gt;
| Sets the color.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A&lt;br /&gt;
| 4&lt;br /&gt;
| Specifies a 4x4 matrix, used for glLoadMatrix() for the texture matrix.(Index0)&lt;br /&gt;
|-&lt;br /&gt;
| 0x0E&lt;br /&gt;
| 3&lt;br /&gt;
| Specifies a 4x3 texture matrix.(Index1)&lt;br /&gt;
|-&lt;br /&gt;
| 0x11&lt;br /&gt;
| 3&lt;br /&gt;
| Specifies a 4x3 texture matrix.(Index2)&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| &amp;lt;=30&lt;br /&gt;
| Used to specify a 4xN matrix, where N is the total CmdID 0xXXXF02C1 entries. This is glMultMatrix() for the model-view matrix, except the input matrix is 4xN instead of 4x4.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C&lt;br /&gt;
| 4&lt;br /&gt;
| This specifies a 4x4 float matrix.&lt;br /&gt;
|-&lt;br /&gt;
| 0x50, 0x53, and 0x56&lt;br /&gt;
| 1&lt;br /&gt;
| This specifies the GL_LIGHT0-2 color for GL_AMBIENT?&lt;br /&gt;
|-&lt;br /&gt;
| 0x51, 0x54, and 0x57&lt;br /&gt;
| 1&lt;br /&gt;
| This specifies the GL_LIGHT0-2 color for GL_DIFFUSE?&lt;br /&gt;
|-&lt;br /&gt;
| 0x52, 0x55, and 0x58&lt;br /&gt;
| 1&lt;br /&gt;
| This specifies the GL_LIGHT0-2 color for GL_SPECULAR?&lt;br /&gt;
|-&lt;br /&gt;
| 0x59&lt;br /&gt;
| 1&lt;br /&gt;
| Unknown, the entry data is floats converted from s32s. Usually each entry word is zeros.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5A&lt;br /&gt;
| 2&lt;br /&gt;
| Color related?&lt;br /&gt;
|-&lt;br /&gt;
| 0x5C&lt;br /&gt;
| 1&lt;br /&gt;
| ?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The matrices for types 0x00 and 0x04 use row-major order, instead of column-major order.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=GSP_Shared_Memory&amp;diff=5609</id>
		<title>GSP Shared Memory</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=GSP_Shared_Memory&amp;diff=5609"/>
		<updated>2013-04-15T23:59:50Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the structure of the GSP [[GSPGPU:RegisterInterruptRelayQueue|shared]] memory. GX commands and framebuffer info is stored here, and other unknown data.&lt;br /&gt;
&lt;br /&gt;
=Framebuffer info=&lt;br /&gt;
The framebuffer info structure for the main LCD is located at sharedmemvadr + 0x200 + threadindex*0x80. The framebuffer info structure for the sub LCD is located at sharedmemvadr + 0x240 + threadindex*0x80.&lt;br /&gt;
&lt;br /&gt;
==Framebuffer info header==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Byte&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
|  Framebuffer info [[GSPGPU:SetBufferSwap|entry]] index&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Flag&lt;br /&gt;
|-&lt;br /&gt;
| 3-2&lt;br /&gt;
| Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When a process sets this framebuffer info, it sets index to &amp;lt;nowiki&amp;gt;(index+1) &amp;amp; 1&amp;lt;/nowiki&amp;gt;. Then it writes the framebuffer info entry, and sets flag to value 1. The GSP module loads this framebuffer info entry data into GSP state once the [[GPU]] finishes processing GX commands 3 or 4. Once the GSP module finishes loading this framebuffer info, it sets flag to value 0, then it will not load the framebuffer info again until flag is value 1. After loading this entry data into GSP state, the GSP module then writes this framebuffer state to the [[LCD]] registers. GSP module automatically updates the LCD framebuffer registers each time GX commands 3 or 4 finish, even when this shared memory data was not updated by the application.(GSP module toggles the active framebuffer register when automatically updating LCD registers, when shared memory data is not used)&lt;br /&gt;
&lt;br /&gt;
The two 0x1C-byte framebuffer info entries are located at framebufferinfo+4.&lt;br /&gt;
&lt;br /&gt;
=3D Slider=&lt;br /&gt;
See [[Configuration Memory]].&lt;br /&gt;
&lt;br /&gt;
=Command Buffer Header=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Byte&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0&lt;br /&gt;
|  Current command index. This index is updated by GSP module after loading the command data, right before the command is processed. When this index is updated by GSP module, the total commands field is decreased by one as well.&lt;br /&gt;
|-&lt;br /&gt;
|  1&lt;br /&gt;
|  Total commands to process, must not be value 0 when GSP module handles commands. This must be &amp;lt;=15 when writing a command to shared memory. This is incremented by the application when writing a command to shared memory, after increasing this value [[GSPGPU:TriggerCmdReqQueue|TriggerCmdReqQueue]] is only used if this field is value 1.&lt;br /&gt;
|-&lt;br /&gt;
|  2&lt;br /&gt;
|  Must not be value 1. When the error-code u32 is set, this u8 is set to value 0x80.&lt;br /&gt;
|-&lt;br /&gt;
|  3&lt;br /&gt;
|  Bit0 must not be set&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|  u32 Error code for the last GX command which failed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The command buffer is located at sharedmem + 0x800 + [[GSPGPU:RegisterInterruptRelayQueue|threadindex]]*0x200. After writing the command data to shared memory, [[GSPGPU:TriggerCmdReqQueue|TriggerCmdReqQueue]] must be used to trigger GSP processing for the command when the total commands field is value 1.&lt;br /&gt;
&lt;br /&gt;
=Command Header=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Byte&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0&lt;br /&gt;
|  Command ID&lt;br /&gt;
|-&lt;br /&gt;
|  2-1&lt;br /&gt;
|  ?&lt;br /&gt;
|-&lt;br /&gt;
|  3&lt;br /&gt;
|  When non-zero GSP module may check flags for the specified cmdID, command handling is aborted when the flags are set. The corresponding flag for each CmdID is set once the command is handled by GSP module, this flag is likely cleared once the GPU finishes processing the command.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The command is located at cmdbuf + 0x20 + cmdindex*0x20, the size of each command is 0x20-bytes. The command parameters are located at command+4. Addresses specified in parameters are application vaddrs, these are usually located in either the process GSP [[Memory_layout|heap]] or VRAM. For applications these addresses are normally located in the GSP heap, while for other processes these addresses are located in VRAM. Addresses/sizes specified in parameters except for cmd0 and cmd5 must be 8-byte [[GPU|aligned]].&lt;br /&gt;
&lt;br /&gt;
=Commands=&lt;br /&gt;
&lt;br /&gt;
==GX RequestDma==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x00&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Source address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Destination address&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| 7-4&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command is normally used to DMA data from the application GSP [[Memory_layout|heap]] to VRAM.&lt;br /&gt;
&lt;br /&gt;
==GX SetCommandList Last==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x01&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Buffer address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Buffer size&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Flag, bit0 is written to GSP module state&lt;br /&gt;
|-&lt;br /&gt;
| 6-4&lt;br /&gt;
| Unused&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| When non-zero, call svcFlushProcessDataCache() with the specified buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command converts the specified address to a physical address, then writes the physical address and size to the [[GPU]] registers at 0x1EF018E0. This buffer contains [[GPU_Commands|GPU commands]].&lt;br /&gt;
&lt;br /&gt;
==GX SetMemoryFill==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x02&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Buf0 address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Buf0 size&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Buf0 data&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Buf1 address&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Buf1 size&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Buf1 data&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| The low u16 is width0, while the high u16 is width1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This commands converts the specified addresses to physical addresses, then writes these addresses and the specified parameters to the [[GPU]] registers at 0x1EF00010 and 0x1EF00020. The associated buffer address must not be &amp;lt;= to the main buffer address, thus the associated buffer address must not be zero as well. When the bufX address is zero, processing for the bufX parameters is skipped.&lt;br /&gt;
&lt;br /&gt;
==GX SetDisplayTransfer==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x03&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Input framebuffer address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Output framebuffer address&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Input framebuffer [[GPU|dimensions]]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Output framebuffer dimensions&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| [[GPU|Flags]], for applications this is 0x1001000 for the main screen, and 0x1000 for the sub screen.&lt;br /&gt;
|-&lt;br /&gt;
| 7-6&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command converts the specified addresses to physical addresses, then writes these physical addresses and parameters to the [[GPU]] registers at 0x1EF00C00. This command writes the rendered framebuffer data from the input framebuffer address to the specified output framebuffer. The input framebuffer is normally located in VRAM.&lt;br /&gt;
&lt;br /&gt;
==GX SetTextureCopy==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x04&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Buf0 address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Buf1 address&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command is similar to cmd3, this command also writes to the [[GPU]] registers at 0x1EF00C00.&lt;br /&gt;
&lt;br /&gt;
==GX SetCommandList First ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x05&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Buf0 address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Buf0 size&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Buf1 address&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Buf1 size&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Buf2 address&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Buf2 size&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The application buffer addresses specified in the parameters are used with [[SVC|svcFlushProcessDataCache]]. The input buf0 size must not be zero. When buf1 size is zero, svcFlushProcessDataCache() for buf1 and buf2 are skipped. When buf2 size is zero, svcFlushProcessDataCache() for buf2 is skipped.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=GSP_Shared_Memory&amp;diff=5608</id>
		<title>GSP Shared Memory</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=GSP_Shared_Memory&amp;diff=5608"/>
		<updated>2013-04-15T23:51:04Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the structure of the GSP [[GSPGPU:RegisterInterruptRelayQueue|shared]] memory. GX commands and framebuffer info is stored here, and other unknown data.&lt;br /&gt;
&lt;br /&gt;
=Framebuffer info=&lt;br /&gt;
The framebuffer info structure for the main LCD is located at sharedmemvadr + 0x200 + threadindex*0x80. The framebuffer info structure for the sub LCD is located at sharedmemvadr + 0x240 + threadindex*0x80.&lt;br /&gt;
&lt;br /&gt;
==Framebuffer info header==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Byte&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
|  Framebuffer info [[GSPGPU:SetBufferSwap|entry]] index&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Flag&lt;br /&gt;
|-&lt;br /&gt;
| 3-2&lt;br /&gt;
| Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When a process sets this framebuffer info, it sets index to &amp;lt;nowiki&amp;gt;(index+1) &amp;amp; 1&amp;lt;/nowiki&amp;gt;. Then it writes the framebuffer info entry, and sets flag to value 1. The GSP module loads this framebuffer info entry data into GSP state once the [[GPU]] finishes processing GX commands 3 or 4. Once the GSP module finishes loading this framebuffer info, it sets flag to value 0, then it will not load the framebuffer info again until flag is value 1. After loading this entry data into GSP state, the GSP module then writes this framebuffer state to the [[LCD]] registers. GSP module automatically updates the LCD framebuffer registers each time GX commands 3 or 4 finish, even when this shared memory data was not updated by the application.(GSP module toggles the active framebuffer register when automatically updating LCD registers, when shared memory data is not used)&lt;br /&gt;
&lt;br /&gt;
The two 0x1C-byte framebuffer info entries are located at framebufferinfo+4.&lt;br /&gt;
&lt;br /&gt;
=3D Slider=&lt;br /&gt;
See [[Configuration Memory]].&lt;br /&gt;
&lt;br /&gt;
=Command Buffer Header=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Byte&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0&lt;br /&gt;
|  Current command index. This index is updated by GSP module after loading the command data, right before the command is processed. When this index is updated by GSP module, the total commands field is decreased by one as well.&lt;br /&gt;
|-&lt;br /&gt;
|  1&lt;br /&gt;
|  Total commands to process, must not be value 0 when GSP module handles commands. This must be &amp;lt;=15 when writing a command to shared memory. This is incremented by the application when writing a command to shared memory, after increasing this value [[GSPGPU:TriggerCmdReqQueue|TriggerCmdReqQueue]] is only used if this field is value 1.&lt;br /&gt;
|-&lt;br /&gt;
|  2&lt;br /&gt;
|  Must not be value 1. When the error-code u32 is set, this u8 is set to value 0x80.&lt;br /&gt;
|-&lt;br /&gt;
|  3&lt;br /&gt;
|  Bit0 must not be set&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|  u32 Error code for the last GX command which failed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The command buffer is located at sharedmem + 0x800 + [[GSPGPU:RegisterInterruptRelayQueue|threadindex]]*0x200. After writing the command data to shared memory, [[GSPGPU:TriggerCmdReqQueue|TriggerCmdReqQueue]] must be used to trigger GSP processing for the command when the total commands field is value 1.&lt;br /&gt;
&lt;br /&gt;
=Command Header=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Byte&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0&lt;br /&gt;
|  Command ID&lt;br /&gt;
|-&lt;br /&gt;
|  2-1&lt;br /&gt;
|  ?&lt;br /&gt;
|-&lt;br /&gt;
|  3&lt;br /&gt;
|  When non-zero GSP module may check flags for the specified cmdID, command handling is aborted when the flags are set. The corresponding flag for each CmdID is set once the command is handled by GSP module, this flag is likely cleared once the GPU finishes processing the command.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The command is located at cmdbuf + 0x20 + cmdindex*0x20, the size of each command is 0x20-bytes. The command parameters are located at command+4. Addresses specified in parameters are application vaddrs, these are usually located in either the process GSP [[Memory_layout|heap]] or VRAM. For applications these addresses are normally located in the GSP heap, while for other processes these addresses are located in VRAM. Addresses/sizes specified in parameters except for cmd0 and cmd5 must be 8-byte [[GPU|aligned]].&lt;br /&gt;
&lt;br /&gt;
=Commands=&lt;br /&gt;
&lt;br /&gt;
==GX RequestDma==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x00&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Source address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Destination address&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| 7-4&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command is normally used to DMA data from the application GSP [[Memory_layout|heap]] to VRAM.&lt;br /&gt;
&lt;br /&gt;
==GX SetCommandList==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x01&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Buffer address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Buffer size&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Flag, bit0 is written to GSP module state&lt;br /&gt;
|-&lt;br /&gt;
| 6-4&lt;br /&gt;
| Unused&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| When non-zero, call svcFlushProcessDataCache() with the specified buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command converts the specified address to a physical address, then writes the physical address and size to the [[GPU]] registers at 0x1EF018E0. This buffer contains [[GPU_Commands|GPU commands]].&lt;br /&gt;
&lt;br /&gt;
==GX SetMemoryFill==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x02&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Buf0 address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Buf0 size&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Buf0 data&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Buf1 address&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Buf1 size&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Buf1 data&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| The low u16 is width0, while the high u16 is width1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This commands converts the specified addresses to physical addresses, then writes these addresses and the specified parameters to the [[GPU]] registers at 0x1EF00010 and 0x1EF00020. The associated buffer address must not be &amp;lt;= to the main buffer address, thus the associated buffer address must not be zero as well. When the bufX address is zero, processing for the bufX parameters is skipped.&lt;br /&gt;
&lt;br /&gt;
==GX SetDisplayTransfer==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x03&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Input framebuffer address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Output framebuffer address&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Input framebuffer [[GPU|dimensions]]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Output framebuffer dimensions&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| [[GPU|Flags]], for applications this is 0x1001000 for the main screen, and 0x1000 for the sub screen.&lt;br /&gt;
|-&lt;br /&gt;
| 7-6&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command converts the specified addresses to physical addresses, then writes these physical addresses and parameters to the [[GPU]] registers at 0x1EF00C00. This command writes the rendered framebuffer data from the input framebuffer address to the specified output framebuffer. The input framebuffer is normally located in VRAM.&lt;br /&gt;
&lt;br /&gt;
==GX SetTextureCopy==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x04&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Buf0 address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Buf1 address&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command is similar to cmd3, this command also writes to the [[GPU]] registers at 0x1EF00C00.&lt;br /&gt;
&lt;br /&gt;
==GX SetCommandList==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x05&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Buf0 address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Buf0 size&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Buf1 address&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Buf1 size&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Buf2 address&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Buf2 size&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The application buffer addresses specified in the parameters are used with [[SVC|svcFlushProcessDataCache]]. The input buf0 size must not be zero. When buf1 size is zero, svcFlushProcessDataCache() for buf1 and buf2 are skipped. When buf2 size is zero, svcFlushProcessDataCache() for buf2 is skipped.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=GSP_Shared_Memory&amp;diff=5607</id>
		<title>GSP Shared Memory</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=GSP_Shared_Memory&amp;diff=5607"/>
		<updated>2013-04-15T23:45:35Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the structure of the GSP [[GSPGPU:RegisterInterruptRelayQueue|shared]] memory. GX commands and framebuffer info is stored here, and other unknown data.&lt;br /&gt;
&lt;br /&gt;
=Framebuffer info=&lt;br /&gt;
The framebuffer info structure for the main LCD is located at sharedmemvadr + 0x200 + threadindex*0x80. The framebuffer info structure for the sub LCD is located at sharedmemvadr + 0x240 + threadindex*0x80.&lt;br /&gt;
&lt;br /&gt;
==Framebuffer info header==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Byte&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
|  Framebuffer info [[GSPGPU:SetBufferSwap|entry]] index&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Flag&lt;br /&gt;
|-&lt;br /&gt;
| 3-2&lt;br /&gt;
| Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When a process sets this framebuffer info, it sets index to &amp;lt;nowiki&amp;gt;(index+1) &amp;amp; 1&amp;lt;/nowiki&amp;gt;. Then it writes the framebuffer info entry, and sets flag to value 1. The GSP module loads this framebuffer info entry data into GSP state once the [[GPU]] finishes processing GX commands 3 or 4. Once the GSP module finishes loading this framebuffer info, it sets flag to value 0, then it will not load the framebuffer info again until flag is value 1. After loading this entry data into GSP state, the GSP module then writes this framebuffer state to the [[LCD]] registers. GSP module automatically updates the LCD framebuffer registers each time GX commands 3 or 4 finish, even when this shared memory data was not updated by the application.(GSP module toggles the active framebuffer register when automatically updating LCD registers, when shared memory data is not used)&lt;br /&gt;
&lt;br /&gt;
The two 0x1C-byte framebuffer info entries are located at framebufferinfo+4.&lt;br /&gt;
&lt;br /&gt;
=3D Slider=&lt;br /&gt;
See [[Configuration Memory]].&lt;br /&gt;
&lt;br /&gt;
=Command Buffer Header=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Byte&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0&lt;br /&gt;
|  Current command index. This index is updated by GSP module after loading the command data, right before the command is processed. When this index is updated by GSP module, the total commands field is decreased by one as well.&lt;br /&gt;
|-&lt;br /&gt;
|  1&lt;br /&gt;
|  Total commands to process, must not be value 0 when GSP module handles commands. This must be &amp;lt;=15 when writing a command to shared memory. This is incremented by the application when writing a command to shared memory, after increasing this value [[GSPGPU:TriggerCmdReqQueue|TriggerCmdReqQueue]] is only used if this field is value 1.&lt;br /&gt;
|-&lt;br /&gt;
|  2&lt;br /&gt;
|  Must not be value 1. When the error-code u32 is set, this u8 is set to value 0x80.&lt;br /&gt;
|-&lt;br /&gt;
|  3&lt;br /&gt;
|  Bit0 must not be set&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|  u32 Error code for the last GX command which failed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The command buffer is located at sharedmem + 0x800 + [[GSPGPU:RegisterInterruptRelayQueue|threadindex]]*0x200. After writing the command data to shared memory, [[GSPGPU:TriggerCmdReqQueue|TriggerCmdReqQueue]] must be used to trigger GSP processing for the command when the total commands field is value 1.&lt;br /&gt;
&lt;br /&gt;
=Command Header=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Byte&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0&lt;br /&gt;
|  Command ID&lt;br /&gt;
|-&lt;br /&gt;
|  2-1&lt;br /&gt;
|  ?&lt;br /&gt;
|-&lt;br /&gt;
|  3&lt;br /&gt;
|  When non-zero GSP module may check flags for the specified cmdID, command handling is aborted when the flags are set. The corresponding flag for each CmdID is set once the command is handled by GSP module, this flag is likely cleared once the GPU finishes processing the command.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The command is located at cmdbuf + 0x20 + cmdindex*0x20, the size of each command is 0x20-bytes. The command parameters are located at command+4. Addresses specified in parameters are application vaddrs, these are usually located in either the process GSP [[Memory_layout|heap]] or VRAM. For applications these addresses are normally located in the GSP heap, while for other processes these addresses are located in VRAM. Addresses/sizes specified in parameters except for cmd0 and cmd5 must be 8-byte [[GPU|aligned]].&lt;br /&gt;
&lt;br /&gt;
=Commands=&lt;br /&gt;
&lt;br /&gt;
==GX Command 0==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x00&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Source address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Destination address&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| 7-4&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command is normally used to DMA data from the application GSP [[Memory_layout|heap]] to VRAM.&lt;br /&gt;
&lt;br /&gt;
==GX SetCommandList==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x01&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Buffer address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Buffer size&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Flag, bit0 is written to GSP module state&lt;br /&gt;
|-&lt;br /&gt;
| 6-4&lt;br /&gt;
| Unused&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| When non-zero, call svcFlushProcessDataCache() with the specified buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command converts the specified address to a physical address, then writes the physical address and size to the [[GPU]] registers at 0x1EF018E0. This buffer contains [[GPU_Commands|GPU commands]].&lt;br /&gt;
&lt;br /&gt;
==GX SetMemoryFill==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x02&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Buf0 address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Buf0 size&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Buf0 data&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Buf1 address&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Buf1 size&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Buf1 data&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| The low u16 is width0, while the high u16 is width1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This commands converts the specified addresses to physical addresses, then writes these addresses and the specified parameters to the [[GPU]] registers at 0x1EF00010 and 0x1EF00020. The associated buffer address must not be &amp;lt;= to the main buffer address, thus the associated buffer address must not be zero as well. When the bufX address is zero, processing for the bufX parameters is skipped.&lt;br /&gt;
&lt;br /&gt;
==GX SetDisplayTransfer==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x03&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Input framebuffer address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Output framebuffer address&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Input framebuffer [[GPU|dimensions]]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Output framebuffer dimensions&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| [[GPU|Flags]], for applications this is 0x1001000 for the main screen, and 0x1000 for the sub screen.&lt;br /&gt;
|-&lt;br /&gt;
| 7-6&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command converts the specified addresses to physical addresses, then writes these physical addresses and parameters to the [[GPU]] registers at 0x1EF00C00. This command writes the rendered framebuffer data from the input framebuffer address to the specified output framebuffer. The input framebuffer is normally located in VRAM.&lt;br /&gt;
&lt;br /&gt;
==GX SetTextureCopy==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x04&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Buf0 address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Buf1 address&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command is similar to cmd3, this command also writes to the [[GPU]] registers at 0x1EF00C00.&lt;br /&gt;
&lt;br /&gt;
==GX SetCommandList==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x05&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Buf0 address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Buf0 size&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Buf1 address&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Buf1 size&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Buf2 address&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Buf2 size&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The application buffer addresses specified in the parameters are used with [[SVC|svcFlushProcessDataCache]]. The input buf0 size must not be zero. When buf1 size is zero, svcFlushProcessDataCache() for buf1 and buf2 are skipped. When buf2 size is zero, svcFlushProcessDataCache() for buf2 is skipped.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=GSP_Shared_Memory&amp;diff=5606</id>
		<title>GSP Shared Memory</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=GSP_Shared_Memory&amp;diff=5606"/>
		<updated>2013-04-15T23:36:07Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the structure of the GSP [[GSPGPU:RegisterInterruptRelayQueue|shared]] memory. GX commands and framebuffer info is stored here, and other unknown data.&lt;br /&gt;
&lt;br /&gt;
=Framebuffer info=&lt;br /&gt;
The framebuffer info structure for the main LCD is located at sharedmemvadr + 0x200 + threadindex*0x80. The framebuffer info structure for the sub LCD is located at sharedmemvadr + 0x240 + threadindex*0x80.&lt;br /&gt;
&lt;br /&gt;
==Framebuffer info header==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Byte&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
|  Framebuffer info [[GSPGPU:SetBufferSwap|entry]] index&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Flag&lt;br /&gt;
|-&lt;br /&gt;
| 3-2&lt;br /&gt;
| Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When a process sets this framebuffer info, it sets index to &amp;lt;nowiki&amp;gt;(index+1) &amp;amp; 1&amp;lt;/nowiki&amp;gt;. Then it writes the framebuffer info entry, and sets flag to value 1. The GSP module loads this framebuffer info entry data into GSP state once the [[GPU]] finishes processing GX commands 3 or 4. Once the GSP module finishes loading this framebuffer info, it sets flag to value 0, then it will not load the framebuffer info again until flag is value 1. After loading this entry data into GSP state, the GSP module then writes this framebuffer state to the [[LCD]] registers. GSP module automatically updates the LCD framebuffer registers each time GX commands 3 or 4 finish, even when this shared memory data was not updated by the application.(GSP module toggles the active framebuffer register when automatically updating LCD registers, when shared memory data is not used)&lt;br /&gt;
&lt;br /&gt;
The two 0x1C-byte framebuffer info entries are located at framebufferinfo+4.&lt;br /&gt;
&lt;br /&gt;
=3D Slider=&lt;br /&gt;
See [[Configuration Memory]].&lt;br /&gt;
&lt;br /&gt;
=Command Buffer Header=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Byte&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0&lt;br /&gt;
|  Current command index. This index is updated by GSP module after loading the command data, right before the command is processed. When this index is updated by GSP module, the total commands field is decreased by one as well.&lt;br /&gt;
|-&lt;br /&gt;
|  1&lt;br /&gt;
|  Total commands to process, must not be value 0 when GSP module handles commands. This must be &amp;lt;=15 when writing a command to shared memory. This is incremented by the application when writing a command to shared memory, after increasing this value [[GSPGPU:TriggerCmdReqQueue|TriggerCmdReqQueue]] is only used if this field is value 1.&lt;br /&gt;
|-&lt;br /&gt;
|  2&lt;br /&gt;
|  Must not be value 1. When the error-code u32 is set, this u8 is set to value 0x80.&lt;br /&gt;
|-&lt;br /&gt;
|  3&lt;br /&gt;
|  Bit0 must not be set&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
|  u32 Error code for the last GX command which failed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The command buffer is located at sharedmem + 0x800 + [[GSPGPU:RegisterInterruptRelayQueue|threadindex]]*0x200. After writing the command data to shared memory, [[GSPGPU:TriggerCmdReqQueue|TriggerCmdReqQueue]] must be used to trigger GSP processing for the command when the total commands field is value 1.&lt;br /&gt;
&lt;br /&gt;
=Command Header=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Byte&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
|  0&lt;br /&gt;
|  Command ID&lt;br /&gt;
|-&lt;br /&gt;
|  2-1&lt;br /&gt;
|  ?&lt;br /&gt;
|-&lt;br /&gt;
|  3&lt;br /&gt;
|  When non-zero GSP module may check flags for the specified cmdID, command handling is aborted when the flags are set. The corresponding flag for each CmdID is set once the command is handled by GSP module, this flag is likely cleared once the GPU finishes processing the command.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The command is located at cmdbuf + 0x20 + cmdindex*0x20, the size of each command is 0x20-bytes. The command parameters are located at command+4. Addresses specified in parameters are application vaddrs, these are usually located in either the process GSP [[Memory_layout|heap]] or VRAM. For applications these addresses are normally located in the GSP heap, while for other processes these addresses are located in VRAM. Addresses/sizes specified in parameters except for cmd0 and cmd5 must be 8-byte [[GPU|aligned]].&lt;br /&gt;
&lt;br /&gt;
=Commands=&lt;br /&gt;
&lt;br /&gt;
==GX Command 0==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x00&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Source address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Destination address&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| 7-4&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command is normally used to DMA data from the application GSP [[Memory_layout|heap]] to VRAM.&lt;br /&gt;
&lt;br /&gt;
==GX Command 1==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x01&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Buffer address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Buffer size&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Flag, bit0 is written to GSP module state&lt;br /&gt;
|-&lt;br /&gt;
| 6-4&lt;br /&gt;
| Unused&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| When non-zero, call svcFlushProcessDataCache() with the specified buffer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command converts the specified address to a physical address, then writes the physical address and size to the [[GPU]] registers at 0x1EF018E0. This buffer contains [[GPU_Commands|GPU commands]].&lt;br /&gt;
&lt;br /&gt;
==GX SetMemoryFill==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x02&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Buf0 address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Buf0 size&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Buf0 data&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Buf1 address&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Buf1 size&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Buf1 data&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| The low u16 is width0, while the high u16 is width1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This commands converts the specified addresses to physical addresses, then writes these addresses and the specified parameters to the [[GPU]] registers at 0x1EF00010 and 0x1EF00020. The associated buffer address must not be &amp;lt;= to the main buffer address, thus the associated buffer address must not be zero as well. When the bufX address is zero, processing for the bufX parameters is skipped.&lt;br /&gt;
&lt;br /&gt;
==GX Command 3==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x03&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Input framebuffer address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Output framebuffer address&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Input framebuffer [[GPU|dimensions]]&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Output framebuffer dimensions&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| [[GPU|Flags]], for applications this is 0x1001000 for the main screen, and 0x1000 for the sub screen.&lt;br /&gt;
|-&lt;br /&gt;
| 7-6&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command converts the specified addresses to physical addresses, then writes these physical addresses and parameters to the [[GPU]] registers at 0x1EF00C00. This command writes the rendered framebuffer data from the input framebuffer address to the specified output framebuffer. The input framebuffer is normally located in VRAM.&lt;br /&gt;
&lt;br /&gt;
==GX Command 4==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x04&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Buf0 address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Buf1 address&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command is similar to cmd3, this command also writes to the [[GPU]] registers at 0x1EF00C00.&lt;br /&gt;
&lt;br /&gt;
==GX Command 5==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| u8 CommandID is 0x05&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Buf0 address&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Buf0 size&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| Buf1 address&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Buf1 size&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Buf2 address&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Buf2 size&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The application buffer addresses specified in the parameters are used with [[SVC|svcFlushProcessDataCache]]. The input buf0 size must not be zero. When buf1 size is zero, svcFlushProcessDataCache() for buf1 and buf2 are skipped. When buf2 size is zero, svcFlushProcessDataCache() for buf2 is skipped.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Main_Page/Current_events&amp;diff=5287</id>
		<title>Main Page/Current events</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Main_Page/Current_events&amp;diff=5287"/>
		<updated>2013-03-29T21:25:44Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Main page box|Latest safe firmware|:FirmwareNews}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: -.3em -1em -1em -1em;&amp;quot;&amp;gt;&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; bgcolor=&amp;quot;#fff&amp;quot; border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2px&amp;quot; cellspacing=&amp;quot;2px&amp;quot; style=&amp;quot;margin:auto;&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot; align=&amp;quot;left&amp;quot; style=&amp;quot;background: #F5FAFF;&amp;quot;&lt;br /&gt;
| {{:FirmwareNews}} &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{box-footer-empty}}&lt;br /&gt;
&lt;br /&gt;
{{Main page box|Latest news|:News}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: -.3em -1em -1em -1em;&amp;quot;&amp;gt;&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; bgcolor=&amp;quot;#fff&amp;quot; border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2px&amp;quot; cellspacing=&amp;quot;2px&amp;quot; style=&amp;quot;margin:auto;&amp;quot;&lt;br /&gt;
|- valign=&amp;quot;top&amp;quot; align=&amp;quot;left&amp;quot; style=&amp;quot;background: #F5FAFF;&amp;quot;&lt;br /&gt;
| {{:News}} &lt;br /&gt;
|- class=&amp;quot;plainlinks&amp;quot; style=&amp;quot;background: #e7eef6; text-align: center;&amp;quot;&lt;br /&gt;
| [[Image:view_more.png|link=:News/Archive]] [[:News/Archive|Archive]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{box-footer-empty}}&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=FirmwareNews&amp;diff=5286</id>
		<title>FirmwareNews</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=FirmwareNews&amp;diff=5286"/>
		<updated>2013-03-29T21:25:21Z</updated>

		<summary type="html">&lt;p&gt;Neimod: Created page with &amp;quot;Latest &amp;#039;&amp;#039;&amp;#039;safe&amp;#039;&amp;#039;&amp;#039; firmware is 4.5.0-10, &amp;#039;&amp;#039;&amp;#039;updating to 5.0.0-11 is not recommended&amp;#039;&amp;#039;&amp;#039;!&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Latest &#039;&#039;&#039;safe&#039;&#039;&#039; firmware is [[4.5.0-10]], &#039;&#039;&#039;updating to [[5.0.0-11]] is not recommended&#039;&#039;&#039;!&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=News&amp;diff=5285</id>
		<title>News</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=News&amp;diff=5285"/>
		<updated>2013-03-29T21:23:59Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
==Adding an item==&lt;br /&gt;
* Log in to the wiki. Editing is disabled if you don&#039;t have an account.&lt;br /&gt;
* Add the news event to the top of the list, using this format for the date: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;&#039;&#039;&#039;&amp;lt;/nowiki&amp;gt;{{#time: d F y}}&amp;lt;nowiki&amp;gt;&#039;&#039;&#039; &amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;. Please include the application&#039;s creator, version number, and a link to a page on 3DBrew about the application. No external links please.&lt;br /&gt;
* &#039;&#039;&#039;Move the last entry to the [[:News/Archive|news archive]]. There should be no more than 4 entrees in the list.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Archives==&lt;br /&gt;
For older news, see the [[:News/Archive|news archive]].&lt;br /&gt;
&lt;br /&gt;
=== News ===&lt;br /&gt;
&amp;lt;!-- Add news below --&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;25 March 13&#039;&#039;&#039; Nintendo released system update [[5.0.0-11]].&lt;br /&gt;
*&#039;&#039;&#039;14 January 13&#039;&#039;&#039; [[3DSExplorer|3DSExplorer v1.5.1]] updated by [[User:Elisherer|Elisherer]]&lt;br /&gt;
*&#039;&#039;&#039;4 December 12&#039;&#039;&#039; Nintendo released system update [[4.5.0-10]].&lt;br /&gt;
*&#039;&#039;&#039;1 December 12&#039;&#039;&#039; [[3DSExplorer|3DSExplorer v1.4]] updated by [[User:Elisherer|Elisherer]]&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=News&amp;diff=5284</id>
		<title>News</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=News&amp;diff=5284"/>
		<updated>2013-03-29T21:19:39Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
==Adding an item==&lt;br /&gt;
* Log in to the wiki. Editing is disabled if you don&#039;t have an account.&lt;br /&gt;
* Add the news event to the top of the list, using this format for the date: &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;&#039;&#039;&#039;&amp;lt;/nowiki&amp;gt;{{#time: d F y}}&amp;lt;nowiki&amp;gt;&#039;&#039;&#039; &amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;. Please include the application&#039;s creator, version number, and a link to a page on 3DBrew about the application. No external links please.&lt;br /&gt;
* &#039;&#039;&#039;Move the last entry to the [[:News/Archive|news archive]]. There should be no more than 4 entrees in the list.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Archives==&lt;br /&gt;
For older news, see the [[:News/Archive|news archive]].&lt;br /&gt;
&lt;br /&gt;
=== Firmware safety ===&lt;br /&gt;
Latest &#039;&#039;&#039;safe&#039;&#039;&#039; firmware is [[4.5.0-10]], &#039;&#039;&#039;updating to [[5.0.0-11]] is not recommended&#039;&#039;&#039;! &lt;br /&gt;
&lt;br /&gt;
=== News ===&lt;br /&gt;
&amp;lt;!-- Add news below --&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;25 March 13&#039;&#039;&#039; Nintendo released system update [[5.0.0-11]].&lt;br /&gt;
*&#039;&#039;&#039;14 January 13&#039;&#039;&#039; [[3DSExplorer|3DSExplorer v1.5.1]] updated by [[User:Elisherer|Elisherer]]&lt;br /&gt;
*&#039;&#039;&#039;4 December 12&#039;&#039;&#039; Nintendo released system update [[4.5.0-10]].&lt;br /&gt;
*&#039;&#039;&#039;1 December 12&#039;&#039;&#039; [[3DSExplorer|3DSExplorer v1.4]] updated by [[User:Elisherer|Elisherer]]&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=AMPXI:GetTitleInfo&amp;diff=5181</id>
		<title>AMPXI:GetTitleInfo</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=AMPXI:GetTitleInfo&amp;diff=5181"/>
		<updated>2013-03-26T21:59:49Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Request=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x00030084]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| [[#Mediatypes|Mediatype]]&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Title count&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| (titlecount*8)&amp;lt;&amp;lt;8 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 4&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Pointer to buffer that contains title list, for which info needs to be retrieved&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| (titlecount*24)&amp;lt;&amp;lt;8 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 0x14&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Pointer to buffer that will receive the title info&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Response=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x00030040]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Result code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Title info =&lt;br /&gt;
Each entry in the buffer is 24 bytes, some contents are currently unknown.&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;
| 0&lt;br /&gt;
| 8&lt;br /&gt;
| Title id&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 8&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 2&lt;br /&gt;
| Version&lt;br /&gt;
|-&lt;br /&gt;
| 18&lt;br /&gt;
| 2&lt;br /&gt;
| Unknown&lt;br /&gt;
|-&lt;br /&gt;
| 20&lt;br /&gt;
| 4&lt;br /&gt;
| Title type&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{:Mediatypes}}&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=AMPXI:GetTitleList&amp;diff=5180</id>
		<title>AMPXI:GetTitleList</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=AMPXI:GetTitleList&amp;diff=5180"/>
		<updated>2013-03-26T21:59:11Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Request=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x00020082]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Title count&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| [[#Mediatypes|Mediatype]]&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| (titlecount*8)&amp;lt;&amp;lt;8 &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; 4&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Pointer to buffer that will receive list with titleid&#039;s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Response=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Index Word&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| Header code [0x00020080]&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Result code&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Number of entries returned&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{:Mediatypes}}&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Memory_layout&amp;diff=5025</id>
		<title>Memory layout</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Memory_layout&amp;diff=5025"/>
		<updated>2013-02-24T19:16:25Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=ARM11 Physical memory regions =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Address&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x10000&lt;br /&gt;
| Bootrom (super secret code/data @ 0x8000)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10000&lt;br /&gt;
| 0x10000&lt;br /&gt;
| Bootrom mirror&lt;br /&gt;
|-&lt;br /&gt;
| 0x10000000&lt;br /&gt;
| ?&lt;br /&gt;
| [[IO]] memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x17E00000&lt;br /&gt;
| 0x2000&lt;br /&gt;
| MPCore private memory region&lt;br /&gt;
|-&lt;br /&gt;
| 0x18000000&lt;br /&gt;
| 0x600000&lt;br /&gt;
| VRAM&lt;br /&gt;
|-&lt;br /&gt;
| 0x1FF00000&lt;br /&gt;
| 0x80000&lt;br /&gt;
| DSP memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x1FF80000&lt;br /&gt;
| 0x80000&lt;br /&gt;
| AXI WRAM&lt;br /&gt;
|-&lt;br /&gt;
| 0x20000000&lt;br /&gt;
| 0x8000000&lt;br /&gt;
| FCRAM&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Memory map by firmware=&lt;br /&gt;
* [[Virtual address mapping FW0B]]&lt;br /&gt;
* [[Virtual address mapping FW1F]]&lt;br /&gt;
&lt;br /&gt;
=ARM11 Detailed physical memory map=&lt;br /&gt;
 18000000 - 18600000: VRAM&lt;br /&gt;
 &lt;br /&gt;
 1FF80000 - 1FFAB000: Kernel code&lt;br /&gt;
 1FFAB000 - 1FFF0000: SlabHeap [temporarily contains boot processes]&lt;br /&gt;
 1FFF0000 - 1FFF1000: ?&lt;br /&gt;
 1FFF1000 - 1FFF2000: ?&lt;br /&gt;
 1FFF2000 - 1FFF3000: ?&lt;br /&gt;
 1FFF3000 - 1FFF4000: ?&lt;br /&gt;
 1FFF4000 - 1FFF5000: Exception vectors&lt;br /&gt;
 1FFF5000 - 1FFF5800: Unused?&lt;br /&gt;
 1FFF5800 - 1FFF5C00: 256-entry L2 MMU table for VA FF4xx000&lt;br /&gt;
 1FFF5C00 - 1FFF6000: 256-entry L2 MMU table for VA FF5xx000&lt;br /&gt;
 1FFF6000 - 1FFF6400: 256-entry L2 MMU table for VA FF6xx000&lt;br /&gt;
 1FFF6400 - 1FFF6800: 256-entry L2 MMU table for VA FF7xx000&lt;br /&gt;
 1FFF6800 - 1FFF6C00: 256-entry L2 MMU table for VA FF8xx000&lt;br /&gt;
 1FFF6C00 - 1FFF7000: 256-entry L2 MMU table for VA FF9xx000&lt;br /&gt;
 1FFF7000 - 1FFF7400: 256-entry L2 MMU table for VA FFAxx000&lt;br /&gt;
 1FFF7400 - 1FFF7800: 256-entry L2 MMU table for VA FFBxx000&lt;br /&gt;
 1FFF7800 - 1FFF7C00: MMU table but unused?&lt;br /&gt;
 1FFF7C00 - 1FFF8000: 256-entry L2 MMU table for VA FFFxx000 &lt;br /&gt;
 1FFF8000 - 1FFFC000: 4096-entry L1 MMU table for VA xxx00000 (CPU 0 or 1)&lt;br /&gt;
 1FFFC000 - 20000000: 4096-entry L1 MMU table for VA xxx00000 (CPU 1 or 0)&lt;br /&gt;
 20000000 - 28000000: Main memory&lt;br /&gt;
&lt;br /&gt;
=ARM11 Detailed virtual memory map=&lt;br /&gt;
 E8000000 - E8600000: mapped VRAM (18000000 - 18600000)&lt;br /&gt;
 &lt;br /&gt;
 EFF00000 - F0000000: mapped Internal memory (1FF00000 - 20000000)&lt;br /&gt;
 F0000000 - F8000000: mapped Main memory&lt;br /&gt;
 &lt;br /&gt;
 FF401000 - FF402000: mapped ? (27FC7000 - 27FC8000)&lt;br /&gt;
 &lt;br /&gt;
 FF403000 - FF404000: mapped ? (27FC2000 - 27FC3000)&lt;br /&gt;
 &lt;br /&gt;
 FF405000 - FF406000: mapped ? (27FBB000 - 27FBC000)&lt;br /&gt;
 &lt;br /&gt;
 FF407000 - FF408000: mapped ? (27FB3000 - 27FB4000)&lt;br /&gt;
 &lt;br /&gt;
 FF409000 - FF40A000: mapped ? (27F8E000 - 27F8F000)&lt;br /&gt;
 &lt;br /&gt;
 FFF00000 - FFF45000: mapped SlabHeap &lt;br /&gt;
 &lt;br /&gt;
 FFF60000 - FFF8B000: mapped Kernel code&lt;br /&gt;
 &lt;br /&gt;
 FFFCC000 - FFFCD000: mapped IO [[I2C|I2C]] second bus (10144000 - 10145000)&lt;br /&gt;
 &lt;br /&gt;
 FFFCE000 - FFFCF000: mapped IO PDC (10400000 - 10401000)&lt;br /&gt;
 &lt;br /&gt;
 FFFD0000 - FFFD1000: mapped IO PDN (10141000 - 10142000)&lt;br /&gt;
 &lt;br /&gt;
 FFFD2000 - FFFD3000: mapped IO PXI (10163000 - 10164000)&lt;br /&gt;
 &lt;br /&gt;
 FFFD4000 - FFFD5000: mapped IO PAD (10146000 - 10147000)&lt;br /&gt;
 &lt;br /&gt;
 FFFD6000 - FFFD7000: mapped IO LCD (10202000 - 10203000)&lt;br /&gt;
 &lt;br /&gt;
 FFFD8000 - FFFD9000: mapped IO ? (10140000 - 10141000)&lt;br /&gt;
 &lt;br /&gt;
 FFFDA000 - FFFDB000: mapped IO XDMA (10200000 - 10201000)&lt;br /&gt;
 &lt;br /&gt;
 FFFDC000 - FFFE0000: mapped ? (1FFF8000 - 1FFFC000)&lt;br /&gt;
 &lt;br /&gt;
 FFFE1000 - FFFE2000: mapped ? (1FFF0000 - 1FFF1000)&lt;br /&gt;
 &lt;br /&gt;
 FFFE3000 - FFFE4000: mapped ? (1FFF2000 - 1FFF3000)&lt;br /&gt;
 &lt;br /&gt;
 FFFE5000 - FFFE9000: mapped L1 MMU table for VA xxx00000&lt;br /&gt;
 &lt;br /&gt;
 FFFEA000 - FFFEB000: mapped ? (1FFF1000 - 1FFF2000)&lt;br /&gt;
 &lt;br /&gt;
 FFFEC000 - FFFED000: mapped ? (1FFF3000 - 1FFF4000)&lt;br /&gt;
 &lt;br /&gt;
 FFFEE000 - FFFF0000: mapped IO IRQ (17E00000 - 17E02000)&lt;br /&gt;
 &lt;br /&gt;
 FFFF0000 - FFFF1000: mapped Exception vectors&lt;br /&gt;
 &lt;br /&gt;
 FFFF2000 - FFFF6000: mapped L1 MMU table for VA xxx00000&lt;br /&gt;
 &lt;br /&gt;
 FFFF7000 - FFFF8000: mapped ? (1FFF1000 - 1FFF2000)&lt;br /&gt;
 &lt;br /&gt;
 FFFF9000 - FFFFA000: mapped ? (1FFF3000 - 1FFF4000)&lt;br /&gt;
 &lt;br /&gt;
 FFFFB000 - FFFFE000: mapped L2 MMU tables (1FFF5000 - 1FFF8000)&lt;br /&gt;
&lt;br /&gt;
=ARM11 User-land memory regions=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Virtual Address Base&lt;br /&gt;
!  Physical Address Base&lt;br /&gt;
!  Region Max Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00100000 / 0x14000000&lt;br /&gt;
| &lt;br /&gt;
| 0x03F00000&lt;br /&gt;
| The [[ExeFS]]:/.code is loaded here, executables must be loaded to the 0x00100000 region when the exheader &amp;quot;special memory&amp;quot; flag is clear. The 0x03F00000-byte size restriction only applies when this flag is clear. Executables are usually loaded to 0x14000000 when the exheader &amp;quot;special memory&amp;quot; flag is set, however this address can be arbitrary.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| For applications: FCRAM + GSP heap size&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| Heap mapped by [[SVC|ControlMemory]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x10000000-StackSize&lt;br /&gt;
| .bss physical address - total stack pages&lt;br /&gt;
| StackSize from process exheader&lt;br /&gt;
| Stack for the main-thread, initialized by the ARM11 kernel. The StackSize from the exheader is usually 0x4000, therefore the stack-bottom is usually 0x0FFFC000. The stack for the other threads is normally located in the process .data section however this can be arbitrary.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10000000&lt;br /&gt;
| &lt;br /&gt;
| 0x04000000&lt;br /&gt;
| [[SVC|Shared]] memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x14000000&lt;br /&gt;
| FCRAM+0&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| Can be mapped by [[SVC|ControlMemory]], this is used for the application&#039;s GSP heap.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EC00000&lt;br /&gt;
| 0x10100000&lt;br /&gt;
| 0x01000000&lt;br /&gt;
| [[IO]] registers, the mapped IO pages which each process can access is specified in the [[NCCH#CXI|CXI]] exheader.(Applications normally don&#039;t have access to registers in this range)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F000000&lt;br /&gt;
| 0x18000000&lt;br /&gt;
| 0x00600000&lt;br /&gt;
| VRAM, access to this is specified by the exheader.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1FF00000&lt;br /&gt;
| 0x1FF00000&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| DSP memory, access to this is specified by the exheader.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1FF80000&lt;br /&gt;
| &lt;br /&gt;
| 0x1000&lt;br /&gt;
| [[Configuration Memory]], all processes have access to this however write-permission to this page is specified by the exheader &amp;quot;Shared page writing&amp;quot; kernel flag.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1FF81000&lt;br /&gt;
| &lt;br /&gt;
| 0x1000&lt;br /&gt;
| Shared page, access to this is the same as 0x1FF80000.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All executable pages are read-only, and data pages have the execute-never permission set. Normally .text from the loaded ExeFS:/.code is the only mapped executable memory. Executable [[RO Services|CROs]] can be loaded into memory, once loaded the CRO .text section memory page permissions are changed via [[SVC|ControlProcessMemory]] from RW- to R-X. The address and size of each ExeFS:/.code section is stored in the exheader, the permissions for each section is: .text R-X, .rodata R--, .data RW-, and .bss RW-. The loaded .code is mapped to the addresses specified in the exheader by the ARM11 kernel. The stack permissions is initialized by the ARM11 kernel: RW-. The heap permissions is normally RW-.&lt;br /&gt;
&lt;br /&gt;
All userland memory is mapped with RW permissions for privileged-mode. However, normally the ARM11 kernel only uses userland read/write instructions(or checks that the memory can be written from userland first) for accessing memory specified by [[SVC|SVCs]].&lt;br /&gt;
&lt;br /&gt;
The virtual memory located below 0x20000000 is process-unique, processes can&#039;t directly access memory for other processes. The virtual memory starting at 0x20000000 is only accessible in privileged-mode. When service [[Services API|commands]] are used, the kernel maps memory in the destination process for input/output buffers, where the addresses in the command received by the process is replaced by this mapped memory. When this is an input buffer, the buffer data is copied to the mapped memory. When this is an output buffer, the data stored in the mapped memory is copied to the destination buffer specified in the command.&lt;br /&gt;
&lt;br /&gt;
The physical address which memory for the application memory-type is mapped to begins at FCRAM+0, the total memory allocated for this memory-type is stored in [[Configuration_Memory]]. Applications&#039; exefs:/.code under the application memory-type is mapped at FCRAM + APPMEMALLOC - exefs:/.code size aligned to the page size. The application .bss is mapped at CODEADDR - .bss size aligned down to the page size. Once the application exefs:/.code, .bss, and stack are mapped, APPMEMALLOC is set to APPMEMALLOC - (stacksize + bss_size + codesize), where stacksize, bss_size, and code_size are aligned to the page size.&lt;br /&gt;
&lt;br /&gt;
== System memory details ==&lt;br /&gt;
 0xFFFF9004 Pointer to the current KProcess instance&lt;br /&gt;
&lt;br /&gt;
== Handles ==&lt;br /&gt;
The handle 0xFFFF8001 is a reference to the current KProcess.&lt;br /&gt;
&lt;br /&gt;
== VRAM Map While Running Webbrowser ==&lt;br /&gt;
*0x1e6000-0x22C500 -- top screen framebuffer 0(240x400x3)&lt;br /&gt;
*0x22C800-0x272D00 -- top screen framebuffer 1(240x400x3)&lt;br /&gt;
*0x273000-0x2B9500 -- top screen framebuffer 2(240x400x3)&lt;br /&gt;
*0x2B9800-0x2FFD00 -- top screen framebuffer 3(240x400x3)&lt;br /&gt;
*0x48F000-0x4C7400 -- bottom screen framebuffer 0(240x320x3)&lt;br /&gt;
*0x4C7800-0x4FF800 -- bottom screen framebuffer 1(240x320x3)&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Memory_layout&amp;diff=5018</id>
		<title>Memory layout</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Memory_layout&amp;diff=5018"/>
		<updated>2013-02-23T20:43:47Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=ARM11 Physical memory regions =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Address&lt;br /&gt;
!  Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x10000&lt;br /&gt;
| Bootrom (super secret code/data @ 0x8000)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10000&lt;br /&gt;
| 0x10000&lt;br /&gt;
| Bootrom mirror&lt;br /&gt;
|-&lt;br /&gt;
| 0x10000000&lt;br /&gt;
| ?&lt;br /&gt;
| [[IO]] memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x18000000&lt;br /&gt;
| 0x600000&lt;br /&gt;
| VRAM&lt;br /&gt;
|-&lt;br /&gt;
| 0x1FF00000&lt;br /&gt;
| 0x80000&lt;br /&gt;
| DSP memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x1FF80000&lt;br /&gt;
| 0x80000&lt;br /&gt;
| AXI WRAM&lt;br /&gt;
|-&lt;br /&gt;
| 0x20000000&lt;br /&gt;
| 0x8000000&lt;br /&gt;
| FCRAM&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Memory map by firmware=&lt;br /&gt;
* [[Virtual address mapping FW0B]]&lt;br /&gt;
* [[Virtual address mapping FW1F]]&lt;br /&gt;
&lt;br /&gt;
=ARM11 Detailed physical memory map=&lt;br /&gt;
 18000000 - 18600000: VRAM&lt;br /&gt;
 &lt;br /&gt;
 1FF80000 - 1FFAB000: Kernel code&lt;br /&gt;
 1FFAB000 - 1FFF0000: SlabHeap [temporarily contains boot processes]&lt;br /&gt;
 1FFF0000 - 1FFF1000: ?&lt;br /&gt;
 1FFF1000 - 1FFF2000: ?&lt;br /&gt;
 1FFF2000 - 1FFF3000: ?&lt;br /&gt;
 1FFF3000 - 1FFF4000: ?&lt;br /&gt;
 1FFF4000 - 1FFF5000: Exception vectors&lt;br /&gt;
 1FFF5000 - 1FFF5800: Unused?&lt;br /&gt;
 1FFF5800 - 1FFF5C00: 256-entry L2 MMU table for VA FF4xx000&lt;br /&gt;
 1FFF5C00 - 1FFF6000: 256-entry L2 MMU table for VA FF5xx000&lt;br /&gt;
 1FFF6000 - 1FFF6400: 256-entry L2 MMU table for VA FF6xx000&lt;br /&gt;
 1FFF6400 - 1FFF6800: 256-entry L2 MMU table for VA FF7xx000&lt;br /&gt;
 1FFF6800 - 1FFF6C00: 256-entry L2 MMU table for VA FF8xx000&lt;br /&gt;
 1FFF6C00 - 1FFF7000: 256-entry L2 MMU table for VA FF9xx000&lt;br /&gt;
 1FFF7000 - 1FFF7400: 256-entry L2 MMU table for VA FFAxx000&lt;br /&gt;
 1FFF7400 - 1FFF7800: 256-entry L2 MMU table for VA FFBxx000&lt;br /&gt;
 1FFF7800 - 1FFF7C00: MMU table but unused?&lt;br /&gt;
 1FFF7C00 - 1FFF8000: 256-entry L2 MMU table for VA FFFxx000 &lt;br /&gt;
 1FFF8000 - 1FFFC000: 4096-entry L1 MMU table for VA xxx00000 (CPU 0 or 1)&lt;br /&gt;
 1FFFC000 - 20000000: 4096-entry L1 MMU table for VA xxx00000 (CPU 1 or 0)&lt;br /&gt;
 20000000 - 28000000: Main memory&lt;br /&gt;
&lt;br /&gt;
=ARM11 Detailed virtual memory map=&lt;br /&gt;
 E8000000 - E8600000: mapped VRAM (18000000 - 18600000)&lt;br /&gt;
 &lt;br /&gt;
 EFF00000 - F0000000: mapped Internal memory (1FF00000 - 20000000)&lt;br /&gt;
 F0000000 - F8000000: mapped Main memory&lt;br /&gt;
 &lt;br /&gt;
 FF401000 - FF402000: mapped ? (27FC7000 - 27FC8000)&lt;br /&gt;
 &lt;br /&gt;
 FF403000 - FF404000: mapped ? (27FC2000 - 27FC3000)&lt;br /&gt;
 &lt;br /&gt;
 FF405000 - FF406000: mapped ? (27FBB000 - 27FBC000)&lt;br /&gt;
 &lt;br /&gt;
 FF407000 - FF408000: mapped ? (27FB3000 - 27FB4000)&lt;br /&gt;
 &lt;br /&gt;
 FF409000 - FF40A000: mapped ? (27F8E000 - 27F8F000)&lt;br /&gt;
 &lt;br /&gt;
 FFF00000 - FFF45000: mapped SlabHeap &lt;br /&gt;
 &lt;br /&gt;
 FFF60000 - FFF8B000: mapped Kernel code&lt;br /&gt;
 &lt;br /&gt;
 FFFCC000 - FFFCD000: mapped IO [[I2C|I2C]] second bus (10144000 - 10145000)&lt;br /&gt;
 &lt;br /&gt;
 FFFCE000 - FFFCF000: mapped IO PDC (10400000 - 10401000)&lt;br /&gt;
 &lt;br /&gt;
 FFFD0000 - FFFD1000: mapped IO PDN (10141000 - 10142000)&lt;br /&gt;
 &lt;br /&gt;
 FFFD2000 - FFFD3000: mapped IO PXI (10163000 - 10164000)&lt;br /&gt;
 &lt;br /&gt;
 FFFD4000 - FFFD5000: mapped IO PAD (10146000 - 10147000)&lt;br /&gt;
 &lt;br /&gt;
 FFFD6000 - FFFD7000: mapped IO LCD (10202000 - 10203000)&lt;br /&gt;
 &lt;br /&gt;
 FFFD8000 - FFFD9000: mapped IO ? (10140000 - 10141000)&lt;br /&gt;
 &lt;br /&gt;
 FFFDA000 - FFFDB000: mapped IO XDMA (10200000 - 10201000)&lt;br /&gt;
 &lt;br /&gt;
 FFFDC000 - FFFE0000: mapped ? (1FFF8000 - 1FFFC000)&lt;br /&gt;
 &lt;br /&gt;
 FFFE1000 - FFFE2000: mapped ? (1FFF0000 - 1FFF1000)&lt;br /&gt;
 &lt;br /&gt;
 FFFE3000 - FFFE4000: mapped ? (1FFF2000 - 1FFF3000)&lt;br /&gt;
 &lt;br /&gt;
 FFFE5000 - FFFE9000: mapped L1 MMU table for VA xxx00000&lt;br /&gt;
 &lt;br /&gt;
 FFFEA000 - FFFEB000: mapped ? (1FFF1000 - 1FFF2000)&lt;br /&gt;
 &lt;br /&gt;
 FFFEC000 - FFFED000: mapped ? (1FFF3000 - 1FFF4000)&lt;br /&gt;
 &lt;br /&gt;
 FFFEE000 - FFFF0000: mapped IO IRQ (17E00000 - 17E02000)&lt;br /&gt;
 &lt;br /&gt;
 FFFF0000 - FFFF1000: mapped Exception vectors&lt;br /&gt;
 &lt;br /&gt;
 FFFF2000 - FFFF6000: mapped L1 MMU table for VA xxx00000&lt;br /&gt;
 &lt;br /&gt;
 FFFF7000 - FFFF8000: mapped ? (1FFF1000 - 1FFF2000)&lt;br /&gt;
 &lt;br /&gt;
 FFFF9000 - FFFFA000: mapped ? (1FFF3000 - 1FFF4000)&lt;br /&gt;
 &lt;br /&gt;
 FFFFB000 - FFFFE000: mapped L2 MMU tables (1FFF5000 - 1FFF8000)&lt;br /&gt;
&lt;br /&gt;
=ARM11 User-land memory regions=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Virtual Address Base&lt;br /&gt;
!  Physical Address Base&lt;br /&gt;
!  Region Max Size&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00100000 / 0x14000000&lt;br /&gt;
| &lt;br /&gt;
| 0x03F00000&lt;br /&gt;
| The [[ExeFS]]:/.code is loaded here, executables must be loaded to the 0x00100000 region when the exheader &amp;quot;special memory&amp;quot; flag is clear. The 0x03F00000-byte size restriction only applies when this flag is clear. Executables are usually loaded to 0x14000000 when the exheader &amp;quot;special memory&amp;quot; flag is set, however this address can be arbitrary.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| For applications: FCRAM + GSP heap size&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| Heap mapped by [[SVC|ControlMemory]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x10000000-StackSize&lt;br /&gt;
| .bss physical address - total stack pages&lt;br /&gt;
| StackSize from process exheader&lt;br /&gt;
| Stack for the main-thread, initialized by the ARM11 kernel. The StackSize from the exheader is usually 0x4000, therefore the stack-bottom is usually 0x0FFFC000. The stack for the other threads is normally located in the process .data section however this can be arbitrary.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10000000&lt;br /&gt;
| &lt;br /&gt;
| 0x04000000&lt;br /&gt;
| [[SVC|Shared]] memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x14000000&lt;br /&gt;
| FCRAM+0&lt;br /&gt;
| 0x08000000&lt;br /&gt;
| Can be mapped by [[SVC|ControlMemory]], this is used for the application&#039;s GSP heap.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1EC00000&lt;br /&gt;
| 0x10100000&lt;br /&gt;
| 0x01000000&lt;br /&gt;
| [[IO]] registers, the mapped IO pages which each process can access is specified in the [[NCCH#CXI|CXI]] exheader.(Applications normally don&#039;t have access to registers in this range)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F000000&lt;br /&gt;
| 0x18000000&lt;br /&gt;
| 0x00600000&lt;br /&gt;
| VRAM, access to this is specified by the exheader.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1FF00000&lt;br /&gt;
| 0x1FF00000&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| DSP memory, access to this is specified by the exheader.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1FF80000&lt;br /&gt;
| &lt;br /&gt;
| 0x1000&lt;br /&gt;
| [[Configuration Memory]], all processes have access to this however write-permission to this page is specified by the exheader &amp;quot;Shared page writing&amp;quot; kernel flag.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1FF81000&lt;br /&gt;
| &lt;br /&gt;
| 0x1000&lt;br /&gt;
| Shared page, access to this is the same as 0x1FF80000.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All executable pages are read-only, and data pages have the execute-never permission set. Normally .text from the loaded ExeFS:/.code is the only mapped executable memory. Executable [[RO Services|CROs]] can be loaded into memory, once loaded the CRO .text section memory page permissions are changed via [[SVC|ControlProcessMemory]] from RW- to R-X. The address and size of each ExeFS:/.code section is stored in the exheader, the permissions for each section is: .text R-X, .rodata R--, .data RW-, and .bss RW-. The loaded .code is mapped to the addresses specified in the exheader by the ARM11 kernel. The stack permissions is initialized by the ARM11 kernel: RW-. The heap permissions is normally RW-.&lt;br /&gt;
&lt;br /&gt;
All userland memory is mapped with RW permissions for privileged-mode. However, normally the ARM11 kernel only uses userland read/write instructions(or checks that the memory can be written from userland first) for accessing memory specified by [[SVC|SVCs]].&lt;br /&gt;
&lt;br /&gt;
The virtual memory located below 0x20000000 is process-unique, processes can&#039;t directly access memory for other processes. The virtual memory starting at 0x20000000 is only accessible in privileged-mode. When service [[Services API|commands]] are used, the kernel maps memory in the destination process for input/output buffers, where the addresses in the command received by the process is replaced by this mapped memory. When this is an input buffer, the buffer data is copied to the mapped memory. When this is an output buffer, the data stored in the mapped memory is copied to the destination buffer specified in the command.&lt;br /&gt;
&lt;br /&gt;
The physical address which memory for the application memory-type is mapped to begins at FCRAM+0, the total memory allocated for this memory-type is stored in [[Configuration_Memory]]. Applications&#039; exefs:/.code under the application memory-type is mapped at FCRAM + APPMEMALLOC - exefs:/.code size aligned to the page size. The application .bss is mapped at CODEADDR - .bss size aligned down to the page size. Once the application exefs:/.code, .bss, and stack are mapped, APPMEMALLOC is set to APPMEMALLOC - (stacksize + bss_size + codesize), where stacksize, bss_size, and code_size are aligned to the page size.&lt;br /&gt;
&lt;br /&gt;
== System memory details ==&lt;br /&gt;
 0xFFFF9004 Pointer to the current KProcess instance&lt;br /&gt;
&lt;br /&gt;
== Handles ==&lt;br /&gt;
The handle 0xFFFF8001 is a reference to the current KProcess.&lt;br /&gt;
&lt;br /&gt;
== VRAM Map While Running Webbrowser ==&lt;br /&gt;
*0x1e6000-0x22C500 -- top screen framebuffer 0(240x400x3)&lt;br /&gt;
*0x22C800-0x272D00 -- top screen framebuffer 1(240x400x3)&lt;br /&gt;
*0x273000-0x2B9500 -- top screen framebuffer 2(240x400x3)&lt;br /&gt;
*0x2B9800-0x2FFD00 -- top screen framebuffer 3(240x400x3)&lt;br /&gt;
*0x48F000-0x4C7400 -- bottom screen framebuffer 0(240x320x3)&lt;br /&gt;
*0x4C7800-0x4FF800 -- bottom screen framebuffer 1(240x320x3)&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=5015</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=5015"/>
		<updated>2013-02-22T22:26:48Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= System calls =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Id&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 &lt;br /&gt;
| Result ControlMemory(u32* outaddr, u32 addr0, u32 addr1, u32 size, u32 operation, u32 permissions) (outaddr is usually the same as the input addr0)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 &lt;br /&gt;
| Result  QueryMemory(MemoryInfo* info, PageInfo* out, u32 Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 &lt;br /&gt;
| void ExitProcess(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 &lt;br /&gt;
| Result  GetProcessAffinityMask(u8* affinitymask, Handle process, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 &lt;br /&gt;
| Result SetProcessAffinityMask(Handle process, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 &lt;br /&gt;
| Result GetProcessIdealProcessor(s32 *idealprocessor, Handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 &lt;br /&gt;
| Result SetProcessIdealProcessor(Handle process, s32 idealprocessor)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| Result [[#CreateThread|CreateThread]](Handle* thread, func entrypoint, u32 arg, u32 stacktop, s32 threadpriority, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9 &lt;br /&gt;
| void ExitThread(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0xA &lt;br /&gt;
| void SleepThread(s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0xB &lt;br /&gt;
| Result GetThreadPriority(s32* priority, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| Result SetThreadPriority(Handle thread, s32 priority)&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| Result GetThreadAffinityMask(u8* affinitymask, Handle thread, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| Result SetThreadAffinityMask(Handle thread, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xF &lt;br /&gt;
| Result GetThreadIdealProcessor(s32* processorid, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 &lt;br /&gt;
| Result SetThreadIdealProcessor(Handle thread, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 &lt;br /&gt;
| s32 GetCurrentProcessorNumber(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 &lt;br /&gt;
| Result Run(Handle process, StartupInfo* info) (This starts the main() thread. Buf+0 is main-thread priority, Buf+4 is main-thread stack-size.)&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 &lt;br /&gt;
| Result CreateMutex(Handle* mutex, bool initialLocked)&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 &lt;br /&gt;
| Result ReleaseMutex(Handle mutex)&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 &lt;br /&gt;
| Result CreateSemaphore(Handle* semaphore, s32 initialCount, s32 maxCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 &lt;br /&gt;
| Result ReleaseSemaphore(s32* count, Handle semaphore, s32 releaseCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 &lt;br /&gt;
| Result CreateEvent(Handle* event, ResetType resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 &lt;br /&gt;
| Result SignalEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 &lt;br /&gt;
| Result ClearEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A &lt;br /&gt;
| Result CreateTimer(Handle* timer, ResetType resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B &lt;br /&gt;
| Result SetTimer(Handle timer, s64 initial, s64 interval)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C &lt;br /&gt;
| Result CancelTimer(Handle timer)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D &lt;br /&gt;
| Result ClearTimer(Handle timer)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E &lt;br /&gt;
| Result CreateMemoryBlock(Handle* memblock, u32 memory, u32 size, u32 mypermission, u32 otherpermission)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F &lt;br /&gt;
| Result MapMemoryBlock(Handle memblock, u32 addr, u32 mypermissions, u32 otherpermission)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 &lt;br /&gt;
| Result UnmapMemoryBlock(Handle memblock, u32 addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 &lt;br /&gt;
| Result CreateAddressArbiter(Handle* arbiter)&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 &lt;br /&gt;
| Result ArbitrateAddress(Handle arbiter, u32 addr, ArbitrationType type, s32 value)&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 &lt;br /&gt;
| Result CloseHandle(Handle handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 &lt;br /&gt;
| Result WaitSynchronization1(Handle handle, s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 &lt;br /&gt;
| Result WaitSynchronizationN(s32* out, Handle* handles, s32 handlecount, bool waitAll, s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 &lt;br /&gt;
| Result SignalAndWait(s32* out, Handle signal, Handle* handles, s32 handleCount, bool waitAll, s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 &lt;br /&gt;
| Result DuplicateHandle(Handle* out, Handle original)&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 &lt;br /&gt;
| s64 GetSystemTick(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 &lt;br /&gt;
| Result GetHandleInfo(s64* out, Handle handle, HandleInfoType type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A &lt;br /&gt;
| Result GetSystemInfo(s64* out, SystemInfoType type, s32 param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B &lt;br /&gt;
| Result GetProcessInfo(s64* out, Handle process, ProcessInfoType type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C &lt;br /&gt;
| Result GetThreadInfo(s64* out, Handle thread, ThreadInfoType type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D &lt;br /&gt;
| Result ConnectToPort(Handle* out, const char* portName)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E &lt;br /&gt;
| Result SendSyncRequest1(Handle session) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F &lt;br /&gt;
| Result SendSyncRequest2(Handle session) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 &lt;br /&gt;
| Result SendSyncRequest3(Handle session) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 &lt;br /&gt;
| Result SendSyncRequest4(Handle session) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 &lt;br /&gt;
| Result SendSyncRequest(Handle session)&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 &lt;br /&gt;
| Result OpenProcess(Handle* process, u32 processId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 &lt;br /&gt;
| Result OpenThread(Handle* thread, Handle process, u32 threadId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x35 &lt;br /&gt;
| Result GetProcessId(u32* processId, Handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 &lt;br /&gt;
| Result GetProcessIdOfThread(u32* processId, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x37 &lt;br /&gt;
| Result GetThreadId(u32* threadId, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 &lt;br /&gt;
| Result GetResourceLimit(Handle* resourceLimit, Handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x39 &lt;br /&gt;
| Result GetResourceLimitLimitValues(s64* values, Handle resourceLimit, LimitableResource* names, s32 nameCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A &lt;br /&gt;
| Result GetResourceLimitCurrentValues(s64* values, Handle resourceLimit, LimitableResource* names, s32 nameCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B &lt;br /&gt;
| Result GetThreadContext(ThreadContext* context, Handle thread) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C &lt;br /&gt;
| Break(BreakReason)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D &lt;br /&gt;
| OutputDebugString(void const, int) (Does nothing on non-debug units)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E &lt;br /&gt;
| ControlPerformanceCounter(unsigned long long, int, unsigned int, unsigned long long)&lt;br /&gt;
|-&lt;br /&gt;
| 0x47 &lt;br /&gt;
| Result CreatePort(Handle* portServer, Handle* portClient,  const char* name, s32 maxSessions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 &lt;br /&gt;
| Result CreateSessionToPort(Handle* session, Handle port)&lt;br /&gt;
|-&lt;br /&gt;
| 0x49 &lt;br /&gt;
| Result CreateSession(Handle* sessionServer, Handle* sessionClient)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A &lt;br /&gt;
| Result AcceptSession(Handle* session, Handle port)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B &lt;br /&gt;
| Result ReplyAndReceive1(s32* index, Handle* handles, s32 handleCount, Handle replyTarget) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C &lt;br /&gt;
| Result ReplyAndReceive2(s32* index, Handle* handles, s32 handleCount, Handle replyTarget) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4D &lt;br /&gt;
| Result ReplyAndReceive3(s32* index, Handle* handles, s32 handleCount, Handle replyTarget) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E &lt;br /&gt;
| Result ReplyAndReceive4(s32* index, Handle* handles, s32 handleCount, Handle replyTarget) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F &lt;br /&gt;
| Result ReplyAndReceive(s32* index, Handle* handles, s32 handleCount, Handle replyTarget)&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 &lt;br /&gt;
| Result BindInterrupt(Interrupt name, Handle syncObject, s32 priority, bool isManualClear)&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 &lt;br /&gt;
| Result UnbindInterrupt(Interrupt name, Handle syncObject)&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 &lt;br /&gt;
| Result InvalidateProcessDataCache(Handle process, void* addr, u32 size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 &lt;br /&gt;
| Result StoreProcessDataCache(Handle process, void const* addr, u32 size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 &lt;br /&gt;
| Result FlushProcessDataCache(Handle process, void const* addr, u32 size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 &lt;br /&gt;
| Result StartInterProcessDma(Handle* dma, Handle dstProcess, void* dst, Handle srcProcess, const void* src, u32 size, const DmaConfig&amp;amp; config )&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 &lt;br /&gt;
| Result StopDma(Handle dma)&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 &lt;br /&gt;
| Result GetDmaState(DmaState* state, Handle dma)&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| RestartDma(nn::Handle, void *, void  const*, unsigned int, signed char)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 &lt;br /&gt;
| Result DebugActiveProcess(Handle* debug, u32 processID)&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 &lt;br /&gt;
| Result BreakDebugProcess(Handle debug)&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 &lt;br /&gt;
| Result TerminateDebugProcess(Handle debug)&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 &lt;br /&gt;
| Result GetProcessDebugEvent(DebugEventInfo* info, Handle debug)&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 &lt;br /&gt;
| Result ContinueDebugEvent(Handle debug, u32 flags)&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 &lt;br /&gt;
| Result GetProcessList(s32* processCount, u32* processIds, s32 processIdMaxCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 &lt;br /&gt;
| Result GetThreadList(s32* threadCount, u32* threadIds, s32 threadIdMaxCount, Handle domain)&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 &lt;br /&gt;
| Result GetDebugThreadContext(ThreadContext* context, Handle debug, u32 threadId, u32 controlFlags)&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 &lt;br /&gt;
| Result SetDebugThreadContext(Handle debug, u32 threadId, ThreadContext* context, u32 controlFlags)&lt;br /&gt;
|-&lt;br /&gt;
| 0x69 &lt;br /&gt;
| Result QueryDebugProcessMemory(MemoryInfo* blockInfo, PageInfo* pageInfo, Handle process, u32 addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A &lt;br /&gt;
| Result ReadProcessMemory(void* buffer, Handle debug, u32 addr, u32 size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B &lt;br /&gt;
| Result WriteProcessMemory(Handle debug, void const* buffer, u32 addr, u32 size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C &lt;br /&gt;
| Result SetHardwareBreakPoint(s32 registerId, u32 control, u32 value)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D&lt;br /&gt;
| GetDebugThreadParam(long long *, int *, nn::Handle, unsigned int, nn::dmnt::DebugThreadParam) (Disabled on regular kernel)&lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| ControlProcessMemory(Handle KProcess, unsigned int Addr0, unsigned int Addr1, unsigned int Size, unsigned int Type, unsigned int Permissions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x71&lt;br /&gt;
| MapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x72&lt;br /&gt;
| UnmapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x73&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| Stubbed on regular kernel&lt;br /&gt;
|-&lt;br /&gt;
| 0x75&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x76&lt;br /&gt;
| TerminateProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x77&lt;br /&gt;
| (Handle KProcess, Handle KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| CreateResourceLimit(Handle *KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x79&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A&lt;br /&gt;
| DisableExecuteNever(unsigned int Addr, unsigned int Size) (Stubbed for regular kernel beginning with [[2.0.0-2]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C&lt;br /&gt;
| KernelSetState(unsigned int Type, unsigned int Param0, unsigned int Param1, unsigned int Param2) (The Type determines the usage of each param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D&lt;br /&gt;
| QueryProcessMemory(MemInfo *Info, unsigned int *Out, Handle KProcess, unsigned int Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0xFF&lt;br /&gt;
| Debug related (The Syscall access control mask doesn&#039;t apply for this SVC)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateThread ==&lt;br /&gt;
 R0=s32 threadpriority&lt;br /&gt;
 R1=func entrypoint&lt;br /&gt;
 R2=u32 arg&lt;br /&gt;
 R3=u32 stacktop&lt;br /&gt;
 R4=s32 processorid&lt;br /&gt;
&lt;br /&gt;
 Result result=R0&lt;br /&gt;
 Handle* thread=R1&lt;br /&gt;
&lt;br /&gt;
= Types and structures =&lt;br /&gt;
&lt;br /&gt;
== enum MemoryState ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory state flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| RESERVED&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| IO&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| STATIC&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| CODE&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| PRIVATE&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| SHARED&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| CONTINUOUS&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| ALIASED&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS&lt;br /&gt;
| 9&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS CODE&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 11&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum PageFlags ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Page flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| CHANGED&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryOperation ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory operation&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| RESERVE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| COMMIT&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| MAP&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| UNMAP&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| PROTECT&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| REGION APP&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| REGION SYSTEM&lt;br /&gt;
| 0x200&lt;br /&gt;
|-&lt;br /&gt;
| REGION BASE&lt;br /&gt;
| 0x300&lt;br /&gt;
|-&lt;br /&gt;
| LINEAR&lt;br /&gt;
| 0x1000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryPermission ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory permission&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| NONE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| READ&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| WRITE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| READWRITE&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| DONTCARE&lt;br /&gt;
| 0x10000000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== enum ResetType ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Reset type&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| ONESHOT&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| STICKY&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| PULSE&lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct MemoryInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Base address&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Permission&lt;br /&gt;
|-&lt;br /&gt;
| enum MemoryState&lt;br /&gt;
| State&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct PageInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Flags&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct StartupInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| Priority&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Stack size&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| argc&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| argv&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| envp&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Processes =&lt;br /&gt;
Each process can only use SVCs which are enabled in the [[NCCH#CXI|exheader]] for this process. The ARM11 kernel SVC handler checks whether the SVC is enabled in the syscall access control mask stored on the SVC-mode stack, when the SVC isn&#039;t enabled a kernelpanic() is triggered. Each process has a separate SVC-mode stack, this stack and the syscall access mask stored here is initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of this table is stored in the exheader. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for the current KThread.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
= Threads =&lt;br /&gt;
For svcCreateThread the input address used for Entrypoint_Param and StackTop are normally the same, however these can be arbitrary. For the main thread the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread.&lt;br /&gt;
&lt;br /&gt;
= Memory Mapping =&lt;br /&gt;
ControlMemory and MapMemoryBlock can be used to map memory pages, these two SVCs only support mapping execute-never R/W pages. The input permissions parameter for these SVCs must be &amp;lt;=3, where value zero is used when un-mapping memory. Bitmask 0xf00 for ControlMemory parameter MemoryType is the memory-type, when this is zero the memory-type is loaded from the kernel flags stored in the exheader ARM11 kernel descriptors, for the process using the SVC. ControlMemory parameter MemoryType with value 0x10003 is used for mapping the GSP [[Memory_layout|heap]]. The low 8-bits are the type: 1 is for un-mapping memory, 3 for mapping memory. Type4 is used to mirror the RW memory at Addr1, to Addr0. Type4 will return an error if Addr1 is located in read-only memory. Addr1 is not used for type1 and type3.&lt;br /&gt;
&lt;br /&gt;
ControlProcessMemory maps memory in the specified process, this is the only SVC which allows mapping executable memory. Format of the permissions field for memory mapping SVCs: bit0=R, bit1=W, bit2=X. Type6 sets the Addr0 memory permissions to the input permissions, for already mapped memory.&lt;br /&gt;
&lt;br /&gt;
MapProcessMemory maps RW memory starting at address 0x00100000 in the specified KProcess, at the specified StartAddr in the current process. MapProcessMemory then maps 0x08000000 in the specified process, to StartAddr+0x7f00000 in the current process. UnmapProcessMemory unmaps the memory which was mapped by MapProcessMemory.&lt;br /&gt;
&lt;br /&gt;
= Debugging =&lt;br /&gt;
DebugActiveProcess is used to attach to a process for debugging. This SVC can only be used when the target process&#039; ARM11 descriptors stored in the exheader have the kernel flag for &amp;quot;Enable debug&amp;quot; set. Otherwise when that flag is clear, the kernel flags for the process using this SVC must have the &amp;quot;Force debug&amp;quot; flag set.&lt;br /&gt;
&lt;br /&gt;
= KernelSetState =&lt;br /&gt;
Type0 initializes the programID for launching [[FIRM]], then triggers launching [[FIRM]]. Param0 and Param2 are unused. Param1 is the programID-low, and the programID-high is 0x00040138.&lt;br /&gt;
&lt;br /&gt;
Type3 is used for initializing the 0x1000-byte buffer used by the launched [[FIRM]]. Param2 is unused. When Param0 is value 1, this buffer is copied to the beginning of FCRAM at 0xF0000000, and Param1 is unused. When Param0 is value 0, this kernel buffer is mapped to process address Param1.&lt;br /&gt;
&lt;br /&gt;
= GetSystemInfo =&lt;br /&gt;
Type0 value 26(Type1 is unused) writes the total number of processes which were directly launched by the kernel, to Output. For the NATIVE_FIRM/SAFE_MODE_FIRM ARM11 kernel, this is normally 5, for processes sm, fs, pm, loader, and pxi.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=5014</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=5014"/>
		<updated>2013-02-22T22:19:39Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= System calls =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Id&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 &lt;br /&gt;
| Result ControlMemory(u32* outaddr, u32 addr0, u32 addr1, u32 size, u32 operation, u32 permissions) (outaddr is usually the same as the input addr0)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 &lt;br /&gt;
| Result  QueryMemory(MemoryInfo* info, PageInfo* out, u32 Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 &lt;br /&gt;
| void ExitProcess(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 &lt;br /&gt;
| Result  GetProcessAffinityMask(u8* affinitymask, Handle process, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 &lt;br /&gt;
| Result SetProcessAffinityMask(Handle process, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 &lt;br /&gt;
| Result GetProcessIdealProcessor(s32 *idealprocessor, Handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 &lt;br /&gt;
| Result SetProcessIdealProcessor(Handle process, s32 idealprocessor)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| Result CreateThread(Handle* thread, func entrypoint, u32 arg, u32 stacktop, s32 threadpriority, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9 &lt;br /&gt;
| void ExitThread(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0xA &lt;br /&gt;
| void SleepThread(s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0xB &lt;br /&gt;
| Result GetThreadPriority(s32* priority, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| Result SetThreadPriority(Handle thread, s32 priority)&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| Result GetThreadAffinityMask(u8* affinitymask, Handle thread, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| Result SetThreadAffinityMask(Handle thread, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xF &lt;br /&gt;
| Result GetThreadIdealProcessor(s32* processorid, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 &lt;br /&gt;
| Result SetThreadIdealProcessor(Handle thread, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 &lt;br /&gt;
| s32 GetCurrentProcessorNumber(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 &lt;br /&gt;
| Result Run(Handle process, StartupInfo* info) (This starts the main() thread. Buf+0 is main-thread priority, Buf+4 is main-thread stack-size.)&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 &lt;br /&gt;
| Result CreateMutex(Handle* mutex, bool initialLocked)&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 &lt;br /&gt;
| Result ReleaseMutex(Handle mutex)&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 &lt;br /&gt;
| Result CreateSemaphore(Handle* semaphore, s32 initialCount, s32 maxCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 &lt;br /&gt;
| Result ReleaseSemaphore(s32* count, Handle semaphore, s32 releaseCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 &lt;br /&gt;
| Result CreateEvent(Handle* event, ResetType resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 &lt;br /&gt;
| Result SignalEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 &lt;br /&gt;
| Result ClearEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A &lt;br /&gt;
| Result CreateTimer(Handle* timer, ResetType resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B &lt;br /&gt;
| Result SetTimer(Handle timer, s64 initial, s64 interval)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C &lt;br /&gt;
| Result CancelTimer(Handle timer)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D &lt;br /&gt;
| Result ClearTimer(Handle timer)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E &lt;br /&gt;
| Result CreateMemoryBlock(Handle* memblock, u32 memory, u32 size, u32 mypermission, u32 otherpermission)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F &lt;br /&gt;
| Result MapMemoryBlock(Handle memblock, u32 addr, u32 mypermissions, u32 otherpermission)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 &lt;br /&gt;
| Result UnmapMemoryBlock(Handle memblock, u32 addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 &lt;br /&gt;
| Result CreateAddressArbiter(Handle* arbiter)&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 &lt;br /&gt;
| Result ArbitrateAddress(Handle arbiter, u32 addr, ArbitrationType type, s32 value)&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 &lt;br /&gt;
| Result CloseHandle(Handle handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 &lt;br /&gt;
| Result WaitSynchronization1(Handle handle, s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 &lt;br /&gt;
| Result WaitSynchronizationN(s32* out, Handle* handles, s32 handlecount, bool waitAll, s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 &lt;br /&gt;
| Result SignalAndWait(s32* out, Handle signal, Handle* handles, s32 handleCount, bool waitAll, s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 &lt;br /&gt;
| Result DuplicateHandle(Handle* out, Handle original)&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 &lt;br /&gt;
| s64 GetSystemTick(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 &lt;br /&gt;
| Result GetHandleInfo(s64* out, Handle handle, HandleInfoType type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A &lt;br /&gt;
| Result GetSystemInfo(s64* out, SystemInfoType type, s32 param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B &lt;br /&gt;
| Result GetProcessInfo(s64* out, Handle process, ProcessInfoType type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C &lt;br /&gt;
| Result GetThreadInfo(s64* out, Handle thread, ThreadInfoType type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D &lt;br /&gt;
| Result ConnectToPort(Handle* out, const char* portName)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E &lt;br /&gt;
| Result SendSyncRequest1(Handle session) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F &lt;br /&gt;
| Result SendSyncRequest2(Handle session) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 &lt;br /&gt;
| Result SendSyncRequest3(Handle session) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 &lt;br /&gt;
| Result SendSyncRequest4(Handle session) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 &lt;br /&gt;
| Result SendSyncRequest(Handle session)&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 &lt;br /&gt;
| Result OpenProcess(Handle* process, u32 processId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 &lt;br /&gt;
| Result OpenThread(Handle* thread, Handle process, u32 threadId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x35 &lt;br /&gt;
| Result GetProcessId(u32* processId, Handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 &lt;br /&gt;
| Result GetProcessIdOfThread(u32* processId, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x37 &lt;br /&gt;
| Result GetThreadId(u32* threadId, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 &lt;br /&gt;
| Result GetResourceLimit(Handle* resourceLimit, Handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x39 &lt;br /&gt;
| Result GetResourceLimitLimitValues(s64* values, Handle resourceLimit, LimitableResource* names, s32 nameCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A &lt;br /&gt;
| Result GetResourceLimitCurrentValues(s64* values, Handle resourceLimit, LimitableResource* names, s32 nameCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B &lt;br /&gt;
| Result GetThreadContext(ThreadContext* context, Handle thread) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C &lt;br /&gt;
| Break(BreakReason)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D &lt;br /&gt;
| OutputDebugString(void const, int) (Does nothing on non-debug units)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E &lt;br /&gt;
| ControlPerformanceCounter(unsigned long long, int, unsigned int, unsigned long long)&lt;br /&gt;
|-&lt;br /&gt;
| 0x47 &lt;br /&gt;
| Result CreatePort(Handle* portServer, Handle* portClient,  const char* name, s32 maxSessions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 &lt;br /&gt;
| Result CreateSessionToPort(Handle* session, Handle port)&lt;br /&gt;
|-&lt;br /&gt;
| 0x49 &lt;br /&gt;
| Result CreateSession(Handle* sessionServer, Handle* sessionClient)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A &lt;br /&gt;
| Result AcceptSession(Handle* session, Handle port)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B &lt;br /&gt;
| Result ReplyAndReceive1(s32* index, Handle* handles, s32 handleCount, Handle replyTarget) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C &lt;br /&gt;
| Result ReplyAndReceive2(s32* index, Handle* handles, s32 handleCount, Handle replyTarget) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4D &lt;br /&gt;
| Result ReplyAndReceive3(s32* index, Handle* handles, s32 handleCount, Handle replyTarget) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E &lt;br /&gt;
| Result ReplyAndReceive4(s32* index, Handle* handles, s32 handleCount, Handle replyTarget) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F &lt;br /&gt;
| Result ReplyAndReceive(s32* index, Handle* handles, s32 handleCount, Handle replyTarget)&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 &lt;br /&gt;
| Result BindInterrupt(Interrupt name, Handle syncObject, s32 priority, bool isManualClear)&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 &lt;br /&gt;
| Result UnbindInterrupt(Interrupt name, Handle syncObject)&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 &lt;br /&gt;
| Result InvalidateProcessDataCache(Handle process, void* addr, u32 size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 &lt;br /&gt;
| Result StoreProcessDataCache(Handle process, void const* addr, u32 size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 &lt;br /&gt;
| Result FlushProcessDataCache(Handle process, void const* addr, u32 size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 &lt;br /&gt;
| Result StartInterProcessDma(Handle* dma, Handle dstProcess, void* dst, Handle srcProcess, const void* src, u32 size, const DmaConfig&amp;amp; config )&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 &lt;br /&gt;
| Result StopDma(Handle dma)&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 &lt;br /&gt;
| Result GetDmaState(DmaState* state, Handle dma)&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| RestartDma(nn::Handle, void *, void  const*, unsigned int, signed char)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 &lt;br /&gt;
| Result DebugActiveProcess(Handle* debug, u32 processID)&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 &lt;br /&gt;
| Result BreakDebugProcess(Handle debug)&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 &lt;br /&gt;
| Result TerminateDebugProcess(Handle debug)&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 &lt;br /&gt;
| Result GetProcessDebugEvent(DebugEventInfo* info, Handle debug)&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 &lt;br /&gt;
| Result ContinueDebugEvent(Handle debug, u32 flags)&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 &lt;br /&gt;
| Result GetProcessList(s32* processCount, u32* processIds, s32 processIdMaxCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 &lt;br /&gt;
| Result GetThreadList(s32* threadCount, u32* threadIds, s32 threadIdMaxCount, Handle domain)&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 &lt;br /&gt;
| Result GetDebugThreadContext(ThreadContext* context, Handle debug, u32 threadId, u32 controlFlags)&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 &lt;br /&gt;
| Result SetDebugThreadContext(Handle debug, u32 threadId, ThreadContext* context, u32 controlFlags)&lt;br /&gt;
|-&lt;br /&gt;
| 0x69 &lt;br /&gt;
| Result QueryDebugProcessMemory(MemoryInfo* blockInfo, PageInfo* pageInfo, Handle process, u32 addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A &lt;br /&gt;
| Result ReadProcessMemory(void* buffer, Handle debug, u32 addr, u32 size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B &lt;br /&gt;
| Result WriteProcessMemory(Handle debug, void const* buffer, u32 addr, u32 size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C &lt;br /&gt;
| Result SetHardwareBreakPoint(s32 registerId, u32 control, u32 value)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D&lt;br /&gt;
| GetDebugThreadParam(long long *, int *, nn::Handle, unsigned int, nn::dmnt::DebugThreadParam) (Disabled on regular kernel)&lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| ControlProcessMemory(Handle KProcess, unsigned int Addr0, unsigned int Addr1, unsigned int Size, unsigned int Type, unsigned int Permissions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x71&lt;br /&gt;
| MapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x72&lt;br /&gt;
| UnmapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x73&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| Stubbed on regular kernel&lt;br /&gt;
|-&lt;br /&gt;
| 0x75&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x76&lt;br /&gt;
| TerminateProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x77&lt;br /&gt;
| (Handle KProcess, Handle KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| CreateResourceLimit(Handle *KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x79&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A&lt;br /&gt;
| DisableExecuteNever(unsigned int Addr, unsigned int Size) (Stubbed for regular kernel beginning with [[2.0.0-2]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C&lt;br /&gt;
| KernelSetState(unsigned int Type, unsigned int Param0, unsigned int Param1, unsigned int Param2) (The Type determines the usage of each param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D&lt;br /&gt;
| QueryProcessMemory(MemInfo *Info, unsigned int *Out, Handle KProcess, unsigned int Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0xFF&lt;br /&gt;
| Debug related (The Syscall access control mask doesn&#039;t apply for this SVC)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateThread ==&lt;br /&gt;
 R0=threadpriority&lt;br /&gt;
 R1=entrypoint&lt;br /&gt;
 R2=arg&lt;br /&gt;
 R3=stacktop&lt;br /&gt;
 R4=processorid&lt;br /&gt;
&lt;br /&gt;
 result=R0&lt;br /&gt;
 thread=R1&lt;br /&gt;
&lt;br /&gt;
= Types and structures =&lt;br /&gt;
&lt;br /&gt;
== enum MemoryState ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory state flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| RESERVED&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| IO&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| STATIC&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| CODE&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| PRIVATE&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| SHARED&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| CONTINUOUS&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| ALIASED&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS&lt;br /&gt;
| 9&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS CODE&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 11&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum PageFlags ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Page flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| CHANGED&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryOperation ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory operation&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| RESERVE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| COMMIT&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| MAP&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| UNMAP&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| PROTECT&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| REGION APP&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| REGION SYSTEM&lt;br /&gt;
| 0x200&lt;br /&gt;
|-&lt;br /&gt;
| REGION BASE&lt;br /&gt;
| 0x300&lt;br /&gt;
|-&lt;br /&gt;
| LINEAR&lt;br /&gt;
| 0x1000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryPermission ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory permission&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| NONE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| READ&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| WRITE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| READWRITE&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| DONTCARE&lt;br /&gt;
| 0x10000000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== enum ResetType ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Reset type&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| ONESHOT&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| STICKY&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| PULSE&lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct MemoryInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Base address&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Permission&lt;br /&gt;
|-&lt;br /&gt;
| enum MemoryState&lt;br /&gt;
| State&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct PageInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Flags&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct StartupInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| Priority&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Stack size&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| argc&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| argv&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| envp&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Processes =&lt;br /&gt;
Each process can only use SVCs which are enabled in the [[NCCH#CXI|exheader]] for this process. The ARM11 kernel SVC handler checks whether the SVC is enabled in the syscall access control mask stored on the SVC-mode stack, when the SVC isn&#039;t enabled a kernelpanic() is triggered. Each process has a separate SVC-mode stack, this stack and the syscall access mask stored here is initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of this table is stored in the exheader. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for the current KThread.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
= Threads =&lt;br /&gt;
For svcCreateThread the input address used for Entrypoint_Param and StackTop are normally the same, however these can be arbitrary. For the main thread the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread.&lt;br /&gt;
&lt;br /&gt;
= Memory Mapping =&lt;br /&gt;
ControlMemory and MapMemoryBlock can be used to map memory pages, these two SVCs only support mapping execute-never R/W pages. The input permissions parameter for these SVCs must be &amp;lt;=3, where value zero is used when un-mapping memory. Bitmask 0xf00 for ControlMemory parameter MemoryType is the memory-type, when this is zero the memory-type is loaded from the kernel flags stored in the exheader ARM11 kernel descriptors, for the process using the SVC. ControlMemory parameter MemoryType with value 0x10003 is used for mapping the GSP [[Memory_layout|heap]]. The low 8-bits are the type: 1 is for un-mapping memory, 3 for mapping memory. Type4 is used to mirror the RW memory at Addr1, to Addr0. Type4 will return an error if Addr1 is located in read-only memory. Addr1 is not used for type1 and type3.&lt;br /&gt;
&lt;br /&gt;
ControlProcessMemory maps memory in the specified process, this is the only SVC which allows mapping executable memory. Format of the permissions field for memory mapping SVCs: bit0=R, bit1=W, bit2=X. Type6 sets the Addr0 memory permissions to the input permissions, for already mapped memory.&lt;br /&gt;
&lt;br /&gt;
MapProcessMemory maps RW memory starting at address 0x00100000 in the specified KProcess, at the specified StartAddr in the current process. MapProcessMemory then maps 0x08000000 in the specified process, to StartAddr+0x7f00000 in the current process. UnmapProcessMemory unmaps the memory which was mapped by MapProcessMemory.&lt;br /&gt;
&lt;br /&gt;
= Debugging =&lt;br /&gt;
DebugActiveProcess is used to attach to a process for debugging. This SVC can only be used when the target process&#039; ARM11 descriptors stored in the exheader have the kernel flag for &amp;quot;Enable debug&amp;quot; set. Otherwise when that flag is clear, the kernel flags for the process using this SVC must have the &amp;quot;Force debug&amp;quot; flag set.&lt;br /&gt;
&lt;br /&gt;
= KernelSetState =&lt;br /&gt;
Type0 initializes the programID for launching [[FIRM]], then triggers launching [[FIRM]]. Param0 and Param2 are unused. Param1 is the programID-low, and the programID-high is 0x00040138.&lt;br /&gt;
&lt;br /&gt;
Type3 is used for initializing the 0x1000-byte buffer used by the launched [[FIRM]]. Param2 is unused. When Param0 is value 1, this buffer is copied to the beginning of FCRAM at 0xF0000000, and Param1 is unused. When Param0 is value 0, this kernel buffer is mapped to process address Param1.&lt;br /&gt;
&lt;br /&gt;
= GetSystemInfo =&lt;br /&gt;
Type0 value 26(Type1 is unused) writes the total number of processes which were directly launched by the kernel, to Output. For the NATIVE_FIRM/SAFE_MODE_FIRM ARM11 kernel, this is normally 5, for processes sm, fs, pm, loader, and pxi.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=5011</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=5011"/>
		<updated>2013-02-22T02:32:50Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= System calls =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Id&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 &lt;br /&gt;
| Result ControlMemory(u32* outaddr, u32 addr0, u32 addr1, u32 size, u32 operation, u32 permissions) (outaddr is usually the same as the input addr0)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 &lt;br /&gt;
| Result  QueryMemory(MemoryInfo* info, PageInfo* out, u32 Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 &lt;br /&gt;
| void ExitProcess(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 &lt;br /&gt;
| Result  GetProcessAffinityMask(u8* affinitymask, Handle process, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 &lt;br /&gt;
| Result SetProcessAffinityMask(Handle process, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 &lt;br /&gt;
| Result GetProcessIdealProcessor(s32 *idealprocessor, Handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 &lt;br /&gt;
| Result SetProcessIdealProcessor(Handle process, s32 idealprocessor)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| Result CreateThread(Handle* thread, func entrypoint, u32 arg, u32 stacktop, s32 threadpriority, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9 &lt;br /&gt;
| void ExitThread(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0xA &lt;br /&gt;
| void SleepThread(s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0xB &lt;br /&gt;
| Result GetThreadPriority(s32* priority, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| Result SetThreadPriority(Handle thread, s32 priority)&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| Result GetThreadAffinityMask(u8* affinitymask, Handle thread, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| Result SetThreadAffinityMask(Handle thread, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xF &lt;br /&gt;
| Result GetThreadIdealProcessor(s32* processorid, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 &lt;br /&gt;
| Result SetThreadIdealProcessor(Handle thread, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 &lt;br /&gt;
| s32 GetCurrentProcessorNumber(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 &lt;br /&gt;
| Result Run(Handle process, StartupInfo* info) (This starts the main() thread. Buf+0 is main-thread priority, Buf+4 is main-thread stack-size.)&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 &lt;br /&gt;
| Result CreateMutex(Handle* mutex, bool initialLocked)&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 &lt;br /&gt;
| Result ReleaseMutex(Handle mutex)&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 &lt;br /&gt;
| Result CreateSemaphore(Handle* semaphore, s32 initialCount, s32 maxCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 &lt;br /&gt;
| Result ReleaseSemaphore(s32* count, Handle semaphore, s32 releaseCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 &lt;br /&gt;
| Result CreateEvent(Handle* event, ResetType resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 &lt;br /&gt;
| Result SignalEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 &lt;br /&gt;
| Result ClearEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A &lt;br /&gt;
| Result CreateTimer(Handle* timer, ResetType resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B &lt;br /&gt;
| Result SetTimer(Handle timer, s64 initial, s64 interval)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C &lt;br /&gt;
| Result CancelTimer(Handle timer)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D &lt;br /&gt;
| Result ClearTimer(Handle timer)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E &lt;br /&gt;
| Result CreateMemoryBlock(Handle* memblock, u32 memory, u32 size, u32 mypermission, u32 otherpermission)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F &lt;br /&gt;
| Result MapMemoryBlock(Handle memblock, u32 addr, u32 mypermissions, u32 otherpermission)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 &lt;br /&gt;
| Result UnmapMemoryBlock(Handle memblock, u32 addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 &lt;br /&gt;
| Result CreateAddressArbiter(Handle* arbiter)&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 &lt;br /&gt;
| Result ArbitrateAddress(Handle arbiter, u32 addr, ArbitrationType type, s32 value)&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 &lt;br /&gt;
| Result CloseHandle(Handle handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 &lt;br /&gt;
| Result WaitSynchronization1(Handle handle, s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 &lt;br /&gt;
| Result WaitSynchronizationN(s32* out, Handle* handles, s32 handlecount, bool waitAll, s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 &lt;br /&gt;
| Result SignalAndWait(s32* out, Handle signal, Handle* handles, s32 handleCount, bool waitAll, s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 &lt;br /&gt;
| Result DuplicateHandle(Handle* out, Handle original)&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 &lt;br /&gt;
| s64 GetSystemTick(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 &lt;br /&gt;
| Result GetHandleInfo(s64* out, Handle handle, HandleInfoType type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A &lt;br /&gt;
| Result GetSystemInfo(s64* out, SystemInfoType type, s32 param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B &lt;br /&gt;
| Result GetProcessInfo(s64* out, Handle process, ProcessInfoType type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C &lt;br /&gt;
| Result GetThreadInfo(s64* out, Handle thread, ThreadInfoType type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D &lt;br /&gt;
| Result ConnectToPort(Handle* out, const char* portName)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E &lt;br /&gt;
| Result SendSyncRequest1(Handle session) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F &lt;br /&gt;
| Result SendSyncRequest2(Handle session) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 &lt;br /&gt;
| Result SendSyncRequest3(Handle session) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 &lt;br /&gt;
| Result SendSyncRequest4(Handle session) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 &lt;br /&gt;
| Result SendSyncRequest(Handle session)&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 &lt;br /&gt;
| Result OpenProcess(Handle* process, u32 processId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 &lt;br /&gt;
| Result OpenThread(Handle* thread, Handle process, u32 threadId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x35 &lt;br /&gt;
| Result GetProcessId(u32* processId, Handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 &lt;br /&gt;
| Result GetProcessIdOfThread(u32* processId, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x37 &lt;br /&gt;
| Result GetThreadId(u32* threadId, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 &lt;br /&gt;
| Result GetResourceLimit(Handle* resourceLimit, Handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x39 &lt;br /&gt;
| Result GetResourceLimitLimitValues(s64* values, Handle resourceLimit, LimitableResource* names, s32 nameCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A &lt;br /&gt;
| Result GetResourceLimitCurrentValues(s64* values, Handle resourceLimit, LimitableResource* names, s32 nameCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B &lt;br /&gt;
| Result GetThreadContext(ThreadContext* context, Handle thread) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C &lt;br /&gt;
| Break(BreakReason)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D &lt;br /&gt;
| OutputDebugString(void const, int) (Does nothing on non-debug units)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E &lt;br /&gt;
| ControlPerformanceCounter(unsigned long long, int, unsigned int, unsigned long long)&lt;br /&gt;
|-&lt;br /&gt;
| 0x47 &lt;br /&gt;
| Result CreatePort(Handle* portServer, Handle* portClient,  const char* name, s32 maxSessions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 &lt;br /&gt;
| Result CreateSessionToPort(Handle* session, Handle port)&lt;br /&gt;
|-&lt;br /&gt;
| 0x49 &lt;br /&gt;
| Result CreateSession(Handle* sessionServer, Handle* sessionClient)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A &lt;br /&gt;
| Result AcceptSession(Handle* session, Handle port)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B &lt;br /&gt;
| Result ReplyAndReceive1(s32* index, Handle* handles, s32 handleCount, Handle replyTarget) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C &lt;br /&gt;
| Result ReplyAndReceive2(s32* index, Handle* handles, s32 handleCount, Handle replyTarget) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4D &lt;br /&gt;
| Result ReplyAndReceive3(s32* index, Handle* handles, s32 handleCount, Handle replyTarget) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E &lt;br /&gt;
| Result ReplyAndReceive4(s32* index, Handle* handles, s32 handleCount, Handle replyTarget) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F &lt;br /&gt;
| Result ReplyAndReceive(s32* index, Handle* handles, s32 handleCount, Handle replyTarget)&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 &lt;br /&gt;
| Result BindInterrupt(Interrupt name, Handle syncObject, s32 priority, bool isManualClear)&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 &lt;br /&gt;
| Result UnbindInterrupt(Interrupt name, Handle syncObject)&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 &lt;br /&gt;
| Result InvalidateProcessDataCache(Handle process, void* addr, u32 size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 &lt;br /&gt;
| Result StoreProcessDataCache(Handle process, void const* addr, u32 size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 &lt;br /&gt;
| Result FlushProcessDataCache(Handle process, void const* addr, u32 size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 &lt;br /&gt;
| Result StartInterProcessDma(Handle* dma, Handle dstProcess, void* dst, Handle srcProcess, const void* src, u32 size, const DmaConfig&amp;amp; config )&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 &lt;br /&gt;
| Result StopDma(Handle dma)&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 &lt;br /&gt;
| Result GetDmaState(DmaState* state, Handle dma)&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| RestartDma(nn::Handle, void *, void  const*, unsigned int, signed char)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 &lt;br /&gt;
| Result DebugActiveProcess(Handle* debug, u32 processID)&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 &lt;br /&gt;
| Result BreakDebugProcess(Handle debug)&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 &lt;br /&gt;
| Result TerminateDebugProcess(Handle debug)&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 &lt;br /&gt;
| Result GetProcessDebugEvent(DebugEventInfo* info, Handle debug)&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 &lt;br /&gt;
| Result ContinueDebugEvent(Handle debug, u32 flags)&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 &lt;br /&gt;
| Result GetProcessList(s32* processCount, u32* processIds, s32 processIdMaxCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 &lt;br /&gt;
| Result GetThreadList(s32* threadCount, u32* threadIds, s32 threadIdMaxCount, Handle domain)&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 &lt;br /&gt;
| Result GetDebugThreadContext(ThreadContext* context, Handle debug, u32 threadId, u32 controlFlags)&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 &lt;br /&gt;
| Result SetDebugThreadContext(Handle debug, u32 threadId, ThreadContext* context, u32 controlFlags)&lt;br /&gt;
|-&lt;br /&gt;
| 0x69 &lt;br /&gt;
| Result QueryDebugProcessMemory(MemoryInfo* blockInfo, PageInfo* pageInfo, Handle process, u32 addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A &lt;br /&gt;
| Result ReadProcessMemory(void* buffer, Handle debug, u32 addr, u32 size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B &lt;br /&gt;
| Result WriteProcessMemory(Handle debug, void const* buffer, u32 addr, u32 size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C &lt;br /&gt;
| Result SetHardwareBreakPoint(s32 registerId, u32 control, u32 value)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D&lt;br /&gt;
| GetDebugThreadParam(long long *, int *, nn::Handle, unsigned int, nn::dmnt::DebugThreadParam) (Disabled on regular kernel)&lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| ControlProcessMemory(Handle KProcess, unsigned int Addr0, unsigned int Addr1, unsigned int Size, unsigned int Type, unsigned int Permissions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x71&lt;br /&gt;
| MapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x72&lt;br /&gt;
| UnmapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x73&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| Stubbed on regular kernel&lt;br /&gt;
|-&lt;br /&gt;
| 0x75&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x76&lt;br /&gt;
| TerminateProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x77&lt;br /&gt;
| (Handle KProcess, Handle KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| CreateResourceLimit(Handle *KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x79&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A&lt;br /&gt;
| DisableExecuteNever(unsigned int Addr, unsigned int Size) (Stubbed for regular kernel beginning with [[2.0.0-2]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C&lt;br /&gt;
| KernelSetState(unsigned int Type, unsigned int Param0, unsigned int Param1, unsigned int Param2) (The Type determines the usage of each param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D&lt;br /&gt;
| QueryProcessMemory(MemInfo *Info, unsigned int *Out, Handle KProcess, unsigned int Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0xFF&lt;br /&gt;
| Debug related (The Syscall access control mask doesn&#039;t apply for this SVC)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Types and structures =&lt;br /&gt;
&lt;br /&gt;
== enum MemoryState ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory state flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| RESERVED&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| IO&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| STATIC&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| CODE&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| PRIVATE&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| SHARED&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| CONTINUOUS&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| ALIASED&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS&lt;br /&gt;
| 9&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS CODE&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 11&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum PageFlags ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Page flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| CHANGED&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryOperation ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory operation&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| RESERVE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| COMMIT&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| MAP&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| UNMAP&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| PROTECT&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| REGION APP&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| REGION SYSTEM&lt;br /&gt;
| 0x200&lt;br /&gt;
|-&lt;br /&gt;
| REGION BASE&lt;br /&gt;
| 0x300&lt;br /&gt;
|-&lt;br /&gt;
| LINEAR&lt;br /&gt;
| 0x1000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryPermission ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory permission&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| NONE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| READ&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| WRITE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| READWRITE&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| DONTCARE&lt;br /&gt;
| 0x10000000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== enum ResetType ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Reset type&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| ONESHOT&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| STICKY&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| PULSE&lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct MemoryInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Base address&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Permission&lt;br /&gt;
|-&lt;br /&gt;
| enum MemoryState&lt;br /&gt;
| State&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct PageInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Flags&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct StartupInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| Priority&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Stack size&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| argc&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| argv&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| envp&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Processes =&lt;br /&gt;
Each process can only use SVCs which are enabled in the [[NCCH#CXI|exheader]] for this process. The ARM11 kernel SVC handler checks whether the SVC is enabled in the syscall access control mask stored on the SVC-mode stack, when the SVC isn&#039;t enabled a kernelpanic() is triggered. Each process has a separate SVC-mode stack, this stack and the syscall access mask stored here is initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of this table is stored in the exheader. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for the current KThread.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
= Threads =&lt;br /&gt;
For svcCreateThread the input address used for Entrypoint_Param and StackTop are normally the same, however these can be arbitrary. For the main thread the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread.&lt;br /&gt;
&lt;br /&gt;
= Memory Mapping =&lt;br /&gt;
ControlMemory and MapMemoryBlock can be used to map memory pages, these two SVCs only support mapping execute-never R/W pages. The input permissions parameter for these SVCs must be &amp;lt;=3, where value zero is used when un-mapping memory. Bitmask 0xf00 for ControlMemory parameter MemoryType is the memory-type, when this is zero the memory-type is loaded from the kernel flags stored in the exheader ARM11 kernel descriptors, for the process using the SVC. ControlMemory parameter MemoryType with value 0x10003 is used for mapping the GSP [[Memory_layout|heap]]. The low 8-bits are the type: 1 is for un-mapping memory, 3 for mapping memory. Type4 is used to mirror the RW memory at Addr1, to Addr0. Type4 will return an error if Addr1 is located in read-only memory. Addr1 is not used for type1 and type3.&lt;br /&gt;
&lt;br /&gt;
ControlProcessMemory maps memory in the specified process, this is the only SVC which allows mapping executable memory. Format of the permissions field for memory mapping SVCs: bit0=R, bit1=W, bit2=X. Type6 sets the Addr0 memory permissions to the input permissions, for already mapped memory.&lt;br /&gt;
&lt;br /&gt;
MapProcessMemory maps RW memory starting at address 0x00100000 in the specified KProcess, at the specified StartAddr in the current process. MapProcessMemory then maps 0x08000000 in the specified process, to StartAddr+0x7f00000 in the current process. UnmapProcessMemory unmaps the memory which was mapped by MapProcessMemory.&lt;br /&gt;
&lt;br /&gt;
= Debugging =&lt;br /&gt;
DebugActiveProcess is used to attach to a process for debugging. This SVC can only be used when the target process&#039; ARM11 descriptors stored in the exheader have the kernel flag for &amp;quot;Enable debug&amp;quot; set. Otherwise when that flag is clear, the kernel flags for the process using this SVC must have the &amp;quot;Force debug&amp;quot; flag set.&lt;br /&gt;
&lt;br /&gt;
= KernelSetState =&lt;br /&gt;
Type0 initializes the programID for launching [[FIRM]], then triggers launching [[FIRM]]. Param0 and Param2 are unused. Param1 is the programID-low, and the programID-high is 0x00040138.&lt;br /&gt;
&lt;br /&gt;
Type3 is used for initializing the 0x1000-byte buffer used by the launched [[FIRM]]. Param2 is unused. When Param0 is value 1, this buffer is copied to the beginning of FCRAM at 0xF0000000, and Param1 is unused. When Param0 is value 0, this kernel buffer is mapped to process address Param1.&lt;br /&gt;
&lt;br /&gt;
= GetSystemInfo =&lt;br /&gt;
Type0 value 26(Type1 is unused) writes the total number of processes which were directly launched by the kernel, to Output. For the NATIVE_FIRM/SAFE_MODE_FIRM ARM11 kernel, this is normally 5, for processes sm, fs, pm, loader, and pxi.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=5010</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=5010"/>
		<updated>2013-02-22T02:26:30Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= System calls =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Id&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 &lt;br /&gt;
| Result ControlMemory(u32* outaddr, u32 addr0, u32 addr1, u32 size, u32 operation, u32 permissions) (outaddr is usually the same as the input addr0)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 &lt;br /&gt;
| Result  QueryMemory(MemoryInfo* info, PageInfo* out, u32 Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 &lt;br /&gt;
| void ExitProcess(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 &lt;br /&gt;
| Result  GetProcessAffinityMask(u8* affinitymask, Handle process, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 &lt;br /&gt;
| Result SetProcessAffinityMask(Handle process, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 &lt;br /&gt;
| Result GetProcessIdealProcessor(s32 *idealprocessor, Handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 &lt;br /&gt;
| Result SetProcessIdealProcessor(Handle process, s32 idealprocessor)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| Result CreateThread(Handle* thread, func entrypoint, u32 arg, u32 stacktop, s32 threadpriority, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9 &lt;br /&gt;
| void ExitThread(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0xA &lt;br /&gt;
| void SleepThread(s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0xB &lt;br /&gt;
| Result GetThreadPriority(s32* priority, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| Result SetThreadPriority(Handle thread, s32 priority)&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| Result GetThreadAffinityMask(u8* affinitymask, Handle thread, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| Result SetThreadAffinityMask(Handle thread, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xF &lt;br /&gt;
| Result GetThreadIdealProcessor(s32* processorid, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 &lt;br /&gt;
| Result SetThreadIdealProcessor(Handle thread, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 &lt;br /&gt;
| s32 GetCurrentProcessorNumber(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 &lt;br /&gt;
| Result Run(Handle process, StartupInfo* info) (This starts the main() thread. Buf+0 is main-thread priority, Buf+4 is main-thread stack-size.)&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 &lt;br /&gt;
| Result CreateMutex(Handle* mutex, bool initialLocked)&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 &lt;br /&gt;
| Result ReleaseMutex(Handle mutex)&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 &lt;br /&gt;
| Result CreateSemaphore(Handle* semaphore, s32 initialCount, s32 maxCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 &lt;br /&gt;
| Result ReleaseSemaphore(s32* count, Handle semaphore, s32 releaseCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 &lt;br /&gt;
| Result CreateEvent(Handle* event, ResetType resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 &lt;br /&gt;
| Result SignalEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 &lt;br /&gt;
| Result ClearEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A &lt;br /&gt;
| Result CreateTimer(Handle* timer, ResetType resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B &lt;br /&gt;
| Result SetTimer(Handle timer, s64 initial, s64 interval)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C &lt;br /&gt;
| Result CancelTimer(Handle timer)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D &lt;br /&gt;
| Result ClearTimer(Handle timer)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E &lt;br /&gt;
| Result CreateMemoryBlock(Handle* memblock, u32 memory, u32 size, u32 mypermission, u32 otherpermission)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F &lt;br /&gt;
| Result MapMemoryBlock(Handle memblock, u32 addr, u32 mypermissions, u32 otherpermission)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 &lt;br /&gt;
| Result UnmapMemoryBlock(Handle memblock, u32 addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 &lt;br /&gt;
| Result CreateAddressArbiter(Handle* arbiter)&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 &lt;br /&gt;
| Result ArbitrateAddress(Handle arbiter, u32 addr, ArbitrationType type, s32 value)&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 &lt;br /&gt;
| Result CloseHandle(Handle handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 &lt;br /&gt;
| Result WaitSynchronization1(Handle handle, s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 &lt;br /&gt;
| Result WaitSynchronizationN(s32* out, Handle* handles, s32 handlecount, bool waitAll, s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 &lt;br /&gt;
| Result SignalAndWait(s32* out, Handle signal, Handle* handles, s32 handleCount, bool waitAll, s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 &lt;br /&gt;
| Result DuplicateHandle(Handle* out, Handle original)&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 &lt;br /&gt;
| s64 GetSystemTick(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 &lt;br /&gt;
| Result GetHandleInfo(s64* out, Handle handle, HandleInfoType type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A &lt;br /&gt;
| Result GetSystemInfo(s64* out, SystemInfoType type, s32 param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B &lt;br /&gt;
| Result GetProcessInfo(s64* out, Handle process, ProcessInfoType type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C &lt;br /&gt;
| Result GetThreadInfo(s64* out, Handle thread, ThreadInfoType type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D &lt;br /&gt;
| Result ConnectToPort(Handle* out, const char* portName)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E &lt;br /&gt;
| Result SendSyncRequest1(Handle session) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F &lt;br /&gt;
| Result SendSyncRequest2(Handle session) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 &lt;br /&gt;
| Result SendSyncRequest3(Handle session) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 &lt;br /&gt;
| Result SendSyncRequest4(Handle session) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 &lt;br /&gt;
| Result SendSyncRequest(Handle session)&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 &lt;br /&gt;
| Result OpenProcess(Handle* process, u32 processId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 &lt;br /&gt;
| Result OpenThread(Handle* thread, Handle process, u32 threadId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x35 &lt;br /&gt;
| Result GetProcessId(u32* processId, Handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 &lt;br /&gt;
| Result GetProcessIdOfThread(u32* processId, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x37 &lt;br /&gt;
| Result GetThreadId(u32* threadId, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 &lt;br /&gt;
| Result GetResourceLimit(Handle* resourceLimit, Handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x39 &lt;br /&gt;
| Result GetResourceLimitLimitValues(s64* values, Handle resourceLimit, LimitableResource* names, s32 nameCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A &lt;br /&gt;
| Result GetResourceLimitCurrentValues(s64* values, Handle resourceLimit, LimitableResource* names, s32 nameCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B &lt;br /&gt;
| Result GetThreadContext(ThreadContext* context, Handle thread) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C &lt;br /&gt;
| Break(BreakReason)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D &lt;br /&gt;
| OutputDebugString(void const, int) (Does nothing on non-debug units)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E &lt;br /&gt;
| ControlPerformanceCounter(unsigned long long, int, unsigned int, unsigned long long)&lt;br /&gt;
|-&lt;br /&gt;
| 0x47 &lt;br /&gt;
| Result CreatePort(Handle* portServer, Handle* portClient,  const char* name, s32 maxSessions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 &lt;br /&gt;
| Result CreateSessionToPort(Handle* session, Handle port)&lt;br /&gt;
|-&lt;br /&gt;
| 0x49 &lt;br /&gt;
| Result CreateSession(Handle* sessionServer, Handle* sessionClient)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A &lt;br /&gt;
| Result AcceptSession(Handle* session, Handle port)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B &lt;br /&gt;
| Result ReplyAndReceive1(s32* index, Handle* handles, s32 handleCount, Handle replyTarget) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C &lt;br /&gt;
| Result ReplyAndReceive2(s32* index, Handle* handles, s32 handleCount, Handle replyTarget) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4D &lt;br /&gt;
| Result ReplyAndReceive3(s32* index, Handle* handles, s32 handleCount, Handle replyTarget) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E &lt;br /&gt;
| Result ReplyAndReceive4(s32* index, Handle* handles, s32 handleCount, Handle replyTarget) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F &lt;br /&gt;
| Result ReplyAndReceive(s32* index, Handle* handles, s32 handleCount, Handle replyTarget)&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 &lt;br /&gt;
| Result BindInterrupt(Interrupt name, Handle syncObject, s32 priority, bool isManualClear)&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 &lt;br /&gt;
| Result UnbindInterrupt(Interrupt name, Handle syncObject)&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 &lt;br /&gt;
| Result InvalidateProcessDataCache(Handle process, void* addr, u32 size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 &lt;br /&gt;
| Result StoreProcessDataCache(Handle process, void const* addr, u32 size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 &lt;br /&gt;
| Result FlushProcessDataCache(Handle process, void const* addr, u32 size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 &lt;br /&gt;
| Result StartInterProcessDma(Handle* dma, Handle dstProcess, void* dst, Handle srcProcess, const void* src, u32 size, const DmaConfig&amp;amp; config )&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 &lt;br /&gt;
| Result StopDma(Handle dma)&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 &lt;br /&gt;
| Result GetDmaState(DmaState* state, Handle dma)&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| RestartDma(nn::Handle, void *, void  const*, unsigned int, signed char)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 &lt;br /&gt;
| DebugActiveProcess(Handle *KDebug, unsigned int ProcessID)&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 &lt;br /&gt;
| BreakDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 &lt;br /&gt;
| TerminateDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 &lt;br /&gt;
| GetProcessDebugEvent(DebugEventInfo*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 &lt;br /&gt;
| ContinueDebugEvent(Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 &lt;br /&gt;
| GetProcessList(int *TotalPIDs, unsigned int *PIDs, int MaxPIDs)&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 &lt;br /&gt;
| GetThreadList(int*, unsigned int*, int, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 &lt;br /&gt;
| GetDebugThreadContext(ThreadContext*, Handle, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 &lt;br /&gt;
| SetDebugThreadContext(Handle, unsigned int, ThreadContext const&amp;amp;, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x69 &lt;br /&gt;
| QueryDebugProcessMemory(MemoryInfo*, PageInfo*, Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A &lt;br /&gt;
| ReadProcessMemory(void* Buffer, Handle KDebug, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B &lt;br /&gt;
| WriteProcessMemory(Handle KDebug, void const* Buffer, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C &lt;br /&gt;
| SetHardwareBreakPoint(int, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D&lt;br /&gt;
| GetDebugThreadParam(long long *, int *, nn::Handle, unsigned int, nn::dmnt::DebugThreadParam) (Disabled on regular kernel)&lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| ControlProcessMemory(Handle KProcess, unsigned int Addr0, unsigned int Addr1, unsigned int Size, unsigned int Type, unsigned int Permissions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x71&lt;br /&gt;
| MapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x72&lt;br /&gt;
| UnmapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x73&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| Stubbed on regular kernel&lt;br /&gt;
|-&lt;br /&gt;
| 0x75&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x76&lt;br /&gt;
| TerminateProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x77&lt;br /&gt;
| (Handle KProcess, Handle KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| CreateResourceLimit(Handle *KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x79&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A&lt;br /&gt;
| DisableExecuteNever(unsigned int Addr, unsigned int Size) (Stubbed for regular kernel beginning with [[2.0.0-2]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C&lt;br /&gt;
| KernelSetState(unsigned int Type, unsigned int Param0, unsigned int Param1, unsigned int Param2) (The Type determines the usage of each param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D&lt;br /&gt;
| QueryProcessMemory(MemInfo *Info, unsigned int *Out, Handle KProcess, unsigned int Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0xFF&lt;br /&gt;
| Debug related (The Syscall access control mask doesn&#039;t apply for this SVC)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Types and structures =&lt;br /&gt;
&lt;br /&gt;
== enum MemoryState ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory state flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| RESERVED&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| IO&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| STATIC&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| CODE&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| PRIVATE&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| SHARED&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| CONTINUOUS&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| ALIASED&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS&lt;br /&gt;
| 9&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS CODE&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 11&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum PageFlags ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Page flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| CHANGED&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryOperation ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory operation&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| RESERVE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| COMMIT&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| MAP&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| UNMAP&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| PROTECT&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| REGION APP&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| REGION SYSTEM&lt;br /&gt;
| 0x200&lt;br /&gt;
|-&lt;br /&gt;
| REGION BASE&lt;br /&gt;
| 0x300&lt;br /&gt;
|-&lt;br /&gt;
| LINEAR&lt;br /&gt;
| 0x1000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryPermission ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory permission&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| NONE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| READ&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| WRITE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| READWRITE&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| DONTCARE&lt;br /&gt;
| 0x10000000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== enum ResetType ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Reset type&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| ONESHOT&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| STICKY&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| PULSE&lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct MemoryInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Base address&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Permission&lt;br /&gt;
|-&lt;br /&gt;
| enum MemoryState&lt;br /&gt;
| State&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct PageInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Flags&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct StartupInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| Priority&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Stack size&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| argc&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| argv&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| envp&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Processes =&lt;br /&gt;
Each process can only use SVCs which are enabled in the [[NCCH#CXI|exheader]] for this process. The ARM11 kernel SVC handler checks whether the SVC is enabled in the syscall access control mask stored on the SVC-mode stack, when the SVC isn&#039;t enabled a kernelpanic() is triggered. Each process has a separate SVC-mode stack, this stack and the syscall access mask stored here is initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of this table is stored in the exheader. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for the current KThread.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
= Threads =&lt;br /&gt;
For svcCreateThread the input address used for Entrypoint_Param and StackTop are normally the same, however these can be arbitrary. For the main thread the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread.&lt;br /&gt;
&lt;br /&gt;
= Memory Mapping =&lt;br /&gt;
ControlMemory and MapMemoryBlock can be used to map memory pages, these two SVCs only support mapping execute-never R/W pages. The input permissions parameter for these SVCs must be &amp;lt;=3, where value zero is used when un-mapping memory. Bitmask 0xf00 for ControlMemory parameter MemoryType is the memory-type, when this is zero the memory-type is loaded from the kernel flags stored in the exheader ARM11 kernel descriptors, for the process using the SVC. ControlMemory parameter MemoryType with value 0x10003 is used for mapping the GSP [[Memory_layout|heap]]. The low 8-bits are the type: 1 is for un-mapping memory, 3 for mapping memory. Type4 is used to mirror the RW memory at Addr1, to Addr0. Type4 will return an error if Addr1 is located in read-only memory. Addr1 is not used for type1 and type3.&lt;br /&gt;
&lt;br /&gt;
ControlProcessMemory maps memory in the specified process, this is the only SVC which allows mapping executable memory. Format of the permissions field for memory mapping SVCs: bit0=R, bit1=W, bit2=X. Type6 sets the Addr0 memory permissions to the input permissions, for already mapped memory.&lt;br /&gt;
&lt;br /&gt;
MapProcessMemory maps RW memory starting at address 0x00100000 in the specified KProcess, at the specified StartAddr in the current process. MapProcessMemory then maps 0x08000000 in the specified process, to StartAddr+0x7f00000 in the current process. UnmapProcessMemory unmaps the memory which was mapped by MapProcessMemory.&lt;br /&gt;
&lt;br /&gt;
= Debugging =&lt;br /&gt;
DebugActiveProcess is used to attach to a process for debugging. This SVC can only be used when the target process&#039; ARM11 descriptors stored in the exheader have the kernel flag for &amp;quot;Enable debug&amp;quot; set. Otherwise when that flag is clear, the kernel flags for the process using this SVC must have the &amp;quot;Force debug&amp;quot; flag set.&lt;br /&gt;
&lt;br /&gt;
= KernelSetState =&lt;br /&gt;
Type0 initializes the programID for launching [[FIRM]], then triggers launching [[FIRM]]. Param0 and Param2 are unused. Param1 is the programID-low, and the programID-high is 0x00040138.&lt;br /&gt;
&lt;br /&gt;
Type3 is used for initializing the 0x1000-byte buffer used by the launched [[FIRM]]. Param2 is unused. When Param0 is value 1, this buffer is copied to the beginning of FCRAM at 0xF0000000, and Param1 is unused. When Param0 is value 0, this kernel buffer is mapped to process address Param1.&lt;br /&gt;
&lt;br /&gt;
= GetSystemInfo =&lt;br /&gt;
Type0 value 26(Type1 is unused) writes the total number of processes which were directly launched by the kernel, to Output. For the NATIVE_FIRM/SAFE_MODE_FIRM ARM11 kernel, this is normally 5, for processes sm, fs, pm, loader, and pxi.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=5009</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=5009"/>
		<updated>2013-02-22T02:20:38Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= System calls =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Id&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 &lt;br /&gt;
| Result ControlMemory(u32* outaddr, u32 addr0, u32 addr1, u32 size, u32 operation, u32 permissions) (outaddr is usually the same as the input addr0)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 &lt;br /&gt;
| Result  QueryMemory(MemoryInfo* info, PageInfo* out, u32 Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 &lt;br /&gt;
| void ExitProcess(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 &lt;br /&gt;
| Result  GetProcessAffinityMask(u8* affinitymask, Handle process, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 &lt;br /&gt;
| Result SetProcessAffinityMask(Handle process, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 &lt;br /&gt;
| Result GetProcessIdealProcessor(s32 *idealprocessor, Handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 &lt;br /&gt;
| Result SetProcessIdealProcessor(Handle process, s32 idealprocessor)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| Result CreateThread(Handle* thread, func entrypoint, u32 arg, u32 stacktop, s32 threadpriority, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9 &lt;br /&gt;
| void ExitThread(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0xA &lt;br /&gt;
| void SleepThread(s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0xB &lt;br /&gt;
| Result GetThreadPriority(s32* priority, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| Result SetThreadPriority(Handle thread, s32 priority)&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| Result GetThreadAffinityMask(u8* affinitymask, Handle thread, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| Result SetThreadAffinityMask(Handle thread, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xF &lt;br /&gt;
| Result GetThreadIdealProcessor(s32* processorid, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 &lt;br /&gt;
| Result SetThreadIdealProcessor(Handle thread, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 &lt;br /&gt;
| s32 GetCurrentProcessorNumber(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 &lt;br /&gt;
| Result Run(Handle process, StartupInfo* info) (This starts the main() thread. Buf+0 is main-thread priority, Buf+4 is main-thread stack-size.)&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 &lt;br /&gt;
| Result CreateMutex(Handle* mutex, bool initialLocked)&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 &lt;br /&gt;
| Result ReleaseMutex(Handle mutex)&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 &lt;br /&gt;
| Result CreateSemaphore(Handle* semaphore, s32 initialCount, s32 maxCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 &lt;br /&gt;
| Result ReleaseSemaphore(s32* count, Handle semaphore, s32 releaseCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 &lt;br /&gt;
| Result CreateEvent(Handle* event, ResetType resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 &lt;br /&gt;
| Result SignalEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 &lt;br /&gt;
| Result ClearEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A &lt;br /&gt;
| Result CreateTimer(Handle* timer, ResetType resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B &lt;br /&gt;
| Result SetTimer(Handle timer, s64 initial, s64 interval)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C &lt;br /&gt;
| Result CancelTimer(Handle timer)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D &lt;br /&gt;
| Result ClearTimer(Handle timer)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E &lt;br /&gt;
| Result CreateMemoryBlock(Handle* memblock, u32 memory, u32 size, u32 mypermission, u32 otherpermission)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F &lt;br /&gt;
| Result MapMemoryBlock(Handle memblock, u32 addr, u32 mypermissions, u32 otherpermission)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 &lt;br /&gt;
| Result UnmapMemoryBlock(Handle memblock, u32 addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 &lt;br /&gt;
| Result CreateAddressArbiter(Handle* arbiter)&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 &lt;br /&gt;
| Result ArbitrateAddress(Handle arbiter, u32 addr, ArbitrationType type, s32 value)&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 &lt;br /&gt;
| Result CloseHandle(Handle handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 &lt;br /&gt;
| Result WaitSynchronization1(Handle handle, s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 &lt;br /&gt;
| Result WaitSynchronizationN(s32* out, Handle* handles, s32 handlecount, bool waitAll, s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 &lt;br /&gt;
| Result SignalAndWait(s32* out, Handle signal, Handle* handles, s32 handleCount, bool waitAll, s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 &lt;br /&gt;
| Result DuplicateHandle(Handle* out, Handle original)&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 &lt;br /&gt;
| s64 GetSystemTick(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 &lt;br /&gt;
| Result GetHandleInfo(s64* out, Handle handle, HandleInfoType type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A &lt;br /&gt;
| Result GetSystemInfo(s64* out, SystemInfoType type, s32 param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B &lt;br /&gt;
| Result GetProcessInfo(s64* out, Handle process, ProcessInfoType type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C &lt;br /&gt;
| Result GetThreadInfo(s64* out, Handle thread, ThreadInfoType type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D &lt;br /&gt;
| Result ConnectToPort(Handle* out, const char* portName)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E &lt;br /&gt;
| Result SendSyncRequest1(Handle session) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F &lt;br /&gt;
| Result SendSyncRequest2(Handle session) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 &lt;br /&gt;
| Result SendSyncRequest3(Handle session) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 &lt;br /&gt;
| Result SendSyncRequest4(Handle session) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 &lt;br /&gt;
| Result SendSyncRequest(Handle session)&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 &lt;br /&gt;
| Result OpenProcess(Handle* process, u32 processId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 &lt;br /&gt;
| Result OpenThread(Handle* thread, Handle process, u32 threadId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x35 &lt;br /&gt;
| Result GetProcessId(u32* processId, Handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 &lt;br /&gt;
| Result GetProcessIdOfThread(u32* processId, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x37 &lt;br /&gt;
| Result GetThreadId(u32* threadId, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 &lt;br /&gt;
| Result GetResourceLimit(Handle* resourceLimit, Handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x39 &lt;br /&gt;
| Result GetResourceLimitLimitValues(s64* values, Handle resourceLimit, LimitableResource* names, s32 nameCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A &lt;br /&gt;
| Result GetResourceLimitCurrentValues(s64* values, Handle resourceLimit, LimitableResource* names, s32 nameCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B &lt;br /&gt;
| Result GetThreadContext(ThreadContext* context, Handle thread) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C &lt;br /&gt;
| Break(BreakReason)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D &lt;br /&gt;
| OutputDebugString(void const, int) (Does nothing on non-debug units)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E &lt;br /&gt;
| ControlPerformanceCounter(unsigned long long, int, unsigned int, unsigned long long)&lt;br /&gt;
|-&lt;br /&gt;
| 0x47 &lt;br /&gt;
| Result CreatePort(Handle* portServer, Handle* portClient,  const char* name, s32 maxSessions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 &lt;br /&gt;
| Result CreateSessionToPort(Handle* session, Handle port)&lt;br /&gt;
|-&lt;br /&gt;
| 0x49 &lt;br /&gt;
| Result CreateSession(Handle* sessionServer, Handle* sessionClient)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A &lt;br /&gt;
| Result AcceptSession(Handle* session, Handle port)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B &lt;br /&gt;
| Result ReplyAndReceive1(s32* index, Handle* handles, s32 handleCount, Handle replyTarget) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C &lt;br /&gt;
| Result ReplyAndReceive2(s32* index, Handle* handles, s32 handleCount, Handle replyTarget) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4D &lt;br /&gt;
| Result ReplyAndReceive3(s32* index, Handle* handles, s32 handleCount, Handle replyTarget) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E &lt;br /&gt;
| Result ReplyAndReceive4(s32* index, Handle* handles, s32 handleCount, Handle replyTarget) (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F &lt;br /&gt;
| Result ReplyAndReceive(s32* index, Handle* handles, s32 handleCount, Handle replyTarget)&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 &lt;br /&gt;
| BindInterrupt(Interrupt, Handle, int, bool)&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 &lt;br /&gt;
| UnbindInterrupt(Interrupt, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 &lt;br /&gt;
| InvalidateProcessDataCache(Handle, void*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 &lt;br /&gt;
| StoreProcessDataCache(Handle process, void const* addr, unsigned int size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 &lt;br /&gt;
| FlushProcessDataCache(Handle, void const*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 &lt;br /&gt;
| StartInterProcessDma(Handle* out, Handle dstProcess, void* dst, Handle srcProcess, const void* src, size_t size, const DmaConfig&amp;amp; config )&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 &lt;br /&gt;
| StopDma(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 &lt;br /&gt;
| GetDmaState(DmaState*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| RestartDma(nn::Handle, void *, void  const*, unsigned int, signed char)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 &lt;br /&gt;
| DebugActiveProcess(Handle *KDebug, unsigned int ProcessID)&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 &lt;br /&gt;
| BreakDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 &lt;br /&gt;
| TerminateDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 &lt;br /&gt;
| GetProcessDebugEvent(DebugEventInfo*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 &lt;br /&gt;
| ContinueDebugEvent(Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 &lt;br /&gt;
| GetProcessList(int *TotalPIDs, unsigned int *PIDs, int MaxPIDs)&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 &lt;br /&gt;
| GetThreadList(int*, unsigned int*, int, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 &lt;br /&gt;
| GetDebugThreadContext(ThreadContext*, Handle, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 &lt;br /&gt;
| SetDebugThreadContext(Handle, unsigned int, ThreadContext const&amp;amp;, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x69 &lt;br /&gt;
| QueryDebugProcessMemory(MemoryInfo*, PageInfo*, Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A &lt;br /&gt;
| ReadProcessMemory(void* Buffer, Handle KDebug, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B &lt;br /&gt;
| WriteProcessMemory(Handle KDebug, void const* Buffer, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C &lt;br /&gt;
| SetHardwareBreakPoint(int, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D&lt;br /&gt;
| GetDebugThreadParam(long long *, int *, nn::Handle, unsigned int, nn::dmnt::DebugThreadParam) (Disabled on regular kernel)&lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| ControlProcessMemory(Handle KProcess, unsigned int Addr0, unsigned int Addr1, unsigned int Size, unsigned int Type, unsigned int Permissions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x71&lt;br /&gt;
| MapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x72&lt;br /&gt;
| UnmapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x73&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| Stubbed on regular kernel&lt;br /&gt;
|-&lt;br /&gt;
| 0x75&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x76&lt;br /&gt;
| TerminateProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x77&lt;br /&gt;
| (Handle KProcess, Handle KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| CreateResourceLimit(Handle *KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x79&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A&lt;br /&gt;
| DisableExecuteNever(unsigned int Addr, unsigned int Size) (Stubbed for regular kernel beginning with [[2.0.0-2]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C&lt;br /&gt;
| KernelSetState(unsigned int Type, unsigned int Param0, unsigned int Param1, unsigned int Param2) (The Type determines the usage of each param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D&lt;br /&gt;
| QueryProcessMemory(MemInfo *Info, unsigned int *Out, Handle KProcess, unsigned int Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0xFF&lt;br /&gt;
| Debug related (The Syscall access control mask doesn&#039;t apply for this SVC)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Types and structures =&lt;br /&gt;
&lt;br /&gt;
== enum MemoryState ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory state flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| RESERVED&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| IO&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| STATIC&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| CODE&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| PRIVATE&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| SHARED&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| CONTINUOUS&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| ALIASED&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS&lt;br /&gt;
| 9&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS CODE&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 11&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum PageFlags ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Page flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| CHANGED&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryOperation ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory operation&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| RESERVE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| COMMIT&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| MAP&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| UNMAP&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| PROTECT&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| REGION APP&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| REGION SYSTEM&lt;br /&gt;
| 0x200&lt;br /&gt;
|-&lt;br /&gt;
| REGION BASE&lt;br /&gt;
| 0x300&lt;br /&gt;
|-&lt;br /&gt;
| LINEAR&lt;br /&gt;
| 0x1000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryPermission ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory permission&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| NONE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| READ&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| WRITE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| READWRITE&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| DONTCARE&lt;br /&gt;
| 0x10000000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== enum ResetType ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Reset type&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| ONESHOT&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| STICKY&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| PULSE&lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct MemoryInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Base address&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Permission&lt;br /&gt;
|-&lt;br /&gt;
| enum MemoryState&lt;br /&gt;
| State&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct PageInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Flags&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct StartupInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| Priority&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Stack size&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| argc&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| argv&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| envp&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Processes =&lt;br /&gt;
Each process can only use SVCs which are enabled in the [[NCCH#CXI|exheader]] for this process. The ARM11 kernel SVC handler checks whether the SVC is enabled in the syscall access control mask stored on the SVC-mode stack, when the SVC isn&#039;t enabled a kernelpanic() is triggered. Each process has a separate SVC-mode stack, this stack and the syscall access mask stored here is initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of this table is stored in the exheader. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for the current KThread.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
= Threads =&lt;br /&gt;
For svcCreateThread the input address used for Entrypoint_Param and StackTop are normally the same, however these can be arbitrary. For the main thread the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread.&lt;br /&gt;
&lt;br /&gt;
= Memory Mapping =&lt;br /&gt;
ControlMemory and MapMemoryBlock can be used to map memory pages, these two SVCs only support mapping execute-never R/W pages. The input permissions parameter for these SVCs must be &amp;lt;=3, where value zero is used when un-mapping memory. Bitmask 0xf00 for ControlMemory parameter MemoryType is the memory-type, when this is zero the memory-type is loaded from the kernel flags stored in the exheader ARM11 kernel descriptors, for the process using the SVC. ControlMemory parameter MemoryType with value 0x10003 is used for mapping the GSP [[Memory_layout|heap]]. The low 8-bits are the type: 1 is for un-mapping memory, 3 for mapping memory. Type4 is used to mirror the RW memory at Addr1, to Addr0. Type4 will return an error if Addr1 is located in read-only memory. Addr1 is not used for type1 and type3.&lt;br /&gt;
&lt;br /&gt;
ControlProcessMemory maps memory in the specified process, this is the only SVC which allows mapping executable memory. Format of the permissions field for memory mapping SVCs: bit0=R, bit1=W, bit2=X. Type6 sets the Addr0 memory permissions to the input permissions, for already mapped memory.&lt;br /&gt;
&lt;br /&gt;
MapProcessMemory maps RW memory starting at address 0x00100000 in the specified KProcess, at the specified StartAddr in the current process. MapProcessMemory then maps 0x08000000 in the specified process, to StartAddr+0x7f00000 in the current process. UnmapProcessMemory unmaps the memory which was mapped by MapProcessMemory.&lt;br /&gt;
&lt;br /&gt;
= Debugging =&lt;br /&gt;
DebugActiveProcess is used to attach to a process for debugging. This SVC can only be used when the target process&#039; ARM11 descriptors stored in the exheader have the kernel flag for &amp;quot;Enable debug&amp;quot; set. Otherwise when that flag is clear, the kernel flags for the process using this SVC must have the &amp;quot;Force debug&amp;quot; flag set.&lt;br /&gt;
&lt;br /&gt;
= KernelSetState =&lt;br /&gt;
Type0 initializes the programID for launching [[FIRM]], then triggers launching [[FIRM]]. Param0 and Param2 are unused. Param1 is the programID-low, and the programID-high is 0x00040138.&lt;br /&gt;
&lt;br /&gt;
Type3 is used for initializing the 0x1000-byte buffer used by the launched [[FIRM]]. Param2 is unused. When Param0 is value 1, this buffer is copied to the beginning of FCRAM at 0xF0000000, and Param1 is unused. When Param0 is value 0, this kernel buffer is mapped to process address Param1.&lt;br /&gt;
&lt;br /&gt;
= GetSystemInfo =&lt;br /&gt;
Type0 value 26(Type1 is unused) writes the total number of processes which were directly launched by the kernel, to Output. For the NATIVE_FIRM/SAFE_MODE_FIRM ARM11 kernel, this is normally 5, for processes sm, fs, pm, loader, and pxi.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=5008</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=5008"/>
		<updated>2013-02-22T02:12:59Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= System calls =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Id&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 &lt;br /&gt;
| Result ControlMemory(u32* outaddr, u32 addr0, u32 addr1, u32 size, u32 operation, u32 permissions) (outaddr is usually the same as the input addr0)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 &lt;br /&gt;
| Result  QueryMemory(MemoryInfo* info, PageInfo* out, u32 Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 &lt;br /&gt;
| void ExitProcess(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 &lt;br /&gt;
| Result  GetProcessAffinityMask(u8* affinitymask, Handle process, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 &lt;br /&gt;
| Result SetProcessAffinityMask(Handle process, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 &lt;br /&gt;
| Result GetProcessIdealProcessor(s32 *idealprocessor, Handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 &lt;br /&gt;
| Result SetProcessIdealProcessor(Handle process, s32 idealprocessor)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| Result CreateThread(Handle* thread, func entrypoint, u32 arg, u32 stacktop, s32 threadpriority, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9 &lt;br /&gt;
| void ExitThread(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0xA &lt;br /&gt;
| void SleepThread(s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0xB &lt;br /&gt;
| Result GetThreadPriority(s32* priority, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| Result SetThreadPriority(Handle thread, s32 priority)&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| Result GetThreadAffinityMask(u8* affinitymask, Handle thread, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| Result SetThreadAffinityMask(Handle thread, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xF &lt;br /&gt;
| Result GetThreadIdealProcessor(s32* processorid, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 &lt;br /&gt;
| Result SetThreadIdealProcessor(Handle thread, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 &lt;br /&gt;
| s32 GetCurrentProcessorNumber(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 &lt;br /&gt;
| Result Run(Handle process, StartupInfo* info) (This starts the main() thread. Buf+0 is main-thread priority, Buf+4 is main-thread stack-size.)&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 &lt;br /&gt;
| Result CreateMutex(Handle* mutex, bool initialLocked)&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 &lt;br /&gt;
| Result ReleaseMutex(Handle mutex)&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 &lt;br /&gt;
| Result CreateSemaphore(Handle* semaphore, s32 initialCount, s32 maxCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 &lt;br /&gt;
| Result ReleaseSemaphore(s32* count, Handle semaphore, s32 releaseCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 &lt;br /&gt;
| Result CreateEvent(Handle* event, ResetType resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 &lt;br /&gt;
| Result SignalEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 &lt;br /&gt;
| Result ClearEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A &lt;br /&gt;
| Result CreateTimer(Handle* timer, ResetType resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B &lt;br /&gt;
| Result SetTimer(Handle timer, s64 initial, s64 interval)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C &lt;br /&gt;
| Result CancelTimer(Handle timer)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D &lt;br /&gt;
| Result ClearTimer(Handle timer)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E &lt;br /&gt;
| Result CreateMemoryBlock(Handle* memblock, u32 memory, u32 size, u32 mypermission, u32 otherpermission)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F &lt;br /&gt;
| Result MapMemoryBlock(Handle memblock, u32 addr, u32 mypermissions, u32 otherpermission)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 &lt;br /&gt;
| Result UnmapMemoryBlock(Handle memblock, u32 addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 &lt;br /&gt;
| Result CreateAddressArbiter(Handle* arbiter)&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 &lt;br /&gt;
| Result ArbitrateAddress(Handle arbiter, u32 addr, ArbitrationType type, s32 value)&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 &lt;br /&gt;
| Result CloseHandle(Handle handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 &lt;br /&gt;
| Result WaitSynchronization1(Handle handle, s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 &lt;br /&gt;
| Result WaitSynchronizationN(s32* out, Handle* handles, s32 handlecount, bool waitAll, s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 &lt;br /&gt;
| Result SignalAndWait(s32* out, Handle signal, Handle* handles, s32 handleCount, bool waitAll, s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 &lt;br /&gt;
| Result DuplicateHandle(Handle* out, Handle original)&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 &lt;br /&gt;
| s64 GetSystemTick(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 &lt;br /&gt;
| Result GetHandleInfo(s64* out, Handle handle, HandleInfoType type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A &lt;br /&gt;
| Result GetSystemInfo(s64* out, SystemInfoType type, s32 param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B &lt;br /&gt;
| Result GetProcessInfo(s64* out, Handle process, ProcessInfoType type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C &lt;br /&gt;
| Result GetThreadInfo(s64* out, Handle thread, ThreadInfoType type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D &lt;br /&gt;
| Result ConnectToPort(Handle* out, const char* portName)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E &lt;br /&gt;
| SendSyncRequest1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F &lt;br /&gt;
| SendSyncRequest2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 &lt;br /&gt;
| SendSyncRequest3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 &lt;br /&gt;
| SendSyncRequest4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 &lt;br /&gt;
| SendSyncRequest(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 &lt;br /&gt;
| OpenProcess(Handle *KProcess, unsigned int ProcessId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 &lt;br /&gt;
| OpenThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x35 &lt;br /&gt;
| GetProcessId(unsigned int *ProcessId, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 &lt;br /&gt;
| GetProcessIdOfThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x37 &lt;br /&gt;
| GetThreadId&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 &lt;br /&gt;
| GetResourceLimit(Handle*, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x39 &lt;br /&gt;
| GetResourceLimitLimitValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A &lt;br /&gt;
| GetResourceLimitCurrentValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B &lt;br /&gt;
| GetThreadContext (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C &lt;br /&gt;
| Break(BreakReason)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D &lt;br /&gt;
| OutputDebugString(void const, int) (Does nothing on non-debug units)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E &lt;br /&gt;
| ControlPerformanceCounter(unsigned long long, int, unsigned int, unsigned long long)&lt;br /&gt;
|-&lt;br /&gt;
| 0x47 &lt;br /&gt;
| CreatePort&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 &lt;br /&gt;
| CreateSessionToPort&lt;br /&gt;
|-&lt;br /&gt;
| 0x49 &lt;br /&gt;
| CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A &lt;br /&gt;
| AcceptSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B &lt;br /&gt;
| ReplyAndReceive1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C &lt;br /&gt;
| ReplyAndReceive2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4D &lt;br /&gt;
| ReplyAndReceive3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E &lt;br /&gt;
| ReplyAndReceive4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F &lt;br /&gt;
| ReplyAndReceive&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 &lt;br /&gt;
| BindInterrupt(Interrupt, Handle, int, bool)&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 &lt;br /&gt;
| UnbindInterrupt(Interrupt, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 &lt;br /&gt;
| InvalidateProcessDataCache(Handle, void*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 &lt;br /&gt;
| StoreProcessDataCache(Handle process, void const* addr, unsigned int size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 &lt;br /&gt;
| FlushProcessDataCache(Handle, void const*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 &lt;br /&gt;
| StartInterProcessDma(Handle* out, Handle dstProcess, void* dst, Handle srcProcess, const void* src, size_t size, const DmaConfig&amp;amp; config )&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 &lt;br /&gt;
| StopDma(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 &lt;br /&gt;
| GetDmaState(DmaState*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| RestartDma(nn::Handle, void *, void  const*, unsigned int, signed char)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 &lt;br /&gt;
| DebugActiveProcess(Handle *KDebug, unsigned int ProcessID)&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 &lt;br /&gt;
| BreakDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 &lt;br /&gt;
| TerminateDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 &lt;br /&gt;
| GetProcessDebugEvent(DebugEventInfo*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 &lt;br /&gt;
| ContinueDebugEvent(Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 &lt;br /&gt;
| GetProcessList(int *TotalPIDs, unsigned int *PIDs, int MaxPIDs)&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 &lt;br /&gt;
| GetThreadList(int*, unsigned int*, int, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 &lt;br /&gt;
| GetDebugThreadContext(ThreadContext*, Handle, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 &lt;br /&gt;
| SetDebugThreadContext(Handle, unsigned int, ThreadContext const&amp;amp;, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x69 &lt;br /&gt;
| QueryDebugProcessMemory(MemoryInfo*, PageInfo*, Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A &lt;br /&gt;
| ReadProcessMemory(void* Buffer, Handle KDebug, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B &lt;br /&gt;
| WriteProcessMemory(Handle KDebug, void const* Buffer, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C &lt;br /&gt;
| SetHardwareBreakPoint(int, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D&lt;br /&gt;
| GetDebugThreadParam(long long *, int *, nn::Handle, unsigned int, nn::dmnt::DebugThreadParam) (Disabled on regular kernel)&lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| ControlProcessMemory(Handle KProcess, unsigned int Addr0, unsigned int Addr1, unsigned int Size, unsigned int Type, unsigned int Permissions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x71&lt;br /&gt;
| MapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x72&lt;br /&gt;
| UnmapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x73&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| Stubbed on regular kernel&lt;br /&gt;
|-&lt;br /&gt;
| 0x75&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x76&lt;br /&gt;
| TerminateProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x77&lt;br /&gt;
| (Handle KProcess, Handle KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| CreateResourceLimit(Handle *KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x79&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A&lt;br /&gt;
| DisableExecuteNever(unsigned int Addr, unsigned int Size) (Stubbed for regular kernel beginning with [[2.0.0-2]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C&lt;br /&gt;
| KernelSetState(unsigned int Type, unsigned int Param0, unsigned int Param1, unsigned int Param2) (The Type determines the usage of each param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D&lt;br /&gt;
| QueryProcessMemory(MemInfo *Info, unsigned int *Out, Handle KProcess, unsigned int Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0xFF&lt;br /&gt;
| Debug related (The Syscall access control mask doesn&#039;t apply for this SVC)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Types and structures =&lt;br /&gt;
&lt;br /&gt;
== enum MemoryState ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory state flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| RESERVED&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| IO&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| STATIC&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| CODE&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| PRIVATE&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| SHARED&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| CONTINUOUS&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| ALIASED&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS&lt;br /&gt;
| 9&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS CODE&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 11&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum PageFlags ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Page flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| CHANGED&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryOperation ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory operation&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| RESERVE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| COMMIT&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| MAP&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| UNMAP&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| PROTECT&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| REGION APP&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| REGION SYSTEM&lt;br /&gt;
| 0x200&lt;br /&gt;
|-&lt;br /&gt;
| REGION BASE&lt;br /&gt;
| 0x300&lt;br /&gt;
|-&lt;br /&gt;
| LINEAR&lt;br /&gt;
| 0x1000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryPermission ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory permission&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| NONE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| READ&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| WRITE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| READWRITE&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| DONTCARE&lt;br /&gt;
| 0x10000000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== enum ResetType ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Reset type&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| ONESHOT&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| STICKY&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| PULSE&lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct MemoryInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Base address&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Permission&lt;br /&gt;
|-&lt;br /&gt;
| enum MemoryState&lt;br /&gt;
| State&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct PageInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Flags&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct StartupInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| Priority&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Stack size&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| argc&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| argv&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| envp&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Processes =&lt;br /&gt;
Each process can only use SVCs which are enabled in the [[NCCH#CXI|exheader]] for this process. The ARM11 kernel SVC handler checks whether the SVC is enabled in the syscall access control mask stored on the SVC-mode stack, when the SVC isn&#039;t enabled a kernelpanic() is triggered. Each process has a separate SVC-mode stack, this stack and the syscall access mask stored here is initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of this table is stored in the exheader. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for the current KThread.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
= Threads =&lt;br /&gt;
For svcCreateThread the input address used for Entrypoint_Param and StackTop are normally the same, however these can be arbitrary. For the main thread the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread.&lt;br /&gt;
&lt;br /&gt;
= Memory Mapping =&lt;br /&gt;
ControlMemory and MapMemoryBlock can be used to map memory pages, these two SVCs only support mapping execute-never R/W pages. The input permissions parameter for these SVCs must be &amp;lt;=3, where value zero is used when un-mapping memory. Bitmask 0xf00 for ControlMemory parameter MemoryType is the memory-type, when this is zero the memory-type is loaded from the kernel flags stored in the exheader ARM11 kernel descriptors, for the process using the SVC. ControlMemory parameter MemoryType with value 0x10003 is used for mapping the GSP [[Memory_layout|heap]]. The low 8-bits are the type: 1 is for un-mapping memory, 3 for mapping memory. Type4 is used to mirror the RW memory at Addr1, to Addr0. Type4 will return an error if Addr1 is located in read-only memory. Addr1 is not used for type1 and type3.&lt;br /&gt;
&lt;br /&gt;
ControlProcessMemory maps memory in the specified process, this is the only SVC which allows mapping executable memory. Format of the permissions field for memory mapping SVCs: bit0=R, bit1=W, bit2=X. Type6 sets the Addr0 memory permissions to the input permissions, for already mapped memory.&lt;br /&gt;
&lt;br /&gt;
MapProcessMemory maps RW memory starting at address 0x00100000 in the specified KProcess, at the specified StartAddr in the current process. MapProcessMemory then maps 0x08000000 in the specified process, to StartAddr+0x7f00000 in the current process. UnmapProcessMemory unmaps the memory which was mapped by MapProcessMemory.&lt;br /&gt;
&lt;br /&gt;
= Debugging =&lt;br /&gt;
DebugActiveProcess is used to attach to a process for debugging. This SVC can only be used when the target process&#039; ARM11 descriptors stored in the exheader have the kernel flag for &amp;quot;Enable debug&amp;quot; set. Otherwise when that flag is clear, the kernel flags for the process using this SVC must have the &amp;quot;Force debug&amp;quot; flag set.&lt;br /&gt;
&lt;br /&gt;
= KernelSetState =&lt;br /&gt;
Type0 initializes the programID for launching [[FIRM]], then triggers launching [[FIRM]]. Param0 and Param2 are unused. Param1 is the programID-low, and the programID-high is 0x00040138.&lt;br /&gt;
&lt;br /&gt;
Type3 is used for initializing the 0x1000-byte buffer used by the launched [[FIRM]]. Param2 is unused. When Param0 is value 1, this buffer is copied to the beginning of FCRAM at 0xF0000000, and Param1 is unused. When Param0 is value 0, this kernel buffer is mapped to process address Param1.&lt;br /&gt;
&lt;br /&gt;
= GetSystemInfo =&lt;br /&gt;
Type0 value 26(Type1 is unused) writes the total number of processes which were directly launched by the kernel, to Output. For the NATIVE_FIRM/SAFE_MODE_FIRM ARM11 kernel, this is normally 5, for processes sm, fs, pm, loader, and pxi.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4999</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4999"/>
		<updated>2013-02-21T01:08:18Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= System calls =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Id&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 &lt;br /&gt;
| ControlMemory(u32* outaddr, u32 addr0, u32 addr1, u32 size, u32 operation, u32 permissions) (outaddr is usually the same as the input addr0)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 &lt;br /&gt;
| QueryMemory(MemoryInfo* info, PageInfo* out, u32 Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 &lt;br /&gt;
| ExitProcess(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 &lt;br /&gt;
| GetProcessAffinityMask(u8* affinitymask, Handle process, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 &lt;br /&gt;
| SetProcessAffinityMask(Handle process, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 &lt;br /&gt;
| GetProcessIdealProcessor(s32 *idealprocessor, Handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 &lt;br /&gt;
| SetProcessIdealProcessor(Handle process, s32 idealprocessor)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| CreateThread(Handle* thread, func entrypoint, u32 arg, u32 stacktop, s32 threadpriority, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9 &lt;br /&gt;
| ExitThread(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0xA &lt;br /&gt;
| SleepThread(s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0xB &lt;br /&gt;
| GetThreadPriority(s32* priority, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| SetThreadPriority(Handle thread, s32 priority)&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| GetThreadAffinityMask(u8* affinitymask, Handle thread, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| SetThreadAffinityMask(Handle thread, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xF &lt;br /&gt;
| GetThreadIdealProcessor(s32* processorid, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 &lt;br /&gt;
| SetThreadIdealProcessor(Handle thread, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 &lt;br /&gt;
| GetCurrentProcessorNumber(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 &lt;br /&gt;
| Run(Handle process, StartupInfo* info) (This starts the main() thread. Buf+0 is main-thread priority, Buf+4 is main-thread stack-size.)&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 &lt;br /&gt;
| CreateMutex(Handle* mutex, bool initialLocked)&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 &lt;br /&gt;
| ReleaseMutex(Handle mutex)&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 &lt;br /&gt;
| CreateSemaphore(Handle* semaphore, s32 initialCount, s32 maxCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 &lt;br /&gt;
| ReleaseSemaphore(s32* count, Handle semaphore, s32 releaseCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 &lt;br /&gt;
| CreateEvent(Handle* event, ResetType resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 &lt;br /&gt;
| SignalEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 &lt;br /&gt;
| ClearEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A &lt;br /&gt;
| CreateTimer(Handle* timer, ResetType resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B &lt;br /&gt;
| SetTimer(Handle timer, s64 initial, s64 interval)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C &lt;br /&gt;
| CancelTimer(Handle timer)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D &lt;br /&gt;
| ClearTimer(Handle timer)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E &lt;br /&gt;
| CreateMemoryBlock(Handle* memblock, u32 memory, u32 size, u32 mypermission, u32 otherpermission)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F &lt;br /&gt;
| MapMemoryBlock(Handle memblock, u32 addr, u32 mypermissions, u32 otherpermission)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 &lt;br /&gt;
| UnmapMemoryBlock(Handle memblock, u32 addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 &lt;br /&gt;
| CreateAddressArbiter(Handle* arbiter)&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 &lt;br /&gt;
| ArbitrateAddress(Handle arbiter, u32 addr, ArbitrationType type, s32 value)&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 &lt;br /&gt;
| CloseHandle(Handle handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 &lt;br /&gt;
| WaitSynchronization1(Handle handle, s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 &lt;br /&gt;
| WaitSynchronizationN(s32* out, Handle* handles, s32 handlecount, bool waitAll, s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 &lt;br /&gt;
| SignalAndWait&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 &lt;br /&gt;
| DuplicateHandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 &lt;br /&gt;
| GetSystemTick&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 &lt;br /&gt;
| GetHandleInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A &lt;br /&gt;
| GetSystemInfo(unsigned long long *Output, unsigned int Type0, unsigned int Type1)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B &lt;br /&gt;
| GetProcessInfo(unsigned long long *Output, Handle KProcess, unsigned int Type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C &lt;br /&gt;
| GetThreadInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D &lt;br /&gt;
| ConnectToPort(Handle*, char *PortName)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E &lt;br /&gt;
| SendSyncRequest1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F &lt;br /&gt;
| SendSyncRequest2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 &lt;br /&gt;
| SendSyncRequest3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 &lt;br /&gt;
| SendSyncRequest4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 &lt;br /&gt;
| SendSyncRequest(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 &lt;br /&gt;
| OpenProcess(Handle *KProcess, unsigned int ProcessId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 &lt;br /&gt;
| OpenThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x35 &lt;br /&gt;
| GetProcessId(unsigned int *ProcessId, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 &lt;br /&gt;
| GetProcessIdOfThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x37 &lt;br /&gt;
| GetThreadId&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 &lt;br /&gt;
| GetResourceLimit(Handle*, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x39 &lt;br /&gt;
| GetResourceLimitLimitValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A &lt;br /&gt;
| GetResourceLimitCurrentValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B &lt;br /&gt;
| GetThreadContext (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C &lt;br /&gt;
| Break(BreakReason)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D &lt;br /&gt;
| OutputDebugString(void const, int) (Does nothing on non-debug units)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E &lt;br /&gt;
| ControlPerformanceCounter(unsigned long long, int, unsigned int, unsigned long long)&lt;br /&gt;
|-&lt;br /&gt;
| 0x47 &lt;br /&gt;
| CreatePort&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 &lt;br /&gt;
| CreateSessionToPort&lt;br /&gt;
|-&lt;br /&gt;
| 0x49 &lt;br /&gt;
| CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A &lt;br /&gt;
| AcceptSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B &lt;br /&gt;
| ReplyAndReceive1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C &lt;br /&gt;
| ReplyAndReceive2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4D &lt;br /&gt;
| ReplyAndReceive3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E &lt;br /&gt;
| ReplyAndReceive4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F &lt;br /&gt;
| ReplyAndReceive&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 &lt;br /&gt;
| BindInterrupt(Interrupt, Handle, int, bool)&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 &lt;br /&gt;
| UnbindInterrupt(Interrupt, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 &lt;br /&gt;
| InvalidateProcessDataCache(Handle, void*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 &lt;br /&gt;
| StoreProcessDataCache(Handle process, void const* addr, unsigned int size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 &lt;br /&gt;
| FlushProcessDataCache(Handle, void const*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 &lt;br /&gt;
| StartInterProcessDma(Handle* out, Handle dstProcess, void* dst, Handle srcProcess, const void* src, size_t size, const DmaConfig&amp;amp; config )&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 &lt;br /&gt;
| StopDma(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 &lt;br /&gt;
| GetDmaState(DmaState*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| RestartDma(nn::Handle, void *, void  const*, unsigned int, signed char)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 &lt;br /&gt;
| DebugActiveProcess(Handle *KDebug, unsigned int ProcessID)&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 &lt;br /&gt;
| BreakDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 &lt;br /&gt;
| TerminateDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 &lt;br /&gt;
| GetProcessDebugEvent(DebugEventInfo*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 &lt;br /&gt;
| ContinueDebugEvent(Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 &lt;br /&gt;
| GetProcessList(int *TotalPIDs, unsigned int *PIDs, int MaxPIDs)&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 &lt;br /&gt;
| GetThreadList(int*, unsigned int*, int, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 &lt;br /&gt;
| GetDebugThreadContext(ThreadContext*, Handle, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 &lt;br /&gt;
| SetDebugThreadContext(Handle, unsigned int, ThreadContext const&amp;amp;, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x69 &lt;br /&gt;
| QueryDebugProcessMemory(MemoryInfo*, PageInfo*, Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A &lt;br /&gt;
| ReadProcessMemory(void* Buffer, Handle KDebug, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B &lt;br /&gt;
| WriteProcessMemory(Handle KDebug, void const* Buffer, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C &lt;br /&gt;
| SetHardwareBreakPoint(int, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D&lt;br /&gt;
| GetDebugThreadParam(long long *, int *, nn::Handle, unsigned int, nn::dmnt::DebugThreadParam) (Disabled on regular kernel)&lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| ControlProcessMemory(Handle KProcess, unsigned int Addr0, unsigned int Addr1, unsigned int Size, unsigned int Type, unsigned int Permissions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x71&lt;br /&gt;
| MapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x72&lt;br /&gt;
| UnmapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x73&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| Stubbed on regular kernel&lt;br /&gt;
|-&lt;br /&gt;
| 0x75&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x76&lt;br /&gt;
| TerminateProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x77&lt;br /&gt;
| (Handle KProcess, Handle KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| CreateResourceLimit(Handle *KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x79&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A&lt;br /&gt;
| DisableExecuteNever(unsigned int Addr, unsigned int Size) (Stubbed for regular kernel beginning with [[2.0.0-2]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C&lt;br /&gt;
| KernelSetState(unsigned int Type, unsigned int Param0, unsigned int Param1, unsigned int Param2) (The Type determines the usage of each param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D&lt;br /&gt;
| QueryProcessMemory(MemInfo *Info, unsigned int *Out, Handle KProcess, unsigned int Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0xFF&lt;br /&gt;
| Debug related (The Syscall access control mask doesn&#039;t apply for this SVC)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Types and structures =&lt;br /&gt;
&lt;br /&gt;
== enum MemoryState ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory state flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| RESERVED&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| IO&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| STATIC&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| CODE&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| PRIVATE&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| SHARED&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| CONTINUOUS&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| ALIASED&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS&lt;br /&gt;
| 9&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS CODE&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 11&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum PageFlags ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Page flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| CHANGED&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryOperation ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory operation&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| RESERVE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| COMMIT&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| MAP&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| UNMAP&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| PROTECT&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| REGION APP&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| REGION SYSTEM&lt;br /&gt;
| 0x200&lt;br /&gt;
|-&lt;br /&gt;
| REGION BASE&lt;br /&gt;
| 0x300&lt;br /&gt;
|-&lt;br /&gt;
| LINEAR&lt;br /&gt;
| 0x1000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryPermission ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory permission&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| NONE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| READ&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| WRITE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| READWRITE&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| DONTCARE&lt;br /&gt;
| 0x10000000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== enum ResetType ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Reset type&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| ONESHOT&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| STICKY&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| PULSE&lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct MemoryInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Base address&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Permission&lt;br /&gt;
|-&lt;br /&gt;
| enum MemoryState&lt;br /&gt;
| State&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct PageInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Flags&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct StartupInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| Priority&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Stack size&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| argc&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| argv&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| envp&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Processes =&lt;br /&gt;
Each process can only use SVCs which are enabled in the [[NCCH#CXI|exheader]] for this process. The ARM11 kernel SVC handler checks whether the SVC is enabled in the syscall access control mask stored on the SVC-mode stack, when the SVC isn&#039;t enabled a kernelpanic() is triggered. Each process has a separate SVC-mode stack, this stack and the syscall access mask stored here is initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of this table is stored in the exheader. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for the current KThread.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
= Threads =&lt;br /&gt;
For svcCreateThread the input address used for Entrypoint_Param and StackTop are normally the same, however these can be arbitrary. For the main thread the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread.&lt;br /&gt;
&lt;br /&gt;
= Memory Mapping =&lt;br /&gt;
ControlMemory and MapMemoryBlock can be used to map memory pages, these two SVCs only support mapping execute-never R/W pages. The input permissions parameter for these SVCs must be &amp;lt;=3, where value zero is used when un-mapping memory. Bitmask 0xf00 for ControlMemory parameter MemoryType is the memory-type, when this is zero the memory-type is loaded from the kernel flags stored in the exheader ARM11 kernel descriptors, for the process using the SVC. ControlMemory parameter MemoryType with value 0x10003 is used for mapping the GSP [[Memory_layout|heap]]. The low 8-bits are the type: 1 is for un-mapping memory, 3 for mapping memory. Type4 is used to mirror the RW memory at Addr1, to Addr0. Type4 will return an error if Addr1 is located in read-only memory. Addr1 is not used for type1 and type3.&lt;br /&gt;
&lt;br /&gt;
ControlProcessMemory maps memory in the specified process, this is the only SVC which allows mapping executable memory. Format of the permissions field for memory mapping SVCs: bit0=R, bit1=W, bit2=X. Type6 sets the Addr0 memory permissions to the input permissions, for already mapped memory.&lt;br /&gt;
&lt;br /&gt;
MapProcessMemory maps RW memory starting at address 0x00100000 in the specified KProcess, at the specified StartAddr in the current process. MapProcessMemory then maps 0x08000000 in the specified process, to StartAddr+0x7f00000 in the current process. UnmapProcessMemory unmaps the memory which was mapped by MapProcessMemory.&lt;br /&gt;
&lt;br /&gt;
= Debugging =&lt;br /&gt;
DebugActiveProcess is used to attach to a process for debugging. This SVC can only be used when the target process&#039; ARM11 descriptors stored in the exheader have the kernel flag for &amp;quot;Enable debug&amp;quot; set. Otherwise when that flag is clear, the kernel flags for the process using this SVC must have the &amp;quot;Force debug&amp;quot; flag set.&lt;br /&gt;
&lt;br /&gt;
= KernelSetState =&lt;br /&gt;
Type0 initializes the programID for launching [[FIRM]], then triggers launching [[FIRM]]. Param0 and Param2 are unused. Param1 is the programID-low, and the programID-high is 0x00040138.&lt;br /&gt;
&lt;br /&gt;
Type3 is used for initializing the 0x1000-byte buffer used by the launched [[FIRM]]. Param2 is unused. When Param0 is value 1, this buffer is copied to the beginning of FCRAM at 0xF0000000, and Param1 is unused. When Param0 is value 0, this kernel buffer is mapped to process address Param1.&lt;br /&gt;
&lt;br /&gt;
= GetSystemInfo =&lt;br /&gt;
Type0 value 26(Type1 is unused) writes the total number of processes which were directly launched by the kernel, to Output. For the NATIVE_FIRM/SAFE_MODE_FIRM ARM11 kernel, this is normally 5, for processes sm, fs, pm, loader, and pxi.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4998</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4998"/>
		<updated>2013-02-21T00:51:40Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= System calls =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Id&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 &lt;br /&gt;
| ControlMemory(u32* outaddr, u32 addr0, u32 addr1, u32 size, u32 operation, u32 permissions) (outaddr is usually the same as the input addr0)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 &lt;br /&gt;
| QueryMemory(MemoryInfo* info, PageInfo* out, u32 Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 &lt;br /&gt;
| ExitProcess(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 &lt;br /&gt;
| GetProcessAffinityMask(u8* affinitymask, Handle process, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 &lt;br /&gt;
| SetProcessAffinityMask(Handle process, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 &lt;br /&gt;
| GetProcessIdealProcessor(s32 *idealprocessor, Handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 &lt;br /&gt;
| SetProcessIdealProcessor(Handle process, s32 idealprocessor)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| CreateThread(Handle* thread, func entrypoint, u32 arg, u32 stackbottom, s32 threadpriority, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9 &lt;br /&gt;
| ExitThread(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0xA &lt;br /&gt;
| SleepThread(s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0xB &lt;br /&gt;
| GetThreadPriority(s32* priority, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| SetThreadPriority(Handle thread, s32 priority)&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| GetThreadAffinityMask(u8* affinitymask, Handle thread, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| SetThreadAffinityMask(Handle thread, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xF &lt;br /&gt;
| GetThreadIdealProcessor(s32* processorid, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 &lt;br /&gt;
| SetThreadIdealProcessor(Handle thread, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 &lt;br /&gt;
| GetCurrentProcessorNumber(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 &lt;br /&gt;
| Run(Handle process, StartupInfo* info) (This starts the main() thread. Buf+0 is main-thread priority, Buf+4 is main-thread stack-size.)&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 &lt;br /&gt;
| CreateMutex(Handle* mutex, bool initialLocked)&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 &lt;br /&gt;
| ReleaseMutex(Handle mutex)&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 &lt;br /&gt;
| CreateSemaphore(Handle* semaphore, s32 initialCount, s32 maxCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 &lt;br /&gt;
| ReleaseSemaphore(s32* count, Handle semaphore, s32 releaseCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 &lt;br /&gt;
| CreateEvent(Handle* event, ResetType resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 &lt;br /&gt;
| SignalEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 &lt;br /&gt;
| ClearEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A &lt;br /&gt;
| CreateTimer(Handle* timer, ResetType resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B &lt;br /&gt;
| SetTimer(Handle timer, s64 initial, s64 interval)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C &lt;br /&gt;
| CancelTimer(Handle timer)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D &lt;br /&gt;
| ClearTimer(Handle timer)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E &lt;br /&gt;
| CreateMemoryBlock(Handle* memblock, u32 memory, u32 size, u32 mypermission, u32 otherpermission)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F &lt;br /&gt;
| MapMemoryBlock(Handle memblock, u32 addr, u32 mypermissions, u32 otherpermission)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 &lt;br /&gt;
| UnmapMemoryBlock(Handle memblock, u32 addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 &lt;br /&gt;
| CreateAddressArbiter(Handle* arbiter)&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 &lt;br /&gt;
| ArbitrateAddress(Handle arbiter, u32 addr, ArbitrationType type, s32 value)&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 &lt;br /&gt;
| CloseHandle(Handle handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 &lt;br /&gt;
| WaitSynchronization1(Handle handle, s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 &lt;br /&gt;
| WaitSynchronizationN(s32* out, Handle* handles, s32 handlecount, bool waitAll, s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 &lt;br /&gt;
| SignalAndWait&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 &lt;br /&gt;
| DuplicateHandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 &lt;br /&gt;
| GetSystemTick&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 &lt;br /&gt;
| GetHandleInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A &lt;br /&gt;
| GetSystemInfo(unsigned long long *Output, unsigned int Type0, unsigned int Type1)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B &lt;br /&gt;
| GetProcessInfo(unsigned long long *Output, Handle KProcess, unsigned int Type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C &lt;br /&gt;
| GetThreadInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D &lt;br /&gt;
| ConnectToPort(Handle*, char *PortName)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E &lt;br /&gt;
| SendSyncRequest1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F &lt;br /&gt;
| SendSyncRequest2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 &lt;br /&gt;
| SendSyncRequest3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 &lt;br /&gt;
| SendSyncRequest4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 &lt;br /&gt;
| SendSyncRequest(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 &lt;br /&gt;
| OpenProcess(Handle *KProcess, unsigned int ProcessId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 &lt;br /&gt;
| OpenThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x35 &lt;br /&gt;
| GetProcessId(unsigned int *ProcessId, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 &lt;br /&gt;
| GetProcessIdOfThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x37 &lt;br /&gt;
| GetThreadId&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 &lt;br /&gt;
| GetResourceLimit(Handle*, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x39 &lt;br /&gt;
| GetResourceLimitLimitValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A &lt;br /&gt;
| GetResourceLimitCurrentValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B &lt;br /&gt;
| GetThreadContext (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C &lt;br /&gt;
| Break(BreakReason)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D &lt;br /&gt;
| OutputDebugString(void const, int) (Does nothing on non-debug units)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E &lt;br /&gt;
| ControlPerformanceCounter(unsigned long long, int, unsigned int, unsigned long long)&lt;br /&gt;
|-&lt;br /&gt;
| 0x47 &lt;br /&gt;
| CreatePort&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 &lt;br /&gt;
| CreateSessionToPort&lt;br /&gt;
|-&lt;br /&gt;
| 0x49 &lt;br /&gt;
| CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A &lt;br /&gt;
| AcceptSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B &lt;br /&gt;
| ReplyAndReceive1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C &lt;br /&gt;
| ReplyAndReceive2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4D &lt;br /&gt;
| ReplyAndReceive3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E &lt;br /&gt;
| ReplyAndReceive4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F &lt;br /&gt;
| ReplyAndReceive&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 &lt;br /&gt;
| BindInterrupt(Interrupt, Handle, int, bool)&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 &lt;br /&gt;
| UnbindInterrupt(Interrupt, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 &lt;br /&gt;
| InvalidateProcessDataCache(Handle, void*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 &lt;br /&gt;
| StoreProcessDataCache(Handle process, void const* addr, unsigned int size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 &lt;br /&gt;
| FlushProcessDataCache(Handle, void const*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 &lt;br /&gt;
| StartInterProcessDma(Handle* out, Handle dstProcess, void* dst, Handle srcProcess, const void* src, size_t size, const DmaConfig&amp;amp; config )&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 &lt;br /&gt;
| StopDma(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 &lt;br /&gt;
| GetDmaState(DmaState*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| RestartDma(nn::Handle, void *, void  const*, unsigned int, signed char)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 &lt;br /&gt;
| DebugActiveProcess(Handle *KDebug, unsigned int ProcessID)&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 &lt;br /&gt;
| BreakDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 &lt;br /&gt;
| TerminateDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 &lt;br /&gt;
| GetProcessDebugEvent(DebugEventInfo*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 &lt;br /&gt;
| ContinueDebugEvent(Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 &lt;br /&gt;
| GetProcessList(int *TotalPIDs, unsigned int *PIDs, int MaxPIDs)&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 &lt;br /&gt;
| GetThreadList(int*, unsigned int*, int, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 &lt;br /&gt;
| GetDebugThreadContext(ThreadContext*, Handle, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 &lt;br /&gt;
| SetDebugThreadContext(Handle, unsigned int, ThreadContext const&amp;amp;, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x69 &lt;br /&gt;
| QueryDebugProcessMemory(MemoryInfo*, PageInfo*, Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A &lt;br /&gt;
| ReadProcessMemory(void* Buffer, Handle KDebug, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B &lt;br /&gt;
| WriteProcessMemory(Handle KDebug, void const* Buffer, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C &lt;br /&gt;
| SetHardwareBreakPoint(int, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D&lt;br /&gt;
| GetDebugThreadParam(long long *, int *, nn::Handle, unsigned int, nn::dmnt::DebugThreadParam) (Disabled on regular kernel)&lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| ControlProcessMemory(Handle KProcess, unsigned int Addr0, unsigned int Addr1, unsigned int Size, unsigned int Type, unsigned int Permissions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x71&lt;br /&gt;
| MapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x72&lt;br /&gt;
| UnmapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x73&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| Stubbed on regular kernel&lt;br /&gt;
|-&lt;br /&gt;
| 0x75&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x76&lt;br /&gt;
| TerminateProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x77&lt;br /&gt;
| (Handle KProcess, Handle KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| CreateResourceLimit(Handle *KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x79&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A&lt;br /&gt;
| DisableExecuteNever(unsigned int Addr, unsigned int Size) (Stubbed for regular kernel beginning with [[2.0.0-2]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C&lt;br /&gt;
| KernelSetState(unsigned int Type, unsigned int Param0, unsigned int Param1, unsigned int Param2) (The Type determines the usage of each param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D&lt;br /&gt;
| QueryProcessMemory(MemInfo *Info, unsigned int *Out, Handle KProcess, unsigned int Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0xFF&lt;br /&gt;
| Debug related (The Syscall access control mask doesn&#039;t apply for this SVC)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Types and structures =&lt;br /&gt;
&lt;br /&gt;
== enum MemoryState ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory state flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| RESERVED&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| IO&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| STATIC&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| CODE&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| PRIVATE&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| SHARED&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| CONTINUOUS&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| ALIASED&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS&lt;br /&gt;
| 9&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS CODE&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 11&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum PageFlags ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Page flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| CHANGED&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryOperation ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory operation&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| RESERVE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| COMMIT&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| MAP&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| UNMAP&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| PROTECT&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| REGION APP&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| REGION SYSTEM&lt;br /&gt;
| 0x200&lt;br /&gt;
|-&lt;br /&gt;
| REGION BASE&lt;br /&gt;
| 0x300&lt;br /&gt;
|-&lt;br /&gt;
| LINEAR&lt;br /&gt;
| 0x1000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryPermission ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory permission&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| NONE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| READ&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| WRITE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| READWRITE&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| DONTCARE&lt;br /&gt;
| 0x10000000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== enum ResetType ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Reset type&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| ONESHOT&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| STICKY&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| PULSE&lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct MemoryInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Base address&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Permission&lt;br /&gt;
|-&lt;br /&gt;
| enum MemoryState&lt;br /&gt;
| State&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct PageInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Flags&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct StartupInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| Priority&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Stack size&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| argc&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| argv&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| envp&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Processes =&lt;br /&gt;
Each process can only use SVCs which are enabled in the [[NCCH#CXI|exheader]] for this process. The ARM11 kernel SVC handler checks whether the SVC is enabled in the syscall access control mask stored on the SVC-mode stack, when the SVC isn&#039;t enabled a kernelpanic() is triggered. Each process has a separate SVC-mode stack, this stack and the syscall access mask stored here is initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of this table is stored in the exheader. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for the current KThread.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
= Threads =&lt;br /&gt;
For svcCreateThread the input address used for Entrypoint_Param and StackTop are normally the same, however these can be arbitrary. For the main thread the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread.&lt;br /&gt;
&lt;br /&gt;
= Memory Mapping =&lt;br /&gt;
ControlMemory and MapMemoryBlock can be used to map memory pages, these two SVCs only support mapping execute-never R/W pages. The input permissions parameter for these SVCs must be &amp;lt;=3, where value zero is used when un-mapping memory. Bitmask 0xf00 for ControlMemory parameter MemoryType is the memory-type, when this is zero the memory-type is loaded from the kernel flags stored in the exheader ARM11 kernel descriptors, for the process using the SVC. ControlMemory parameter MemoryType with value 0x10003 is used for mapping the GSP [[Memory_layout|heap]]. The low 8-bits are the type: 1 is for un-mapping memory, 3 for mapping memory. Type4 is used to mirror the RW memory at Addr1, to Addr0. Type4 will return an error if Addr1 is located in read-only memory. Addr1 is not used for type1 and type3.&lt;br /&gt;
&lt;br /&gt;
ControlProcessMemory maps memory in the specified process, this is the only SVC which allows mapping executable memory. Format of the permissions field for memory mapping SVCs: bit0=R, bit1=W, bit2=X. Type6 sets the Addr0 memory permissions to the input permissions, for already mapped memory.&lt;br /&gt;
&lt;br /&gt;
MapProcessMemory maps RW memory starting at address 0x00100000 in the specified KProcess, at the specified StartAddr in the current process. MapProcessMemory then maps 0x08000000 in the specified process, to StartAddr+0x7f00000 in the current process. UnmapProcessMemory unmaps the memory which was mapped by MapProcessMemory.&lt;br /&gt;
&lt;br /&gt;
= Debugging =&lt;br /&gt;
DebugActiveProcess is used to attach to a process for debugging. This SVC can only be used when the target process&#039; ARM11 descriptors stored in the exheader have the kernel flag for &amp;quot;Enable debug&amp;quot; set. Otherwise when that flag is clear, the kernel flags for the process using this SVC must have the &amp;quot;Force debug&amp;quot; flag set.&lt;br /&gt;
&lt;br /&gt;
= KernelSetState =&lt;br /&gt;
Type0 initializes the programID for launching [[FIRM]], then triggers launching [[FIRM]]. Param0 and Param2 are unused. Param1 is the programID-low, and the programID-high is 0x00040138.&lt;br /&gt;
&lt;br /&gt;
Type3 is used for initializing the 0x1000-byte buffer used by the launched [[FIRM]]. Param2 is unused. When Param0 is value 1, this buffer is copied to the beginning of FCRAM at 0xF0000000, and Param1 is unused. When Param0 is value 0, this kernel buffer is mapped to process address Param1.&lt;br /&gt;
&lt;br /&gt;
= GetSystemInfo =&lt;br /&gt;
Type0 value 26(Type1 is unused) writes the total number of processes which were directly launched by the kernel, to Output. For the NATIVE_FIRM/SAFE_MODE_FIRM ARM11 kernel, this is normally 5, for processes sm, fs, pm, loader, and pxi.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4997</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4997"/>
		<updated>2013-02-21T00:48:32Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= System calls =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Id&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 &lt;br /&gt;
| ControlMemory(u32* outaddr, u32 addr0, u32 addr1, u32 size, u32 operation, u32 permissions) (outaddr is usually the same as the input addr0)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 &lt;br /&gt;
| QueryMemory(MemoryInfo* info, PageInfo* out, u32 Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 &lt;br /&gt;
| ExitProcess(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 &lt;br /&gt;
| GetProcessAffinityMask(u8* affinitymask, Handle process, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 &lt;br /&gt;
| SetProcessAffinityMask(Handle process, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 &lt;br /&gt;
| GetProcessIdealProcessor(s32 *idealprocessor, Handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 &lt;br /&gt;
| SetProcessIdealProcessor(Handle process, s32 idealprocessor)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| CreateThread(Handle* thread, func entrypoint, u32 arg, u32 stackbottom, s32 threadpriority, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9 &lt;br /&gt;
| ExitThread(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0xA &lt;br /&gt;
| SleepThread(s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0xB &lt;br /&gt;
| GetThreadPriority(s32* priority, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| SetThreadPriority(Handle thread, s32 priority)&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| GetThreadAffinityMask(u8* affinitymask, Handle thread, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| SetThreadAffinityMask(Handle thread, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xF &lt;br /&gt;
| GetThreadIdealProcessor(s32* processorid, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 &lt;br /&gt;
| SetThreadIdealProcessor(Handle thread, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 &lt;br /&gt;
| GetCurrentProcessorNumber(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 &lt;br /&gt;
| Run(Handle process, StartupInfo* info) (This starts the main() thread. Buf+0 is main-thread priority, Buf+4 is main-thread stack-size.)&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 &lt;br /&gt;
| CreateMutex(Handle* mutex, bool initialLocked)&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 &lt;br /&gt;
| ReleaseMutex(Handle mutex)&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 &lt;br /&gt;
| CreateSemaphore(Handle* semaphore, s32 initialCount, s32 maxCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 &lt;br /&gt;
| ReleaseSemaphore(s32* count, Handle semaphore, s32 releaseCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 &lt;br /&gt;
| CreateEvent(Handle* event, ResetType resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 &lt;br /&gt;
| SignalEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 &lt;br /&gt;
| ClearEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A &lt;br /&gt;
| CreateTimer(Handle* timer, ResetType resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B &lt;br /&gt;
| SetTimer(Handle timer, s64 initial, s64 interval)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C &lt;br /&gt;
| CancelTimer(Handle timer)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D &lt;br /&gt;
| ClearTimer(Handle timer)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E &lt;br /&gt;
| CreateMemoryBlock(Handle* memblock, u32 memory, u32 size, u32 mypermission, u32 otherpermission)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F &lt;br /&gt;
| MapMemoryBlock(Handle memblock, u32 addr, u32 mypermissions, u32 otherpermission)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 &lt;br /&gt;
| UnmapMemoryBlock(Handle memblock, u32 addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 &lt;br /&gt;
| CreateAddressArbiter(Handle* arbiter)&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 &lt;br /&gt;
| ArbitrateAddress(Handle arbiter, u32 addr, ArbitrationType type, s32 value)&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 &lt;br /&gt;
| CloseHandle(Handle handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 &lt;br /&gt;
| WaitSynchronization1&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 &lt;br /&gt;
| WaitSynchronization2&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 &lt;br /&gt;
| SignalAndWait&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 &lt;br /&gt;
| DuplicateHandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 &lt;br /&gt;
| GetSystemTick&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 &lt;br /&gt;
| GetHandleInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A &lt;br /&gt;
| GetSystemInfo(unsigned long long *Output, unsigned int Type0, unsigned int Type1)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B &lt;br /&gt;
| GetProcessInfo(unsigned long long *Output, Handle KProcess, unsigned int Type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C &lt;br /&gt;
| GetThreadInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D &lt;br /&gt;
| ConnectToPort(Handle*, char *PortName)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E &lt;br /&gt;
| SendSyncRequest1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F &lt;br /&gt;
| SendSyncRequest2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 &lt;br /&gt;
| SendSyncRequest3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 &lt;br /&gt;
| SendSyncRequest4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 &lt;br /&gt;
| SendSyncRequest(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 &lt;br /&gt;
| OpenProcess(Handle *KProcess, unsigned int ProcessId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 &lt;br /&gt;
| OpenThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x35 &lt;br /&gt;
| GetProcessId(unsigned int *ProcessId, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 &lt;br /&gt;
| GetProcessIdOfThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x37 &lt;br /&gt;
| GetThreadId&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 &lt;br /&gt;
| GetResourceLimit(Handle*, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x39 &lt;br /&gt;
| GetResourceLimitLimitValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A &lt;br /&gt;
| GetResourceLimitCurrentValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B &lt;br /&gt;
| GetThreadContext (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C &lt;br /&gt;
| Break(BreakReason)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D &lt;br /&gt;
| OutputDebugString(void const, int) (Does nothing on non-debug units)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E &lt;br /&gt;
| ControlPerformanceCounter(unsigned long long, int, unsigned int, unsigned long long)&lt;br /&gt;
|-&lt;br /&gt;
| 0x47 &lt;br /&gt;
| CreatePort&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 &lt;br /&gt;
| CreateSessionToPort&lt;br /&gt;
|-&lt;br /&gt;
| 0x49 &lt;br /&gt;
| CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A &lt;br /&gt;
| AcceptSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B &lt;br /&gt;
| ReplyAndReceive1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C &lt;br /&gt;
| ReplyAndReceive2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4D &lt;br /&gt;
| ReplyAndReceive3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E &lt;br /&gt;
| ReplyAndReceive4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F &lt;br /&gt;
| ReplyAndReceive&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 &lt;br /&gt;
| BindInterrupt(Interrupt, Handle, int, bool)&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 &lt;br /&gt;
| UnbindInterrupt(Interrupt, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 &lt;br /&gt;
| InvalidateProcessDataCache(Handle, void*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 &lt;br /&gt;
| StoreProcessDataCache(Handle process, void const* addr, unsigned int size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 &lt;br /&gt;
| FlushProcessDataCache(Handle, void const*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 &lt;br /&gt;
| StartInterProcessDma(Handle* out, Handle dstProcess, void* dst, Handle srcProcess, const void* src, size_t size, const DmaConfig&amp;amp; config )&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 &lt;br /&gt;
| StopDma(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 &lt;br /&gt;
| GetDmaState(DmaState*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| RestartDma(nn::Handle, void *, void  const*, unsigned int, signed char)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 &lt;br /&gt;
| DebugActiveProcess(Handle *KDebug, unsigned int ProcessID)&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 &lt;br /&gt;
| BreakDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 &lt;br /&gt;
| TerminateDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 &lt;br /&gt;
| GetProcessDebugEvent(DebugEventInfo*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 &lt;br /&gt;
| ContinueDebugEvent(Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 &lt;br /&gt;
| GetProcessList(int *TotalPIDs, unsigned int *PIDs, int MaxPIDs)&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 &lt;br /&gt;
| GetThreadList(int*, unsigned int*, int, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 &lt;br /&gt;
| GetDebugThreadContext(ThreadContext*, Handle, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 &lt;br /&gt;
| SetDebugThreadContext(Handle, unsigned int, ThreadContext const&amp;amp;, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x69 &lt;br /&gt;
| QueryDebugProcessMemory(MemoryInfo*, PageInfo*, Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A &lt;br /&gt;
| ReadProcessMemory(void* Buffer, Handle KDebug, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B &lt;br /&gt;
| WriteProcessMemory(Handle KDebug, void const* Buffer, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C &lt;br /&gt;
| SetHardwareBreakPoint(int, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D&lt;br /&gt;
| GetDebugThreadParam(long long *, int *, nn::Handle, unsigned int, nn::dmnt::DebugThreadParam) (Disabled on regular kernel)&lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| ControlProcessMemory(Handle KProcess, unsigned int Addr0, unsigned int Addr1, unsigned int Size, unsigned int Type, unsigned int Permissions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x71&lt;br /&gt;
| MapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x72&lt;br /&gt;
| UnmapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x73&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| Stubbed on regular kernel&lt;br /&gt;
|-&lt;br /&gt;
| 0x75&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x76&lt;br /&gt;
| TerminateProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x77&lt;br /&gt;
| (Handle KProcess, Handle KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| CreateResourceLimit(Handle *KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x79&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A&lt;br /&gt;
| DisableExecuteNever(unsigned int Addr, unsigned int Size) (Stubbed for regular kernel beginning with [[2.0.0-2]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C&lt;br /&gt;
| KernelSetState(unsigned int Type, unsigned int Param0, unsigned int Param1, unsigned int Param2) (The Type determines the usage of each param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D&lt;br /&gt;
| QueryProcessMemory(MemInfo *Info, unsigned int *Out, Handle KProcess, unsigned int Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0xFF&lt;br /&gt;
| Debug related (The Syscall access control mask doesn&#039;t apply for this SVC)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Types and structures =&lt;br /&gt;
&lt;br /&gt;
== enum MemoryState ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory state flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| RESERVED&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| IO&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| STATIC&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| CODE&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| PRIVATE&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| SHARED&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| CONTINUOUS&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| ALIASED&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS&lt;br /&gt;
| 9&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS CODE&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 11&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum PageFlags ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Page flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| CHANGED&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryOperation ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory operation&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| RESERVE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| COMMIT&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| MAP&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| UNMAP&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| PROTECT&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| REGION APP&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| REGION SYSTEM&lt;br /&gt;
| 0x200&lt;br /&gt;
|-&lt;br /&gt;
| REGION BASE&lt;br /&gt;
| 0x300&lt;br /&gt;
|-&lt;br /&gt;
| LINEAR&lt;br /&gt;
| 0x1000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryPermission ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory permission&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| NONE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| READ&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| WRITE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| READWRITE&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| DONTCARE&lt;br /&gt;
| 0x10000000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== enum ResetType ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Reset type&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| ONESHOT&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| STICKY&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| PULSE&lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct MemoryInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Base address&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Permission&lt;br /&gt;
|-&lt;br /&gt;
| enum MemoryState&lt;br /&gt;
| State&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct PageInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Flags&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct StartupInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| Priority&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Stack size&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| argc&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| argv&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| envp&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Processes =&lt;br /&gt;
Each process can only use SVCs which are enabled in the [[NCCH#CXI|exheader]] for this process. The ARM11 kernel SVC handler checks whether the SVC is enabled in the syscall access control mask stored on the SVC-mode stack, when the SVC isn&#039;t enabled a kernelpanic() is triggered. Each process has a separate SVC-mode stack, this stack and the syscall access mask stored here is initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of this table is stored in the exheader. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for the current KThread.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
= Threads =&lt;br /&gt;
For svcCreateThread the input address used for Entrypoint_Param and StackTop are normally the same, however these can be arbitrary. For the main thread the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread.&lt;br /&gt;
&lt;br /&gt;
= Memory Mapping =&lt;br /&gt;
ControlMemory and MapMemoryBlock can be used to map memory pages, these two SVCs only support mapping execute-never R/W pages. The input permissions parameter for these SVCs must be &amp;lt;=3, where value zero is used when un-mapping memory. Bitmask 0xf00 for ControlMemory parameter MemoryType is the memory-type, when this is zero the memory-type is loaded from the kernel flags stored in the exheader ARM11 kernel descriptors, for the process using the SVC. ControlMemory parameter MemoryType with value 0x10003 is used for mapping the GSP [[Memory_layout|heap]]. The low 8-bits are the type: 1 is for un-mapping memory, 3 for mapping memory. Type4 is used to mirror the RW memory at Addr1, to Addr0. Type4 will return an error if Addr1 is located in read-only memory. Addr1 is not used for type1 and type3.&lt;br /&gt;
&lt;br /&gt;
ControlProcessMemory maps memory in the specified process, this is the only SVC which allows mapping executable memory. Format of the permissions field for memory mapping SVCs: bit0=R, bit1=W, bit2=X. Type6 sets the Addr0 memory permissions to the input permissions, for already mapped memory.&lt;br /&gt;
&lt;br /&gt;
MapProcessMemory maps RW memory starting at address 0x00100000 in the specified KProcess, at the specified StartAddr in the current process. MapProcessMemory then maps 0x08000000 in the specified process, to StartAddr+0x7f00000 in the current process. UnmapProcessMemory unmaps the memory which was mapped by MapProcessMemory.&lt;br /&gt;
&lt;br /&gt;
= Debugging =&lt;br /&gt;
DebugActiveProcess is used to attach to a process for debugging. This SVC can only be used when the target process&#039; ARM11 descriptors stored in the exheader have the kernel flag for &amp;quot;Enable debug&amp;quot; set. Otherwise when that flag is clear, the kernel flags for the process using this SVC must have the &amp;quot;Force debug&amp;quot; flag set.&lt;br /&gt;
&lt;br /&gt;
= KernelSetState =&lt;br /&gt;
Type0 initializes the programID for launching [[FIRM]], then triggers launching [[FIRM]]. Param0 and Param2 are unused. Param1 is the programID-low, and the programID-high is 0x00040138.&lt;br /&gt;
&lt;br /&gt;
Type3 is used for initializing the 0x1000-byte buffer used by the launched [[FIRM]]. Param2 is unused. When Param0 is value 1, this buffer is copied to the beginning of FCRAM at 0xF0000000, and Param1 is unused. When Param0 is value 0, this kernel buffer is mapped to process address Param1.&lt;br /&gt;
&lt;br /&gt;
= GetSystemInfo =&lt;br /&gt;
Type0 value 26(Type1 is unused) writes the total number of processes which were directly launched by the kernel, to Output. For the NATIVE_FIRM/SAFE_MODE_FIRM ARM11 kernel, this is normally 5, for processes sm, fs, pm, loader, and pxi.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4996</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4996"/>
		<updated>2013-02-21T00:46:24Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Service calls =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Id&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 &lt;br /&gt;
| ControlMemory(u32* outaddr, u32 addr0, u32 addr1, u32 size, u32 operation, u32 permissions) (outaddr is usually the same as the input addr0)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 &lt;br /&gt;
| QueryMemory(MemoryInfo* info, PageInfo* out, u32 Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 &lt;br /&gt;
| ExitProcess(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 &lt;br /&gt;
| GetProcessAffinityMask(u8* affinitymask, Handle process, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 &lt;br /&gt;
| SetProcessAffinityMask(Handle process, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 &lt;br /&gt;
| GetProcessIdealProcessor(s32 *idealprocessor, Handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 &lt;br /&gt;
| SetProcessIdealProcessor(Handle process, s32 idealprocessor)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| CreateThread(Handle* thread, func entrypoint, u32 arg, u32 stackbottom, s32 threadpriority, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9 &lt;br /&gt;
| ExitThread(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0xA &lt;br /&gt;
| SleepThread(s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0xB &lt;br /&gt;
| GetThreadPriority(s32* priority, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| SetThreadPriority(Handle thread, s32 priority)&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| GetThreadAffinityMask(u8* affinitymask, Handle thread, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| SetThreadAffinityMask(Handle thread, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xF &lt;br /&gt;
| GetThreadIdealProcessor(s32* processorid, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 &lt;br /&gt;
| SetThreadIdealProcessor(Handle thread, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 &lt;br /&gt;
| GetCurrentProcessorNumber(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 &lt;br /&gt;
| Run(Handle process, StartupInfo* info) (This starts the main() thread. Buf+0 is main-thread priority, Buf+4 is main-thread stack-size.)&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 &lt;br /&gt;
| CreateMutex(Handle* mutex, bool initialLocked)&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 &lt;br /&gt;
| ReleaseMutex(Handle mutex)&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 &lt;br /&gt;
| CreateSemaphore(Handle* semaphore, s32 initialCount, s32 maxCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 &lt;br /&gt;
| ReleaseSemaphore(s32* count, Handle semaphore, s32 releaseCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 &lt;br /&gt;
| CreateEvent(Handle* event, ResetType resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 &lt;br /&gt;
| SignalEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 &lt;br /&gt;
| ClearEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A &lt;br /&gt;
| CreateTimer(Handle* timer, ResetType resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B &lt;br /&gt;
| SetTimer(Handle timer, s64 initial, s64 interval)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C &lt;br /&gt;
| CancelTimer(Handle timer)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D &lt;br /&gt;
| ClearTimer(Handle timer)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E &lt;br /&gt;
| CreateMemoryBlock(Handle* memblock, u32 memory, u32 size, u32 mypermission, u32 otherpermission)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F &lt;br /&gt;
| MapMemoryBlock(Handle memblock, u32 addr, u32 mypermissions, u32 otherpermission)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 &lt;br /&gt;
| UnmapMemoryBlock(Handle memblock, u32 addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 &lt;br /&gt;
| CreateAddressArbiter(Handle* arbiter)&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 &lt;br /&gt;
| ArbitrateAddress(Handle arbiter, u32 addr, ArbitrationType type, s32 value)&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 &lt;br /&gt;
| CloseHandle(Handle handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 &lt;br /&gt;
| WaitSynchronization1&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 &lt;br /&gt;
| WaitSynchronization2&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 &lt;br /&gt;
| SignalAndWait&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 &lt;br /&gt;
| DuplicateHandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 &lt;br /&gt;
| GetSystemTick&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 &lt;br /&gt;
| GetHandleInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A &lt;br /&gt;
| GetSystemInfo(unsigned long long *Output, unsigned int Type0, unsigned int Type1)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B &lt;br /&gt;
| GetProcessInfo(unsigned long long *Output, Handle KProcess, unsigned int Type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C &lt;br /&gt;
| GetThreadInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D &lt;br /&gt;
| ConnectToPort(Handle*, char *PortName)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E &lt;br /&gt;
| SendSyncRequest1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F &lt;br /&gt;
| SendSyncRequest2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 &lt;br /&gt;
| SendSyncRequest3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 &lt;br /&gt;
| SendSyncRequest4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 &lt;br /&gt;
| SendSyncRequest(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 &lt;br /&gt;
| OpenProcess(Handle *KProcess, unsigned int ProcessId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 &lt;br /&gt;
| OpenThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x35 &lt;br /&gt;
| GetProcessId(unsigned int *ProcessId, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 &lt;br /&gt;
| GetProcessIdOfThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x37 &lt;br /&gt;
| GetThreadId&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 &lt;br /&gt;
| GetResourceLimit(Handle*, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x39 &lt;br /&gt;
| GetResourceLimitLimitValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A &lt;br /&gt;
| GetResourceLimitCurrentValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B &lt;br /&gt;
| GetThreadContext (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C &lt;br /&gt;
| Break(BreakReason)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D &lt;br /&gt;
| OutputDebugString(void const, int) (Does nothing on non-debug units)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E &lt;br /&gt;
| ControlPerformanceCounter(unsigned long long, int, unsigned int, unsigned long long)&lt;br /&gt;
|-&lt;br /&gt;
| 0x47 &lt;br /&gt;
| CreatePort&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 &lt;br /&gt;
| CreateSessionToPort&lt;br /&gt;
|-&lt;br /&gt;
| 0x49 &lt;br /&gt;
| CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A &lt;br /&gt;
| AcceptSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B &lt;br /&gt;
| ReplyAndReceive1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C &lt;br /&gt;
| ReplyAndReceive2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4D &lt;br /&gt;
| ReplyAndReceive3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E &lt;br /&gt;
| ReplyAndReceive4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F &lt;br /&gt;
| ReplyAndReceive&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 &lt;br /&gt;
| BindInterrupt(Interrupt, Handle, int, bool)&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 &lt;br /&gt;
| UnbindInterrupt(Interrupt, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 &lt;br /&gt;
| InvalidateProcessDataCache(Handle, void*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 &lt;br /&gt;
| StoreProcessDataCache(Handle process, void const* addr, unsigned int size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 &lt;br /&gt;
| FlushProcessDataCache(Handle, void const*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 &lt;br /&gt;
| StartInterProcessDma(Handle* out, Handle dstProcess, void* dst, Handle srcProcess, const void* src, size_t size, const DmaConfig&amp;amp; config )&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 &lt;br /&gt;
| StopDma(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 &lt;br /&gt;
| GetDmaState(DmaState*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| RestartDma(nn::Handle, void *, void  const*, unsigned int, signed char)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 &lt;br /&gt;
| DebugActiveProcess(Handle *KDebug, unsigned int ProcessID)&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 &lt;br /&gt;
| BreakDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 &lt;br /&gt;
| TerminateDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 &lt;br /&gt;
| GetProcessDebugEvent(DebugEventInfo*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 &lt;br /&gt;
| ContinueDebugEvent(Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 &lt;br /&gt;
| GetProcessList(int *TotalPIDs, unsigned int *PIDs, int MaxPIDs)&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 &lt;br /&gt;
| GetThreadList(int*, unsigned int*, int, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 &lt;br /&gt;
| GetDebugThreadContext(ThreadContext*, Handle, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 &lt;br /&gt;
| SetDebugThreadContext(Handle, unsigned int, ThreadContext const&amp;amp;, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x69 &lt;br /&gt;
| QueryDebugProcessMemory(MemoryInfo*, PageInfo*, Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A &lt;br /&gt;
| ReadProcessMemory(void* Buffer, Handle KDebug, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B &lt;br /&gt;
| WriteProcessMemory(Handle KDebug, void const* Buffer, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C &lt;br /&gt;
| SetHardwareBreakPoint(int, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D&lt;br /&gt;
| GetDebugThreadParam(long long *, int *, nn::Handle, unsigned int, nn::dmnt::DebugThreadParam) (Disabled on regular kernel)&lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| ControlProcessMemory(Handle KProcess, unsigned int Addr0, unsigned int Addr1, unsigned int Size, unsigned int Type, unsigned int Permissions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x71&lt;br /&gt;
| MapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x72&lt;br /&gt;
| UnmapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x73&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| Stubbed on regular kernel&lt;br /&gt;
|-&lt;br /&gt;
| 0x75&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x76&lt;br /&gt;
| TerminateProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x77&lt;br /&gt;
| (Handle KProcess, Handle KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| CreateResourceLimit(Handle *KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x79&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A&lt;br /&gt;
| DisableExecuteNever(unsigned int Addr, unsigned int Size) (Stubbed for regular kernel beginning with [[2.0.0-2]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C&lt;br /&gt;
| KernelSetState(unsigned int Type, unsigned int Param0, unsigned int Param1, unsigned int Param2) (The Type determines the usage of each param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D&lt;br /&gt;
| QueryProcessMemory(MemInfo *Info, unsigned int *Out, Handle KProcess, unsigned int Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0xFF&lt;br /&gt;
| Debug related (The Syscall access control mask doesn&#039;t apply for this SVC)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Types and structures =&lt;br /&gt;
&lt;br /&gt;
== enum MemoryState ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory state flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| RESERVED&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| IO&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| STATIC&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| CODE&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| PRIVATE&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| SHARED&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| CONTINUOUS&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| ALIASED&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS&lt;br /&gt;
| 9&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS CODE&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 11&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum PageFlags ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Page flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| CHANGED&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryOperation ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory operation&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| RESERVE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| COMMIT&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| MAP&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| UNMAP&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| PROTECT&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| REGION APP&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| REGION SYSTEM&lt;br /&gt;
| 0x200&lt;br /&gt;
|-&lt;br /&gt;
| REGION BASE&lt;br /&gt;
| 0x300&lt;br /&gt;
|-&lt;br /&gt;
| LINEAR&lt;br /&gt;
| 0x1000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryPermission ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory permission&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| NONE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| READ&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| WRITE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| READWRITE&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| DONTCARE&lt;br /&gt;
| 0x10000000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== enum ResetType ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Reset type&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| ONESHOT&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| STICKY&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| PULSE&lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct MemoryInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Base address&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Permission&lt;br /&gt;
|-&lt;br /&gt;
| enum MemoryState&lt;br /&gt;
| State&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct PageInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Flags&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct StartupInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| Priority&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Stack size&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| argc&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| argv&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| envp&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Processes =&lt;br /&gt;
Each process can only use SVCs which are enabled in the [[NCCH#CXI|exheader]] for this process. The ARM11 kernel SVC handler checks whether the SVC is enabled in the syscall access control mask stored on the SVC-mode stack, when the SVC isn&#039;t enabled a kernelpanic() is triggered. Each process has a separate SVC-mode stack, this stack and the syscall access mask stored here is initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of this table is stored in the exheader. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for the current KThread.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
= Threads =&lt;br /&gt;
For svcCreateThread the input address used for Entrypoint_Param and StackTop are normally the same, however these can be arbitrary. For the main thread the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread.&lt;br /&gt;
&lt;br /&gt;
= Memory Mapping =&lt;br /&gt;
ControlMemory and MapMemoryBlock can be used to map memory pages, these two SVCs only support mapping execute-never R/W pages. The input permissions parameter for these SVCs must be &amp;lt;=3, where value zero is used when un-mapping memory. Bitmask 0xf00 for ControlMemory parameter MemoryType is the memory-type, when this is zero the memory-type is loaded from the kernel flags stored in the exheader ARM11 kernel descriptors, for the process using the SVC. ControlMemory parameter MemoryType with value 0x10003 is used for mapping the GSP [[Memory_layout|heap]]. The low 8-bits are the type: 1 is for un-mapping memory, 3 for mapping memory. Type4 is used to mirror the RW memory at Addr1, to Addr0. Type4 will return an error if Addr1 is located in read-only memory. Addr1 is not used for type1 and type3.&lt;br /&gt;
&lt;br /&gt;
ControlProcessMemory maps memory in the specified process, this is the only SVC which allows mapping executable memory. Format of the permissions field for memory mapping SVCs: bit0=R, bit1=W, bit2=X. Type6 sets the Addr0 memory permissions to the input permissions, for already mapped memory.&lt;br /&gt;
&lt;br /&gt;
MapProcessMemory maps RW memory starting at address 0x00100000 in the specified KProcess, at the specified StartAddr in the current process. MapProcessMemory then maps 0x08000000 in the specified process, to StartAddr+0x7f00000 in the current process. UnmapProcessMemory unmaps the memory which was mapped by MapProcessMemory.&lt;br /&gt;
&lt;br /&gt;
= Debugging =&lt;br /&gt;
DebugActiveProcess is used to attach to a process for debugging. This SVC can only be used when the target process&#039; ARM11 descriptors stored in the exheader have the kernel flag for &amp;quot;Enable debug&amp;quot; set. Otherwise when that flag is clear, the kernel flags for the process using this SVC must have the &amp;quot;Force debug&amp;quot; flag set.&lt;br /&gt;
&lt;br /&gt;
= KernelSetState =&lt;br /&gt;
Type0 initializes the programID for launching [[FIRM]], then triggers launching [[FIRM]]. Param0 and Param2 are unused. Param1 is the programID-low, and the programID-high is 0x00040138.&lt;br /&gt;
&lt;br /&gt;
Type3 is used for initializing the 0x1000-byte buffer used by the launched [[FIRM]]. Param2 is unused. When Param0 is value 1, this buffer is copied to the beginning of FCRAM at 0xF0000000, and Param1 is unused. When Param0 is value 0, this kernel buffer is mapped to process address Param1.&lt;br /&gt;
&lt;br /&gt;
= GetSystemInfo =&lt;br /&gt;
Type0 value 26(Type1 is unused) writes the total number of processes which were directly launched by the kernel, to Output. For the NATIVE_FIRM/SAFE_MODE_FIRM ARM11 kernel, this is normally 5, for processes sm, fs, pm, loader, and pxi.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4995</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4995"/>
		<updated>2013-02-21T00:43:15Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Service calls =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Id&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 &lt;br /&gt;
| ControlMemory(u32* outaddr, u32 addr0, u32 addr1, u32 size, u32 operation, u32 permissions) (outaddr is usually the same as the input addr0)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 &lt;br /&gt;
| QueryMemory(MemoryInfo* info, PageInfo* out, u32 Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 &lt;br /&gt;
| ExitProcess(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 &lt;br /&gt;
| GetProcessAffinityMask(u8* affinitymask, Handle process, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 &lt;br /&gt;
| SetProcessAffinityMask(Handle process, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 &lt;br /&gt;
| GetProcessIdealProcessor(s32 *idealprocessor, Handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 &lt;br /&gt;
| SetProcessIdealProcessor(Handle process, s32 idealprocessor)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| CreateThread(Handle* thread, func entrypoint, u32 arg, u32 stackbottom, s32 threadpriority, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9 &lt;br /&gt;
| ExitThread(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0xA &lt;br /&gt;
| SleepThread(s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0xB &lt;br /&gt;
| GetThreadPriority(s32* priority, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| SetThreadPriority(Handle thread, s32 priority)&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| GetThreadAffinityMask(u8* affinitymask, Handle thread, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| SetThreadAffinityMask(Handle thread, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xF &lt;br /&gt;
| GetThreadIdealProcessor(s32* processorid, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 &lt;br /&gt;
| SetThreadIdealProcessor(Handle thread, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 &lt;br /&gt;
| GetCurrentProcessorNumber(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 &lt;br /&gt;
| Run(Handle process, StartupInfo* info) (This starts the main() thread. Buf+0 is main-thread priority, Buf+4 is main-thread stack-size.)&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 &lt;br /&gt;
| CreateMutex(Handle* mutex, bool initialLocked)&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 &lt;br /&gt;
| ReleaseMutex(Handle mutex)&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 &lt;br /&gt;
| CreateSemaphore(Handle* semaphore, s32 initialCount, s32 maxCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 &lt;br /&gt;
| ReleaseSemaphore(s32* count, Handle semaphore, s32 releaseCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 &lt;br /&gt;
| CreateEvent(Handle* event, ResetType resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 &lt;br /&gt;
| SignalEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 &lt;br /&gt;
| ClearEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A &lt;br /&gt;
| CreateTimer(Handle* timer, &lt;br /&gt;
|-&lt;br /&gt;
| 0x1B &lt;br /&gt;
| SetTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C &lt;br /&gt;
| CancelTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D &lt;br /&gt;
| ClearTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E &lt;br /&gt;
| CreateMemoryBlock&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F &lt;br /&gt;
| MapMemoryBlock(Handle, unsigned int Addr, unsigned int Permissions, unsigned int Unk)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 &lt;br /&gt;
| UnmapMemoryBlock&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 &lt;br /&gt;
| CreateAddressArbiter&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 &lt;br /&gt;
| ArbitrateAddress&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 &lt;br /&gt;
| CloseHandle(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 &lt;br /&gt;
| WaitSynchronization1&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 &lt;br /&gt;
| WaitSynchronization2&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 &lt;br /&gt;
| SignalAndWait&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 &lt;br /&gt;
| DuplicateHandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 &lt;br /&gt;
| GetSystemTick&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 &lt;br /&gt;
| GetHandleInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A &lt;br /&gt;
| GetSystemInfo(unsigned long long *Output, unsigned int Type0, unsigned int Type1)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B &lt;br /&gt;
| GetProcessInfo(unsigned long long *Output, Handle KProcess, unsigned int Type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C &lt;br /&gt;
| GetThreadInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D &lt;br /&gt;
| ConnectToPort(Handle*, char *PortName)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E &lt;br /&gt;
| SendSyncRequest1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F &lt;br /&gt;
| SendSyncRequest2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 &lt;br /&gt;
| SendSyncRequest3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 &lt;br /&gt;
| SendSyncRequest4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 &lt;br /&gt;
| SendSyncRequest(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 &lt;br /&gt;
| OpenProcess(Handle *KProcess, unsigned int ProcessId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 &lt;br /&gt;
| OpenThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x35 &lt;br /&gt;
| GetProcessId(unsigned int *ProcessId, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 &lt;br /&gt;
| GetProcessIdOfThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x37 &lt;br /&gt;
| GetThreadId&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 &lt;br /&gt;
| GetResourceLimit(Handle*, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x39 &lt;br /&gt;
| GetResourceLimitLimitValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A &lt;br /&gt;
| GetResourceLimitCurrentValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B &lt;br /&gt;
| GetThreadContext (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C &lt;br /&gt;
| Break(BreakReason)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D &lt;br /&gt;
| OutputDebugString(void const, int) (Does nothing on non-debug units)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E &lt;br /&gt;
| ControlPerformanceCounter(unsigned long long, int, unsigned int, unsigned long long)&lt;br /&gt;
|-&lt;br /&gt;
| 0x47 &lt;br /&gt;
| CreatePort&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 &lt;br /&gt;
| CreateSessionToPort&lt;br /&gt;
|-&lt;br /&gt;
| 0x49 &lt;br /&gt;
| CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A &lt;br /&gt;
| AcceptSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B &lt;br /&gt;
| ReplyAndReceive1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C &lt;br /&gt;
| ReplyAndReceive2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4D &lt;br /&gt;
| ReplyAndReceive3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E &lt;br /&gt;
| ReplyAndReceive4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F &lt;br /&gt;
| ReplyAndReceive&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 &lt;br /&gt;
| BindInterrupt(Interrupt, Handle, int, bool)&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 &lt;br /&gt;
| UnbindInterrupt(Interrupt, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 &lt;br /&gt;
| InvalidateProcessDataCache(Handle, void*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 &lt;br /&gt;
| StoreProcessDataCache(Handle process, void const* addr, unsigned int size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 &lt;br /&gt;
| FlushProcessDataCache(Handle, void const*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 &lt;br /&gt;
| StartInterProcessDma(Handle* out, Handle dstProcess, void* dst, Handle srcProcess, const void* src, size_t size, const DmaConfig&amp;amp; config )&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 &lt;br /&gt;
| StopDma(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 &lt;br /&gt;
| GetDmaState(DmaState*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| RestartDma(nn::Handle, void *, void  const*, unsigned int, signed char)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 &lt;br /&gt;
| DebugActiveProcess(Handle *KDebug, unsigned int ProcessID)&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 &lt;br /&gt;
| BreakDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 &lt;br /&gt;
| TerminateDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 &lt;br /&gt;
| GetProcessDebugEvent(DebugEventInfo*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 &lt;br /&gt;
| ContinueDebugEvent(Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 &lt;br /&gt;
| GetProcessList(int *TotalPIDs, unsigned int *PIDs, int MaxPIDs)&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 &lt;br /&gt;
| GetThreadList(int*, unsigned int*, int, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 &lt;br /&gt;
| GetDebugThreadContext(ThreadContext*, Handle, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 &lt;br /&gt;
| SetDebugThreadContext(Handle, unsigned int, ThreadContext const&amp;amp;, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x69 &lt;br /&gt;
| QueryDebugProcessMemory(MemoryInfo*, PageInfo*, Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A &lt;br /&gt;
| ReadProcessMemory(void* Buffer, Handle KDebug, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B &lt;br /&gt;
| WriteProcessMemory(Handle KDebug, void const* Buffer, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C &lt;br /&gt;
| SetHardwareBreakPoint(int, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D&lt;br /&gt;
| GetDebugThreadParam(long long *, int *, nn::Handle, unsigned int, nn::dmnt::DebugThreadParam) (Disabled on regular kernel)&lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| ControlProcessMemory(Handle KProcess, unsigned int Addr0, unsigned int Addr1, unsigned int Size, unsigned int Type, unsigned int Permissions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x71&lt;br /&gt;
| MapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x72&lt;br /&gt;
| UnmapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x73&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| Stubbed on regular kernel&lt;br /&gt;
|-&lt;br /&gt;
| 0x75&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x76&lt;br /&gt;
| TerminateProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x77&lt;br /&gt;
| (Handle KProcess, Handle KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| CreateResourceLimit(Handle *KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x79&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A&lt;br /&gt;
| DisableExecuteNever(unsigned int Addr, unsigned int Size) (Stubbed for regular kernel beginning with [[2.0.0-2]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C&lt;br /&gt;
| KernelSetState(unsigned int Type, unsigned int Param0, unsigned int Param1, unsigned int Param2) (The Type determines the usage of each param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D&lt;br /&gt;
| QueryProcessMemory(MemInfo *Info, unsigned int *Out, Handle KProcess, unsigned int Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0xFF&lt;br /&gt;
| Debug related (The Syscall access control mask doesn&#039;t apply for this SVC)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Types and structures =&lt;br /&gt;
&lt;br /&gt;
== enum MemoryState ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory state flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| RESERVED&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| IO&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| STATIC&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| CODE&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| PRIVATE&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| SHARED&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| CONTINUOUS&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| ALIASED&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS&lt;br /&gt;
| 9&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS CODE&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 11&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum PageFlags ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Page flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| CHANGED&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryOperation ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory operation&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| RESERVE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| COMMIT&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| MAP&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| UNMAP&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| PROTECT&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| REGION APP&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| REGION SYSTEM&lt;br /&gt;
| 0x200&lt;br /&gt;
|-&lt;br /&gt;
| REGION BASE&lt;br /&gt;
| 0x300&lt;br /&gt;
|-&lt;br /&gt;
| LINEAR&lt;br /&gt;
| 0x1000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryPermission ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory permission&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| NONE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| READ&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| WRITE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| READWRITE&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| DONTCARE&lt;br /&gt;
| 0x10000000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== enum ResetType ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Reset type&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| ONESHOT&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| STICKY&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| PULSE&lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct MemoryInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Base address&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Permission&lt;br /&gt;
|-&lt;br /&gt;
| enum MemoryState&lt;br /&gt;
| State&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct PageInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Flags&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct StartupInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| Priority&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Stack size&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| argc&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| argv&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| envp&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Processes =&lt;br /&gt;
Each process can only use SVCs which are enabled in the [[NCCH#CXI|exheader]] for this process. The ARM11 kernel SVC handler checks whether the SVC is enabled in the syscall access control mask stored on the SVC-mode stack, when the SVC isn&#039;t enabled a kernelpanic() is triggered. Each process has a separate SVC-mode stack, this stack and the syscall access mask stored here is initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of this table is stored in the exheader. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for the current KThread.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
= Threads =&lt;br /&gt;
For svcCreateThread the input address used for Entrypoint_Param and StackTop are normally the same, however these can be arbitrary. For the main thread the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread.&lt;br /&gt;
&lt;br /&gt;
= Memory Mapping =&lt;br /&gt;
ControlMemory and MapMemoryBlock can be used to map memory pages, these two SVCs only support mapping execute-never R/W pages. The input permissions parameter for these SVCs must be &amp;lt;=3, where value zero is used when un-mapping memory. Bitmask 0xf00 for ControlMemory parameter MemoryType is the memory-type, when this is zero the memory-type is loaded from the kernel flags stored in the exheader ARM11 kernel descriptors, for the process using the SVC. ControlMemory parameter MemoryType with value 0x10003 is used for mapping the GSP [[Memory_layout|heap]]. The low 8-bits are the type: 1 is for un-mapping memory, 3 for mapping memory. Type4 is used to mirror the RW memory at Addr1, to Addr0. Type4 will return an error if Addr1 is located in read-only memory. Addr1 is not used for type1 and type3.&lt;br /&gt;
&lt;br /&gt;
ControlProcessMemory maps memory in the specified process, this is the only SVC which allows mapping executable memory. Format of the permissions field for memory mapping SVCs: bit0=R, bit1=W, bit2=X. Type6 sets the Addr0 memory permissions to the input permissions, for already mapped memory.&lt;br /&gt;
&lt;br /&gt;
MapProcessMemory maps RW memory starting at address 0x00100000 in the specified KProcess, at the specified StartAddr in the current process. MapProcessMemory then maps 0x08000000 in the specified process, to StartAddr+0x7f00000 in the current process. UnmapProcessMemory unmaps the memory which was mapped by MapProcessMemory.&lt;br /&gt;
&lt;br /&gt;
= Debugging =&lt;br /&gt;
DebugActiveProcess is used to attach to a process for debugging. This SVC can only be used when the target process&#039; ARM11 descriptors stored in the exheader have the kernel flag for &amp;quot;Enable debug&amp;quot; set. Otherwise when that flag is clear, the kernel flags for the process using this SVC must have the &amp;quot;Force debug&amp;quot; flag set.&lt;br /&gt;
&lt;br /&gt;
= KernelSetState =&lt;br /&gt;
Type0 initializes the programID for launching [[FIRM]], then triggers launching [[FIRM]]. Param0 and Param2 are unused. Param1 is the programID-low, and the programID-high is 0x00040138.&lt;br /&gt;
&lt;br /&gt;
Type3 is used for initializing the 0x1000-byte buffer used by the launched [[FIRM]]. Param2 is unused. When Param0 is value 1, this buffer is copied to the beginning of FCRAM at 0xF0000000, and Param1 is unused. When Param0 is value 0, this kernel buffer is mapped to process address Param1.&lt;br /&gt;
&lt;br /&gt;
= GetSystemInfo =&lt;br /&gt;
Type0 value 26(Type1 is unused) writes the total number of processes which were directly launched by the kernel, to Output. For the NATIVE_FIRM/SAFE_MODE_FIRM ARM11 kernel, this is normally 5, for processes sm, fs, pm, loader, and pxi.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4994</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4994"/>
		<updated>2013-02-21T00:41:37Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Service calls =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Id&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 &lt;br /&gt;
| ControlMemory(u32* outaddr, u32 addr0, u32 addr1, u32 size, u32 operation, u32 permissions) (outaddr is usually the same as the input addr0)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 &lt;br /&gt;
| QueryMemory(MemoryInfo* info, PageInfo* out, u32 Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 &lt;br /&gt;
| ExitProcess(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 &lt;br /&gt;
| GetProcessAffinityMask(u8* affinitymask, Handle process, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 &lt;br /&gt;
| SetProcessAffinityMask(Handle process, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 &lt;br /&gt;
| GetProcessIdealProcessor(s32 *idealprocessor, Handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 &lt;br /&gt;
| SetProcessIdealProcessor(Handle process, s32 idealprocessor)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| CreateThread(Handle* thread, func entrypoint, u32 arg, u32 stackbottom, s32 threadpriority, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9 &lt;br /&gt;
| ExitThread(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0xA &lt;br /&gt;
| SleepThread(s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0xB &lt;br /&gt;
| GetThreadPriority(s32* priority, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| SetThreadPriority(Handle thread, s32 priority)&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| GetThreadAffinityMask(u8* affinitymask, Handle thread, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| SetThreadAffinityMask(Handle thread, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xF &lt;br /&gt;
| GetThreadIdealProcessor(s32* processorid, Handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 &lt;br /&gt;
| SetThreadIdealProcessor(Handle thread, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 &lt;br /&gt;
| GetCurrentProcessorNumber(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 &lt;br /&gt;
| Run(Handle process, StartupInfo* info) (This starts the main() thread. Buf+0 is main-thread priority, Buf+4 is main-thread stack-size.)&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 &lt;br /&gt;
| CreateMutex(Handle* mutex, bool initialLocked)&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 &lt;br /&gt;
| ReleaseMutex(Handle mutex)&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 &lt;br /&gt;
| CreateSemaphore(Handle* semaphore, s32 initialCount, s32 maxCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 &lt;br /&gt;
| ReleaseSemaphore(s32* count, Handle semaphore, s32 releaseCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 &lt;br /&gt;
| CreateEvent(Handle* event, ResetType resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 &lt;br /&gt;
| SignalEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 &lt;br /&gt;
| ClearEvent(Handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A &lt;br /&gt;
| CreateTimer(Handle* timer, &lt;br /&gt;
|-&lt;br /&gt;
| 0x1B &lt;br /&gt;
| SetTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C &lt;br /&gt;
| CancelTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D &lt;br /&gt;
| ClearTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E &lt;br /&gt;
| CreateMemoryBlock&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F &lt;br /&gt;
| MapMemoryBlock(Handle, unsigned int Addr, unsigned int Permissions, unsigned int Unk)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 &lt;br /&gt;
| UnmapMemoryBlock&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 &lt;br /&gt;
| CreateAddressArbiter&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 &lt;br /&gt;
| ArbitrateAddress&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 &lt;br /&gt;
| CloseHandle(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 &lt;br /&gt;
| WaitSynchronization1&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 &lt;br /&gt;
| WaitSynchronization2&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 &lt;br /&gt;
| SignalAndWait&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 &lt;br /&gt;
| DuplicateHandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 &lt;br /&gt;
| GetSystemTick&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 &lt;br /&gt;
| GetHandleInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A &lt;br /&gt;
| GetSystemInfo(unsigned long long *Output, unsigned int Type0, unsigned int Type1)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B &lt;br /&gt;
| GetProcessInfo(unsigned long long *Output, Handle KProcess, unsigned int Type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C &lt;br /&gt;
| GetThreadInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D &lt;br /&gt;
| ConnectToPort(Handle*, char *PortName)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E &lt;br /&gt;
| SendSyncRequest1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F &lt;br /&gt;
| SendSyncRequest2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 &lt;br /&gt;
| SendSyncRequest3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 &lt;br /&gt;
| SendSyncRequest4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 &lt;br /&gt;
| SendSyncRequest(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 &lt;br /&gt;
| OpenProcess(Handle *KProcess, unsigned int ProcessId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 &lt;br /&gt;
| OpenThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x35 &lt;br /&gt;
| GetProcessId(unsigned int *ProcessId, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 &lt;br /&gt;
| GetProcessIdOfThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x37 &lt;br /&gt;
| GetThreadId&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 &lt;br /&gt;
| GetResourceLimit(Handle*, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x39 &lt;br /&gt;
| GetResourceLimitLimitValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A &lt;br /&gt;
| GetResourceLimitCurrentValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B &lt;br /&gt;
| GetThreadContext (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C &lt;br /&gt;
| Break(BreakReason)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D &lt;br /&gt;
| OutputDebugString(void const, int) (Does nothing on non-debug units)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E &lt;br /&gt;
| ControlPerformanceCounter(unsigned long long, int, unsigned int, unsigned long long)&lt;br /&gt;
|-&lt;br /&gt;
| 0x47 &lt;br /&gt;
| CreatePort&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 &lt;br /&gt;
| CreateSessionToPort&lt;br /&gt;
|-&lt;br /&gt;
| 0x49 &lt;br /&gt;
| CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A &lt;br /&gt;
| AcceptSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B &lt;br /&gt;
| ReplyAndReceive1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C &lt;br /&gt;
| ReplyAndReceive2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4D &lt;br /&gt;
| ReplyAndReceive3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E &lt;br /&gt;
| ReplyAndReceive4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F &lt;br /&gt;
| ReplyAndReceive&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 &lt;br /&gt;
| BindInterrupt(Interrupt, Handle, int, bool)&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 &lt;br /&gt;
| UnbindInterrupt(Interrupt, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 &lt;br /&gt;
| InvalidateProcessDataCache(Handle, void*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 &lt;br /&gt;
| StoreProcessDataCache(Handle process, void const* addr, unsigned int size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 &lt;br /&gt;
| FlushProcessDataCache(Handle, void const*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 &lt;br /&gt;
| StartInterProcessDma(Handle* out, Handle dstProcess, void* dst, Handle srcProcess, const void* src, size_t size, const DmaConfig&amp;amp; config )&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 &lt;br /&gt;
| StopDma(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 &lt;br /&gt;
| GetDmaState(DmaState*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| RestartDma(nn::Handle, void *, void  const*, unsigned int, signed char)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 &lt;br /&gt;
| DebugActiveProcess(Handle *KDebug, unsigned int ProcessID)&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 &lt;br /&gt;
| BreakDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 &lt;br /&gt;
| TerminateDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 &lt;br /&gt;
| GetProcessDebugEvent(DebugEventInfo*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 &lt;br /&gt;
| ContinueDebugEvent(Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 &lt;br /&gt;
| GetProcessList(int *TotalPIDs, unsigned int *PIDs, int MaxPIDs)&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 &lt;br /&gt;
| GetThreadList(int*, unsigned int*, int, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 &lt;br /&gt;
| GetDebugThreadContext(ThreadContext*, Handle, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 &lt;br /&gt;
| SetDebugThreadContext(Handle, unsigned int, ThreadContext const&amp;amp;, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x69 &lt;br /&gt;
| QueryDebugProcessMemory(MemoryInfo*, PageInfo*, Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A &lt;br /&gt;
| ReadProcessMemory(void* Buffer, Handle KDebug, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B &lt;br /&gt;
| WriteProcessMemory(Handle KDebug, void const* Buffer, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C &lt;br /&gt;
| SetHardwareBreakPoint(int, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D&lt;br /&gt;
| GetDebugThreadParam(long long *, int *, nn::Handle, unsigned int, nn::dmnt::DebugThreadParam) (Disabled on regular kernel)&lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| ControlProcessMemory(Handle KProcess, unsigned int Addr0, unsigned int Addr1, unsigned int Size, unsigned int Type, unsigned int Permissions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x71&lt;br /&gt;
| MapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x72&lt;br /&gt;
| UnmapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x73&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| Stubbed on regular kernel&lt;br /&gt;
|-&lt;br /&gt;
| 0x75&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x76&lt;br /&gt;
| TerminateProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x77&lt;br /&gt;
| (Handle KProcess, Handle KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| CreateResourceLimit(Handle *KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x79&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A&lt;br /&gt;
| DisableExecuteNever(unsigned int Addr, unsigned int Size) (Stubbed for regular kernel beginning with [[2.0.0-2]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C&lt;br /&gt;
| KernelSetState(unsigned int Type, unsigned int Param0, unsigned int Param1, unsigned int Param2) (The Type determines the usage of each param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D&lt;br /&gt;
| QueryProcessMemory(MemInfo *Info, unsigned int *Out, Handle KProcess, unsigned int Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0xFF&lt;br /&gt;
| Debug related (The Syscall access control mask doesn&#039;t apply for this SVC)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Types and structures =&lt;br /&gt;
&lt;br /&gt;
== enum MemoryState ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory state flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| RESERVED&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| IO&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| STATIC&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| CODE&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| PRIVATE&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| SHARED&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| CONTINUOUS&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| ALIASED&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS&lt;br /&gt;
| 9&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS CODE&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 11&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum PageFlags ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Page flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| CHANGED&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryOperation ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory operation&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| RESERVE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| COMMIT&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| MAP&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| UNMAP&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| PROTECT&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| REGION APP&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| REGION SYSTEM&lt;br /&gt;
| 0x200&lt;br /&gt;
|-&lt;br /&gt;
| REGION BASE&lt;br /&gt;
| 0x300&lt;br /&gt;
|-&lt;br /&gt;
| LINEAR&lt;br /&gt;
| 0x1000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== enum MemoryPermission ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory permission&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| NONE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| READ&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| WRITE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| READWRITE&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| DONTCARE&lt;br /&gt;
| 0x10000000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct MemoryInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Base address&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Size&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Permission&lt;br /&gt;
|-&lt;br /&gt;
| enum MemoryState&lt;br /&gt;
| State&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct PageInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Flags&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== struct StartupInfo ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Type&lt;br /&gt;
!  Field&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| Priority&lt;br /&gt;
|-&lt;br /&gt;
| u32&lt;br /&gt;
| Stack size&lt;br /&gt;
|-&lt;br /&gt;
| s32&lt;br /&gt;
| argc&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| argv&lt;br /&gt;
|-&lt;br /&gt;
| s16*&lt;br /&gt;
| envp&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Processes =&lt;br /&gt;
Each process can only use SVCs which are enabled in the [[NCCH#CXI|exheader]] for this process. The ARM11 kernel SVC handler checks whether the SVC is enabled in the syscall access control mask stored on the SVC-mode stack, when the SVC isn&#039;t enabled a kernelpanic() is triggered. Each process has a separate SVC-mode stack, this stack and the syscall access mask stored here is initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of this table is stored in the exheader. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for the current KThread.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
= Threads =&lt;br /&gt;
For svcCreateThread the input address used for Entrypoint_Param and StackTop are normally the same, however these can be arbitrary. For the main thread the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread.&lt;br /&gt;
&lt;br /&gt;
= Memory Mapping =&lt;br /&gt;
ControlMemory and MapMemoryBlock can be used to map memory pages, these two SVCs only support mapping execute-never R/W pages. The input permissions parameter for these SVCs must be &amp;lt;=3, where value zero is used when un-mapping memory. Bitmask 0xf00 for ControlMemory parameter MemoryType is the memory-type, when this is zero the memory-type is loaded from the kernel flags stored in the exheader ARM11 kernel descriptors, for the process using the SVC. ControlMemory parameter MemoryType with value 0x10003 is used for mapping the GSP [[Memory_layout|heap]]. The low 8-bits are the type: 1 is for un-mapping memory, 3 for mapping memory. Type4 is used to mirror the RW memory at Addr1, to Addr0. Type4 will return an error if Addr1 is located in read-only memory. Addr1 is not used for type1 and type3.&lt;br /&gt;
&lt;br /&gt;
ControlProcessMemory maps memory in the specified process, this is the only SVC which allows mapping executable memory. Format of the permissions field for memory mapping SVCs: bit0=R, bit1=W, bit2=X. Type6 sets the Addr0 memory permissions to the input permissions, for already mapped memory.&lt;br /&gt;
&lt;br /&gt;
MapProcessMemory maps RW memory starting at address 0x00100000 in the specified KProcess, at the specified StartAddr in the current process. MapProcessMemory then maps 0x08000000 in the specified process, to StartAddr+0x7f00000 in the current process. UnmapProcessMemory unmaps the memory which was mapped by MapProcessMemory.&lt;br /&gt;
&lt;br /&gt;
= Debugging =&lt;br /&gt;
DebugActiveProcess is used to attach to a process for debugging. This SVC can only be used when the target process&#039; ARM11 descriptors stored in the exheader have the kernel flag for &amp;quot;Enable debug&amp;quot; set. Otherwise when that flag is clear, the kernel flags for the process using this SVC must have the &amp;quot;Force debug&amp;quot; flag set.&lt;br /&gt;
&lt;br /&gt;
= KernelSetState =&lt;br /&gt;
Type0 initializes the programID for launching [[FIRM]], then triggers launching [[FIRM]]. Param0 and Param2 are unused. Param1 is the programID-low, and the programID-high is 0x00040138.&lt;br /&gt;
&lt;br /&gt;
Type3 is used for initializing the 0x1000-byte buffer used by the launched [[FIRM]]. Param2 is unused. When Param0 is value 1, this buffer is copied to the beginning of FCRAM at 0xF0000000, and Param1 is unused. When Param0 is value 0, this kernel buffer is mapped to process address Param1.&lt;br /&gt;
&lt;br /&gt;
= GetSystemInfo =&lt;br /&gt;
Type0 value 26(Type1 is unused) writes the total number of processes which were directly launched by the kernel, to Output. For the NATIVE_FIRM/SAFE_MODE_FIRM ARM11 kernel, this is normally 5, for processes sm, fs, pm, loader, and pxi.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4993</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4993"/>
		<updated>2013-02-21T00:31:54Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== SVC List ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Id&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 &lt;br /&gt;
| ControlMemory(u32* outaddr, u32 addr0, u32 addr1, u32 size, u32 operation, u32 permissions) (outaddr is usually the same as the input addr0)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 &lt;br /&gt;
| QueryMemory(MemInfo* info, PageInfo* out, u32 Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 &lt;br /&gt;
| ExitProcess(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 &lt;br /&gt;
| GetProcessAffinityMask(u8* affinitymask, handle process, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 &lt;br /&gt;
| SetProcessAffinityMask(handle process, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 &lt;br /&gt;
| GetProcessIdealProcessor(s32 *idealprocessor, handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 &lt;br /&gt;
| SetProcessIdealProcessor(handle process, s32 idealprocessor)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| CreateThread(handle* thread, func entrypoint, u32 arg, u32 stackbottom, s32 threadpriority, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9 &lt;br /&gt;
| ExitThread(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0xA &lt;br /&gt;
| SleepThread(s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0xB &lt;br /&gt;
| GetThreadPriority(s32* priority, handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| SetThreadPriority(handle thread, s32 priority)&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| GetThreadAffinityMask(u8* affinitymask, handle thread, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| SetThreadAffinityMask(handle thread, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xF &lt;br /&gt;
| GetThreadIdealProcessor(s32* processorid, handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 &lt;br /&gt;
| SetThreadIdealProcessor(handle thread, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 &lt;br /&gt;
| GetCurrentProcessorNumber(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 &lt;br /&gt;
| Run(handle process, StartupInfo* info) (This starts the main() thread. Buf+0 is main-thread priority, Buf+4 is main-thread stack-size.)&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 &lt;br /&gt;
| CreateMutex(handle* mutex, bool initialLocked)&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 &lt;br /&gt;
| ReleaseMutex(handle mutex)&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 &lt;br /&gt;
| CreateSemaphore(handle* semaphore, s32 initialCount, s32 maxCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 &lt;br /&gt;
| ReleaseSemaphore(s32* count, handle semaphore, s32 releaseCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 &lt;br /&gt;
| CreateEvent(handle* event, unsigned char resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 &lt;br /&gt;
| SignalEvent(handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 &lt;br /&gt;
| ClearEvent(handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A &lt;br /&gt;
| CreateTimer(handle* timer, &lt;br /&gt;
|-&lt;br /&gt;
| 0x1B &lt;br /&gt;
| SetTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C &lt;br /&gt;
| CancelTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D &lt;br /&gt;
| ClearTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E &lt;br /&gt;
| CreateMemoryBlock&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F &lt;br /&gt;
| MapMemoryBlock(Handle, unsigned int Addr, unsigned int Permissions, unsigned int Unk)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 &lt;br /&gt;
| UnmapMemoryBlock&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 &lt;br /&gt;
| CreateAddressArbiter&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 &lt;br /&gt;
| ArbitrateAddress&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 &lt;br /&gt;
| CloseHandle(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 &lt;br /&gt;
| WaitSynchronization1&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 &lt;br /&gt;
| WaitSynchronization2&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 &lt;br /&gt;
| SignalAndWait&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 &lt;br /&gt;
| DuplicateHandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 &lt;br /&gt;
| GetSystemTick&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 &lt;br /&gt;
| GetHandleInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A &lt;br /&gt;
| GetSystemInfo(unsigned long long *Output, unsigned int Type0, unsigned int Type1)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B &lt;br /&gt;
| GetProcessInfo(unsigned long long *Output, Handle KProcess, unsigned int Type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C &lt;br /&gt;
| GetThreadInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D &lt;br /&gt;
| ConnectToPort(Handle*, char *PortName)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E &lt;br /&gt;
| SendSyncRequest1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F &lt;br /&gt;
| SendSyncRequest2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 &lt;br /&gt;
| SendSyncRequest3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 &lt;br /&gt;
| SendSyncRequest4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 &lt;br /&gt;
| SendSyncRequest(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 &lt;br /&gt;
| OpenProcess(Handle *KProcess, unsigned int ProcessId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 &lt;br /&gt;
| OpenThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x35 &lt;br /&gt;
| GetProcessId(unsigned int *ProcessId, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 &lt;br /&gt;
| GetProcessIdOfThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x37 &lt;br /&gt;
| GetThreadId&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 &lt;br /&gt;
| GetResourceLimit(Handle*, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x39 &lt;br /&gt;
| GetResourceLimitLimitValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A &lt;br /&gt;
| GetResourceLimitCurrentValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B &lt;br /&gt;
| GetThreadContext (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C &lt;br /&gt;
| Break(BreakReason)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D &lt;br /&gt;
| OutputDebugString(void const, int) (Does nothing on non-debug units)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E &lt;br /&gt;
| ControlPerformanceCounter(unsigned long long, int, unsigned int, unsigned long long)&lt;br /&gt;
|-&lt;br /&gt;
| 0x47 &lt;br /&gt;
| CreatePort&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 &lt;br /&gt;
| CreateSessionToPort&lt;br /&gt;
|-&lt;br /&gt;
| 0x49 &lt;br /&gt;
| CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A &lt;br /&gt;
| AcceptSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B &lt;br /&gt;
| ReplyAndReceive1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C &lt;br /&gt;
| ReplyAndReceive2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4D &lt;br /&gt;
| ReplyAndReceive3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E &lt;br /&gt;
| ReplyAndReceive4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F &lt;br /&gt;
| ReplyAndReceive&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 &lt;br /&gt;
| BindInterrupt(Interrupt, Handle, int, bool)&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 &lt;br /&gt;
| UnbindInterrupt(Interrupt, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 &lt;br /&gt;
| InvalidateProcessDataCache(Handle, void*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 &lt;br /&gt;
| StoreProcessDataCache(Handle process, void const* addr, unsigned int size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 &lt;br /&gt;
| FlushProcessDataCache(Handle, void const*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 &lt;br /&gt;
| StartInterProcessDma(Handle* out, Handle dstProcess, void* dst, Handle srcProcess, const void* src, size_t size, const DmaConfig&amp;amp; config )&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 &lt;br /&gt;
| StopDma(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 &lt;br /&gt;
| GetDmaState(DmaState*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| RestartDma(nn::Handle, void *, void  const*, unsigned int, signed char)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 &lt;br /&gt;
| DebugActiveProcess(Handle *KDebug, unsigned int ProcessID)&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 &lt;br /&gt;
| BreakDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 &lt;br /&gt;
| TerminateDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 &lt;br /&gt;
| GetProcessDebugEvent(DebugEventInfo*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 &lt;br /&gt;
| ContinueDebugEvent(Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 &lt;br /&gt;
| GetProcessList(int *TotalPIDs, unsigned int *PIDs, int MaxPIDs)&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 &lt;br /&gt;
| GetThreadList(int*, unsigned int*, int, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 &lt;br /&gt;
| GetDebugThreadContext(ThreadContext*, Handle, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 &lt;br /&gt;
| SetDebugThreadContext(Handle, unsigned int, ThreadContext const&amp;amp;, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x69 &lt;br /&gt;
| QueryDebugProcessMemory(MemoryInfo*, PageInfo*, Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A &lt;br /&gt;
| ReadProcessMemory(void* Buffer, Handle KDebug, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B &lt;br /&gt;
| WriteProcessMemory(Handle KDebug, void const* Buffer, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C &lt;br /&gt;
| SetHardwareBreakPoint(int, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D&lt;br /&gt;
| GetDebugThreadParam(long long *, int *, nn::Handle, unsigned int, nn::dmnt::DebugThreadParam) (Disabled on regular kernel)&lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| ControlProcessMemory(Handle KProcess, unsigned int Addr0, unsigned int Addr1, unsigned int Size, unsigned int Type, unsigned int Permissions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x71&lt;br /&gt;
| MapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x72&lt;br /&gt;
| UnmapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x73&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| Stubbed on regular kernel&lt;br /&gt;
|-&lt;br /&gt;
| 0x75&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x76&lt;br /&gt;
| TerminateProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x77&lt;br /&gt;
| (Handle KProcess, Handle KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| CreateResourceLimit(Handle *KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x79&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A&lt;br /&gt;
| DisableExecuteNever(unsigned int Addr, unsigned int Size) (Stubbed for regular kernel beginning with [[2.0.0-2]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C&lt;br /&gt;
| KernelSetState(unsigned int Type, unsigned int Param0, unsigned int Param1, unsigned int Param2) (The Type determines the usage of each param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D&lt;br /&gt;
| QueryProcessMemory(MemInfo *Info, unsigned int *Out, Handle KProcess, unsigned int Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0xFF&lt;br /&gt;
| Debug related (The Syscall access control mask doesn&#039;t apply for this SVC)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Types and structures ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory state flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| RESERVED&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| IO&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| STATIC&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| CODE&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| PRIVATE&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| SHARED&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| CONTINUOUS&lt;br /&gt;
| 7&lt;br /&gt;
|-&lt;br /&gt;
| ALIASED&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS&lt;br /&gt;
| 9&lt;br /&gt;
|-&lt;br /&gt;
| ALIAS CODE&lt;br /&gt;
| 10&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 11&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Page flags&lt;br /&gt;
!  Bit&lt;br /&gt;
|-&lt;br /&gt;
| LOCKED&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| CHANGED&lt;br /&gt;
| 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory operation&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| FREE&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| RESERVE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| COMMIT&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| MAP&lt;br /&gt;
| 4&lt;br /&gt;
|-&lt;br /&gt;
| UNMAP&lt;br /&gt;
| 5&lt;br /&gt;
|-&lt;br /&gt;
| PROTECT&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| REGION APP&lt;br /&gt;
| 0x100&lt;br /&gt;
|-&lt;br /&gt;
| REGION SYSTEM&lt;br /&gt;
| 0x200&lt;br /&gt;
|-&lt;br /&gt;
| REGION BASE&lt;br /&gt;
| 0x300&lt;br /&gt;
|-&lt;br /&gt;
| LINEAR&lt;br /&gt;
| 0x1000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!  Memory permission&lt;br /&gt;
!  Id&lt;br /&gt;
|-&lt;br /&gt;
| NONE&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| READ&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| WRITE&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| READWRITE&lt;br /&gt;
| 3&lt;br /&gt;
|-&lt;br /&gt;
| DONTCARE&lt;br /&gt;
| 0x10000000&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Processes ===&lt;br /&gt;
Each process can only use SVCs which are enabled in the [[NCCH#CXI|exheader]] for this process. The ARM11 kernel SVC handler checks whether the SVC is enabled in the syscall access control mask stored on the SVC-mode stack, when the SVC isn&#039;t enabled a kernelpanic() is triggered. Each process has a separate SVC-mode stack, this stack and the syscall access mask stored here is initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of this table is stored in the exheader. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for the current KThread.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
=== Threads ===&lt;br /&gt;
For svcCreateThread the input address used for Entrypoint_Param and StackTop are normally the same, however these can be arbitrary. For the main thread the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread.&lt;br /&gt;
&lt;br /&gt;
=== Memory Mapping ===&lt;br /&gt;
ControlMemory and MapMemoryBlock can be used to map memory pages, these two SVCs only support mapping execute-never R/W pages. The input permissions parameter for these SVCs must be &amp;lt;=3, where value zero is used when un-mapping memory. Bitmask 0xf00 for ControlMemory parameter MemoryType is the memory-type, when this is zero the memory-type is loaded from the kernel flags stored in the exheader ARM11 kernel descriptors, for the process using the SVC. ControlMemory parameter MemoryType with value 0x10003 is used for mapping the GSP [[Memory_layout|heap]]. The low 8-bits are the type: 1 is for un-mapping memory, 3 for mapping memory. Type4 is used to mirror the RW memory at Addr1, to Addr0. Type4 will return an error if Addr1 is located in read-only memory. Addr1 is not used for type1 and type3.&lt;br /&gt;
&lt;br /&gt;
ControlProcessMemory maps memory in the specified process, this is the only SVC which allows mapping executable memory. Format of the permissions field for memory mapping SVCs: bit0=R, bit1=W, bit2=X. Type6 sets the Addr0 memory permissions to the input permissions, for already mapped memory.&lt;br /&gt;
&lt;br /&gt;
MapProcessMemory maps RW memory starting at address 0x00100000 in the specified KProcess, at the specified StartAddr in the current process. MapProcessMemory then maps 0x08000000 in the specified process, to StartAddr+0x7f00000 in the current process. UnmapProcessMemory unmaps the memory which was mapped by MapProcessMemory.&lt;br /&gt;
&lt;br /&gt;
=== Debugging ===&lt;br /&gt;
DebugActiveProcess is used to attach to a process for debugging. This SVC can only be used when the target process&#039; ARM11 descriptors stored in the exheader have the kernel flag for &amp;quot;Enable debug&amp;quot; set. Otherwise when that flag is clear, the kernel flags for the process using this SVC must have the &amp;quot;Force debug&amp;quot; flag set.&lt;br /&gt;
&lt;br /&gt;
=== KernelSetState ===&lt;br /&gt;
Type0 initializes the programID for launching [[FIRM]], then triggers launching [[FIRM]]. Param0 and Param2 are unused. Param1 is the programID-low, and the programID-high is 0x00040138.&lt;br /&gt;
&lt;br /&gt;
Type3 is used for initializing the 0x1000-byte buffer used by the launched [[FIRM]]. Param2 is unused. When Param0 is value 1, this buffer is copied to the beginning of FCRAM at 0xF0000000, and Param1 is unused. When Param0 is value 0, this kernel buffer is mapped to process address Param1.&lt;br /&gt;
&lt;br /&gt;
=== GetSystemInfo ===&lt;br /&gt;
Type0 value 26(Type1 is unused) writes the total number of processes which were directly launched by the kernel, to Output. For the NATIVE_FIRM/SAFE_MODE_FIRM ARM11 kernel, this is normally 5, for processes sm, fs, pm, loader, and pxi.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4992</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4992"/>
		<updated>2013-02-21T00:20:08Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== SVC List ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Id&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 &lt;br /&gt;
| ControlMemory(u32* outaddr, u32 addr0, u32 addr1, u32 size, u32 operation, u32 permissions) (outaddr is usually the same as the input addr0)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 &lt;br /&gt;
| QueryMemory(MemInfo* info, PageInfo* out, u32 Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 &lt;br /&gt;
| ExitProcess(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 &lt;br /&gt;
| GetProcessAffinityMask(u8* affinitymask, handle process, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 &lt;br /&gt;
| SetProcessAffinityMask(handle process, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 &lt;br /&gt;
| GetProcessIdealProcessor(s32 *idealprocessor, handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 &lt;br /&gt;
| SetProcessIdealProcessor(handle process, s32 idealprocessor)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| CreateThread(handle* thread, func entrypoint, u32 arg, u32 stackbottom, s32 threadpriority, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9 &lt;br /&gt;
| ExitThread(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0xA &lt;br /&gt;
| SleepThread(s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0xB &lt;br /&gt;
| GetThreadPriority(s32* priority, handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| SetThreadPriority(handle thread, s32 priority)&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| GetThreadAffinityMask(u8* affinitymask, handle thread, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| SetThreadAffinityMask(handle thread, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xF &lt;br /&gt;
| GetThreadIdealProcessor(s32* processorid, handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 &lt;br /&gt;
| SetThreadIdealProcessor(handle thread, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 &lt;br /&gt;
| GetCurrentProcessorNumber(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 &lt;br /&gt;
| Run(handle process, StartupInfo* info) (This starts the main() thread. Buf+0 is main-thread priority, Buf+4 is main-thread stack-size.)&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 &lt;br /&gt;
| CreateMutex(handle* mutex, bool initialLocked)&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 &lt;br /&gt;
| ReleaseMutex(handle mutex)&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 &lt;br /&gt;
| CreateSemaphore(handle* semaphore, s32 initialCount, s32 maxCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 &lt;br /&gt;
| ReleaseSemaphore(s32* count, handle semaphore, s32 releaseCount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 &lt;br /&gt;
| CreateEvent(handle* event, unsigned char resettype)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 &lt;br /&gt;
| SignalEvent(handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 &lt;br /&gt;
| ClearEvent(handle event)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A &lt;br /&gt;
| CreateTimer(handle* timer, &lt;br /&gt;
|-&lt;br /&gt;
| 0x1B &lt;br /&gt;
| SetTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C &lt;br /&gt;
| CancelTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D &lt;br /&gt;
| ClearTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E &lt;br /&gt;
| CreateMemoryBlock&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F &lt;br /&gt;
| MapMemoryBlock(Handle, unsigned int Addr, unsigned int Permissions, unsigned int Unk)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 &lt;br /&gt;
| UnmapMemoryBlock&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 &lt;br /&gt;
| CreateAddressArbiter&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 &lt;br /&gt;
| ArbitrateAddress&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 &lt;br /&gt;
| CloseHandle(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 &lt;br /&gt;
| WaitSynchronization1&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 &lt;br /&gt;
| WaitSynchronization2&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 &lt;br /&gt;
| SignalAndWait&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 &lt;br /&gt;
| DuplicateHandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 &lt;br /&gt;
| GetSystemTick&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 &lt;br /&gt;
| GetHandleInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A &lt;br /&gt;
| GetSystemInfo(unsigned long long *Output, unsigned int Type0, unsigned int Type1)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B &lt;br /&gt;
| GetProcessInfo(unsigned long long *Output, Handle KProcess, unsigned int Type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C &lt;br /&gt;
| GetThreadInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D &lt;br /&gt;
| ConnectToPort(Handle*, char *PortName)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E &lt;br /&gt;
| SendSyncRequest1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F &lt;br /&gt;
| SendSyncRequest2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 &lt;br /&gt;
| SendSyncRequest3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 &lt;br /&gt;
| SendSyncRequest4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 &lt;br /&gt;
| SendSyncRequest(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 &lt;br /&gt;
| OpenProcess(Handle *KProcess, unsigned int ProcessId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 &lt;br /&gt;
| OpenThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x35 &lt;br /&gt;
| GetProcessId(unsigned int *ProcessId, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 &lt;br /&gt;
| GetProcessIdOfThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x37 &lt;br /&gt;
| GetThreadId&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 &lt;br /&gt;
| GetResourceLimit(Handle*, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x39 &lt;br /&gt;
| GetResourceLimitLimitValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A &lt;br /&gt;
| GetResourceLimitCurrentValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B &lt;br /&gt;
| GetThreadContext (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C &lt;br /&gt;
| Break(BreakReason)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D &lt;br /&gt;
| OutputDebugString(void const, int) (Does nothing on non-debug units)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E &lt;br /&gt;
| ControlPerformanceCounter(unsigned long long, int, unsigned int, unsigned long long)&lt;br /&gt;
|-&lt;br /&gt;
| 0x47 &lt;br /&gt;
| CreatePort&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 &lt;br /&gt;
| CreateSessionToPort&lt;br /&gt;
|-&lt;br /&gt;
| 0x49 &lt;br /&gt;
| CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A &lt;br /&gt;
| AcceptSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B &lt;br /&gt;
| ReplyAndReceive1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C &lt;br /&gt;
| ReplyAndReceive2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4D &lt;br /&gt;
| ReplyAndReceive3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E &lt;br /&gt;
| ReplyAndReceive4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F &lt;br /&gt;
| ReplyAndReceive&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 &lt;br /&gt;
| BindInterrupt(Interrupt, Handle, int, bool)&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 &lt;br /&gt;
| UnbindInterrupt(Interrupt, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 &lt;br /&gt;
| InvalidateProcessDataCache(Handle, void*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 &lt;br /&gt;
| StoreProcessDataCache(Handle process, void const* addr, unsigned int size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 &lt;br /&gt;
| FlushProcessDataCache(Handle, void const*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 &lt;br /&gt;
| StartInterProcessDma(Handle* out, Handle dstProcess, void* dst, Handle srcProcess, const void* src, size_t size, const DmaConfig&amp;amp; config )&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 &lt;br /&gt;
| StopDma(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 &lt;br /&gt;
| GetDmaState(DmaState*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| RestartDma(nn::Handle, void *, void  const*, unsigned int, signed char)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 &lt;br /&gt;
| DebugActiveProcess(Handle *KDebug, unsigned int ProcessID)&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 &lt;br /&gt;
| BreakDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 &lt;br /&gt;
| TerminateDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 &lt;br /&gt;
| GetProcessDebugEvent(DebugEventInfo*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 &lt;br /&gt;
| ContinueDebugEvent(Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 &lt;br /&gt;
| GetProcessList(int *TotalPIDs, unsigned int *PIDs, int MaxPIDs)&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 &lt;br /&gt;
| GetThreadList(int*, unsigned int*, int, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 &lt;br /&gt;
| GetDebugThreadContext(ThreadContext*, Handle, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 &lt;br /&gt;
| SetDebugThreadContext(Handle, unsigned int, ThreadContext const&amp;amp;, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x69 &lt;br /&gt;
| QueryDebugProcessMemory(MemoryInfo*, PageInfo*, Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A &lt;br /&gt;
| ReadProcessMemory(void* Buffer, Handle KDebug, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B &lt;br /&gt;
| WriteProcessMemory(Handle KDebug, void const* Buffer, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C &lt;br /&gt;
| SetHardwareBreakPoint(int, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D&lt;br /&gt;
| GetDebugThreadParam(long long *, int *, nn::Handle, unsigned int, nn::dmnt::DebugThreadParam) (Disabled on regular kernel)&lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| ControlProcessMemory(Handle KProcess, unsigned int Addr0, unsigned int Addr1, unsigned int Size, unsigned int Type, unsigned int Permissions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x71&lt;br /&gt;
| MapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x72&lt;br /&gt;
| UnmapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x73&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| Stubbed on regular kernel&lt;br /&gt;
|-&lt;br /&gt;
| 0x75&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x76&lt;br /&gt;
| TerminateProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x77&lt;br /&gt;
| (Handle KProcess, Handle KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| CreateResourceLimit(Handle *KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x79&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A&lt;br /&gt;
| DisableExecuteNever(unsigned int Addr, unsigned int Size) (Stubbed for regular kernel beginning with [[2.0.0-2]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C&lt;br /&gt;
| KernelSetState(unsigned int Type, unsigned int Param0, unsigned int Param1, unsigned int Param2) (The Type determines the usage of each param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D&lt;br /&gt;
| QueryProcessMemory(MemInfo *Info, unsigned int *Out, Handle KProcess, unsigned int Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0xFF&lt;br /&gt;
| Debug related (The Syscall access control mask doesn&#039;t apply for this SVC)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Processes ===&lt;br /&gt;
Each process can only use SVCs which are enabled in the [[NCCH#CXI|exheader]] for this process. The ARM11 kernel SVC handler checks whether the SVC is enabled in the syscall access control mask stored on the SVC-mode stack, when the SVC isn&#039;t enabled a kernelpanic() is triggered. Each process has a separate SVC-mode stack, this stack and the syscall access mask stored here is initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of this table is stored in the exheader. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for the current KThread.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
=== Threads ===&lt;br /&gt;
For svcCreateThread the input address used for Entrypoint_Param and StackTop are normally the same, however these can be arbitrary. For the main thread the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread.&lt;br /&gt;
&lt;br /&gt;
=== Memory Mapping ===&lt;br /&gt;
ControlMemory and MapMemoryBlock can be used to map memory pages, these two SVCs only support mapping execute-never R/W pages. The input permissions parameter for these SVCs must be &amp;lt;=3, where value zero is used when un-mapping memory. Bitmask 0xf00 for ControlMemory parameter MemoryType is the memory-type, when this is zero the memory-type is loaded from the kernel flags stored in the exheader ARM11 kernel descriptors, for the process using the SVC. ControlMemory parameter MemoryType with value 0x10003 is used for mapping the GSP [[Memory_layout|heap]]. The low 8-bits are the type: 1 is for un-mapping memory, 3 for mapping memory. Type4 is used to mirror the RW memory at Addr1, to Addr0. Type4 will return an error if Addr1 is located in read-only memory. Addr1 is not used for type1 and type3.&lt;br /&gt;
&lt;br /&gt;
ControlProcessMemory maps memory in the specified process, this is the only SVC which allows mapping executable memory. Format of the permissions field for memory mapping SVCs: bit0=R, bit1=W, bit2=X. Type6 sets the Addr0 memory permissions to the input permissions, for already mapped memory.&lt;br /&gt;
&lt;br /&gt;
MapProcessMemory maps RW memory starting at address 0x00100000 in the specified KProcess, at the specified StartAddr in the current process. MapProcessMemory then maps 0x08000000 in the specified process, to StartAddr+0x7f00000 in the current process. UnmapProcessMemory unmaps the memory which was mapped by MapProcessMemory.&lt;br /&gt;
&lt;br /&gt;
=== Debugging ===&lt;br /&gt;
DebugActiveProcess is used to attach to a process for debugging. This SVC can only be used when the target process&#039; ARM11 descriptors stored in the exheader have the kernel flag for &amp;quot;Enable debug&amp;quot; set. Otherwise when that flag is clear, the kernel flags for the process using this SVC must have the &amp;quot;Force debug&amp;quot; flag set.&lt;br /&gt;
&lt;br /&gt;
=== KernelSetState ===&lt;br /&gt;
Type0 initializes the programID for launching [[FIRM]], then triggers launching [[FIRM]]. Param0 and Param2 are unused. Param1 is the programID-low, and the programID-high is 0x00040138.&lt;br /&gt;
&lt;br /&gt;
Type3 is used for initializing the 0x1000-byte buffer used by the launched [[FIRM]]. Param2 is unused. When Param0 is value 1, this buffer is copied to the beginning of FCRAM at 0xF0000000, and Param1 is unused. When Param0 is value 0, this kernel buffer is mapped to process address Param1.&lt;br /&gt;
&lt;br /&gt;
=== GetSystemInfo ===&lt;br /&gt;
Type0 value 26(Type1 is unused) writes the total number of processes which were directly launched by the kernel, to Output. For the NATIVE_FIRM/SAFE_MODE_FIRM ARM11 kernel, this is normally 5, for processes sm, fs, pm, loader, and pxi.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4991</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4991"/>
		<updated>2013-02-21T00:14:07Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== SVC List ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Id&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 &lt;br /&gt;
| ControlMemory(u32* outaddr, u32 addr0, u32 addr1, u32 size, u32 operation, u32 permissions) (outaddr is usually the same as the input addr0)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 &lt;br /&gt;
| QueryMemory(MemInfo* info, PageInfo* out, u32 Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 &lt;br /&gt;
| ExitProcess(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 &lt;br /&gt;
| GetProcessAffinityMask(u8* affinitymask, handle process, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 &lt;br /&gt;
| SetProcessAffinityMask(handle process, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 &lt;br /&gt;
| GetProcessIdealProcessor(s32 *idealprocessor, handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 &lt;br /&gt;
| SetProcessIdealProcessor(handle process, s32 idealprocessor)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| CreateThread(handle* thread, func entrypoint, u32 arg, u32 stackbottom, s32 threadpriority, s32 processorid)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9 &lt;br /&gt;
| ExitThread(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0xA &lt;br /&gt;
| SleepThread(s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0xB &lt;br /&gt;
| GetThreadPriority(s32* priority, handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| SetThreadPriority(handle thread, s32 priority)&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| GetThreadAffinityMask(u8* affinitymask, handle thread, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| SetThreadAffinityMask(handle thread, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xF &lt;br /&gt;
| GetThreadIdealProcessor&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 &lt;br /&gt;
| SetThreadIdealProcessor&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 &lt;br /&gt;
| GetCurrentProcessorNumber&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 &lt;br /&gt;
| Run(Handle KProcess, unsigned int *buf) (This starts the main() thread. Buf+0 is main-thread priority, Buf+4 is main-thread stack-size.)&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 &lt;br /&gt;
| CreateMutex&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 &lt;br /&gt;
| ReleaseMutex(Handle KMutex)&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 &lt;br /&gt;
| CreateSemaphore&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 &lt;br /&gt;
| ReleaseSemaphore&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 &lt;br /&gt;
| CreateEvent(Handle *KEvent, unsigned char Unk)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 &lt;br /&gt;
| SignalEvent(Handle KEvent)&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 &lt;br /&gt;
| ClearEvent&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A &lt;br /&gt;
| CreateTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B &lt;br /&gt;
| SetTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C &lt;br /&gt;
| CancelTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D &lt;br /&gt;
| ClearTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E &lt;br /&gt;
| CreateMemoryBlock&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F &lt;br /&gt;
| MapMemoryBlock(Handle, unsigned int Addr, unsigned int Permissions, unsigned int Unk)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 &lt;br /&gt;
| UnmapMemoryBlock&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 &lt;br /&gt;
| CreateAddressArbiter&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 &lt;br /&gt;
| ArbitrateAddress&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 &lt;br /&gt;
| CloseHandle(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 &lt;br /&gt;
| WaitSynchronization1&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 &lt;br /&gt;
| WaitSynchronization2&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 &lt;br /&gt;
| SignalAndWait&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 &lt;br /&gt;
| DuplicateHandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 &lt;br /&gt;
| GetSystemTick&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 &lt;br /&gt;
| GetHandleInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A &lt;br /&gt;
| GetSystemInfo(unsigned long long *Output, unsigned int Type0, unsigned int Type1)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B &lt;br /&gt;
| GetProcessInfo(unsigned long long *Output, Handle KProcess, unsigned int Type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C &lt;br /&gt;
| GetThreadInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D &lt;br /&gt;
| ConnectToPort(Handle*, char *PortName)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E &lt;br /&gt;
| SendSyncRequest1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F &lt;br /&gt;
| SendSyncRequest2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 &lt;br /&gt;
| SendSyncRequest3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 &lt;br /&gt;
| SendSyncRequest4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 &lt;br /&gt;
| SendSyncRequest(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 &lt;br /&gt;
| OpenProcess(Handle *KProcess, unsigned int ProcessId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 &lt;br /&gt;
| OpenThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x35 &lt;br /&gt;
| GetProcessId(unsigned int *ProcessId, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 &lt;br /&gt;
| GetProcessIdOfThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x37 &lt;br /&gt;
| GetThreadId&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 &lt;br /&gt;
| GetResourceLimit(Handle*, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x39 &lt;br /&gt;
| GetResourceLimitLimitValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A &lt;br /&gt;
| GetResourceLimitCurrentValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B &lt;br /&gt;
| GetThreadContext (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C &lt;br /&gt;
| Break(BreakReason)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D &lt;br /&gt;
| OutputDebugString(void const, int) (Does nothing on non-debug units)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E &lt;br /&gt;
| ControlPerformanceCounter(unsigned long long, int, unsigned int, unsigned long long)&lt;br /&gt;
|-&lt;br /&gt;
| 0x47 &lt;br /&gt;
| CreatePort&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 &lt;br /&gt;
| CreateSessionToPort&lt;br /&gt;
|-&lt;br /&gt;
| 0x49 &lt;br /&gt;
| CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A &lt;br /&gt;
| AcceptSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B &lt;br /&gt;
| ReplyAndReceive1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C &lt;br /&gt;
| ReplyAndReceive2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4D &lt;br /&gt;
| ReplyAndReceive3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E &lt;br /&gt;
| ReplyAndReceive4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F &lt;br /&gt;
| ReplyAndReceive&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 &lt;br /&gt;
| BindInterrupt(Interrupt, Handle, int, bool)&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 &lt;br /&gt;
| UnbindInterrupt(Interrupt, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 &lt;br /&gt;
| InvalidateProcessDataCache(Handle, void*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 &lt;br /&gt;
| StoreProcessDataCache(Handle process, void const* addr, unsigned int size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 &lt;br /&gt;
| FlushProcessDataCache(Handle, void const*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 &lt;br /&gt;
| StartInterProcessDma(Handle* out, Handle dstProcess, void* dst, Handle srcProcess, const void* src, size_t size, const DmaConfig&amp;amp; config )&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 &lt;br /&gt;
| StopDma(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 &lt;br /&gt;
| GetDmaState(DmaState*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| RestartDma(nn::Handle, void *, void  const*, unsigned int, signed char)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 &lt;br /&gt;
| DebugActiveProcess(Handle *KDebug, unsigned int ProcessID)&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 &lt;br /&gt;
| BreakDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 &lt;br /&gt;
| TerminateDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 &lt;br /&gt;
| GetProcessDebugEvent(DebugEventInfo*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 &lt;br /&gt;
| ContinueDebugEvent(Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 &lt;br /&gt;
| GetProcessList(int *TotalPIDs, unsigned int *PIDs, int MaxPIDs)&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 &lt;br /&gt;
| GetThreadList(int*, unsigned int*, int, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 &lt;br /&gt;
| GetDebugThreadContext(ThreadContext*, Handle, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 &lt;br /&gt;
| SetDebugThreadContext(Handle, unsigned int, ThreadContext const&amp;amp;, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x69 &lt;br /&gt;
| QueryDebugProcessMemory(MemoryInfo*, PageInfo*, Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A &lt;br /&gt;
| ReadProcessMemory(void* Buffer, Handle KDebug, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B &lt;br /&gt;
| WriteProcessMemory(Handle KDebug, void const* Buffer, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C &lt;br /&gt;
| SetHardwareBreakPoint(int, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D&lt;br /&gt;
| GetDebugThreadParam(long long *, int *, nn::Handle, unsigned int, nn::dmnt::DebugThreadParam) (Disabled on regular kernel)&lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| ControlProcessMemory(Handle KProcess, unsigned int Addr0, unsigned int Addr1, unsigned int Size, unsigned int Type, unsigned int Permissions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x71&lt;br /&gt;
| MapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x72&lt;br /&gt;
| UnmapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x73&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| Stubbed on regular kernel&lt;br /&gt;
|-&lt;br /&gt;
| 0x75&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x76&lt;br /&gt;
| TerminateProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x77&lt;br /&gt;
| (Handle KProcess, Handle KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| CreateResourceLimit(Handle *KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x79&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A&lt;br /&gt;
| DisableExecuteNever(unsigned int Addr, unsigned int Size) (Stubbed for regular kernel beginning with [[2.0.0-2]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C&lt;br /&gt;
| KernelSetState(unsigned int Type, unsigned int Param0, unsigned int Param1, unsigned int Param2) (The Type determines the usage of each param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D&lt;br /&gt;
| QueryProcessMemory(MemInfo *Info, unsigned int *Out, Handle KProcess, unsigned int Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0xFF&lt;br /&gt;
| Debug related (The Syscall access control mask doesn&#039;t apply for this SVC)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Processes ===&lt;br /&gt;
Each process can only use SVCs which are enabled in the [[NCCH#CXI|exheader]] for this process. The ARM11 kernel SVC handler checks whether the SVC is enabled in the syscall access control mask stored on the SVC-mode stack, when the SVC isn&#039;t enabled a kernelpanic() is triggered. Each process has a separate SVC-mode stack, this stack and the syscall access mask stored here is initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of this table is stored in the exheader. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for the current KThread.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
=== Threads ===&lt;br /&gt;
For svcCreateThread the input address used for Entrypoint_Param and StackTop are normally the same, however these can be arbitrary. For the main thread the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread.&lt;br /&gt;
&lt;br /&gt;
=== Memory Mapping ===&lt;br /&gt;
ControlMemory and MapMemoryBlock can be used to map memory pages, these two SVCs only support mapping execute-never R/W pages. The input permissions parameter for these SVCs must be &amp;lt;=3, where value zero is used when un-mapping memory. Bitmask 0xf00 for ControlMemory parameter MemoryType is the memory-type, when this is zero the memory-type is loaded from the kernel flags stored in the exheader ARM11 kernel descriptors, for the process using the SVC. ControlMemory parameter MemoryType with value 0x10003 is used for mapping the GSP [[Memory_layout|heap]]. The low 8-bits are the type: 1 is for un-mapping memory, 3 for mapping memory. Type4 is used to mirror the RW memory at Addr1, to Addr0. Type4 will return an error if Addr1 is located in read-only memory. Addr1 is not used for type1 and type3.&lt;br /&gt;
&lt;br /&gt;
ControlProcessMemory maps memory in the specified process, this is the only SVC which allows mapping executable memory. Format of the permissions field for memory mapping SVCs: bit0=R, bit1=W, bit2=X. Type6 sets the Addr0 memory permissions to the input permissions, for already mapped memory.&lt;br /&gt;
&lt;br /&gt;
MapProcessMemory maps RW memory starting at address 0x00100000 in the specified KProcess, at the specified StartAddr in the current process. MapProcessMemory then maps 0x08000000 in the specified process, to StartAddr+0x7f00000 in the current process. UnmapProcessMemory unmaps the memory which was mapped by MapProcessMemory.&lt;br /&gt;
&lt;br /&gt;
=== Debugging ===&lt;br /&gt;
DebugActiveProcess is used to attach to a process for debugging. This SVC can only be used when the target process&#039; ARM11 descriptors stored in the exheader have the kernel flag for &amp;quot;Enable debug&amp;quot; set. Otherwise when that flag is clear, the kernel flags for the process using this SVC must have the &amp;quot;Force debug&amp;quot; flag set.&lt;br /&gt;
&lt;br /&gt;
=== KernelSetState ===&lt;br /&gt;
Type0 initializes the programID for launching [[FIRM]], then triggers launching [[FIRM]]. Param0 and Param2 are unused. Param1 is the programID-low, and the programID-high is 0x00040138.&lt;br /&gt;
&lt;br /&gt;
Type3 is used for initializing the 0x1000-byte buffer used by the launched [[FIRM]]. Param2 is unused. When Param0 is value 1, this buffer is copied to the beginning of FCRAM at 0xF0000000, and Param1 is unused. When Param0 is value 0, this kernel buffer is mapped to process address Param1.&lt;br /&gt;
&lt;br /&gt;
=== GetSystemInfo ===&lt;br /&gt;
Type0 value 26(Type1 is unused) writes the total number of processes which were directly launched by the kernel, to Output. For the NATIVE_FIRM/SAFE_MODE_FIRM ARM11 kernel, this is normally 5, for processes sm, fs, pm, loader, and pxi.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4990</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4990"/>
		<updated>2013-02-21T00:12:31Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== SVC List ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Id&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 &lt;br /&gt;
| ControlMemory(u32* outaddr, u32 addr0, u32 addr1, u32 size, u32 operation, u32 permissions) (outaddr is usually the same as the input addr0)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 &lt;br /&gt;
| QueryMemory(MemInfo* info, PageInfo* out, u32 Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 &lt;br /&gt;
| ExitProcess(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 &lt;br /&gt;
| GetProcessAffinityMask(u8* affinitymask, handle process, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 &lt;br /&gt;
| SetProcessAffinityMask(handle process, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 &lt;br /&gt;
| GetProcessIdealProcessor(s32 *idealprocessor, handle process)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 &lt;br /&gt;
| SetProcessIdealProcessor(handle process, s32 idealprocessor)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| CreateThread(handle* thread, Entrypoint, void* arg, , ThreadPriority, ResLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9 &lt;br /&gt;
| ExitThread(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0xA &lt;br /&gt;
| SleepThread(s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0xB &lt;br /&gt;
| GetThreadPriority(s32* priority, handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| SetThreadPriority(handle thread, s32 priority)&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| GetThreadAffinityMask(u8* affinitymask, handle thread, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| SetThreadAffinityMask(handle thread, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xF &lt;br /&gt;
| GetThreadIdealProcessor&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 &lt;br /&gt;
| SetThreadIdealProcessor&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 &lt;br /&gt;
| GetCurrentProcessorNumber&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 &lt;br /&gt;
| Run(Handle KProcess, unsigned int *buf) (This starts the main() thread. Buf+0 is main-thread priority, Buf+4 is main-thread stack-size.)&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 &lt;br /&gt;
| CreateMutex&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 &lt;br /&gt;
| ReleaseMutex(Handle KMutex)&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 &lt;br /&gt;
| CreateSemaphore&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 &lt;br /&gt;
| ReleaseSemaphore&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 &lt;br /&gt;
| CreateEvent(Handle *KEvent, unsigned char Unk)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 &lt;br /&gt;
| SignalEvent(Handle KEvent)&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 &lt;br /&gt;
| ClearEvent&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A &lt;br /&gt;
| CreateTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B &lt;br /&gt;
| SetTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C &lt;br /&gt;
| CancelTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D &lt;br /&gt;
| ClearTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E &lt;br /&gt;
| CreateMemoryBlock&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F &lt;br /&gt;
| MapMemoryBlock(Handle, unsigned int Addr, unsigned int Permissions, unsigned int Unk)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 &lt;br /&gt;
| UnmapMemoryBlock&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 &lt;br /&gt;
| CreateAddressArbiter&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 &lt;br /&gt;
| ArbitrateAddress&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 &lt;br /&gt;
| CloseHandle(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 &lt;br /&gt;
| WaitSynchronization1&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 &lt;br /&gt;
| WaitSynchronization2&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 &lt;br /&gt;
| SignalAndWait&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 &lt;br /&gt;
| DuplicateHandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 &lt;br /&gt;
| GetSystemTick&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 &lt;br /&gt;
| GetHandleInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A &lt;br /&gt;
| GetSystemInfo(unsigned long long *Output, unsigned int Type0, unsigned int Type1)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B &lt;br /&gt;
| GetProcessInfo(unsigned long long *Output, Handle KProcess, unsigned int Type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C &lt;br /&gt;
| GetThreadInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D &lt;br /&gt;
| ConnectToPort(Handle*, char *PortName)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E &lt;br /&gt;
| SendSyncRequest1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F &lt;br /&gt;
| SendSyncRequest2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 &lt;br /&gt;
| SendSyncRequest3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 &lt;br /&gt;
| SendSyncRequest4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 &lt;br /&gt;
| SendSyncRequest(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 &lt;br /&gt;
| OpenProcess(Handle *KProcess, unsigned int ProcessId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 &lt;br /&gt;
| OpenThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x35 &lt;br /&gt;
| GetProcessId(unsigned int *ProcessId, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 &lt;br /&gt;
| GetProcessIdOfThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x37 &lt;br /&gt;
| GetThreadId&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 &lt;br /&gt;
| GetResourceLimit(Handle*, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x39 &lt;br /&gt;
| GetResourceLimitLimitValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A &lt;br /&gt;
| GetResourceLimitCurrentValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B &lt;br /&gt;
| GetThreadContext (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C &lt;br /&gt;
| Break(BreakReason)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D &lt;br /&gt;
| OutputDebugString(void const, int) (Does nothing on non-debug units)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E &lt;br /&gt;
| ControlPerformanceCounter(unsigned long long, int, unsigned int, unsigned long long)&lt;br /&gt;
|-&lt;br /&gt;
| 0x47 &lt;br /&gt;
| CreatePort&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 &lt;br /&gt;
| CreateSessionToPort&lt;br /&gt;
|-&lt;br /&gt;
| 0x49 &lt;br /&gt;
| CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A &lt;br /&gt;
| AcceptSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B &lt;br /&gt;
| ReplyAndReceive1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C &lt;br /&gt;
| ReplyAndReceive2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4D &lt;br /&gt;
| ReplyAndReceive3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E &lt;br /&gt;
| ReplyAndReceive4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F &lt;br /&gt;
| ReplyAndReceive&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 &lt;br /&gt;
| BindInterrupt(Interrupt, Handle, int, bool)&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 &lt;br /&gt;
| UnbindInterrupt(Interrupt, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 &lt;br /&gt;
| InvalidateProcessDataCache(Handle, void*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 &lt;br /&gt;
| StoreProcessDataCache(Handle process, void const* addr, unsigned int size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 &lt;br /&gt;
| FlushProcessDataCache(Handle, void const*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 &lt;br /&gt;
| StartInterProcessDma(Handle* out, Handle dstProcess, void* dst, Handle srcProcess, const void* src, size_t size, const DmaConfig&amp;amp; config )&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 &lt;br /&gt;
| StopDma(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 &lt;br /&gt;
| GetDmaState(DmaState*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| RestartDma(nn::Handle, void *, void  const*, unsigned int, signed char)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 &lt;br /&gt;
| DebugActiveProcess(Handle *KDebug, unsigned int ProcessID)&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 &lt;br /&gt;
| BreakDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 &lt;br /&gt;
| TerminateDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 &lt;br /&gt;
| GetProcessDebugEvent(DebugEventInfo*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 &lt;br /&gt;
| ContinueDebugEvent(Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 &lt;br /&gt;
| GetProcessList(int *TotalPIDs, unsigned int *PIDs, int MaxPIDs)&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 &lt;br /&gt;
| GetThreadList(int*, unsigned int*, int, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 &lt;br /&gt;
| GetDebugThreadContext(ThreadContext*, Handle, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 &lt;br /&gt;
| SetDebugThreadContext(Handle, unsigned int, ThreadContext const&amp;amp;, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x69 &lt;br /&gt;
| QueryDebugProcessMemory(MemoryInfo*, PageInfo*, Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A &lt;br /&gt;
| ReadProcessMemory(void* Buffer, Handle KDebug, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B &lt;br /&gt;
| WriteProcessMemory(Handle KDebug, void const* Buffer, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C &lt;br /&gt;
| SetHardwareBreakPoint(int, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D&lt;br /&gt;
| GetDebugThreadParam(long long *, int *, nn::Handle, unsigned int, nn::dmnt::DebugThreadParam) (Disabled on regular kernel)&lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| ControlProcessMemory(Handle KProcess, unsigned int Addr0, unsigned int Addr1, unsigned int Size, unsigned int Type, unsigned int Permissions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x71&lt;br /&gt;
| MapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x72&lt;br /&gt;
| UnmapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x73&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| Stubbed on regular kernel&lt;br /&gt;
|-&lt;br /&gt;
| 0x75&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x76&lt;br /&gt;
| TerminateProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x77&lt;br /&gt;
| (Handle KProcess, Handle KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| CreateResourceLimit(Handle *KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x79&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A&lt;br /&gt;
| DisableExecuteNever(unsigned int Addr, unsigned int Size) (Stubbed for regular kernel beginning with [[2.0.0-2]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C&lt;br /&gt;
| KernelSetState(unsigned int Type, unsigned int Param0, unsigned int Param1, unsigned int Param2) (The Type determines the usage of each param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D&lt;br /&gt;
| QueryProcessMemory(MemInfo *Info, unsigned int *Out, Handle KProcess, unsigned int Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0xFF&lt;br /&gt;
| Debug related (The Syscall access control mask doesn&#039;t apply for this SVC)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Processes ===&lt;br /&gt;
Each process can only use SVCs which are enabled in the [[NCCH#CXI|exheader]] for this process. The ARM11 kernel SVC handler checks whether the SVC is enabled in the syscall access control mask stored on the SVC-mode stack, when the SVC isn&#039;t enabled a kernelpanic() is triggered. Each process has a separate SVC-mode stack, this stack and the syscall access mask stored here is initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of this table is stored in the exheader. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for the current KThread.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
=== Threads ===&lt;br /&gt;
For svcCreateThread the input address used for Entrypoint_Param and StackTop are normally the same, however these can be arbitrary. For the main thread the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread.&lt;br /&gt;
&lt;br /&gt;
=== Memory Mapping ===&lt;br /&gt;
ControlMemory and MapMemoryBlock can be used to map memory pages, these two SVCs only support mapping execute-never R/W pages. The input permissions parameter for these SVCs must be &amp;lt;=3, where value zero is used when un-mapping memory. Bitmask 0xf00 for ControlMemory parameter MemoryType is the memory-type, when this is zero the memory-type is loaded from the kernel flags stored in the exheader ARM11 kernel descriptors, for the process using the SVC. ControlMemory parameter MemoryType with value 0x10003 is used for mapping the GSP [[Memory_layout|heap]]. The low 8-bits are the type: 1 is for un-mapping memory, 3 for mapping memory. Type4 is used to mirror the RW memory at Addr1, to Addr0. Type4 will return an error if Addr1 is located in read-only memory. Addr1 is not used for type1 and type3.&lt;br /&gt;
&lt;br /&gt;
ControlProcessMemory maps memory in the specified process, this is the only SVC which allows mapping executable memory. Format of the permissions field for memory mapping SVCs: bit0=R, bit1=W, bit2=X. Type6 sets the Addr0 memory permissions to the input permissions, for already mapped memory.&lt;br /&gt;
&lt;br /&gt;
MapProcessMemory maps RW memory starting at address 0x00100000 in the specified KProcess, at the specified StartAddr in the current process. MapProcessMemory then maps 0x08000000 in the specified process, to StartAddr+0x7f00000 in the current process. UnmapProcessMemory unmaps the memory which was mapped by MapProcessMemory.&lt;br /&gt;
&lt;br /&gt;
=== Debugging ===&lt;br /&gt;
DebugActiveProcess is used to attach to a process for debugging. This SVC can only be used when the target process&#039; ARM11 descriptors stored in the exheader have the kernel flag for &amp;quot;Enable debug&amp;quot; set. Otherwise when that flag is clear, the kernel flags for the process using this SVC must have the &amp;quot;Force debug&amp;quot; flag set.&lt;br /&gt;
&lt;br /&gt;
=== KernelSetState ===&lt;br /&gt;
Type0 initializes the programID for launching [[FIRM]], then triggers launching [[FIRM]]. Param0 and Param2 are unused. Param1 is the programID-low, and the programID-high is 0x00040138.&lt;br /&gt;
&lt;br /&gt;
Type3 is used for initializing the 0x1000-byte buffer used by the launched [[FIRM]]. Param2 is unused. When Param0 is value 1, this buffer is copied to the beginning of FCRAM at 0xF0000000, and Param1 is unused. When Param0 is value 0, this kernel buffer is mapped to process address Param1.&lt;br /&gt;
&lt;br /&gt;
=== GetSystemInfo ===&lt;br /&gt;
Type0 value 26(Type1 is unused) writes the total number of processes which were directly launched by the kernel, to Output. For the NATIVE_FIRM/SAFE_MODE_FIRM ARM11 kernel, this is normally 5, for processes sm, fs, pm, loader, and pxi.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4986</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4986"/>
		<updated>2013-02-20T20:51:01Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== SVC List ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Id&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 &lt;br /&gt;
| ControlMemory(unsigned int *OutAddr, unsigned int Addr0, unsigned int Addr1, unsigned int Size, unsigned int MemoryType, unsigned int Permissions) (OutAddr is usually the same as the input Addr0)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 &lt;br /&gt;
| QueryMemory(MemInfo *Info, unsigned int *Out, unsigned int Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 &lt;br /&gt;
| ExitProcess()&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 &lt;br /&gt;
| GetProcessAffinityMask&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 &lt;br /&gt;
| SetProcessAffinityMask&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 &lt;br /&gt;
| GetProcessIdealProcessor(unsigned int *IdealProcessor, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 &lt;br /&gt;
| SetProcessIdealProcessor(Handle KProcess, unsigned int IdealProcessor)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| CreateThread(Handle*, Entrypoint, Entrypoint_Param, StackTop, ThreadPriority, ResLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9 &lt;br /&gt;
| ExitThread(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0xA &lt;br /&gt;
| SleepThread(s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0xB &lt;br /&gt;
| GetThreadPriority(s32* priority, handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| SetThreadPriority(handle thread, s32 priority)&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| GetThreadAffinityMask(u8* affinitymask, handle thread, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| SetThreadAffinityMask(handle thread, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xF &lt;br /&gt;
| GetThreadIdealProcessor&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 &lt;br /&gt;
| SetThreadIdealProcessor&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 &lt;br /&gt;
| GetCurrentProcessorNumber&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 &lt;br /&gt;
| Run(Handle KProcess, unsigned int *buf) (This starts the main() thread. Buf+0 is main-thread priority, Buf+4 is main-thread stack-size.)&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 &lt;br /&gt;
| CreateMutex&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 &lt;br /&gt;
| ReleaseMutex(Handle KMutex)&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 &lt;br /&gt;
| CreateSemaphore&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 &lt;br /&gt;
| ReleaseSemaphore&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 &lt;br /&gt;
| CreateEvent(Handle *KEvent, unsigned char Unk)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 &lt;br /&gt;
| SignalEvent(Handle KEvent)&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 &lt;br /&gt;
| ClearEvent&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A &lt;br /&gt;
| CreateTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B &lt;br /&gt;
| SetTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C &lt;br /&gt;
| CancelTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D &lt;br /&gt;
| ClearTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E &lt;br /&gt;
| CreateMemoryBlock&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F &lt;br /&gt;
| MapMemoryBlock(Handle, unsigned int Addr, unsigned int Permissions, unsigned int Unk)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 &lt;br /&gt;
| UnmapMemoryBlock&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 &lt;br /&gt;
| CreateAddressArbiter&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 &lt;br /&gt;
| ArbitrateAddress&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 &lt;br /&gt;
| CloseHandle(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 &lt;br /&gt;
| WaitSynchronization1&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 &lt;br /&gt;
| WaitSynchronization2&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 &lt;br /&gt;
| SignalAndWait&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 &lt;br /&gt;
| DuplicateHandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 &lt;br /&gt;
| GetSystemTick&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 &lt;br /&gt;
| GetHandleInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A &lt;br /&gt;
| GetSystemInfo(unsigned long long *Output, unsigned int Type0, unsigned int Type1)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B &lt;br /&gt;
| GetProcessInfo(unsigned long long *Output, Handle KProcess, unsigned int Type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C &lt;br /&gt;
| GetThreadInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D &lt;br /&gt;
| ConnectToPort(Handle*, char *PortName)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E &lt;br /&gt;
| SendSyncRequest1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F &lt;br /&gt;
| SendSyncRequest2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 &lt;br /&gt;
| SendSyncRequest3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 &lt;br /&gt;
| SendSyncRequest4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 &lt;br /&gt;
| SendSyncRequest(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 &lt;br /&gt;
| OpenProcess(Handle *KProcess, unsigned int ProcessId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 &lt;br /&gt;
| OpenThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x35 &lt;br /&gt;
| GetProcessId(unsigned int *ProcessId, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 &lt;br /&gt;
| GetProcessIdOfThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x37 &lt;br /&gt;
| GetThreadId&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 &lt;br /&gt;
| GetResourceLimit(Handle*, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x39 &lt;br /&gt;
| GetResourceLimitLimitValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A &lt;br /&gt;
| GetResourceLimitCurrentValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B &lt;br /&gt;
| GetThreadContext (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C &lt;br /&gt;
| Break(BreakReason)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D &lt;br /&gt;
| OutputDebugString(void const, int) (Does nothing on non-debug units)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E &lt;br /&gt;
| ControlPerformanceCounter(unsigned long long, int, unsigned int, unsigned long long)&lt;br /&gt;
|-&lt;br /&gt;
| 0x47 &lt;br /&gt;
| CreatePort&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 &lt;br /&gt;
| CreateSessionToPort&lt;br /&gt;
|-&lt;br /&gt;
| 0x49 &lt;br /&gt;
| CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A &lt;br /&gt;
| AcceptSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B &lt;br /&gt;
| ReplyAndReceive1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C &lt;br /&gt;
| ReplyAndReceive2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4D &lt;br /&gt;
| ReplyAndReceive3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E &lt;br /&gt;
| ReplyAndReceive4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F &lt;br /&gt;
| ReplyAndReceive&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 &lt;br /&gt;
| BindInterrupt(Interrupt, Handle, int, bool)&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 &lt;br /&gt;
| UnbindInterrupt(Interrupt, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 &lt;br /&gt;
| InvalidateProcessDataCache(Handle, void*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 &lt;br /&gt;
| StoreProcessDataCache(Handle process, void const* addr, unsigned int size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 &lt;br /&gt;
| FlushProcessDataCache(Handle, void const*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 &lt;br /&gt;
| StartInterProcessDma(Handle* out, Handle dstProcess, void* dst, Handle srcProcess, const void* src, size_t size, const DmaConfig&amp;amp; config )&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 &lt;br /&gt;
| StopDma(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 &lt;br /&gt;
| GetDmaState(DmaState*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| RestartDma(nn::Handle, void *, void  const*, unsigned int, signed char)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 &lt;br /&gt;
| DebugActiveProcess(Handle *KDebug, unsigned int ProcessID)&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 &lt;br /&gt;
| BreakDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 &lt;br /&gt;
| TerminateDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 &lt;br /&gt;
| GetProcessDebugEvent(DebugEventInfo*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 &lt;br /&gt;
| ContinueDebugEvent(Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 &lt;br /&gt;
| GetProcessList(int *TotalPIDs, unsigned int *PIDs, int MaxPIDs)&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 &lt;br /&gt;
| GetThreadList(int*, unsigned int*, int, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 &lt;br /&gt;
| GetDebugThreadContext(ThreadContext*, Handle, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 &lt;br /&gt;
| SetDebugThreadContext(Handle, unsigned int, ThreadContext const&amp;amp;, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x69 &lt;br /&gt;
| QueryDebugProcessMemory(MemoryInfo*, PageInfo*, Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A &lt;br /&gt;
| ReadProcessMemory(void* Buffer, Handle KDebug, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B &lt;br /&gt;
| WriteProcessMemory(Handle KDebug, void const* Buffer, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C &lt;br /&gt;
| SetHardwareBreakPoint(int, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D&lt;br /&gt;
| GetDebugThreadParam(long long *, int *, nn::Handle, unsigned int, nn::dmnt::DebugThreadParam) (Disabled on regular kernel)&lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| ControlProcessMemory(Handle KProcess, unsigned int Addr0, unsigned int Addr1, unsigned int Size, unsigned int Type, unsigned int Permissions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x71&lt;br /&gt;
| MapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x72&lt;br /&gt;
| UnmapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x73&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| Stubbed on regular kernel&lt;br /&gt;
|-&lt;br /&gt;
| 0x75&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x76&lt;br /&gt;
| TerminateProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x77&lt;br /&gt;
| (Handle KProcess, Handle KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| CreateResourceLimit(Handle *KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x79&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A&lt;br /&gt;
| DisableExecuteNever(unsigned int Addr, unsigned int Size) (Stubbed for regular kernel beginning with [[2.0.0-2]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C&lt;br /&gt;
| KernelSetState(unsigned int Type, unsigned int Param0, unsigned int Param1, unsigned int Param2) (The Type determines the usage of each param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D&lt;br /&gt;
| QueryProcessMemory(MemInfo *Info, unsigned int *Out, Handle KProcess, unsigned int Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0xFF&lt;br /&gt;
| Debug related (The Syscall access control mask doesn&#039;t apply for this SVC)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Processes ===&lt;br /&gt;
Each process can only use SVCs which are enabled in the [[NCCH#CXI|exheader]] for this process. The ARM11 kernel SVC handler checks whether the SVC is enabled in the syscall access control mask stored on the SVC-mode stack, when the SVC isn&#039;t enabled a kernelpanic() is triggered. Each process has a separate SVC-mode stack, this stack and the syscall access mask stored here is initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of this table is stored in the exheader. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for the current KThread.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
=== Threads ===&lt;br /&gt;
For svcCreateThread the input address used for Entrypoint_Param and StackTop are normally the same, however these can be arbitrary. For the main thread the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread.&lt;br /&gt;
&lt;br /&gt;
=== Memory Mapping ===&lt;br /&gt;
ControlMemory and MapMemoryBlock can be used to map memory pages, these two SVCs only support mapping execute-never R/W pages. The input permissions parameter for these SVCs must be &amp;lt;=3, where value zero is used when un-mapping memory. Bitmask 0xf00 for ControlMemory parameter MemoryType is the memory-type, when this is zero the memory-type is loaded from the kernel flags stored in the exheader ARM11 kernel descriptors, for the process using the SVC. ControlMemory parameter MemoryType with value 0x10003 is used for mapping the GSP [[Memory_layout|heap]]. The low 8-bits are the type: 1 is for un-mapping memory, 3 for mapping memory. Type4 is used to mirror the RW memory at Addr1, to Addr0. Type4 will return an error if Addr1 is located in read-only memory. Addr1 is not used for type1 and type3.&lt;br /&gt;
&lt;br /&gt;
ControlProcessMemory maps memory in the specified process, this is the only SVC which allows mapping executable memory. Format of the permissions field for memory mapping SVCs: bit0=R, bit1=W, bit2=X. Type6 sets the Addr0 memory permissions to the input permissions, for already mapped memory.&lt;br /&gt;
&lt;br /&gt;
MapProcessMemory maps RW memory starting at address 0x00100000 in the specified KProcess, at the specified StartAddr in the current process. MapProcessMemory then maps 0x08000000 in the specified process, to StartAddr+0x7f00000 in the current process. UnmapProcessMemory unmaps the memory which was mapped by MapProcessMemory.&lt;br /&gt;
&lt;br /&gt;
=== Debugging ===&lt;br /&gt;
DebugActiveProcess is used to attach to a process for debugging. This SVC can only be used when the target process&#039; ARM11 descriptors stored in the exheader have the kernel flag for &amp;quot;Enable debug&amp;quot; set. Otherwise when that flag is clear, the kernel flags for the process using this SVC must have the &amp;quot;Force debug&amp;quot; flag set.&lt;br /&gt;
&lt;br /&gt;
=== KernelSetState ===&lt;br /&gt;
Type0 initializes the programID for launching [[FIRM]], then triggers launching [[FIRM]]. Param0 and Param2 are unused. Param1 is the programID-low, and the programID-high is 0x00040138.&lt;br /&gt;
&lt;br /&gt;
Type3 is used for initializing the 0x1000-byte buffer used by the launched [[FIRM]]. Param2 is unused. When Param0 is value 1, this buffer is copied to the beginning of FCRAM at 0xF0000000, and Param1 is unused. When Param0 is value 0, this kernel buffer is mapped to process address Param1.&lt;br /&gt;
&lt;br /&gt;
=== GetSystemInfo ===&lt;br /&gt;
Type0 value 26(Type1 is unused) writes the total number of processes which were directly launched by the kernel, to Output. For the NATIVE_FIRM/SAFE_MODE_FIRM ARM11 kernel, this is normally 5, for processes sm, fs, pm, loader, and pxi.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4985</id>
		<title>SVC</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=SVC&amp;diff=4985"/>
		<updated>2013-02-20T20:50:09Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== SVC List ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Id&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 &lt;br /&gt;
| ControlMemory(unsigned int *OutAddr, unsigned int Addr0, unsigned int Addr1, unsigned int Size, unsigned int MemoryType, unsigned int Permissions) (OutAddr is usually the same as the input Addr0)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 &lt;br /&gt;
| QueryMemory(MemInfo *Info, unsigned int *Out, unsigned int Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 &lt;br /&gt;
| ExitProcess()&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 &lt;br /&gt;
| GetProcessAffinityMask&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 &lt;br /&gt;
| SetProcessAffinityMask&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 &lt;br /&gt;
| GetProcessIdealProcessor(unsigned int *IdealProcessor, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7 &lt;br /&gt;
| SetProcessIdealProcessor(Handle KProcess, unsigned int IdealProcessor)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 &lt;br /&gt;
| CreateThread(Handle*, Entrypoint, Entrypoint_Param, StackTop, ThreadPriority, ResLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x9 &lt;br /&gt;
| ExitThread(void)&lt;br /&gt;
|-&lt;br /&gt;
| 0xA &lt;br /&gt;
| SleepThread(s64 nanoseconds)&lt;br /&gt;
|-&lt;br /&gt;
| 0xB &lt;br /&gt;
| GetThreadPriority(s32* priority, handle thread)&lt;br /&gt;
|-&lt;br /&gt;
| 0xC &lt;br /&gt;
| SetThreadPriority(handle thread, s32 priority)&lt;br /&gt;
|-&lt;br /&gt;
| 0xD &lt;br /&gt;
| GetThreadAffinityMask(handle thread, u8* affinitymask, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xE &lt;br /&gt;
| SetThreadAffinityMask(u8* affinitymask, handle thread, s32 processorcount)&lt;br /&gt;
|-&lt;br /&gt;
| 0xF &lt;br /&gt;
| GetThreadIdealProcessor&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 &lt;br /&gt;
| SetThreadIdealProcessor&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 &lt;br /&gt;
| GetCurrentProcessorNumber&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 &lt;br /&gt;
| Run(Handle KProcess, unsigned int *buf) (This starts the main() thread. Buf+0 is main-thread priority, Buf+4 is main-thread stack-size.)&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 &lt;br /&gt;
| CreateMutex&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 &lt;br /&gt;
| ReleaseMutex(Handle KMutex)&lt;br /&gt;
|-&lt;br /&gt;
| 0x15 &lt;br /&gt;
| CreateSemaphore&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 &lt;br /&gt;
| ReleaseSemaphore&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 &lt;br /&gt;
| CreateEvent(Handle *KEvent, unsigned char Unk)&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 &lt;br /&gt;
| SignalEvent(Handle KEvent)&lt;br /&gt;
|-&lt;br /&gt;
| 0x19 &lt;br /&gt;
| ClearEvent&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A &lt;br /&gt;
| CreateTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B &lt;br /&gt;
| SetTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C &lt;br /&gt;
| CancelTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D &lt;br /&gt;
| ClearTimer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E &lt;br /&gt;
| CreateMemoryBlock&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F &lt;br /&gt;
| MapMemoryBlock(Handle, unsigned int Addr, unsigned int Permissions, unsigned int Unk)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 &lt;br /&gt;
| UnmapMemoryBlock&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 &lt;br /&gt;
| CreateAddressArbiter&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 &lt;br /&gt;
| ArbitrateAddress&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 &lt;br /&gt;
| CloseHandle(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 &lt;br /&gt;
| WaitSynchronization1&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 &lt;br /&gt;
| WaitSynchronization2&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 &lt;br /&gt;
| SignalAndWait&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 &lt;br /&gt;
| DuplicateHandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 &lt;br /&gt;
| GetSystemTick&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 &lt;br /&gt;
| GetHandleInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A &lt;br /&gt;
| GetSystemInfo(unsigned long long *Output, unsigned int Type0, unsigned int Type1)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B &lt;br /&gt;
| GetProcessInfo(unsigned long long *Output, Handle KProcess, unsigned int Type)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C &lt;br /&gt;
| GetThreadInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D &lt;br /&gt;
| ConnectToPort(Handle*, char *PortName)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E &lt;br /&gt;
| SendSyncRequest1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F &lt;br /&gt;
| SendSyncRequest2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 &lt;br /&gt;
| SendSyncRequest3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 &lt;br /&gt;
| SendSyncRequest4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 &lt;br /&gt;
| SendSyncRequest(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 &lt;br /&gt;
| OpenProcess(Handle *KProcess, unsigned int ProcessId)&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 &lt;br /&gt;
| OpenThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x35 &lt;br /&gt;
| GetProcessId(unsigned int *ProcessId, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 &lt;br /&gt;
| GetProcessIdOfThread&lt;br /&gt;
|-&lt;br /&gt;
| 0x37 &lt;br /&gt;
| GetThreadId&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 &lt;br /&gt;
| GetResourceLimit(Handle*, Handle KProcess)&lt;br /&gt;
|-&lt;br /&gt;
| 0x39 &lt;br /&gt;
| GetResourceLimitLimitValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A &lt;br /&gt;
| GetResourceLimitCurrentValues&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B &lt;br /&gt;
| GetThreadContext (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C &lt;br /&gt;
| Break(BreakReason)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D &lt;br /&gt;
| OutputDebugString(void const, int) (Does nothing on non-debug units)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E &lt;br /&gt;
| ControlPerformanceCounter(unsigned long long, int, unsigned int, unsigned long long)&lt;br /&gt;
|-&lt;br /&gt;
| 0x47 &lt;br /&gt;
| CreatePort&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 &lt;br /&gt;
| CreateSessionToPort&lt;br /&gt;
|-&lt;br /&gt;
| 0x49 &lt;br /&gt;
| CreateSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A &lt;br /&gt;
| AcceptSession&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B &lt;br /&gt;
| ReplyAndReceive1 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C &lt;br /&gt;
| ReplyAndReceive2 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4D &lt;br /&gt;
| ReplyAndReceive3 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E &lt;br /&gt;
| ReplyAndReceive4 (Stubbed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F &lt;br /&gt;
| ReplyAndReceive&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 &lt;br /&gt;
| BindInterrupt(Interrupt, Handle, int, bool)&lt;br /&gt;
|-&lt;br /&gt;
| 0x51 &lt;br /&gt;
| UnbindInterrupt(Interrupt, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x52 &lt;br /&gt;
| InvalidateProcessDataCache(Handle, void*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x53 &lt;br /&gt;
| StoreProcessDataCache(Handle process, void const* addr, unsigned int size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x54 &lt;br /&gt;
| FlushProcessDataCache(Handle, void const*, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x55 &lt;br /&gt;
| StartInterProcessDma(Handle* out, Handle dstProcess, void* dst, Handle srcProcess, const void* src, size_t size, const DmaConfig&amp;amp; config )&lt;br /&gt;
|-&lt;br /&gt;
| 0x56 &lt;br /&gt;
| StopDma(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x57 &lt;br /&gt;
| GetDmaState(DmaState*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x58&lt;br /&gt;
| RestartDma(nn::Handle, void *, void  const*, unsigned int, signed char)&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 &lt;br /&gt;
| DebugActiveProcess(Handle *KDebug, unsigned int ProcessID)&lt;br /&gt;
|-&lt;br /&gt;
| 0x61 &lt;br /&gt;
| BreakDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 &lt;br /&gt;
| TerminateDebugProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 &lt;br /&gt;
| GetProcessDebugEvent(DebugEventInfo*, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 &lt;br /&gt;
| ContinueDebugEvent(Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 &lt;br /&gt;
| GetProcessList(int *TotalPIDs, unsigned int *PIDs, int MaxPIDs)&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 &lt;br /&gt;
| GetThreadList(int*, unsigned int*, int, Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 &lt;br /&gt;
| GetDebugThreadContext(ThreadContext*, Handle, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 &lt;br /&gt;
| SetDebugThreadContext(Handle, unsigned int, ThreadContext const&amp;amp;, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x69 &lt;br /&gt;
| QueryDebugProcessMemory(MemoryInfo*, PageInfo*, Handle, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A &lt;br /&gt;
| ReadProcessMemory(void* Buffer, Handle KDebug, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6B &lt;br /&gt;
| WriteProcessMemory(Handle KDebug, void const* Buffer, unsigned int ProcAddr, unsigned int Size)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C &lt;br /&gt;
| SetHardwareBreakPoint(int, unsigned int, unsigned int)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6D&lt;br /&gt;
| GetDebugThreadParam(long long *, int *, nn::Handle, unsigned int, nn::dmnt::DebugThreadParam) (Disabled on regular kernel)&lt;br /&gt;
|-&lt;br /&gt;
| 0x70&lt;br /&gt;
| ControlProcessMemory(Handle KProcess, unsigned int Addr0, unsigned int Addr1, unsigned int Size, unsigned int Type, unsigned int Permissions)&lt;br /&gt;
|-&lt;br /&gt;
| 0x71&lt;br /&gt;
| MapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x72&lt;br /&gt;
| UnmapProcessMemory(Handle KProcess, unsigned int StartAddr, unsigned int EndAddr)&lt;br /&gt;
|-&lt;br /&gt;
| 0x73&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x74&lt;br /&gt;
| Stubbed on regular kernel&lt;br /&gt;
|-&lt;br /&gt;
| 0x75&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x76&lt;br /&gt;
| TerminateProcess(Handle)&lt;br /&gt;
|-&lt;br /&gt;
| 0x77&lt;br /&gt;
| (Handle KProcess, Handle KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x78&lt;br /&gt;
| CreateResourceLimit(Handle *KResourceLimit)&lt;br /&gt;
|-&lt;br /&gt;
| 0x79&lt;br /&gt;
| ?&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A&lt;br /&gt;
| DisableExecuteNever(unsigned int Addr, unsigned int Size) (Stubbed for regular kernel beginning with [[2.0.0-2]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x7C&lt;br /&gt;
| KernelSetState(unsigned int Type, unsigned int Param0, unsigned int Param1, unsigned int Param2) (The Type determines the usage of each param)&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D&lt;br /&gt;
| QueryProcessMemory(MemInfo *Info, unsigned int *Out, Handle KProcess, unsigned int Addr)&lt;br /&gt;
|-&lt;br /&gt;
| 0xFF&lt;br /&gt;
| Debug related (The Syscall access control mask doesn&#039;t apply for this SVC)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Processes ===&lt;br /&gt;
Each process can only use SVCs which are enabled in the [[NCCH#CXI|exheader]] for this process. The ARM11 kernel SVC handler checks whether the SVC is enabled in the syscall access control mask stored on the SVC-mode stack, when the SVC isn&#039;t enabled a kernelpanic() is triggered. Each process has a separate SVC-mode stack, this stack and the syscall access mask stored here is initialized when the process is started. Applications normally only have access to SVCs &amp;lt;=0x3D, however not all SVCs &amp;lt;=0x3D are accessible to the application. The majority of the SVCs accessible to applications are unused by the application.&lt;br /&gt;
&lt;br /&gt;
Each process has a separate handle-table, the size of this table is stored in the exheader. The handles in a handle-table can&#039;t be used in the context of other processes, since those handles don&#039;t exist in other handle-tables.&lt;br /&gt;
&lt;br /&gt;
0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for the current KThread.&lt;br /&gt;
&lt;br /&gt;
Calling svcBreak on retail will only terminate the process which called this SVC.&lt;br /&gt;
&lt;br /&gt;
=== Threads ===&lt;br /&gt;
For svcCreateThread the input address used for Entrypoint_Param and StackTop are normally the same, however these can be arbitrary. For the main thread the Entrypoint_Param is value 0.&lt;br /&gt;
&lt;br /&gt;
Using CloseHandle() with a KThread handle will terminate the specified thread.&lt;br /&gt;
&lt;br /&gt;
=== Memory Mapping ===&lt;br /&gt;
ControlMemory and MapMemoryBlock can be used to map memory pages, these two SVCs only support mapping execute-never R/W pages. The input permissions parameter for these SVCs must be &amp;lt;=3, where value zero is used when un-mapping memory. Bitmask 0xf00 for ControlMemory parameter MemoryType is the memory-type, when this is zero the memory-type is loaded from the kernel flags stored in the exheader ARM11 kernel descriptors, for the process using the SVC. ControlMemory parameter MemoryType with value 0x10003 is used for mapping the GSP [[Memory_layout|heap]]. The low 8-bits are the type: 1 is for un-mapping memory, 3 for mapping memory. Type4 is used to mirror the RW memory at Addr1, to Addr0. Type4 will return an error if Addr1 is located in read-only memory. Addr1 is not used for type1 and type3.&lt;br /&gt;
&lt;br /&gt;
ControlProcessMemory maps memory in the specified process, this is the only SVC which allows mapping executable memory. Format of the permissions field for memory mapping SVCs: bit0=R, bit1=W, bit2=X. Type6 sets the Addr0 memory permissions to the input permissions, for already mapped memory.&lt;br /&gt;
&lt;br /&gt;
MapProcessMemory maps RW memory starting at address 0x00100000 in the specified KProcess, at the specified StartAddr in the current process. MapProcessMemory then maps 0x08000000 in the specified process, to StartAddr+0x7f00000 in the current process. UnmapProcessMemory unmaps the memory which was mapped by MapProcessMemory.&lt;br /&gt;
&lt;br /&gt;
=== Debugging ===&lt;br /&gt;
DebugActiveProcess is used to attach to a process for debugging. This SVC can only be used when the target process&#039; ARM11 descriptors stored in the exheader have the kernel flag for &amp;quot;Enable debug&amp;quot; set. Otherwise when that flag is clear, the kernel flags for the process using this SVC must have the &amp;quot;Force debug&amp;quot; flag set.&lt;br /&gt;
&lt;br /&gt;
=== KernelSetState ===&lt;br /&gt;
Type0 initializes the programID for launching [[FIRM]], then triggers launching [[FIRM]]. Param0 and Param2 are unused. Param1 is the programID-low, and the programID-high is 0x00040138.&lt;br /&gt;
&lt;br /&gt;
Type3 is used for initializing the 0x1000-byte buffer used by the launched [[FIRM]]. Param2 is unused. When Param0 is value 1, this buffer is copied to the beginning of FCRAM at 0xF0000000, and Param1 is unused. When Param0 is value 0, this kernel buffer is mapped to process address Param1.&lt;br /&gt;
&lt;br /&gt;
=== GetSystemInfo ===&lt;br /&gt;
Type0 value 26(Type1 is unused) writes the total number of processes which were directly launched by the kernel, to Output. For the NATIVE_FIRM/SAFE_MODE_FIRM ARM11 kernel, this is normally 5, for processes sm, fs, pm, loader, and pxi.&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=NS_and_APT_Services&amp;diff=4957</id>
		<title>NS and APT Services</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=NS_and_APT_Services&amp;diff=4957"/>
		<updated>2013-02-16T23:28:09Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Services]]&lt;br /&gt;
The NS system module is the first module launched from a NAND title after the core processes sm, fs, [[Process Manager Ports|pm]], loader, and pxi are loaded. This module is launched by the pm process, with the titleID loaded from [[Configuration Memory|NSTID]]. NS first launches [[ErrDisp]], then the menu. On retail the menu TID is loaded from [[Shared_Registers|MENUTID]], while on dev/debug the menu TID is loaded from [[Config Info Blocks|config]]. The TID of the launched menu is then written to [[Configuration Memory|ACTIVEMENUTID]]. NS uses [[PMApp:LaunchTitle|pm:app]] to launch titles.&lt;br /&gt;
&lt;br /&gt;
Like home menu NS is constantly running while the system is in 3DS-mode.&lt;br /&gt;
&lt;br /&gt;
= Alternate menu =&lt;br /&gt;
When launching the regular menu fails, NS will then attempt to launch the alternate menu. This title could be used as a recovery process, however it normally doesn&#039;t exist on retail.&lt;br /&gt;
&lt;br /&gt;
= NS Service &amp;quot;ns:s&amp;quot; =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x000200C0&lt;br /&gt;
| [[NSS:LaunchTitle|LaunchTitle]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= NS Service &amp;quot;APT:U&amp;quot; =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0040&lt;br /&gt;
| [[APTU:GetSignalType|GetSignalType]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=APT Service=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00010040&lt;br /&gt;
| GetLockHandle&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020080&lt;br /&gt;
| Initialize&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030040&lt;br /&gt;
| Enable&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040040&lt;br /&gt;
| Finalize&lt;br /&gt;
|-&lt;br /&gt;
| 0x00050040&lt;br /&gt;
| GetAppletManInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x00060040&lt;br /&gt;
| GetAppletInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x00070000&lt;br /&gt;
| GetLastSignaledAppletId&lt;br /&gt;
|-&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| CountRegisteredApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x00090040&lt;br /&gt;
| IsRegistered&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A0040&lt;br /&gt;
| GetAttribute&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B0040&lt;br /&gt;
| InquireNotification&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0104&lt;br /&gt;
| SendParameter&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D0080&lt;br /&gt;
| ReceiveParameter&lt;br /&gt;
|-&lt;br /&gt;
| 0x000E0080&lt;br /&gt;
| GlanceParameter&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0100&lt;br /&gt;
| CancelParameter&lt;br /&gt;
|-&lt;br /&gt;
| 0x001000c2&lt;br /&gt;
| DebugFunc&lt;br /&gt;
|-&lt;br /&gt;
| 0x001100C0&lt;br /&gt;
| MapProgramIdForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 0x00120040&lt;br /&gt;
| SetHomeMenuAppletIdForDebug&lt;br /&gt;
|-&lt;br /&gt;
| 0x00130000&lt;br /&gt;
| GetPreparationState&lt;br /&gt;
|-&lt;br /&gt;
| 0x00140040&lt;br /&gt;
| SetPreparationState&lt;br /&gt;
|-&lt;br /&gt;
| 0x00150140&lt;br /&gt;
| PrepareToStartApplication&lt;br /&gt;
|-&lt;br /&gt;
| 0x00160040&lt;br /&gt;
| PreloadLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x00170040&lt;br /&gt;
| FinishPreloadingLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x00180040&lt;br /&gt;
| PrepareToStartLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x00190040&lt;br /&gt;
| PrepareToStartSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x001A0000&lt;br /&gt;
| PrepareToStartNewestHomeMenu&lt;br /&gt;
|-&lt;br /&gt;
| 0x001B00C4&lt;br /&gt;
| StartApplication&lt;br /&gt;
|-&lt;br /&gt;
| 0x001C0000&lt;br /&gt;
| WakeupApplication&lt;br /&gt;
|-&lt;br /&gt;
| 0x001D0000&lt;br /&gt;
| CancelApplication&lt;br /&gt;
|-&lt;br /&gt;
| 0x001E0084&lt;br /&gt;
| StartLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x001F0084&lt;br /&gt;
| StartSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x00200044&lt;br /&gt;
| StartNewestHomeMenu&lt;br /&gt;
|-&lt;br /&gt;
| 0x00210000&lt;br /&gt;
| OrderToCloseApplication&lt;br /&gt;
|-&lt;br /&gt;
| 0x00220040&lt;br /&gt;
| PrepareToCloseApplication&lt;br /&gt;
|-&lt;br /&gt;
| 0x00230040&lt;br /&gt;
| PrepareToJumpToApplication&lt;br /&gt;
|-&lt;br /&gt;
| 0x00240044&lt;br /&gt;
| JumpToApplication&lt;br /&gt;
|-&lt;br /&gt;
| 0x002500C0&lt;br /&gt;
| PrepareToCloseLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x00260000&lt;br /&gt;
| PrepareToCloseSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x00270044&lt;br /&gt;
| CloseApplication&lt;br /&gt;
|-&lt;br /&gt;
| 0x00280044&lt;br /&gt;
| CloseLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x00290044&lt;br /&gt;
| CloseSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x002A0000&lt;br /&gt;
| OrderToCloseSystemApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x002B0000&lt;br /&gt;
| PrepareToJumpToHomeMenu&lt;br /&gt;
|-&lt;br /&gt;
| 0x002C0044&lt;br /&gt;
| JumpToHomeMenu&lt;br /&gt;
|-&lt;br /&gt;
| 0x002D0000&lt;br /&gt;
| PrepareToLeaveHomeMenu&lt;br /&gt;
|-&lt;br /&gt;
| 0x002E0044&lt;br /&gt;
| LeaveHomeMenu&lt;br /&gt;
|-&lt;br /&gt;
| 0x002F0040&lt;br /&gt;
| PrepareToLeaveResidentApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x00300044&lt;br /&gt;
| LeaveResidentApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x00310100&lt;br /&gt;
| PrepareToDoApplicationJump&lt;br /&gt;
|-&lt;br /&gt;
| 0x00320084&lt;br /&gt;
| DoApplicationJump&lt;br /&gt;
|-&lt;br /&gt;
| 0x00330000&lt;br /&gt;
| GetProgramIdOnApplicationJump&lt;br /&gt;
|-&lt;br /&gt;
| 0x00340084&lt;br /&gt;
| SendDeliverArg&lt;br /&gt;
|-&lt;br /&gt;
| 0x00350080&lt;br /&gt;
| ReceiveDeliverArg&lt;br /&gt;
|-&lt;br /&gt;
| 0x00360040&lt;br /&gt;
| LoadSysMenuArg&lt;br /&gt;
|-&lt;br /&gt;
| 0x00370042&lt;br /&gt;
| StoreSysMenuArg&lt;br /&gt;
|-&lt;br /&gt;
| 0x00380040&lt;br /&gt;
| PreloadResidentApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x00390040&lt;br /&gt;
| PrepareToStartResidentApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x003A0044&lt;br /&gt;
| StartResidentApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x003B0040&lt;br /&gt;
| CancelLibraryApplet&lt;br /&gt;
|-&lt;br /&gt;
| 0x003C0042&lt;br /&gt;
| SendDspSleep&lt;br /&gt;
|-&lt;br /&gt;
| 0x003D0042&lt;br /&gt;
| SendDspWakeUp&lt;br /&gt;
|-&lt;br /&gt;
| 0x003E0080&lt;br /&gt;
| ReplySleepQuery&lt;br /&gt;
|-&lt;br /&gt;
| 0x003F0040&lt;br /&gt;
| ReplySleepNotificationComplete&lt;br /&gt;
|-&lt;br /&gt;
| 0x00400042&lt;br /&gt;
| SendCaptureBufferInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x00410040&lt;br /&gt;
| ReceiveCaptureBufferInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x00420080&lt;br /&gt;
| SleepSystem&lt;br /&gt;
|-&lt;br /&gt;
| 0x00430040&lt;br /&gt;
| NotifyToWait&lt;br /&gt;
|-&lt;br /&gt;
| 0x00440000&lt;br /&gt;
| GetSharedFont&lt;br /&gt;
|-&lt;br /&gt;
| 0x00450040&lt;br /&gt;
| GetWirelessRebootInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x00460104&lt;br /&gt;
| Wrap&lt;br /&gt;
|-&lt;br /&gt;
| 0x00470104&lt;br /&gt;
| Unwrap&lt;br /&gt;
|-&lt;br /&gt;
| 0x00480100&lt;br /&gt;
| GetProgramInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x00490180&lt;br /&gt;
| Reboot&lt;br /&gt;
|-&lt;br /&gt;
| 0x004A0040&lt;br /&gt;
| GetCaptureInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x004B00C2&lt;br /&gt;
| AppletUtility&lt;br /&gt;
|-&lt;br /&gt;
| 0x004C0000&lt;br /&gt;
| SetFatalErrDispMode&lt;br /&gt;
|-&lt;br /&gt;
| 0x004D0080&lt;br /&gt;
| GetAppletProgramInfo&lt;br /&gt;
|-&lt;br /&gt;
| 0x004E0000&lt;br /&gt;
| HardwareResetAsync&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These applet services can handle launching &amp;quot;applets&amp;quot;, APT:U handles signaling for home/power button as well.&lt;br /&gt;
&lt;br /&gt;
= NS Service &amp;quot;APT:S&amp;quot; =&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=PTM&amp;diff=4955</id>
		<title>PTM</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=PTM&amp;diff=4955"/>
		<updated>2013-02-16T20:57:02Z</updated>

		<summary type="html">&lt;p&gt;Neimod: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=User PTM Service &amp;quot;ptm:u&amp;quot;=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00010002&lt;br /&gt;
| RegisterAlarmClient&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020080&lt;br /&gt;
| SetRtcAlarm&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030000&lt;br /&gt;
| GetRtcAlarm&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040000&lt;br /&gt;
| CancelRtcAlarm&lt;br /&gt;
|-&lt;br /&gt;
| 0x00050000&lt;br /&gt;
| GetAdapterState&lt;br /&gt;
|-&lt;br /&gt;
| 0x00060000&lt;br /&gt;
| GetShellState&lt;br /&gt;
|-&lt;br /&gt;
| 0x00070000&lt;br /&gt;
| GetBatteryLevel&lt;br /&gt;
|-&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| GetBatteryChargeState&lt;br /&gt;
|-&lt;br /&gt;
| 0x00090000&lt;br /&gt;
| GetPedometerState&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A0042&lt;br /&gt;
| GetStepHistoryEntry&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B00C2&lt;br /&gt;
| GetStepHistory&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0000&lt;br /&gt;
| GetTotalStepCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D0040&lt;br /&gt;
| SetPedometerRecordingMode&lt;br /&gt;
|-&lt;br /&gt;
| 0x000E0000&lt;br /&gt;
| GetPedometerRecordingMode&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0084&lt;br /&gt;
| GetStepHistoryAll&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=PlayHistory PTM Service &amp;quot;ptm:play&amp;quot; =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00010002&lt;br /&gt;
| RegisterAlarmClient&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020080&lt;br /&gt;
| SetRtcAlarm&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030000&lt;br /&gt;
| GetRtcAlarm&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040000&lt;br /&gt;
| CancelRtcAlarm&lt;br /&gt;
|-&lt;br /&gt;
| 0x00050000&lt;br /&gt;
| GetAdapterState&lt;br /&gt;
|-&lt;br /&gt;
| 0x00060000&lt;br /&gt;
| GetShellState&lt;br /&gt;
|-&lt;br /&gt;
| 0x00070000&lt;br /&gt;
| GetBatteryLevel&lt;br /&gt;
|-&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| GetBatteryChargeState&lt;br /&gt;
|-&lt;br /&gt;
| 0x00090000&lt;br /&gt;
| GetPedometerState&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A0042&lt;br /&gt;
| GetStepHistoryEntry&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B00C2&lt;br /&gt;
| GetStepHistory&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0000&lt;br /&gt;
| GetTotalStepCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D0040&lt;br /&gt;
| SetPedometerRecordingMode&lt;br /&gt;
|-&lt;br /&gt;
| 0x000E0000&lt;br /&gt;
| GetPedometerRecordingMode&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0084&lt;br /&gt;
| GetStepHistoryAll&lt;br /&gt;
|-&lt;br /&gt;
| 0x08070082&lt;br /&gt;
| GetPlayHistory&lt;br /&gt;
|-&lt;br /&gt;
| 0x08080000&lt;br /&gt;
| GetPlayHistoryStart&lt;br /&gt;
|-&lt;br /&gt;
| 0x08090000&lt;br /&gt;
| GetPlayHistoryLength&lt;br /&gt;
|-&lt;br /&gt;
| 0x080B0080&lt;br /&gt;
| CalcPlayHistoryStart&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=SysMenu PTM Service &amp;quot;ptm:sysm&amp;quot;=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Command Header&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00010002&lt;br /&gt;
| RegisterAlarmClient&lt;br /&gt;
|-&lt;br /&gt;
| 0x00020080&lt;br /&gt;
| SetRtcAlarm&lt;br /&gt;
|-&lt;br /&gt;
| 0x00030000&lt;br /&gt;
| GetRtcAlarm&lt;br /&gt;
|-&lt;br /&gt;
| 0x00040000&lt;br /&gt;
| CancelRtcAlarm&lt;br /&gt;
|-&lt;br /&gt;
| 0x00050000&lt;br /&gt;
| GetAdapterState&lt;br /&gt;
|-&lt;br /&gt;
| 0x00060000&lt;br /&gt;
| GetShellState&lt;br /&gt;
|-&lt;br /&gt;
| 0x00070000&lt;br /&gt;
| GetBatteryLevel&lt;br /&gt;
|-&lt;br /&gt;
| 0x00080000&lt;br /&gt;
| GetBatteryChargeState&lt;br /&gt;
|-&lt;br /&gt;
| 0x00090000&lt;br /&gt;
| GetPedometerState&lt;br /&gt;
|-&lt;br /&gt;
| 0x000A0042&lt;br /&gt;
| GetStepHistoryEntry&lt;br /&gt;
|-&lt;br /&gt;
| 0x000B00C2&lt;br /&gt;
| GetStepHistory&lt;br /&gt;
|-&lt;br /&gt;
| 0x000C0000&lt;br /&gt;
| GetTotalStepCount&lt;br /&gt;
|-&lt;br /&gt;
| 0x000D0040&lt;br /&gt;
| SetPedometerRecordingMode&lt;br /&gt;
|-&lt;br /&gt;
| 0x000E0000&lt;br /&gt;
| GetPedometerRecordingMode&lt;br /&gt;
|-&lt;br /&gt;
| 0x000F0084&lt;br /&gt;
| GetStepHistoryAll&lt;br /&gt;
|-&lt;br /&gt;
| 0x040100C0&lt;br /&gt;
| SetRtcAlarmEx&lt;br /&gt;
|-&lt;br /&gt;
| 0x04020042&lt;br /&gt;
| ReplySleepQuery&lt;br /&gt;
|-&lt;br /&gt;
| 0x04030042&lt;br /&gt;
| NotifySleepPreparationComplete&lt;br /&gt;
|-&lt;br /&gt;
| 0x04040102&lt;br /&gt;
| SetWakeupTrigger&lt;br /&gt;
|-&lt;br /&gt;
| 0x04050000&lt;br /&gt;
| GetAwakeReason&lt;br /&gt;
|-&lt;br /&gt;
| 0x04060000&lt;br /&gt;
| RequestSleep&lt;br /&gt;
|-&lt;br /&gt;
| 0x040700C0&lt;br /&gt;
| ShutdownAsync&lt;br /&gt;
|-&lt;br /&gt;
| 0x04080000&lt;br /&gt;
| Awake&lt;br /&gt;
|-&lt;br /&gt;
| 0x04090080&lt;br /&gt;
| RebootAsync&lt;br /&gt;
|-&lt;br /&gt;
| 0x08010640&lt;br /&gt;
| SetInfoLEDPattern&lt;br /&gt;
|-&lt;br /&gt;
| 0x08020040&lt;br /&gt;
| SetInfoLEDPatternHeader&lt;br /&gt;
|-&lt;br /&gt;
| 0x08030000&lt;br /&gt;
| GetInfoLEDStatus&lt;br /&gt;
|-&lt;br /&gt;
| 0x08040040&lt;br /&gt;
| SetBatteryEmptyLEDPattern&lt;br /&gt;
|-&lt;br /&gt;
| 0x08050000&lt;br /&gt;
| ClearStepHistory&lt;br /&gt;
|-&lt;br /&gt;
| 0x080600C2&lt;br /&gt;
| SetStepHistory&lt;br /&gt;
|-&lt;br /&gt;
| 0x08070082&lt;br /&gt;
| GetPlayHistory&lt;br /&gt;
|-&lt;br /&gt;
| 0x08080000&lt;br /&gt;
| GetPlayHistoryStart&lt;br /&gt;
|-&lt;br /&gt;
| 0x08090000&lt;br /&gt;
| GetPlayHistoryLength&lt;br /&gt;
|-&lt;br /&gt;
| 0x080A0000&lt;br /&gt;
| ClearPlayHistory&lt;br /&gt;
|-&lt;br /&gt;
| 0x080B0080&lt;br /&gt;
| CalcPlayHistoryStart&lt;br /&gt;
|-&lt;br /&gt;
| 0x080C0080&lt;br /&gt;
| SetUserTime&lt;br /&gt;
|-&lt;br /&gt;
| 0x080D0000&lt;br /&gt;
| InvalidateSystemTime&lt;br /&gt;
|-&lt;br /&gt;
| 0x080E0140&lt;br /&gt;
| NotifyPlayEvent&lt;br /&gt;
|-&lt;br /&gt;
| 0x080F0000&lt;br /&gt;
| IsLegacyPowerOff&lt;br /&gt;
|-&lt;br /&gt;
| 0x08100000&lt;br /&gt;
| ClearLegacyPowerOff&lt;br /&gt;
|-&lt;br /&gt;
| 0x08110000&lt;br /&gt;
| GetShellStatus&lt;br /&gt;
|-&lt;br /&gt;
| 0x08120000&lt;br /&gt;
| IsShutdownByBatteryEmpty&lt;br /&gt;
|-&lt;br /&gt;
| 0x08130000&lt;br /&gt;
| FormatSavedata&lt;br /&gt;
|-&lt;br /&gt;
| 0x08140000&lt;br /&gt;
| GetLegacyJumpProhibitedFlag&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=GetSystemTime PTM Service &amp;quot;ptm:gets&amp;quot;=&lt;br /&gt;
&lt;br /&gt;
=SystemControl PTM Service &amp;quot;ptm:s&amp;quot;=&lt;/div&gt;</summary>
		<author><name>Neimod</name></author>
	</entry>
</feed>