1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
12 >Task Management Functions</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
23 HREF="compat-uitron-microitron-api.html"><LINK
25 TITLE="µITRON and eCos"
26 HREF="compat-uitron-over-ecos.html"><LINK
28 TITLE="Task-Dependent Synchronization Functions"
29 HREF="compat-uitron-task-dependent-synch-functions.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
57 HREF="compat-uitron-over-ecos.html"
65 >Chapter 32. µITRON API</TD
71 HREF="compat-uitron-task-dependent-synch-functions.html"
85 NAME="COMPAT-UITRON-TASK-MANAGEMENT-FUNCTIONS">Task Management Functions</H1
87 >The following functions are fully supported in this release: </P
95 CLASS="PROGRAMLISTING"
124 CLASS="PROGRAMLISTING"
139 CLASS="PROGRAMLISTING"
154 CLASS="PROGRAMLISTING"
169 CLASS="PROGRAMLISTING"
184 CLASS="PROGRAMLISTING"
213 CLASS="PROGRAMLISTING"
235 CLASS="PROGRAMLISTING"
257 CLASS="PROGRAMLISTING"
286 CLASS="PROGRAMLISTING"
308 CLASS="PROGRAMLISTING"
324 >The following two functions are supported in this release,
325 when enabled with the configuration option
328 >CYGPKG_UITRON_TASKS_CREATE_DELETE</TT
330 with some restrictions:</P
338 CLASS="PROGRAMLISTING"
367 CLASS="PROGRAMLISTING"
383 >These functions are restricted as follows:</P
385 >Because of the static initialization facilities provided for
386 system objects, a task is allocated stack space statically in the
387 configuration. So while tasks can be created and deleted, the same
388 stack space is used for that task (task ID number) each time. Thus
389 the stack size (pk_ctsk->stksz) requested in <TT
393 checked for being less than that which was statically allocated,
394 and otherwise ignored. This ensures that the new task will have
395 enough stack to run. For this reason <TT
399 not in any sense free the memory that was in use for the task's
402 >The task attributes (pk_ctsk->tskatr) are
403 ignored; current versions of <SPAN
410 to know whether a task is written in assembler or C/C++ so
411 long as the procedure call standard appropriate to the CPU is followed.</P
413 >Extended information (pk_ctsk->exinf) is
420 NAME="AEN13490">Error checking</H2
422 >For all these calls, an invalid task id (tskid) (less than
423 1 or greater than the number of configured tasks) only returns E_ID
424 when bad params return errors (
427 >CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS</TT
429 is enabled, see above).</P
431 >Similarly, the following conditions are only checked for,
432 and only return errors if
435 >CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS</TT
448 is a valid pointer, otherwise return E_PAR</P
461 on the calling task returns E_OBJ</P
465 >the CPU is not locked already in
489 is checked for validity, E_PAR</P
493 >return value pointer in
503 is a valid pointer, or E_PAR</P
507 >The following conditions are checked for, and return
508 error codes if appropriate, regardless of the setting of
511 >CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS</TT
519 >When create and delete functions
529 are supported, all calls which use a valid task ID number check
530 that the task exists; if not, E_NOEXS is returned</P
539 : the task must not already exist; otherwise E_OBJ</P
548 : the requested stack size must not be larger than that statically
549 configured for the task; see the configuration options
550 “Static initializers”, and “Default stack size”.
568 thread must not be running - this would imply either a bug or some
569 program bypassing the
570 µITRON compatibility layer and manipulating the thread directly.
579 : the task must be dormant, else E_OBJ</P
587 : the task must not be dormant, else E_OBJ</P
595 : the task must not be dormant, else E_OBJ</P
603 : the task must be in
621 SUMMARY="Footer navigation table"
632 HREF="compat-uitron-over-ecos.html"
650 HREF="compat-uitron-task-dependent-synch-functions.html"
660 >µITRON and <SPAN
672 HREF="compat-uitron-microitron-api.html"
680 >Task-Dependent Synchronization Functions</TD