54 #include "../arch/tn_arch.h"
85 #define TN_STACK_ARR_DEF(name, size) \
86 TN_ARCH_STK_ATTR_BEFORE \
87 TN_UWord name[ (size) ] \
88 TN_ARCH_STK_ATTR_AFTER
208 #define TN_NO_TIME_SLICE 0
213 #define TN_MAX_TIME_SLICE 0xFFFE
255 unsigned int idle_task_stack_size,
257 unsigned int int_stack_size,
TN_Context
System context.
#define BOOL
boolean type definition
deadlock is active Note: this feature works if only TN_MUTEX_DEADLOCK_DETECT is non-zero.
TN_RCode
Result code returned by kernel services.
None: this code is possible if only system is not running (flag (TN_STATE_FLAG__SYS_RUNNING is not se...
TN_TaskBody * tn_cur_task_body_get(void)
Returns pointer to the body function of the currently running task.
void tn_callback_deadlock_set(TN_CBDeadlock *cb)
Set callback function that should be called whenever deadlock occurs or becomes inactive (say...
void tn_sys_start(TN_UWord *idle_task_stack, unsigned int idle_task_stack_size, TN_UWord *int_stack, unsigned int int_stack_size, TN_CBUserTaskCreate *cb_user_task_create, TN_CBIdle *cb_idle)
Initial TNeoKernel system start function, never returns.
void( TN_CBDeadlock)(BOOL active, struct TN_Mutex *mutex, struct TN_Task *task)
User-provided callback function that is called whenever deadlock becomes active or inactive...
static BOOL tn_is_task_context(void)
Returns whether current system context is TN_CONTEXT_TASK
enum TN_StateFlag tn_sys_state_flags_get(void)
Returns current system state flags.
void( TN_CBUserTaskCreate)(void)
User-provided callback function that is called directly from tn_sys_start() as a part of system start...
enum TN_Context tn_sys_context_get(void)
Returns system context: task or ISR.
int priority
current task priority
enum TN_RCode tn_tick_int_processing(void)
Process system tick; should be called periodically, typically from some kind of timer ISR...
struct TN_Task * tn_cur_task_get(void)
Returns pointer to the currently running task.
static BOOL tn_is_isr_context(void)
Returns whether current system context is TN_CONTEXT_ISR
void( TN_CBIdle)(void)
User-provided callback function that is called repeatedly from the idle task loop.
enum TN_RCode tn_sys_tslice_set(int priority, int ticks)
Set time slice ticks value for specified priority (see Round-robin scheduling).
void( TN_TaskBody)(void *param)
Prototype for task body function.
unsigned int tn_sys_time_get(void)
Get current system ticks count.
unsigned int TN_UWord
Unsigned integer type whose size is equal to the size of CPU register.
TN_StateFlag
System state flags.