200 #if TN_MUTEX_DEADLOCK_DETECT
310 #define TN_TASK_STACK_DEF(name, size) \
311 TN_ARCH_STK_ATTR_BEFORE \
312 TN_UWord name[ (size) ] \
313 TN_ARCH_STK_ATTR_AFTER
718 #endif // _TN_TASKS_H
enum TN_RCode tn_task_activate(struct TN_Task *task)
Activate task that is in DORMANT state, that is, it was either just created by tn_task_create() witho...
TN_WaitReason
Task wait reason.
task wants to lock a mutex with priority inheritance
enum TN_RCode tn_task_release_wait(struct TN_Task *task)
Release task from WAIT state, independently of the reason of waiting.
enum TN_RCode tn_task_iwakeup(struct TN_Task *task)
The same as tn_task_wakeup() but for using in the ISR.
enum TN_RCode tn_task_terminate(struct TN_Task *task)
This function is similar to tn_task_exit() but it terminates any task other than currently running on...
Task is suspended (by some other task)
enum TN_RCode tn_task_create(struct TN_Task *task, TN_TaskBody *task_func, int priority, TN_UWord *task_stack_low_addr, int task_stack_size, void *param, enum TN_TaskCreateOpt opts)
Construct task and probably start it (depends on options, see below).
TN_RCode
Result code returned by kernel services.
DQueue-specific fields related to waiting task, to be included in struct TN_Task. ...
TN_ObjId
Magic number for object validity verification.
unsigned long TN_Timeout
The value representing maximum number of system ticks to wait.
EventGrp-specific fields related to waiting task, to be included in struct TN_Task.
enum TN_WaitReason task_wait_reason
reason for waiting (relevant if only task_state is WAIT or WAIT+SUSPEND)
Task was previously waiting, and after this it was suspended.
task wants to receive some data to the data queue, and there's no data in the queue ...
Definitions used through the whole kernel.
enum TN_TaskState task_state
task state
enum TN_RCode tn_task_delete(struct TN_Task *task)
This function deletes the task specified by the task.
TN_TaskCreateOpt
Options for tn_task_create()
struct TN_EGrpTaskWait eventgrp
fields specific to tn_eventgrp.h
TN_UWord * base_stack_top
base top of the stack for this task
int stack_size
size of task's stack (in sizeof(TN_UWord), not bytes)
TN_TaskBody * task_func_addr
pointer to task's body function given to tn_task_create()
int tslice_count
time slice counter
enum TN_RCode tn_task_change_priority(struct TN_Task *task, int new_priority)
Set new priority for task.
struct TN_ListItem deadlock_list
list of other tasks involved in deadlock.
Timer is a kernel object that is used to ask the kernel to call some user-provided function at a part...
enum TN_RCode tn_task_wakeup(struct TN_Task *task)
Wake up task from sleep.
This state should never be publicly available.
Fixed memory blocks pool.
enum TN_RCode tn_task_suspend(struct TN_Task *task)
If the task is RUNNABLE, it is moved to the SUSPEND state.
void tn_task_exit(enum TN_TaskExitOpt opts)
This function terminates the currently running task.
whether task should be deleted right after it is exited.
enum TN_RCode tn_task_irelease_wait(struct TN_Task *task)
The same as tn_task_release_wait() but for using in the ISR.
enum TN_RCode tn_task_resume(struct TN_Task *task)
Release task from SUSPEND state.
int base_priority
base priority of the task (actual current priority may be higher than base priority because of mutex)...
Task isn't yet activated or it was terminated by tn_task_terminate().
task has called tn_task_sleep()
enum TN_ObjId id_task
id for object validity verification
Task is ready to run (it doesn't mean that it is running at the moment)
task wants to get memory block from memory pool, and there's no free memory blocks ...
struct TN_DQueueTaskWait dqueue
fields specific to tn_dqueue.h
unsigned waited
Flag indicates that task waited for something This flag is set automatially in _tn_task_set_waiting()...
int priority
current task priority
enum TN_RCode tn_task_iactivate(struct TN_Task *task)
The same as tn_task_activate() but for using in the ISR.
struct TN_ListItem * pwait_queue
pointer to object's (semaphore, mutex, event, etc) wait list in which task is included for waiting ...
struct TN_ListItem task_queue
queue is used to include task in ready/wait lists
for internal kernel usage only: this option must be provided when creating idle task ...
task wants to lock a mutex with priority ceiling
struct TN_FMemTaskWait fmem
fields specific to tn_fmem.h
struct TN_Timer timer
timer object to implement task waiting for timeout
Kernel system routines: system start, tick processing, time slice managing.
union TN_Task::@0 subsys_wait
subsystem-specific fields that are used while task waits for something.
task wants to put some data to the data queue, and there's no space in the queue. ...
enum TN_RCode tn_task_state_get(struct TN_Task *task, enum TN_TaskState *p_state)
Get current state of the task; note that returned state is a bitmask, that is, states could be combin...
void( TN_TaskBody)(void *param)
Prototype for task body function.
task waits to acquire a semaphore
enum TN_RCode tn_task_sleep(TN_Timeout timeout)
Put current task to sleep for at most timeout ticks.
task isn't waiting for anything
unsigned priority_already_updated
Internal flag used to optimize mutex priority algorithms.
whether task should be activated right after it is created.
void * task_func_param
pointer to task's parameter given to tn_task_create()
FMem-specific fields related to waiting task, to be included in struct TN_Task.
unsigned int TN_UWord
Unsigned integer type whose size is equal to the size of CPU register.
unsigned int * task_stk
pointer to task's current stack pointer; Note that this field must be a first field in the struct...
task waits for some event in the event group to be set
A data queue is a FIFO that stores pointer (of type void *) in each cell, called (in uITRON style) a ...
struct TN_ListItem create_queue
queue is used to include task in creation list (currently, this list is used for statistics only) ...
TN_TaskExitOpt
Options for tn_task_exit()
enum TN_RCode task_wait_rc
waiting result code (reason why waiting finished)
struct TN_ListItem mutex_queue
list of all mutexes that are locked by task