TNeoKernel  v1.03
 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  */
49 
50 #ifndef _TN_OLDSYMBOLS_H
51 #define _TN_OLDSYMBOLS_H
52 
53 /*******************************************************************************
54  * INCLUDED FILES
55  ******************************************************************************/
56 
57 #include "tn_common.h"
58 
59 
60 
61 #ifndef TN_OLD_TNKERNEL_NAMES
62 # error TN_OLD_TNKERNEL_NAMES is not defined
63 #endif
64 
65 #if TN_OLD_TNKERNEL_NAMES
66 
67 
68 #ifdef __cplusplus
69 extern "C" { /*}*/
70 #endif
71 
72 /*******************************************************************************
73  * PUBLIC TYPES
74  ******************************************************************************/
75 
76 /// old TNKernel name of `TN_ListItem`
77 typedef struct TN_ListItem CDLL_QUEUE;
78 
79 /// old TNKernel name of `#TN_Mutex`
80 typedef struct TN_Mutex TN_MUTEX;
81 
82 /// old TNKernel name of `#TN_DQueue`
83 typedef struct TN_DQueue TN_DQUE;
84 
85 /// old TNKernel name of `#TN_Task`
86 typedef struct TN_Task TN_TCB;
87 
88 /// old TNKernel name of `#TN_FMem`
89 typedef struct TN_FMem TN_FMP;
90 
91 /// old TNKernel name of `#TN_Sem`
92 typedef struct TN_Sem TN_SEM;
93 
94 
95 //there's no compatibility with TNKernel's event object,
96 //so, this one is commented
97 //typedef struct TN_EventGrp TN_EVENT;
98 
99 
100 
101 
102 /*******************************************************************************
103  * GLOBAL VARIABLES
104  ******************************************************************************/
105 
106 /*******************************************************************************
107  * DEFINITIONS
108  ******************************************************************************/
109 
110 /*
111  * compatibility with old struct names
112  */
113 /// old TNKernel struct name of `TN_ListItem`
114 #define _CDLL_QUEUE TN_ListItem
115 
116 /// old TNKernel struct name of `#TN_Mutex`
117 #define _TN_MUTEX TN_Mutex
118 
119 /// old TNKernel struct name of `#TN_DQueue`
120 #define _TN_DQUE TN_DQueue
121 
122 /// old TNKernel struct name of `#TN_Task`
123 #define _TN_TCB TN_Task
124 
125 /// old TNKernel struct name of `#TN_FMem`
126 #define _TN_FMP TN_FMem
127 
128 /// old TNKernel struct name of `#TN_Sem`
129 #define _TN_SEM TN_Sem
130 
131 //there's no compatibility with TNKernel's event object,
132 //so, this one is commented
133 //#define _TN_EVENT TN_EventGrp
134 
135 /// old TNKernel name of `#TN_MAKE_ALIG` macro
136 ///
137 /// \attention it is recommended to use `#TN_MAKE_ALIG_SIZE` macro instead
138 /// of this one, in order to avoid confusion caused by various
139 /// TNKernel ports: refer to the section \ref tnkernel_diff_make_alig for details.
140 #define MAKE_ALIG TN_MAKE_ALIG
141 
142 
143 /// old TNKernel name of `#TN_TASK_STATE_RUNNABLE`
144 #define TSK_STATE_RUNNABLE TN_TASK_STATE_RUNNABLE
145 
146 /// old TNKernel name of `#TN_TASK_STATE_WAIT`
147 #define TSK_STATE_WAIT TN_TASK_STATE_WAIT
148 
149 /// old TNKernel name of `#TN_TASK_STATE_SUSPEND`
150 #define TSK_STATE_SUSPEND TN_TASK_STATE_SUSPEND
151 
152 /// old TNKernel name of `#TN_TASK_STATE_WAITSUSP`
153 #define TSK_STATE_WAITSUSP TN_TASK_STATE_WAITSUSP
154 
155 /// old TNKernel name of `#TN_TASK_STATE_DORMANT`
156 #define TSK_STATE_DORMANT TN_TASK_STATE_DORMANT
157 
158 /// old TNKernel name of `#TN_TASK_CREATE_OPT_START`
159 #define TN_TASK_START_ON_CREATION TN_TASK_CREATE_OPT_START
160 
161 /// old TNKernel name of `#TN_TASK_EXIT_OPT_DELETE`
162 #define TN_EXIT_AND_DELETE_TASK TN_TASK_EXIT_OPT_DELETE
163 
164 
165 
166 /// old TNKernel name of `#TN_EVENTGRP_WMODE_AND`
167 #define TN_EVENT_WCOND_AND TN_EVENTGRP_WMODE_AND
168 
169 /// old TNKernel name of `#TN_EVENTGRP_WMODE_OR`
170 #define TN_EVENT_WCOND_OR TN_EVENTGRP_WMODE_OR
171 
172 
173 /// old TNKernel name of `#TN_WAIT_REASON_NONE`
174 #define TSK_WAIT_REASON_NONE TN_WAIT_REASON_NONE
175 
176 /// old TNKernel name of `#TN_WAIT_REASON_SLEEP`
177 #define TSK_WAIT_REASON_SLEEP TN_WAIT_REASON_SLEEP
178 
179 /// old TNKernel name of `#TN_WAIT_REASON_SEM`
180 #define TSK_WAIT_REASON_SEM TN_WAIT_REASON_SEM
181 
182 /// old TNKernel name of `#TN_WAIT_REASON_EVENT`
183 #define TSK_WAIT_REASON_EVENT TN_WAIT_REASON_EVENT
184 
185 /// old TNKernel name of `#TN_WAIT_REASON_DQUE_WSEND`
186 #define TSK_WAIT_REASON_DQUE_WSEND TN_WAIT_REASON_DQUE_WSEND
187 
188 /// old TNKernel name of `#TN_WAIT_REASON_DQUE_WRECEIVE`
189 #define TSK_WAIT_REASON_DQUE_WRECEIVE TN_WAIT_REASON_DQUE_WRECEIVE
190 
191 /// old TNKernel name of `#TN_WAIT_REASON_MUTEX_C`
192 #define TSK_WAIT_REASON_MUTEX_C TN_WAIT_REASON_MUTEX_C
193 
194 /// old TNKernel name of `#TN_WAIT_REASON_MUTEX_I`
195 #define TSK_WAIT_REASON_MUTEX_I TN_WAIT_REASON_MUTEX_I
196 
197 /// old TNKernel name of `#TN_WAIT_REASON_WFIXMEM`
198 #define TSK_WAIT_REASON_WFIXMEM TN_WAIT_REASON_WFIXMEM
199 
200 
201 
202 /// old TNKernel name of `#TN_RC_OK`
203 #define TERR_NO_ERR TN_RC_OK
204 
205 /// old TNKernel name of `#TN_RC_OVERFLOW`
206 #define TERR_OVERFLOW TN_RC_OVERFLOW
207 
208 /// old TNKernel name of `#TN_RC_WCONTEXT`
209 #define TERR_WCONTEXT TN_RC_WCONTEXT
210 
211 /// old TNKernel name of `#TN_RC_WSTATE`
212 #define TERR_WSTATE TN_RC_WSTATE
213 
214 /// old TNKernel name of `#TN_RC_TIMEOUT`
215 #define TERR_TIMEOUT TN_RC_TIMEOUT
216 
217 /// old TNKernel name of `#TN_RC_WPARAM`
218 #define TERR_WRONG_PARAM TN_RC_WPARAM
219 
220 /// old TNKernel name of `#TN_RC_ILLEGAL_USE`
221 #define TERR_ILUSE TN_RC_ILLEGAL_USE
222 
223 /// old TNKernel name of `#TN_RC_INVALID_OBJ`
224 #define TERR_NOEXS TN_RC_INVALID_OBJ
225 
226 /// old TNKernel name of `#TN_RC_DELETED`
227 #define TERR_DLT TN_RC_DELETED
228 
229 /// old TNKernel name of `#TN_RC_FORCED`
230 #define TERR_FORCED TN_RC_FORCED
231 
232 /// old TNKernel name of `#TN_RC_INTERNAL`
233 #define TERR_INTERNAL TN_RC_INTERNAL
234 
235 
236 
237 /// old TNKernel name of `#TN_MUTEX_PROT_CEILING`
238 #define TN_MUTEX_ATTR_CEILING TN_MUTEX_PROT_CEILING
239 
240 /// old TNKernel name of `#TN_MUTEX_PROT_INHERIT`
241 #define TN_MUTEX_ATTR_INHERIT TN_MUTEX_PROT_INHERIT
242 
243 
244 
245 
246 /// old TNKernel name of `#tn_sem_acquire_polling`
247 #define tn_sem_polling tn_sem_acquire_polling
248 
249 /// old TNKernel name of `#tn_sem_iacquire_polling`
250 #define tn_sem_ipolling tn_sem_iacquire_polling
251 
252 
253 /// old name of `#tn_sem_wait`
254 #define tn_sem_acquire tn_sem_wait
255 
256 /// old name of `#tn_sem_wait_polling`
257 #define tn_sem_acquire_polling tn_sem_wait_polling
258 
259 /// old name of `#tn_sem_iwait_polling`
260 #define tn_sem_iacquire_polling tn_sem_iwait_polling
261 
262 
263 
264 /// old TNKernel name of `#tn_fmem_iget_polling`
265 #define tn_fmem_get_ipolling tn_fmem_iget_polling
266 
267 
268 /// old TNKernel name of `#tn_queue_ireceive_polling`
269 #define tn_queue_ireceive tn_queue_ireceive_polling
270 
271 
272 /// old TNKernel name of `#tn_sys_start`
273 #define tn_start_system tn_sys_start
274 
275 /// old TNKernel name of `#tn_sys_tslice_set`
276 #define tn_sys_tslice_ticks tn_sys_tslice_set
277 
278 
279 
280 /// old TNKernel name of `#TN_ARCH_STK_ATTR_BEFORE`
281 #define align_attr_start TN_ARCH_STK_ATTR_BEFORE
282 
283 /// old TNKernel name of `#TN_ARCH_STK_ATTR_AFTER`
284 #define align_attr_end TN_ARCH_STK_ATTR_AFTER
285 
286 
287 /// old TNKernel name of `#tn_arch_int_dis`
288 #define tn_cpu_int_disable tn_arch_int_dis
289 
290 /// old TNKernel name of `#tn_arch_int_en`
291 #define tn_cpu_int_enable tn_arch_int_en
292 
293 
294 /// old TNKernel name of `#tn_arch_sr_save_int_dis`
295 #define tn_cpu_save_sr tn_arch_sr_save_int_dis
296 
297 /// old TNKernel name of `#tn_arch_sr_restore`
298 #define tn_cpu_restore_sr tn_arch_sr_restore
299 
300 
301 /// old TNKernel name of `#TN_INT_DIS_SAVE`
302 #define tn_disable_interrupt TN_INT_DIS_SAVE
303 
304 /// old TNKernel name of `#TN_INT_RESTORE`
305 #define tn_enable_interrupt TN_INT_RESTORE
306 
307 
308 /// old TNKernel name of `#TN_INT_IDIS_SAVE`
309 #define tn_idisable_interrupt TN_INT_IDIS_SAVE
310 
311 /// old TNKernel name of `#TN_INT_IRESTORE`
312 #define tn_ienable_interrupt TN_INT_IRESTORE
313 
314 
315 /// old TNKernel name of `#TN_IS_INT_DISABLED`
316 #define tn_chk_irq_disabled TN_IS_INT_DISABLED
317 
318 /// old TNKernel name of `#TN_PRIORITIES_CNT`
319 #define TN_NUM_PRIORITY TN_PRIORITIES_CNT
320 
321 /// old TNKernel name of `#TN_INT_WIDTH`
322 #define _TN_BITS_IN_INT TN_INT_WIDTH
323 
324 
325 /// old TNKernel name for `sizeof(#TN_UWord)`
326 #define TN_ALIG sizeof(TN_UWord)
327 
328 
329 
330 
331 /// old name for `TN_STACK_ARR_DEF`
332 #define TN_TASK_STACK_DEF TN_STACK_ARR_DEF
333 
334 
335 /*******************************************************************************
336  * PUBLIC FUNCTION PROTOTYPES
337  ******************************************************************************/
338 
339 
340 #ifdef __cplusplus
341 } /* extern "C" */
342 #endif
343 
344 #endif // TN_OLD_TNKERNEL_NAMES
345 
346 #endif // _TN_OLDSYMBOLS_H
347 
348 
349 /*******************************************************************************
350  * end of file
351  ******************************************************************************/
352 
353 
Semaphore.
Definition: tn_sem.h:88
Mutex.
Definition: tn_mutex.h:122
Structure representing data queue object.
Definition: tn_dqueue.h:105
Task.
Definition: tn_tasks.h:173
Definitions used through the whole kernel.
Fixed memory blocks pool.
Definition: tn_fmem.h:78
struct TN_ListItem CDLL_QUEUE
old TNKernel name of TN_ListItem
Definition: tn_oldsymbols.h:77