TNeoKernel  v1.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
tn_oldsymbols.h
Go to the documentation of this file.
1 /*******************************************************************************
2  *
3  * TNeoKernel: real-time kernel initially based on TNKernel
4  *
5  * TNKernel: copyright © 2004, 2013 Yuri Tiomkin.
6  * PIC32-specific routines: copyright © 2013, 2014 Anders Montonen.
7  * TNeoKernel: copyright © 2014 Dmitry Frank.
8  *
9  * TNeoKernel was born as a thorough review and re-implementation of
10  * TNKernel. The new kernel has well-formed code, inherited bugs are fixed
11  * as well as new features being added, and it is tested carefully with
12  * unit-tests.
13  *
14  * API is changed somewhat, so it's not 100% compatible with TNKernel,
15  * hence the new name: TNeoKernel.
16  *
17  * Permission to use, copy, modify, and distribute this software in source
18  * and binary forms and its documentation for any purpose and without fee
19  * is hereby granted, provided that the above copyright notice appear
20  * in all copies and that both that copyright notice and this permission
21  * notice appear in supporting documentation.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE DMITRY FRANK AND CONTRIBUTORS "AS IS"
24  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DMITRY FRANK OR CONTRIBUTORS BE
27  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
33  * THE POSSIBILITY OF SUCH DAMAGE.
34  *
35  ******************************************************************************/
36 
37 /**
38  * \file
39  *
40  * Compatibility layer for old projects that use old TNKernel names;
41  * usage of them in new projects is discouraged.
42  *
43  * If you're porting your existing application written for TNKernel, it
44  * might be useful though.
45  *
46  * Included automatially if the option `#TN_OLD_TNKERNEL_NAMES` is set.
47  *
48  * @see `#TN_OLD_TNKERNEL_NAMES`
49  *
50  */
51 
52 #ifndef _TN_OLDSYMBOLS_H
53 #define _TN_OLDSYMBOLS_H
54 
55 /*******************************************************************************
56  * INCLUDED FILES
57  ******************************************************************************/
58 
59 #include "tn_common.h"
60 
61 
62 
63 #ifndef TN_OLD_TNKERNEL_NAMES
64 # error TN_OLD_TNKERNEL_NAMES is not defined
65 #endif
66 
67 #if TN_OLD_TNKERNEL_NAMES
68 
69 
70 #ifdef __cplusplus
71 extern "C" { /*}*/
72 #endif
73 
74 /*******************************************************************************
75  * PUBLIC TYPES
76  ******************************************************************************/
77 
78 /// old TNKernel name of `TN_ListItem`
79 typedef struct TN_ListItem CDLL_QUEUE;
80 
81 /// old TNKernel name of `#TN_Mutex`
82 typedef struct TN_Mutex TN_MUTEX;
83 
84 /// old TNKernel name of `#TN_DQueue`
85 typedef struct TN_DQueue TN_DQUE;
86 
87 /// old TNKernel name of `#TN_Task`
88 typedef struct TN_Task TN_TCB;
89 
90 /// old TNKernel name of `#TN_FMem`
91 typedef struct TN_FMem TN_FMP;
92 
93 /// old TNKernel name of `#TN_Sem`
94 typedef struct TN_Sem TN_SEM;
95 
96 
97 //there's no compatibility with TNKernel's event object,
98 //so, this one is commented
99 //typedef struct TN_EventGrp TN_EVENT;
100 
101 
102 
103 
104 /*******************************************************************************
105  * GLOBAL VARIABLES
106  ******************************************************************************/
107 
108 /*******************************************************************************
109  * DEFINITIONS
110  ******************************************************************************/
111 
112 /*
113  * compatibility with old struct names
114  */
115 /// old TNKernel struct name of `TN_ListItem`
116 #define _CDLL_QUEUE TN_ListItem
117 
118 /// old TNKernel struct name of `#TN_Mutex`
119 #define _TN_MUTEX TN_Mutex
120 
121 /// old TNKernel struct name of `#TN_DQueue`
122 #define _TN_DQUE TN_DQueue
123 
124 /// old TNKernel struct name of `#TN_Task`
125 #define _TN_TCB TN_Task
126 
127 /// old TNKernel struct name of `#TN_FMem`
128 #define _TN_FMP TN_FMem
129 
130 /// old TNKernel struct name of `#TN_Sem`
131 #define _TN_SEM TN_Sem
132 
133 //there's no compatibility with TNKernel's event object,
134 //so, this one is commented
135 //#define _TN_EVENT TN_EventGrp
136 
137 /// old TNKernel name of `#TN_MAKE_ALIG` macro
138 ///
139 /// \attention it is recommended to use `#TN_MAKE_ALIG_SIZE` macro instead
140 /// of this one, in order to avoid confusion caused by various
141 /// TNKernel ports: refer to the section \ref tnkernel_diff_make_alig for details.
142 #define MAKE_ALIG TN_MAKE_ALIG
143 
144 
145 /// old TNKernel name of `#TN_TASK_STATE_RUNNABLE`
146 #define TSK_STATE_RUNNABLE TN_TASK_STATE_RUNNABLE
147 
148 /// old TNKernel name of `#TN_TASK_STATE_WAIT`
149 #define TSK_STATE_WAIT TN_TASK_STATE_WAIT
150 
151 /// old TNKernel name of `#TN_TASK_STATE_SUSPEND`
152 #define TSK_STATE_SUSPEND TN_TASK_STATE_SUSPEND
153 
154 /// old TNKernel name of `#TN_TASK_STATE_WAITSUSP`
155 #define TSK_STATE_WAITSUSP TN_TASK_STATE_WAITSUSP
156 
157 /// old TNKernel name of `#TN_TASK_STATE_DORMANT`
158 #define TSK_STATE_DORMANT TN_TASK_STATE_DORMANT
159 
160 /// old TNKernel name of `#TN_TASK_CREATE_OPT_START`
161 #define TN_TASK_START_ON_CREATION TN_TASK_CREATE_OPT_START
162 
163 /// old TNKernel name of `#TN_TASK_EXIT_OPT_DELETE`
164 #define TN_EXIT_AND_DELETE_TASK TN_TASK_EXIT_OPT_DELETE
165 
166 
167 
168 /// old TNKernel name of `#TN_EVENTGRP_WMODE_AND`
169 #define TN_EVENT_WCOND_AND TN_EVENTGRP_WMODE_AND
170 
171 /// old TNKernel name of `#TN_EVENTGRP_WMODE_OR`
172 #define TN_EVENT_WCOND_OR TN_EVENTGRP_WMODE_OR
173 
174 
175 /// old TNKernel name of `#TN_WAIT_REASON_NONE`
176 #define TSK_WAIT_REASON_NONE TN_WAIT_REASON_NONE
177 
178 /// old TNKernel name of `#TN_WAIT_REASON_SLEEP`
179 #define TSK_WAIT_REASON_SLEEP TN_WAIT_REASON_SLEEP
180 
181 /// old TNKernel name of `#TN_WAIT_REASON_SEM`
182 #define TSK_WAIT_REASON_SEM TN_WAIT_REASON_SEM
183 
184 /// old TNKernel name of `#TN_WAIT_REASON_EVENT`
185 #define TSK_WAIT_REASON_EVENT TN_WAIT_REASON_EVENT
186 
187 /// old TNKernel name of `#TN_WAIT_REASON_DQUE_WSEND`
188 #define TSK_WAIT_REASON_DQUE_WSEND TN_WAIT_REASON_DQUE_WSEND
189 
190 /// old TNKernel name of `#TN_WAIT_REASON_DQUE_WRECEIVE`
191 #define TSK_WAIT_REASON_DQUE_WRECEIVE TN_WAIT_REASON_DQUE_WRECEIVE
192 
193 /// old TNKernel name of `#TN_WAIT_REASON_MUTEX_C`
194 #define TSK_WAIT_REASON_MUTEX_C TN_WAIT_REASON_MUTEX_C
195 
196 /// old TNKernel name of `#TN_WAIT_REASON_MUTEX_I`
197 #define TSK_WAIT_REASON_MUTEX_I TN_WAIT_REASON_MUTEX_I
198 
199 /// old TNKernel name of `#TN_WAIT_REASON_WFIXMEM`
200 #define TSK_WAIT_REASON_WFIXMEM TN_WAIT_REASON_WFIXMEM
201 
202 
203 
204 /// old TNKernel name of `#TN_RC_OK`
205 #define TERR_NO_ERR TN_RC_OK
206 
207 /// old TNKernel name of `#TN_RC_OVERFLOW`
208 #define TERR_OVERFLOW TN_RC_OVERFLOW
209 
210 /// old TNKernel name of `#TN_RC_WCONTEXT`
211 #define TERR_WCONTEXT TN_RC_WCONTEXT
212 
213 /// old TNKernel name of `#TN_RC_WSTATE`
214 #define TERR_WSTATE TN_RC_WSTATE
215 
216 /// old TNKernel name of `#TN_RC_TIMEOUT`
217 #define TERR_TIMEOUT TN_RC_TIMEOUT
218 
219 /// old TNKernel name of `#TN_RC_WPARAM`
220 #define TERR_WRONG_PARAM TN_RC_WPARAM
221 
222 /// old TNKernel name of `#TN_RC_ILLEGAL_USE`
223 #define TERR_ILUSE TN_RC_ILLEGAL_USE
224 
225 /// old TNKernel name of `#TN_RC_INVALID_OBJ`
226 #define TERR_NOEXS TN_RC_INVALID_OBJ
227 
228 /// old TNKernel name of `#TN_RC_DELETED`
229 #define TERR_DLT TN_RC_DELETED
230 
231 /// old TNKernel name of `#TN_RC_FORCED`
232 #define TERR_FORCED TN_RC_FORCED
233 
234 /// old TNKernel name of `#TN_RC_INTERNAL`
235 #define TERR_INTERNAL TN_RC_INTERNAL
236 
237 
238 
239 /// old TNKernel name of `#TN_MUTEX_PROT_CEILING`
240 #define TN_MUTEX_ATTR_CEILING TN_MUTEX_PROT_CEILING
241 
242 /// old TNKernel name of `#TN_MUTEX_PROT_INHERIT`
243 #define TN_MUTEX_ATTR_INHERIT TN_MUTEX_PROT_INHERIT
244 
245 
246 
247 
248 /// old TNKernel name of `#tn_sem_acquire_polling`
249 #define tn_sem_polling tn_sem_acquire_polling
250 
251 /// old TNKernel name of `#tn_sem_iacquire_polling`
252 #define tn_sem_ipolling tn_sem_iacquire_polling
253 
254 
255 /// old TNKernel name of `#tn_fmem_iget_polling`
256 #define tn_fmem_get_ipolling tn_fmem_iget_polling
257 
258 
259 /// old TNKernel name of `#tn_queue_ireceive_polling`
260 #define tn_queue_ireceive tn_queue_ireceive_polling
261 
262 
263 /// old TNKernel name of `#tn_sys_start`
264 #define tn_start_system tn_sys_start
265 
266 /// old TNKernel name of `#tn_sys_tslice_set`
267 #define tn_sys_tslice_ticks tn_sys_tslice_set
268 
269 
270 
271 /// old TNKernel name of `#TN_ARCH_STK_ATTR_BEFORE`
272 #define align_attr_start TN_ARCH_STK_ATTR_BEFORE
273 
274 /// old TNKernel name of `#TN_ARCH_STK_ATTR_AFTER`
275 #define align_attr_end TN_ARCH_STK_ATTR_AFTER
276 
277 
278 /// old TNKernel name of `#tn_arch_int_dis`
279 #define tn_cpu_int_disable tn_arch_int_dis
280 
281 /// old TNKernel name of `#tn_arch_int_en`
282 #define tn_cpu_int_enable tn_arch_int_en
283 
284 
285 /// old TNKernel name of `#tn_arch_sr_save_int_dis`
286 #define tn_cpu_save_sr tn_arch_sr_save_int_dis
287 
288 /// old TNKernel name of `#tn_arch_sr_restore`
289 #define tn_cpu_restore_sr tn_arch_sr_restore
290 
291 
292 /// old TNKernel name of `#TN_INT_DIS_SAVE`
293 #define tn_disable_interrupt TN_INT_DIS_SAVE
294 
295 /// old TNKernel name of `#TN_INT_RESTORE`
296 #define tn_enable_interrupt TN_INT_RESTORE
297 
298 
299 /// old TNKernel name of `#TN_INT_IDIS_SAVE`
300 #define tn_idisable_interrupt TN_INT_IDIS_SAVE
301 
302 /// old TNKernel name of `#TN_INT_IRESTORE`
303 #define tn_ienable_interrupt TN_INT_IRESTORE
304 
305 
306 /// old TNKernel name of `#TN_IS_INT_DISABLED`
307 #define tn_chk_irq_disabled TN_IS_INT_DISABLED
308 
309 /// old TNKernel name of `#TN_PRIORITIES_CNT`
310 #define TN_NUM_PRIORITY TN_PRIORITIES_CNT
311 
312 /// old TNKernel name of `#TN_INT_WIDTH`
313 #define _TN_BITS_IN_INT TN_INT_WIDTH
314 
315 
316 /// old TNKernel name for `sizeof(#TN_UWord)`
317 #define TN_ALIG sizeof(TN_UWord)
318 
319 /*******************************************************************************
320  * PUBLIC FUNCTION PROTOTYPES
321  ******************************************************************************/
322 
323 
324 #ifdef __cplusplus
325 } /* extern "C" */
326 #endif
327 
328 #endif // TN_OLD_TNKERNEL_NAMES
329 
330 #endif // _TN_OLDSYMBOLS_H
331 
332 
333 /*******************************************************************************
334  * end of file
335  ******************************************************************************/
336 
337 
Semaphore.
Definition: tn_sem.h:88
Mutex.
Definition: tn_mutex.h:122
Structure representing data queue object.
Definition: tn_dqueue.h:83
Task.
Definition: tn_tasks.h:172
Definitions used through the whole kernel.
Fixed memory blocks pool.
Definition: tn_fmem.h:73
struct TN_ListItem CDLL_QUEUE
old TNKernel name of TN_ListItem
Definition: tn_oldsymbols.h:79