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

376 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/kernel/event.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_36b4ff30955378a33ed199d75bfba1a9.html">kernel</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">event.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<p>Kernel-mode event synchronization primitive.
<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="result_8h_source.html">../result.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="wait_8h_source.html">wait.h</a>&quot;</code><br />
</div>
<p><a href="event_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="nested-classes" name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structEvent.html">Event</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Kernel-mode event structure. <a href="structEvent.html#details">More...</a><br /></td></tr>
<tr class="separator:"><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:ae0ad93722c4f144306cd96be36776e81" id="r_ae0ad93722c4f144306cd96be36776e81"><td class="memItemLeft" align="right" valign="top"><a id="ae0ad93722c4f144306cd96be36776e81" name="ae0ad93722c4f144306cd96be36776e81"></a>
static <a class="el" href="structWaiter.html">Waiter</a>&#160;</td><td class="memItemRight" valign="bottom"><b>waiterForEvent</b> (<a class="el" href="structEvent.html">Event</a> *t)</td></tr>
<tr class="memdesc:ae0ad93722c4f144306cd96be36776e81"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a <a class="el" href="structWaiter.html">Waiter</a> for a kernel-mode event. <br /></td></tr>
<tr class="separator:ae0ad93722c4f144306cd96be36776e81"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e01949a047fdf2487879b6e238448db" id="r_a3e01949a047fdf2487879b6e238448db"><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="event_8h.html#a3e01949a047fdf2487879b6e238448db">eventCreate</a> (<a class="el" href="structEvent.html">Event</a> *t, bool autoclear)</td></tr>
<tr class="memdesc:a3e01949a047fdf2487879b6e238448db"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a kernel-mode event. <br /></td></tr>
<tr class="separator:a3e01949a047fdf2487879b6e238448db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a94becfb949c8fc755141fad27c91ec28" id="r_a94becfb949c8fc755141fad27c91ec28"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="event_8h.html#a94becfb949c8fc755141fad27c91ec28">eventLoadRemote</a> (<a class="el" href="structEvent.html">Event</a> *t, <a class="el" href="types_8h.html#ab6d744c6b5de129f12937e482dc674fb">Handle</a> handle, bool autoclear)</td></tr>
<tr class="memdesc:a94becfb949c8fc755141fad27c91ec28"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loads a kernel-mode event obtained from IPC. <br /></td></tr>
<tr class="separator:a94becfb949c8fc755141fad27c91ec28"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d65b07b6731c4911ec5eb56e52d68b5" id="r_a3d65b07b6731c4911ec5eb56e52d68b5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="event_8h.html#a3d65b07b6731c4911ec5eb56e52d68b5">eventClose</a> (<a class="el" href="structEvent.html">Event</a> *t)</td></tr>
<tr class="memdesc:a3d65b07b6731c4911ec5eb56e52d68b5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Closes a kernel-mode event. <br /></td></tr>
<tr class="separator:a3d65b07b6731c4911ec5eb56e52d68b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afac848522744a872d5a54b7f88e9ee66" id="r_afac848522744a872d5a54b7f88e9ee66"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="event_8h.html#afac848522744a872d5a54b7f88e9ee66">eventActive</a> (<a class="el" href="structEvent.html">Event</a> *t)</td></tr>
<tr class="memdesc:afac848522744a872d5a54b7f88e9ee66"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether an <a class="el" href="structEvent.html">Event</a> is initialized. <br /></td></tr>
<tr class="separator:afac848522744a872d5a54b7f88e9ee66"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9ef7b7f64d12b85096b5220f20e2d947" id="r_a9ef7b7f64d12b85096b5220f20e2d947"><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="event_8h.html#a9ef7b7f64d12b85096b5220f20e2d947">eventWait</a> (<a class="el" href="structEvent.html">Event</a> *t, <a class="el" href="types_8h.html#a3f7e2bcbb0b4c338f3c4f6c937cd4234">u64</a> timeout)</td></tr>
<tr class="memdesc:a9ef7b7f64d12b85096b5220f20e2d947"><td class="mdescLeft">&#160;</td><td class="mdescRight">Waits on a kernel-mode event. <br /></td></tr>
<tr class="separator:a9ef7b7f64d12b85096b5220f20e2d947"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a904ffb0f75f59d57470ad17554dbd4" id="r_a2a904ffb0f75f59d57470ad17554dbd4"><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="event_8h.html#a2a904ffb0f75f59d57470ad17554dbd4">eventFire</a> (<a class="el" href="structEvent.html">Event</a> *t)</td></tr>
<tr class="memdesc:a2a904ffb0f75f59d57470ad17554dbd4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Signals a kernel-mode event. <br /></td></tr>
<tr class="separator:a2a904ffb0f75f59d57470ad17554dbd4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a689fb17af2e4e91251c93623cba04a66" id="r_a689fb17af2e4e91251c93623cba04a66"><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="event_8h.html#a689fb17af2e4e91251c93623cba04a66">eventClear</a> (<a class="el" href="structEvent.html">Event</a> *t)</td></tr>
<tr class="memdesc:a689fb17af2e4e91251c93623cba04a66"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears a kernel-mode event. <br /></td></tr>
<tr class="separator:a689fb17af2e4e91251c93623cba04a66"><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>Kernel-mode event synchronization primitive. </p>
<dl class="section author"><dt>Author</dt><dd>plutoo </dd></dl>
<dl class="section copyright"><dt>Copyright</dt><dd>libnx Authors </dd></dl>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="afac848522744a872d5a54b7f88e9ee66" name="afac848522744a872d5a54b7f88e9ee66"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afac848522744a872d5a54b7f88e9ee66">&#9670;&#160;</a></span>eventActive()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static bool eventActive </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structEvent.html">Event</a> *&#160;</td>
<td class="paramname"><em>t</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns whether an <a class="el" href="structEvent.html">Event</a> is initialized. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">t</td><td>Pointer to <a class="el" href="structEvent.html">Event</a> structure. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Initialization status. </dd></dl>
</div>
</div>
<a id="a689fb17af2e4e91251c93623cba04a66" name="a689fb17af2e4e91251c93623cba04a66"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a689fb17af2e4e91251c93623cba04a66">&#9670;&#160;</a></span>eventClear()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="types_8h.html#ad1be2721625a17f1be47fac918032afe">Result</a> eventClear </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structEvent.html">Event</a> *&#160;</td>
<td class="paramname"><em>t</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Clears a kernel-mode event. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">t</td><td>Pointer to <a class="el" href="structEvent.html">Event</a> structure. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result code. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>This function shouldn't be used on autoclear events. </dd></dl>
</div>
</div>
<a id="a3d65b07b6731c4911ec5eb56e52d68b5" name="a3d65b07b6731c4911ec5eb56e52d68b5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3d65b07b6731c4911ec5eb56e52d68b5">&#9670;&#160;</a></span>eventClose()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void eventClose </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structEvent.html">Event</a> *&#160;</td>
<td class="paramname"><em>t</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Closes a kernel-mode event. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">t</td><td>Pointer to <a class="el" href="structEvent.html">Event</a> structure. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a3e01949a047fdf2487879b6e238448db" name="a3e01949a047fdf2487879b6e238448db"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3e01949a047fdf2487879b6e238448db">&#9670;&#160;</a></span>eventCreate()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="types_8h.html#ad1be2721625a17f1be47fac918032afe">Result</a> eventCreate </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structEvent.html">Event</a> *&#160;</td>
<td class="paramname"><em>t</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>autoclear</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a kernel-mode event. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">t</td><td>Pointer to <a class="el" href="structEvent.html">Event</a> structure. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">autoclear</td><td>Autoclear flag. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result code. </dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>This is a privileged operation; in normal circumstances applications shouldn't use this function. </dd></dl>
</div>
</div>
<a id="a2a904ffb0f75f59d57470ad17554dbd4" name="a2a904ffb0f75f59d57470ad17554dbd4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2a904ffb0f75f59d57470ad17554dbd4">&#9670;&#160;</a></span>eventFire()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="types_8h.html#ad1be2721625a17f1be47fac918032afe">Result</a> eventFire </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structEvent.html">Event</a> *&#160;</td>
<td class="paramname"><em>t</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Signals a kernel-mode event. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">t</td><td>Pointer to <a class="el" href="structEvent.html">Event</a> structure. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result code. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>This function only works for events initialized with <a class="el" href="event_8h.html#a3e01949a047fdf2487879b6e238448db">eventCreate</a>, it doesn't work with events initialized with <a class="el" href="event_8h.html#a94becfb949c8fc755141fad27c91ec28">eventLoadRemote</a>. </dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>This is a privileged operation; in normal circumstances applications shouldn't use this function. </dd></dl>
</div>
</div>
<a id="a94becfb949c8fc755141fad27c91ec28" name="a94becfb949c8fc755141fad27c91ec28"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a94becfb949c8fc755141fad27c91ec28">&#9670;&#160;</a></span>eventLoadRemote()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void eventLoadRemote </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structEvent.html">Event</a> *&#160;</td>
<td class="paramname"><em>t</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="types_8h.html#ab6d744c6b5de129f12937e482dc674fb">Handle</a>&#160;</td>
<td class="paramname"><em>handle</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>autoclear</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Loads a kernel-mode event obtained from IPC. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">t</td><td>Pointer to <a class="el" href="structEvent.html">Event</a> structure. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">handle</td><td>Read-only event handle. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">autoclear</td><td>Autoclear flag. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a9ef7b7f64d12b85096b5220f20e2d947" name="a9ef7b7f64d12b85096b5220f20e2d947"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9ef7b7f64d12b85096b5220f20e2d947">&#9670;&#160;</a></span>eventWait()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="types_8h.html#ad1be2721625a17f1be47fac918032afe">Result</a> eventWait </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structEvent.html">Event</a> *&#160;</td>
<td class="paramname"><em>t</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="types_8h.html#a3f7e2bcbb0b4c338f3c4f6c937cd4234">u64</a>&#160;</td>
<td class="paramname"><em>timeout</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Waits on a kernel-mode event. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">t</td><td>Pointer to <a class="el" href="structEvent.html">Event</a> structure. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>Timeout in nanoseconds (pass UINT64_MAX to wait indefinitely). </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result code. </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>