1 #ifndef CYGONCE_COMPAT_UITRON_UIT_OBJS_HXX
2 #define CYGONCE_COMPAT_UITRON_UIT_OBJS_HXX
3 //===========================================================================
7 // uITRON static objects
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 static system objects
51 //####DESCRIPTIONEND####
53 //===========================================================================
55 #include <pkgconf/uitron.h> // uITRON setup CYGNUM_UITRON_SEMAS
56 // CYGPKG_UITRON et al
60 #include <cyg/infra/cyg_type.h> // types; cyg_int32, CYG_ADDRWORD
62 #include <pkgconf/kernel.h>
64 #include <cyg/kernel/ktypes.h>
66 #include <cyg/kernel/thread.hxx> // Cyg_Thread
67 #include <cyg/kernel/mbox.hxx> // Cyg_Mbox
68 #include <cyg/kernel/flag.hxx> // Cyg_Flag
69 #include <cyg/kernel/sema2.hxx> // Cyg_Counting_Semaphore2
70 #include <cyg/memalloc/memfixed.hxx> // Cyg_Mempool_Fixed
71 #include <cyg/memalloc/memvar.hxx> // Cyg_Mempool_Variable
72 #include <cyg/kernel/timer.hxx> // Cyg_Timer
74 // ------------------------------------------------------------------------
75 // Some pasting macros to create names of the config macro and the
76 // static data resulting:
78 #define CYG_UITRON_NUM( _which_ ) (CYGNUM_UITRON_ ## _which_)
79 #define CYG_UITRON_OBJS( _which_ ) cyg_uitron_ ## _which_
80 #define CYG_UITRON_PTRS( _which_ ) cyg_uitron_ ## _which_ ## _ptrs
81 // ------------------------------------------------------------------------
84 // Macro to declare static uitron static objects; uses the appropriate
85 // config define for the number of them to have.
87 #define CYG_UITRON_OBJS_INIT_PRIORITY CYG_INIT_PRIORITY( COMPAT )
89 #define CYG_UITRON_DECL( _which_ ) \
90 CYG_UITRON_OBJS( _which_ ) [ CYG_UITRON_NUM( _which_ ) ] \
91 CYG_UITRON_OBJS_INIT_PRIORITY
93 // and the array of pointers to them for those with dynamic existence:
94 #define CYG_UITRON_DECL_PTRS( _which_ ) \
95 CYG_UITRON_PTRS( _which_ ) [ CYG_UITRON_NUM( _which_ ) ]
98 // ------------------------------------------------------------------------
99 // The external system objects themselves.
101 #ifdef CYGPKG_UITRON_SEMAS
103 Cyg_Counting_Semaphore2 CYG_UITRON_OBJS( SEMAS ) [];
104 #ifdef CYGPKG_UITRON_SEMAS_CREATE_DELETE
106 Cyg_Counting_Semaphore2 *CYG_UITRON_PTRS( SEMAS ) [];
109 #ifdef CYGPKG_UITRON_MBOXES
111 Cyg_Mbox CYG_UITRON_OBJS( MBOXES ) [];
112 #ifdef CYGPKG_UITRON_MBOXES_CREATE_DELETE
114 Cyg_Mbox *CYG_UITRON_PTRS( MBOXES ) [];
117 #ifdef CYGPKG_UITRON_FLAGS
119 Cyg_Flag CYG_UITRON_OBJS( FLAGS ) [];
120 #ifdef CYGPKG_UITRON_FLAGS_CREATE_DELETE
122 Cyg_Flag *CYG_UITRON_PTRS( FLAGS ) [];
125 // there must always be tasks
127 Cyg_Thread CYG_UITRON_OBJS( TASKS ) [];
128 #ifdef CYGPKG_UITRON_TASKS_CREATE_DELETE
130 Cyg_Thread *CYG_UITRON_PTRS( TASKS ) [];
133 #ifdef CYGPKG_UITRON_MEMPOOLFIXED
135 Cyg_Mempool_Fixed CYG_UITRON_OBJS( MEMPOOLFIXED ) [];
136 #ifdef CYGPKG_UITRON_MEMPOOLFIXED_CREATE_DELETE
138 Cyg_Mempool_Fixed *CYG_UITRON_PTRS( MEMPOOLFIXED )[];
141 #ifdef CYGPKG_UITRON_MEMPOOLVAR
143 Cyg_Mempool_Variable CYG_UITRON_OBJS( MEMPOOLVAR ) [];
144 #ifdef CYGPKG_UITRON_MEMPOOLVAR_CREATE_DELETE
146 Cyg_Mempool_Variable *CYG_UITRON_PTRS( MEMPOOLVAR ) [];
149 #ifdef CYGPKG_UITRON_CYCLICS
151 Cyg_Timer CYG_UITRON_OBJS( CYCLICS ) [];
153 #ifdef CYGPKG_UITRON_ALARMS
155 Cyg_Timer CYG_UITRON_OBJS( ALARMS ) [];
158 // ------------------------------------------------------------------------
159 // Ancillary system objects - cleaner than extending the basic class
161 #ifdef CYGIMP_THREAD_PRIORITY
162 // An array of priorities, for resetting back to the "created" prio when a
163 // task cycles though exit, dormancy, restart.
165 cyg_uitron_task_initial_priorities[ CYG_UITRON_NUM( TASKS ) ];
166 // and an accessor macro, for the addressing of this is naturally
168 #define CYG_UITRON_TASK_INITIAL_PRIORITY( _tskid_ ) \
169 (cyg_uitron_task_initial_priorities[ (_tskid_) - 1 ])
170 #endif // CYGIMP_THREAD_PRIORITY
172 // ------------------------------------------------------------------------
174 #endif // CYGPKG_UITRON
176 #endif // CYGONCE_COMPAT_UITRON_UIT_OBJS_HXX