Go to the documentation of this file.
50 #include "../arch/tn_arch_detect.h"
204 # define TN_NULL ((void *)0)
211 # define TN_BOOL bool
219 # define TN_TRUE (1 == 1)
224 # define TN_FALSE (1 == 0)
231 #define TN_MAKE_ALIG_SIZE(a) \
232 (((a) + (sizeof(TN_UWord) - 1)) & (~(sizeof(TN_UWord) - 1)))
235 #if (!defined TN_API_MAKE_ALIG_ARG)
236 # error TN_API_MAKE_ALIG_ARG is not defined
237 #elif (!defined TN_API_MAKE_ALIG_ARG__TYPE)
238 # error TN_API_MAKE_ALIG_ARG__TYPE is not defined
239 #elif (!defined TN_API_MAKE_ALIG_ARG__SIZE)
240 # error TN_API_MAKE_ALIG_ARG__SIZE is not defined
252 #if (TN_API_MAKE_ALIG_ARG == TN_API_MAKE_ALIG_ARG__TYPE)
253 # define TN_MAKE_ALIG(a) TN_MAKE_ALIG_SIZE(sizeof(a))
254 #elif (TN_API_MAKE_ALIG_ARG == TN_API_MAKE_ALIG_ARG__SIZE)
255 # define TN_MAKE_ALIG(a) TN_MAKE_ALIG_SIZE(a)
257 # error wrong TN_API_MAKE_ALIG_ARG
263 #define _TN_UNUSED(x) (void)(x)
265 #define _TN_FATAL_ERROR(error_msg) _TN_FATAL_ERRORF(error_msg, NULL)
275 #endif // _TN_COMMON_H
@ TN_ID_TIMER
id for timers
@ TN_RC_TIMEOUT
Timeout (consult #TN_TickCnt for details).
@ TN_RC_INVALID_OBJ
Returned when user tries to perform some operation on invalid object (mutex, semaphore,...
@ TN_RC_OVERFLOW
This code is returned in the following cases:
@ TN_RC_FORCED
Task was released from waiting forcibly because some other task called tn_task_release_wait()
@ TN_RC_OK
Successful operation.
void() TN_TaskBody(void *param)
Prototype for task body function.
@ TN_RC_WSTATE
Wrong task state error: requested operation requires different task state.
@ TN_RC_WCONTEXT
Wrong context error: returned if function is called from non-acceptable context.
@ TN_RC_WPARAM
This code is returned by most of the kernel functions when wrong params were given to function.
@ TN_ID_SEMAPHORE
id for semaphores
@ TN_ID_EVENTGRP
id for event groups
TN_RCode
Result code returned by kernel services.
@ TN_RC_DELETED
Object for whose event task was waiting is deleted.
@ TN_ID_DATAQUEUE
id for data queues
unsigned long TN_TickCnt
Type for system tick count, it is used by the kernel to represent absolute tick count value as well a...
@ TN_ID_EXCHANGE
id for exchange objects
@ TN_RC_ILLEGAL_USE
Illegal usage.
@ TN_ID_FSMEMORYPOOL
id for fixed memory pools
TN_ObjId
Magic number for object validity verification.
@ TN_ID_EXCHANGE_LINK
id for exchange link
@ TN_ID_NONE
id for invalid object
@ TN_ID_MUTEX
id for mutexes
@ TN_RC_INTERNAL
Internal kernel error, should never be returned by kernel services.