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 > Synchronization and Communication 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="Task-Dependent Synchronization Functions"
26 HREF="compat-uitron-task-dependent-synch-functions.html"><LINK
28 TITLE="Extended Synchronization and Communication Functions"
29 HREF="compat-uitron-extended-sync-comm-functions.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
57 HREF="compat-uitron-task-dependent-synch-functions.html"
65 >Chapter 32. µITRON API</TD
71 HREF="compat-uitron-extended-sync-comm-functions.html"
85 NAME="COMPAT-UITRON-SYNC-AND-COMM-FUNCTIONS">Synchronization and Communication Functions</H1
87 >These functions are fully supported in this release: </P
95 CLASS="PROGRAMLISTING"
117 CLASS="PROGRAMLISTING"
139 CLASS="PROGRAMLISTING"
161 CLASS="PROGRAMLISTING"
189 CLASS="PROGRAMLISTING"
217 CLASS="PROGRAMLISTING"
245 CLASS="PROGRAMLISTING"
273 CLASS="PROGRAMLISTING"
314 CLASS="PROGRAMLISTING"
355 CLASS="PROGRAMLISTING"
402 CLASS="PROGRAMLISTING"
430 CLASS="PROGRAMLISTING"
458 CLASS="PROGRAMLISTING"
486 CLASS="PROGRAMLISTING"
514 CLASS="PROGRAMLISTING"
548 CLASS="PROGRAMLISTING"
570 >The following functions are supported in this release (with
571 some restrictions) if enabled with the appropriate configuration
572 option for the object type (for example
575 >CYGPKG_UITRON_SEMAS_CREATE_DELETE</TT
584 CLASS="PROGRAMLISTING"
612 CLASS="PROGRAMLISTING"
634 CLASS="PROGRAMLISTING"
662 CLASS="PROGRAMLISTING"
684 CLASS="PROGRAMLISTING"
712 CLASS="PROGRAMLISTING"
728 >In general the queueing order when waiting on a synchronization
729 object depends on the underlying kernel configuration. The multi-level
730 queue scheduler is required for strict µITRON
731 conformance and it queues tasks in FIFO order, so requests to create
732 an object with priority queueing of tasks (<TT
734 >pk_cxxx->xxxatr = TA_TPRI</TT
736 are rejected with E_RSATR. Additional undefined bits in
737 the attributes fields must be zero. </P
739 >In general, extended information (pk_cxxx->exinf)
742 >For semaphores, the initial semaphore count (pk_csem->isemcnt)
743 is supported; the new semaphore's count is set. The maximum
744 count is not supported, and is not in fact defined in type pk_csem. </P
746 >For flags, multiple tasks are allowed to wait. Because single
747 task waiting is a subset of this, the W bit (TA_WMUL) of
748 the flag attributes is ignored; all other bits must be zero. The
749 initial flag value is supported. </P
751 >For mailboxes, the buffer count is defined statically by kernel
755 >CYGNUM_KERNEL_SYNCH_MBOX_QUEUE_SIZE</TT
757 therefore the buffer count field is not supported and is not in
758 fact defined in type pk_cmbx. Queueing of messages is FIFO
759 ordered only, so TA_MPRI (in pk_cmbx->mbxatr)
760 is not supported. </P
766 NAME="AEN13716">Error checking</H2
768 >The following conditions are only checked for, and only return
772 >CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS</TT
780 >invalid object id; less than 1 or greater than
783 >CYGNUM_UITRON_TASKS/SEMAS/MBOXES</TT
785 as appropriate returns E_ID</P
789 >dispatching is enabled in any call which can sleep, or
794 >tmout must be positive, otherwise E_PAR</P
803 must be valid pointers, or E_PAR</P
807 >return value pointer in
812 is valid pointer, or E_PAR</P
816 >flag wait pattern must be non-zero, and mode must be valid,
821 >return value pointer in flag wait calls is a valid pointer,
826 >The following conditions are checked for, and can return error
827 codes, regardless of the setting of
830 >CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS</TT
838 >When create and delete functions
848 are supported, all calls which use a valid object ID number check
849 that the object exists. If not, E_NOEXS is returned.</P
858 , when supported, if the object already exists, then E_OBJ</P
862 >In any call which can sleep, such as
867 : return codes E_TMOUT, E_RLWAI, E_DLT
868 or of course E_OK are returned depending on the reason
869 for terminating the sleep</P
873 >In polling functions such as
878 return codes E_TMOUT or E_OK are returned depending
879 on the state of the synchronization object</P
883 >In creation functions, the attributes must be compatible
884 with the selected underlying kernel configuration: in
891 >pk_csem->sematr</TT
909 >pk_cflg->flgatr</TT
936 >pk_cmbx->mbxatr</TT
941 >TA_TFIFO + TA_MFIFO</TT
953 SUMMARY="Footer navigation table"
964 HREF="compat-uitron-task-dependent-synch-functions.html"
982 HREF="compat-uitron-extended-sync-comm-functions.html"
992 >Task-Dependent Synchronization Functions</TD
998 HREF="compat-uitron-microitron-api.html"
1006 >Extended Synchronization and Communication Functions</TD