1 #ifndef CYGONCE_COMPAT_UITRON_UIT_IFNC_H
2 #define CYGONCE_COMPAT_UITRON_UIT_IFNC_H
3 //===========================================================================
7 // uITRON compatibility functions
9 //===========================================================================
10 //####ECOSGPLCOPYRIGHTBEGIN####
11 // -------------------------------------------
12 // This file is part of eCos, the Embedded Configurable Operating System.
13 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
15 // eCos is free software; you can redistribute it and/or modify it under
16 // the terms of the GNU General Public License as published by the Free
17 // Software Foundation; either version 2 or (at your option) any later version.
19 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 // You should have received a copy of the GNU General Public License along
25 // with eCos; if not, write to the Free Software Foundation, Inc.,
26 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
28 // As a special exception, if other files instantiate templates or use macros
29 // or inline functions from this file, or you compile this file and link it
30 // with other works to produce a work based on this file, this file does not
31 // by itself cause the resulting work to be covered by the GNU General Public
32 // License. However the source code for this file must still be made available
33 // in accordance with section (3) of the GNU General Public License.
35 // This exception does not invalidate any other reasons why a work based on
36 // this file might be covered by the GNU General Public License.
38 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
39 // at http://sources.redhat.com/ecos/ecos-license/
40 // -------------------------------------------
41 //####ECOSGPLCOPYRIGHTEND####
42 //===========================================================================
43 //#####DESCRIPTIONBEGIN####
48 // Purpose: uITRON compatibility functions
51 //####DESCRIPTIONEND####
53 //===========================================================================
55 // ------------------------------------------------------------------------
56 // Source Code Organization
58 // First, see pkgconf/uitron.h for details of applicable configuration
61 // This file uit_ifnc.h provides prototypes for the task-independent parts
62 // of the uITRON API, that is functions named ixxx_yyy() for calling in
63 // ISRs. We also define the uitron helper DSR that is needed to despool
64 // stored up requests.
65 // ------------------------------------------------------------------------
67 #include <pkgconf/uitron.h> // uITRON setup CYGNUM_UITRON_SEMAS
68 // CYGPKG_UITRON et al
72 #include <cyg/infra/cyg_type.h> // types; cyg_int32, CYG_ADDRWORD
74 #include <cyg/compat/uitron/uit_type.h> // uITRON types; ER ID TMO T_MSG
75 #include <cyg/compat/uitron/uit_func.h> // uITRON funcs and control macros.
77 // ========================================================================
78 // u I T R O N F U N C T I O N S
79 // The function declarations themselves:
81 // ------------------- These functions can be inline if so configured
82 CYG_UIT_FUNC_EXTERN_BEGIN
84 // ******************************************************
85 // *** 6.5 C Language Interfaces ***
86 // ******************************************************
88 // - Task Management Functions
92 // - Task-Dependent Synchronization Functions
94 //ER irsm_tsk ( ID tskid );
95 //ER ifrsm_tsk ( ID tskid );
97 ER iwup_tsk ( ID tskid );
99 // - Synchronization and Communication Functions
101 ER isig_sem ( ID semid );
103 ER iset_flg ( ID flgid, UINT setptn );
105 ER isnd_msg ( ID mbxid, T_MSG *pk_msg );
107 // - Extended Synchronization and Communication Functions
109 // - Interrupt Management Functions
113 // ---------------------------------------------------------------
115 #define CYGPRI_UITRON_SET_RETCODE( _z_ ) do { \
116 extern volatile int cyg_uit_dsr_actions_head; \
117 extern volatile int cyg_uit_dsr_actions_tail; \
118 (_z_) = (cyg_uit_dsr_actions_head == cyg_uit_dsr_actions_tail) ? 1 : 3; \
121 //void ret_wup ( ID tskid );
122 // Awaken the task (safely) and return Cyg_Interrupt::CALL_DSR
123 #define ret_wup( _id_ ) do { \
124 register int retcode; \
125 (void)iwup_tsk( (_id_) ); \
126 CYGPRI_UITRON_SET_RETCODE( retcode ); \
130 // Subsitute a version of ret_int that returns Cyg_Interrupt::CALL_DSR
132 #define ret_int() do { \
133 register int retcode; \
134 CYGPRI_UITRON_SET_RETCODE( retcode ); \
139 // - Memorypool Management Functions
143 // - Time Management Functions
147 // - System Management Functions
151 // - Network Support Functions
155 CYG_UIT_FUNC_EXTERN_END
156 // ------------------- End of functions that can be inlined
159 // ========================================================================
160 // DSR: use this DSR with the uITRON-type ISR that uses the functions above
161 // to get delayed/safe execution of the wakeup-type functions above.
166 void cyg_uitron_dsr( unsigned int vector, unsigned int count, unsigned int data );
169 // ========================================================================
171 #ifdef CYGPRI_UITRON_FUNCS_HERE_AND_NOW
172 // functions are inline OR we are in the outline implementation, so define
173 // the functions as inlines or plain functions depending on the value of
174 // CYG_UIT_FUNC_INLINE from above.
175 #include <cyg/compat/uitron/uit_ifnc.inl>
176 #endif // CYGPRI_UITRON_FUNCS_HERE_AND_NOW
178 // ------------------------------------------------------------------------
179 #endif // CYGPKG_UITRON
181 #endif // CYGONCE_COMPAT_UITRON_UIT_IFNC_H