
Added initial support Xilinx Embedded Software. Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
372 lines
16 KiB
HTML
Executable file
372 lines
16 KiB
HTML
Executable file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
|
|
<title>2014.1_doc: process.h File Reference</title>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
|
<link href="tabs.css" rel="stylesheet" type="text/css">
|
|
</head><body>
|
|
<!-- Generated by Doxygen 1.4.5 -->
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="annotated.html"><span>Data Structures</span></a></li>
|
|
<li id="current"><a href="files.html"><span>Files</span></a></li>
|
|
<li><a href="dirs.html"><span>Directories</span></a></li>
|
|
</ul></div>
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="files.html"><span>File List</span></a></li>
|
|
<li><a href="globals.html"><span>Globals</span></a></li>
|
|
</ul></div>
|
|
<div class="nav">
|
|
<a class="el" href="dir_U_3A_2Fdoxygen_5Fpublish_2Fsources_2Fbsp_2Fxilkernel_5Fv6_5F0_2Fsrc_2Finclude_2F.html">include</a> » <a class="el" href="dir_U_3A_2Fdoxygen_5Fpublish_2Fsources_2Fbsp_2Fxilkernel_5Fv6_5F0_2Fsrc_2Finclude_2Fsys_2F.html">sys</a></div>
|
|
<h1>process.h File Reference</h1><code>#include <<a class="el" href="config__param_8h.html">config/config_param.h</a>></code><br>
|
|
<code>#include <<a class="el" href="config__cparam_8h.html">config/config_cparam.h</a>></code><br>
|
|
<code>#include <<a class="el" href="queue_8h.html">sys/queue.h</a>></code><br>
|
|
<code>#include <<a class="el" href="ktypes_8h.html">sys/ktypes.h</a>></code><br>
|
|
<code>#include <<a class="el" href="stats_8h.html">sys/stats.h</a>></code><br>
|
|
<code>#include <<a class="el" href="kpthread_8h.html">sys/kpthread.h</a>></code><br>
|
|
<table border="0" cellpadding="0" cellspacing="0">
|
|
<tr><td></td></tr>
|
|
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5c169514fb8cfeb6e4f3673c5d3bae33"></a><!-- doxytag: member="process.h::PROC_NEW" ref="5c169514fb8cfeb6e4f3673c5d3bae33" args="" -->
|
|
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="process_8h.html#5c169514fb8cfeb6e4f3673c5d3bae33">PROC_NEW</a> 0</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Process States. <br></td></tr>
|
|
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="process_8h.html#bc6f27b995045157e9f88aac0bfa1c2a">xmk_enter_kernel</a> (void)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="process_8h.html#834b553ad062472ee1b9c14c47f37ca9">xmk_leave_kernel</a> (void)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="process_8h.html#bfa5620df1483750c886bb02d304a57e">process_block</a> (queuep queue, unsigned int state)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="process_8h.html#488b40f441162bf218c37bd0c61f55a1">process_unblock</a> (queuep queue)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">pid_t </td><td class="memItemRight" valign="bottom"><a class="el" href="process_8h.html#05d3e9db8d242b06de90aa951d7e77b1">proc_create</a> (unsigned int priority)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="process_8h.html#47825286650f0d1c03eb5d895d74445b">process_invalidate</a> (<a class="el" href="struct__process__struct.html">process_struct</a> *proc)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="process_8h.html#b93638f1cade5ca458cefe81282e6c87">sys_process_status</a> (pid_t pid, <a class="el" href="struct__ps__stat.html">p_stat</a> *ps)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">pid_t </td><td class="memItemRight" valign="bottom"><a class="el" href="process_8h.html#55a8fac89c511c87549b523180014861">sys_get_currentPID</a> (void)</td></tr>
|
|
|
|
</table>
|
|
<hr><a name="_details"></a><h2>Detailed Description</h2>
|
|
Process management declarations and definitions <hr><h2>Function Documentation</h2>
|
|
<a class="anchor" name="05d3e9db8d242b06de90aa951d7e77b1"></a><!-- doxytag: member="process.h::proc_create" ref="05d3e9db8d242b06de90aa951d7e77b1" args="(unsigned int priority)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">pid_t proc_create </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">unsigned int </td>
|
|
<td class="mdname1" valign="top" nowrap> <em>priority</em> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Process creation primitive.<ul>
|
|
<li>Reserves a pid for the process.</li><li>Initializes the process structure (except for the context)</li><li>Places the process in the READY_Q. <dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>priority</em> </td><td>is the priority of the process </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd></dd></dl>
|
|
</li><li>PID of the new process.</li><li>-1 on Error. Max. process exceeded. <dl compact><dt><b>Note:</b></dt><dd></dd></dl>
|
|
</li><li>None </li></ul>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="bfa5620df1483750c886bb02d304a57e"></a><!-- doxytag: member="process.h::process_block" ref="bfa5620df1483750c886bb02d304a57e" args="(queuep queue, unsigned int state)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">void process_block </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">queuep </td>
|
|
<td class="mdname" nowrap> <em>queue</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>unsigned int </td>
|
|
<td class="mdname" nowrap> <em>state</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md"></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Block the process.<ul>
|
|
<li>Place the process into the specified wait queue, change the state of the process and set the kernel flag to PROCESS_BLOCK.</li><li>Call the process_scheduler <dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>queue</em> </td><td>is the queue where the process is enqueued.</td></tr>
|
|
</table>
|
|
</dl>
|
|
</li><li>state is the state of the process in queue. <dl compact><dt><b>Returns:</b></dt><dd></dd></dl>
|
|
</li><li>Nothing <dl compact><dt><b>Note:</b></dt><dd></dd></dl>
|
|
</li><li>None </li></ul>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="47825286650f0d1c03eb5d895d74445b"></a><!-- doxytag: member="process.h::process_invalidate" ref="47825286650f0d1c03eb5d895d74445b" args="(process_struct *proc)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">int process_invalidate </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top"><a class="el" href="struct__process__struct.html">process_struct</a> * </td>
|
|
<td class="mdname1" valign="top" nowrap> <em>proc</em> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Remove the Process with pid. This is an internal proc that is called by sys_kill() and also by the schedulers to remove "DEAD" processes <dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>proc</em> </td><td>is the process structure of process to invalidate </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd><ul>
|
|
<li>0 on Success</li><li>-1 on Error </li></ul>
|
|
</dd></dl>
|
|
<dl compact><dt><b>Note:</b></dt><dd><ul>
|
|
<li>None </li></ul>
|
|
</dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="488b40f441162bf218c37bd0c61f55a1"></a><!-- doxytag: member="process.h::process_unblock" ref="488b40f441162bf218c37bd0c61f55a1" args="(queuep queue)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">void process_unblock </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">queuep </td>
|
|
<td class="mdname1" valign="top" nowrap> <em>queue</em> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Unblock the first process in queue and place it onto the ready queue. Call the process_scheduler only if this is PRIO scheduling. This is because we do not want the current process to prematurely lose its time slice. Change the state of the process to PROC_READY <dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>queue</em> </td><td>is the queue where the process is enqueued. </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd><ul>
|
|
<li>Nothing </li></ul>
|
|
</dd></dl>
|
|
<dl compact><dt><b>Note:</b></dt><dd><ul>
|
|
<li>None </li></ul>
|
|
</dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="55a8fac89c511c87549b523180014861"></a><!-- doxytag: member="process.h::sys_get_currentPID" ref="55a8fac89c511c87549b523180014861" args="(void)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">pid_t sys_get_currentPID </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">void </td>
|
|
<td class="mdname1" valign="top" nowrap> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Return the PID of the currently running process context <dl compact><dt><b>Returns:</b></dt><dd><ul>
|
|
<li>PID of the currently running process context. </li></ul>
|
|
</dd></dl>
|
|
<dl compact><dt><b>Note:</b></dt><dd><ul>
|
|
<li>None </li></ul>
|
|
</dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="b93638f1cade5ca458cefe81282e6c87"></a><!-- doxytag: member="process.h::sys_process_status" ref="b93638f1cade5ca458cefe81282e6c87" args="(pid_t pid, p_stat *ps)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">int sys_process_status </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">pid_t </td>
|
|
<td class="mdname" nowrap> <em>pid</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap><a class="el" href="struct__ps__stat.html">p_stat</a> * </td>
|
|
<td class="mdname" nowrap> <em>ps</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md"></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Return the status of the process. <dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>pid</em> </td><td>is the Process ID of the process.<ul>
|
|
<li>ps is the structure where the status is returned. </li></ul>
|
|
</td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd><ul>
|
|
<li>The status of the process is returned on ps</li><li>If pid not an active process, ps->pid is assigned -1 </li></ul>
|
|
</dd></dl>
|
|
<dl compact><dt><b>Note:</b></dt><dd><ul>
|
|
<li>None </li></ul>
|
|
</dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="bc6f27b995045157e9f88aac0bfa1c2a"></a><!-- doxytag: member="process.h::xmk_enter_kernel" ref="bc6f27b995045157e9f88aac0bfa1c2a" args="(void)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">void xmk_enter_kernel </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">void </td>
|
|
<td class="mdname1" valign="top" nowrap> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Lock kernel by turning off ALL system interrupts <dl compact><dt><b>Returns:</b></dt><dd><ul>
|
|
<li>Nothing </li></ul>
|
|
</dd></dl>
|
|
<dl compact><dt><b>Note:</b></dt><dd><ul>
|
|
<li>Locks kernel against ALL interrupts.</li><li>Does not lock against critical interrupts. </li></ul>
|
|
</dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="834b553ad062472ee1b9c14c47f37ca9"></a><!-- doxytag: member="process.h::xmk_leave_kernel" ref="834b553ad062472ee1b9c14c47f37ca9" args="(void)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">void xmk_leave_kernel </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">void </td>
|
|
<td class="mdname1" valign="top" nowrap> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Unlock kernel by turning on system timer interrupts <dl compact><dt><b>Returns:</b></dt><dd><ul>
|
|
<li>Nothing </li></ul>
|
|
</dd></dl>
|
|
<dl compact><dt><b>Note:</b></dt><dd><ul>
|
|
<li>Unlocks kernel with respect to ALL interrupts except critical interrupts </li></ul>
|
|
</dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<hr size="1"><address style="align: right;"><small>Generated on Thu Feb 13 14:46:24 2014 for 2014.1_doc by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.5 </small></address>
|
|
</body>
|
|
</html>
|