URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [doc/] [html/] [ref/] [compat-uitron-task-management-functions.html] - Rev 858
Go to most recent revision | Compare with Previous | Blame | View Log
<!-- Copyright (C) 2003 Red Hat, Inc. --> <!-- This material may be distributed only subject to the terms --> <!-- and conditions set forth in the Open Publication License, v1.0 --> <!-- or later (the latest version is presently available at --> <!-- http://www.opencontent.org/openpub/). --> <!-- Distribution of the work or derivative of the work in any --> <!-- standard (paper) book form is prohibited unless prior --> <!-- permission is obtained from the copyright holder. --> <HTML ><HEAD ><TITLE >Task Management Functions</TITLE ><meta name="MSSmartTagsPreventParsing" content="TRUE"> <META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+ "><LINK REL="HOME" TITLE="eCos Reference Manual" HREF="ecos-ref.html"><LINK REL="UP" TITLE="µITRON API" HREF="compat-uitron-microitron-api.html"><LINK REL="PREVIOUS" TITLE="µITRON and eCos" HREF="compat-uitron-over-ecos.html"><LINK REL="NEXT" TITLE="Task-Dependent Synchronization Functions" HREF="compat-uitron-task-dependent-synch-functions.html"></HEAD ><BODY CLASS="SECT1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >eCos Reference Manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="compat-uitron-over-ecos.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Chapter 32. µITRON API</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="compat-uitron-task-dependent-synch-functions.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="SECT1" ><H1 CLASS="SECT1" ><A NAME="COMPAT-UITRON-TASK-MANAGEMENT-FUNCTIONS">Task Management Functions</H1 ><P >The following functions are fully supported in this release: </P ><TABLE BORDER="5" BGCOLOR="#E0E0F0" WIDTH="70%" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >ER <TT CLASS="FUNCTION" >sta_tsk</TT >( ID <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >tskid,</I ></SPAN > INT <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >stacd</I ></SPAN > )</PRE ></TD ></TR ></TABLE ><TABLE BORDER="5" BGCOLOR="#E0E0F0" WIDTH="70%" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >void <TT CLASS="FUNCTION" >ext_tsk</TT >( void )</PRE ></TD ></TR ></TABLE ><TABLE BORDER="5" BGCOLOR="#E0E0F0" WIDTH="70%" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >void <TT CLASS="FUNCTION" >exd_tsk</TT >( void )</PRE ></TD ></TR ></TABLE ><TABLE BORDER="5" BGCOLOR="#E0E0F0" WIDTH="70%" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >ER <TT CLASS="FUNCTION" >dis_dsp</TT >( void )</PRE ></TD ></TR ></TABLE ><TABLE BORDER="5" BGCOLOR="#E0E0F0" WIDTH="70%" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >ER <TT CLASS="FUNCTION" >ena_dsp</TT >( void )</PRE ></TD ></TR ></TABLE ><TABLE BORDER="5" BGCOLOR="#E0E0F0" WIDTH="70%" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >ER <TT CLASS="FUNCTION" >chg_pri</TT >( ID <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >tskid,</I ></SPAN > PRI <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >tskpri</I ></SPAN > )</PRE ></TD ></TR ></TABLE ><TABLE BORDER="5" BGCOLOR="#E0E0F0" WIDTH="70%" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >ER <TT CLASS="FUNCTION" >rot_rdq</TT >( PRI <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >tskpri</I ></SPAN > )</PRE ></TD ></TR ></TABLE ><TABLE BORDER="5" BGCOLOR="#E0E0F0" WIDTH="70%" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >ER <TT CLASS="FUNCTION" >get_tid</TT >( ID *<SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >p_tskid</I ></SPAN > )</PRE ></TD ></TR ></TABLE ><TABLE BORDER="5" BGCOLOR="#E0E0F0" WIDTH="70%" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >ER <TT CLASS="FUNCTION" >ref_tsk</TT >( T_RTSK *<SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >pk_rtsk,</I ></SPAN > ID <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >tskid</I ></SPAN > )</PRE ></TD ></TR ></TABLE ><TABLE BORDER="5" BGCOLOR="#E0E0F0" WIDTH="70%" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >ER <TT CLASS="FUNCTION" >ter_tsk</TT >( ID <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >tskid</I ></SPAN > )</PRE ></TD ></TR ></TABLE ><TABLE BORDER="5" BGCOLOR="#E0E0F0" WIDTH="70%" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >ER <TT CLASS="FUNCTION" >rel_wai</TT >( ID <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >tskid</I ></SPAN > )</PRE ></TD ></TR ></TABLE ><P >The following two functions are supported in this release, when enabled with the configuration option <TT CLASS="LITERAL" >CYGPKG_UITRON_TASKS_CREATE_DELETE</TT > with some restrictions:</P ><TABLE BORDER="5" BGCOLOR="#E0E0F0" WIDTH="70%" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >ER <TT CLASS="FUNCTION" >cre_tsk</TT >( ID <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >tskid,</I ></SPAN > T_CTSK *<SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >pk_ctsk</I ></SPAN > )</PRE ></TD ></TR ></TABLE ><TABLE BORDER="5" BGCOLOR="#E0E0F0" WIDTH="70%" ><TR ><TD ><PRE CLASS="PROGRAMLISTING" >ER <TT CLASS="FUNCTION" >del_tsk</TT >( ID <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >tskid</I ></SPAN > )</PRE ></TD ></TR ></TABLE ><P >These functions are restricted as follows:</P ><P >Because of the static initialization facilities provided for system objects, a task is allocated stack space statically in the configuration. So while tasks can be created and deleted, the same stack space is used for that task (task ID number) each time. Thus the stack size (pk_ctsk->stksz) requested in <TT CLASS="FUNCTION" >cre_tsk()</TT > is checked for being less than that which was statically allocated, and otherwise ignored. This ensures that the new task will have enough stack to run. For this reason <TT CLASS="FUNCTION" >del_tsk()</TT > does not in any sense free the memory that was in use for the task's stack. </P ><P >The task attributes (pk_ctsk->tskatr) are ignored; current versions of <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >eCos</I ></SPAN > do not need to know whether a task is written in assembler or C/C++ so long as the procedure call standard appropriate to the CPU is followed.</P ><P >Extended information (pk_ctsk->exinf) is ignored.</P ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="AEN13490">Error checking</H2 ><P >For all these calls, an invalid task id (tskid) (less than 1 or greater than the number of configured tasks) only returns E_ID when bad params return errors ( <TT CLASS="LITERAL" >CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS</TT > is enabled, see above).</P ><P >Similarly, the following conditions are only checked for, and only return errors if <TT CLASS="LITERAL" >CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS</TT > is enabled:</P ><P ></P ><UL ><LI ><P >pk_crtk in <TT CLASS="FUNCTION" >cre_tsk()</TT > is a valid pointer, otherwise return E_PAR</P ></LI ><LI ><P ><TT CLASS="FUNCTION" >ter_tsk()</TT > or <TT CLASS="FUNCTION" >rel_wai()</TT > on the calling task returns E_OBJ</P ></LI ><LI ><P >the CPU is not locked already in <TT CLASS="FUNCTION" >dis_dsp()</TT > and <TT CLASS="FUNCTION" >ena_dsp()</TT > ; returns E_CTX</P ></LI ><LI ><P >priority level in <TT CLASS="FUNCTION" >chg_pri()</TT > and <TT CLASS="FUNCTION" >rot_rdq()</TT > is checked for validity, E_PAR</P ></LI ><LI ><P >return value pointer in <TT CLASS="FUNCTION" >get_tid()</TT > and <TT CLASS="FUNCTION" >ref_tsk()</TT > is a valid pointer, or E_PAR</P ></LI ></UL ><P >The following conditions are checked for, and return error codes if appropriate, regardless of the setting of <TT CLASS="LITERAL" >CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS</TT > :</P ><P ></P ><UL ><LI ><P >When create and delete functions <TT CLASS="FUNCTION" >cre_tsk()</TT > and <TT CLASS="FUNCTION" >del_tsk()</TT > are supported, all calls which use a valid task ID number check that the task exists; if not, E_NOEXS is returned</P ></LI ><LI ><P >When supported, <TT CLASS="FUNCTION" >cre_tsk()</TT > : the task must not already exist; otherwise E_OBJ</P ></LI ><LI ><P >When supported, <TT CLASS="FUNCTION" >cre_tsk()</TT > : the requested stack size must not be larger than that statically configured for the task; see the configuration options “Static initializers”, and “Default stack size”. Else E_NOMEM</P ></LI ><LI ><P >When supported, <TT CLASS="FUNCTION" >del_tsk()</TT > : the underlying <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >eCos</I ></SPAN > thread must not be running - this would imply either a bug or some program bypassing the µITRON compatibility layer and manipulating the thread directly. E_OBJ</P ></LI ><LI ><P ><TT CLASS="FUNCTION" >sta_tsk()</TT > : the task must be dormant, else E_OBJ</P ></LI ><LI ><P ><TT CLASS="FUNCTION" >ter_tsk()</TT > : the task must not be dormant, else E_OBJ</P ></LI ><LI ><P ><TT CLASS="FUNCTION" >chg_pri()</TT > : the task must not be dormant, else E_OBJ</P ></LI ><LI ><P ><TT CLASS="FUNCTION" >rel_wai()</TT > : the task must be in <TT CLASS="VARNAME" >WAIT</TT > or <TT CLASS="VARNAME" >WAIT-SUSPEND</TT > state, else E_OBJ</P ></LI ></UL ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="compat-uitron-over-ecos.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ecos-ref.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="compat-uitron-task-dependent-synch-functions.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >µITRON and <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >eCos</I ></SPAN ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="compat-uitron-microitron-api.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Task-Dependent Synchronization Functions</TD ></TR ></TABLE ></DIV ></BODY ></HTML >
Go to most recent revision | Compare with Previous | Blame | View Log