libnx/apm_8h.html
2025-05-08 06:59:12 +00:00

302 lines
20 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libnx: include/switch/services/apm.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">libnx<span id="projectnumber">&#160;v4.9.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_42bea3d40f1f1694e41a8f3166c98108.html">switch</a></li><li class="navelem"><a class="el" href="dir_04a7e0b94d44ce4fc7ca3462163fd33c.html">services</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">apm.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<p>Performance management (apm) service IPC wrapper.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="types_8h_source.html">../types.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="service_8h_source.html">../sf/service.h</a>&quot;</code><br />
</div>
<p><a href="apm_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a202ac2fea4c9b9369b715c450314e163" id="r_a202ac2fea4c9b9369b715c450314e163"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="apm_8h.html#a202ac2fea4c9b9369b715c450314e163">ApmPerformanceMode</a> { <br />
&#160;&#160;<a class="el" href="apm_8h.html#a202ac2fea4c9b9369b715c450314e163a3e36ba2d68d7c8aa49eaf1870a2822eb">ApmPerformanceMode_Invalid</a> = -1
, <br />
&#160;&#160;<a class="el" href="apm_8h.html#a202ac2fea4c9b9369b715c450314e163abc062da77bb0f06559dc0c27671d9380">ApmPerformanceMode_Normal</a> = 0
, <br />
&#160;&#160;<a class="el" href="apm_8h.html#a202ac2fea4c9b9369b715c450314e163a0fc6d3036d8efbf7498335f56caf518e">ApmPerformanceMode_Boost</a> = 1
<br />
}</td></tr>
<tr class="memdesc:a202ac2fea4c9b9369b715c450314e163"><td class="mdescLeft">&#160;</td><td class="mdescRight">PerformanceMode. <a href="apm_8h.html#a202ac2fea4c9b9369b715c450314e163">More...</a><br /></td></tr>
<tr class="separator:a202ac2fea4c9b9369b715c450314e163"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5690c3a786c3bee6ef93f5db5354e080" id="r_a5690c3a786c3bee6ef93f5db5354e080"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="apm_8h.html#a5690c3a786c3bee6ef93f5db5354e080">ApmCpuBoostMode</a> { <br />
&#160;&#160;<a class="el" href="apm_8h.html#a5690c3a786c3bee6ef93f5db5354e080a12a6d432bbee99301be3852ba84d0d4b">ApmCpuBoostMode_Normal</a> = 0
, <br />
&#160;&#160;<a class="el" href="apm_8h.html#a5690c3a786c3bee6ef93f5db5354e080a1d40b4995f67f695cfe888a1518a5fff">ApmCpuBoostMode_FastLoad</a> = 1
, <br />
&#160;&#160;<a class="el" href="apm_8h.html#a5690c3a786c3bee6ef93f5db5354e080ab71da80e8a94a17b2f81ca4e6f62d5c5">ApmCpuBoostMode_Type2</a> = 2
<br />
}</td></tr>
<tr class="memdesc:a5690c3a786c3bee6ef93f5db5354e080"><td class="mdescLeft">&#160;</td><td class="mdescRight">CpuBoostMode. With <a class="el" href="applet_8h.html#ac3dc461da31b19b47bda462a0e8c826d">appletSetCpuBoostMode</a>, only values 0/1 are available. This allows using higher clock rates. <a href="apm_8h.html#a5690c3a786c3bee6ef93f5db5354e080">More...</a><br /></td></tr>
<tr class="separator:a5690c3a786c3bee6ef93f5db5354e080"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a93756bbc2ebd5c09e3921a0852a2a8ca" id="r_a93756bbc2ebd5c09e3921a0852a2a8ca"><td class="memItemLeft" align="right" valign="top"><a id="a93756bbc2ebd5c09e3921a0852a2a8ca" name="a93756bbc2ebd5c09e3921a0852a2a8ca"></a>
<a class="el" href="types_8h.html#ad1be2721625a17f1be47fac918032afe">Result</a>&#160;</td><td class="memItemRight" valign="bottom"><b>apmInitialize</b> (void)</td></tr>
<tr class="memdesc:a93756bbc2ebd5c09e3921a0852a2a8ca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize apm. Used automatically by <a class="el" href="applet_8h.html#a5a71263184d10b47bf7446f15680a585">appletInitialize</a> with AppletType_Application. <br /></td></tr>
<tr class="separator:a93756bbc2ebd5c09e3921a0852a2a8ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab49039fe9490e547abe5d7db87ce48ab" id="r_ab49039fe9490e547abe5d7db87ce48ab"><td class="memItemLeft" align="right" valign="top"><a id="ab49039fe9490e547abe5d7db87ce48ab" name="ab49039fe9490e547abe5d7db87ce48ab"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>apmExit</b> (void)</td></tr>
<tr class="memdesc:ab49039fe9490e547abe5d7db87ce48ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Exit apm. Used automatically by <a class="el" href="applet_8h.html#ae18761516be02f0dfefc6252709f9ac3">appletExit</a> with AppletType_Application. <br /></td></tr>
<tr class="separator:ab49039fe9490e547abe5d7db87ce48ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a624d5efbfcf3dac5c6e3117f09097008" id="r_a624d5efbfcf3dac5c6e3117f09097008"><td class="memItemLeft" align="right" valign="top"><a id="a624d5efbfcf3dac5c6e3117f09097008" name="a624d5efbfcf3dac5c6e3117f09097008"></a>
<a class="el" href="structService.html">Service</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>apmGetServiceSession</b> (void)</td></tr>
<tr class="memdesc:a624d5efbfcf3dac5c6e3117f09097008"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the <a class="el" href="structService.html" title="Service object structure.">Service</a> object for the actual apm service session. <br /></td></tr>
<tr class="separator:a624d5efbfcf3dac5c6e3117f09097008"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a81d680ffb427ee63a6e28dc01d7ac498" id="r_a81d680ffb427ee63a6e28dc01d7ac498"><td class="memItemLeft" align="right" valign="top"><a id="a81d680ffb427ee63a6e28dc01d7ac498" name="a81d680ffb427ee63a6e28dc01d7ac498"></a>
<a class="el" href="structService.html">Service</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>apmGetServiceSession_Session</b> (void)</td></tr>
<tr class="memdesc:a81d680ffb427ee63a6e28dc01d7ac498"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the <a class="el" href="structService.html" title="Service object structure.">Service</a> object for ISession. <br /></td></tr>
<tr class="separator:a81d680ffb427ee63a6e28dc01d7ac498"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa2bcc590745d133a47990f57ba57ef8c" id="r_aa2bcc590745d133a47990f57ba57ef8c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="types_8h.html#ad1be2721625a17f1be47fac918032afe">Result</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="apm_8h.html#aa2bcc590745d133a47990f57ba57ef8c">apmGetPerformanceMode</a> (<a class="el" href="apm_8h.html#a202ac2fea4c9b9369b715c450314e163">ApmPerformanceMode</a> *out_performanceMode)</td></tr>
<tr class="memdesc:aa2bcc590745d133a47990f57ba57ef8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the current ApmPerformanceMode. <br /></td></tr>
<tr class="separator:aa2bcc590745d133a47990f57ba57ef8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ba049c638daa1bcc5efcd169275dcd2" id="r_a1ba049c638daa1bcc5efcd169275dcd2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="types_8h.html#ad1be2721625a17f1be47fac918032afe">Result</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="apm_8h.html#a1ba049c638daa1bcc5efcd169275dcd2">apmSetPerformanceConfiguration</a> (<a class="el" href="apm_8h.html#a202ac2fea4c9b9369b715c450314e163">ApmPerformanceMode</a> PerformanceMode, <a class="el" href="types_8h.html#afaa62991928fb9fb18ff0db62a040aba">u32</a> PerformanceConfiguration)</td></tr>
<tr class="memdesc:a1ba049c638daa1bcc5efcd169275dcd2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the PerformanceConfiguration for the specified PerformanceMode. <br /></td></tr>
<tr class="separator:a1ba049c638daa1bcc5efcd169275dcd2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aad892947ec959896481236d93711be31" id="r_aad892947ec959896481236d93711be31"><td class="memItemLeft" align="right" valign="top"><a class="el" href="types_8h.html#ad1be2721625a17f1be47fac918032afe">Result</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="apm_8h.html#aad892947ec959896481236d93711be31">apmGetPerformanceConfiguration</a> (<a class="el" href="apm_8h.html#a202ac2fea4c9b9369b715c450314e163">ApmPerformanceMode</a> PerformanceMode, <a class="el" href="types_8h.html#afaa62991928fb9fb18ff0db62a040aba">u32</a> *PerformanceConfiguration)</td></tr>
<tr class="memdesc:aad892947ec959896481236d93711be31"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the PerformanceConfiguration for the specified PerformanceMode. <br /></td></tr>
<tr class="separator:aad892947ec959896481236d93711be31"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Performance management (apm) service IPC wrapper. </p>
<p>This is used internally by applet with __nx_applet_PerformanceConfiguration, however if you prefer non-init/exit can be used manually. See also: <a href="https://switchbrew.org/wiki/PTM_services#apm:am">https://switchbrew.org/wiki/PTM_services#apm:am</a> </p><dl class="section author"><dt>Author</dt><dd>yellows8 </dd></dl>
<dl class="section copyright"><dt>Copyright</dt><dd>libnx Authors </dd></dl>
</div><h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="a5690c3a786c3bee6ef93f5db5354e080" name="a5690c3a786c3bee6ef93f5db5354e080"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5690c3a786c3bee6ef93f5db5354e080">&#9670;&#160;</a></span>ApmCpuBoostMode</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="apm_8h.html#a5690c3a786c3bee6ef93f5db5354e080">ApmCpuBoostMode</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>CpuBoostMode. With <a class="el" href="applet_8h.html#ac3dc461da31b19b47bda462a0e8c826d">appletSetCpuBoostMode</a>, only values 0/1 are available. This allows using higher clock rates. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a5690c3a786c3bee6ef93f5db5354e080a12a6d432bbee99301be3852ba84d0d4b" name="a5690c3a786c3bee6ef93f5db5354e080a12a6d432bbee99301be3852ba84d0d4b"></a>ApmCpuBoostMode_Normal&#160;</td><td class="fielddoc"><p>Default, boost-mode disabled. </p>
</td></tr>
<tr><td class="fieldname"><a id="a5690c3a786c3bee6ef93f5db5354e080a1d40b4995f67f695cfe888a1518a5fff" name="a5690c3a786c3bee6ef93f5db5354e080a1d40b4995f67f695cfe888a1518a5fff"></a>ApmCpuBoostMode_FastLoad&#160;</td><td class="fielddoc"><p>Boost CPU. Additionally, throttle GPU to minimum. Use performance configurations 0x92220009 (Docked) and 0x9222000A (Handheld), or 0x9222000B and 0x9222000C. </p>
</td></tr>
<tr><td class="fieldname"><a id="a5690c3a786c3bee6ef93f5db5354e080ab71da80e8a94a17b2f81ca4e6f62d5c5" name="a5690c3a786c3bee6ef93f5db5354e080ab71da80e8a94a17b2f81ca4e6f62d5c5"></a>ApmCpuBoostMode_Type2&#160;</td><td class="fielddoc"><p>Conserve power. Only throttle GPU to minimum. Use performance configurations 0x9222000B and 0x9222000C. </p>
</td></tr>
</table>
</div>
</div>
<a id="a202ac2fea4c9b9369b715c450314e163" name="a202ac2fea4c9b9369b715c450314e163"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a202ac2fea4c9b9369b715c450314e163">&#9670;&#160;</a></span>ApmPerformanceMode</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="apm_8h.html#a202ac2fea4c9b9369b715c450314e163">ApmPerformanceMode</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>PerformanceMode. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a202ac2fea4c9b9369b715c450314e163a3e36ba2d68d7c8aa49eaf1870a2822eb" name="a202ac2fea4c9b9369b715c450314e163a3e36ba2d68d7c8aa49eaf1870a2822eb"></a>ApmPerformanceMode_Invalid&#160;</td><td class="fielddoc"><p>Invalid. </p>
</td></tr>
<tr><td class="fieldname"><a id="a202ac2fea4c9b9369b715c450314e163abc062da77bb0f06559dc0c27671d9380" name="a202ac2fea4c9b9369b715c450314e163abc062da77bb0f06559dc0c27671d9380"></a>ApmPerformanceMode_Normal&#160;</td><td class="fielddoc"><p>Normal. </p>
</td></tr>
<tr><td class="fieldname"><a id="a202ac2fea4c9b9369b715c450314e163a0fc6d3036d8efbf7498335f56caf518e" name="a202ac2fea4c9b9369b715c450314e163a0fc6d3036d8efbf7498335f56caf518e"></a>ApmPerformanceMode_Boost&#160;</td><td class="fielddoc"><p>Boost. </p>
</td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="aad892947ec959896481236d93711be31" name="aad892947ec959896481236d93711be31"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aad892947ec959896481236d93711be31">&#9670;&#160;</a></span>apmGetPerformanceConfiguration()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="types_8h.html#ad1be2721625a17f1be47fac918032afe">Result</a> apmGetPerformanceConfiguration </td>
<td>(</td>
<td class="paramtype"><a class="el" href="apm_8h.html#a202ac2fea4c9b9369b715c450314e163">ApmPerformanceMode</a>&#160;</td>
<td class="paramname"><em>PerformanceMode</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="types_8h.html#afaa62991928fb9fb18ff0db62a040aba">u32</a> *&#160;</td>
<td class="paramname"><em>PerformanceConfiguration</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Gets the PerformanceConfiguration for the specified PerformanceMode. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">PerformanceMode</td><td><a class="el" href="apm_8h.html#a202ac2fea4c9b9369b715c450314e163">ApmPerformanceMode</a> </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">PerformanceConfiguration</td><td>PerformanceConfiguration </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="aa2bcc590745d133a47990f57ba57ef8c" name="aa2bcc590745d133a47990f57ba57ef8c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa2bcc590745d133a47990f57ba57ef8c">&#9670;&#160;</a></span>apmGetPerformanceMode()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="types_8h.html#ad1be2721625a17f1be47fac918032afe">Result</a> apmGetPerformanceMode </td>
<td>(</td>
<td class="paramtype"><a class="el" href="apm_8h.html#a202ac2fea4c9b9369b715c450314e163">ApmPerformanceMode</a> *&#160;</td>
<td class="paramname"><em>out_performanceMode</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Gets the current ApmPerformanceMode. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">out_performanceMode</td><td>ApmPerformanceMode </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a1ba049c638daa1bcc5efcd169275dcd2" name="a1ba049c638daa1bcc5efcd169275dcd2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1ba049c638daa1bcc5efcd169275dcd2">&#9670;&#160;</a></span>apmSetPerformanceConfiguration()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="types_8h.html#ad1be2721625a17f1be47fac918032afe">Result</a> apmSetPerformanceConfiguration </td>
<td>(</td>
<td class="paramtype"><a class="el" href="apm_8h.html#a202ac2fea4c9b9369b715c450314e163">ApmPerformanceMode</a>&#160;</td>
<td class="paramname"><em>PerformanceMode</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="types_8h.html#afaa62991928fb9fb18ff0db62a040aba">u32</a>&#160;</td>
<td class="paramname"><em>PerformanceConfiguration</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the PerformanceConfiguration for the specified PerformanceMode. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">PerformanceMode</td><td><a class="el" href="apm_8h.html#a202ac2fea4c9b9369b715c450314e163">ApmPerformanceMode</a> </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">PerformanceConfiguration</td><td>PerformanceConfiguration </td></tr>
</table>
</dd>
</dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>