Lazuli
|
Base task definition and context description. More...
Go to the source code of this file.
Data Structures | |
struct | Task |
Represents a task. More... | |
struct | TaskContextLayout |
Represents the layout of the stack when saving the context of a task. More... | |
Macros | |
#define | NO_MESSAGE ((lz_task_to_scheduler_message_t)0U) |
No message has to be passed to the scheduler. | |
#define | WAIT_ACTIVATION ((lz_task_to_scheduler_message_t)1U) |
Set the task to wait for its next activation. More... | |
#define | WAIT_INTERRUPT ((lz_task_to_scheduler_message_t)2U) |
Set the task to wait for an interrupt. More... | |
#define | TERMINATE_TASK ((lz_task_to_scheduler_message_t)3U) |
Terminate the task. | |
#define | WAIT_MUTEX ((lz_task_to_scheduler_message_t)4U) |
Wait for a mutex to be unlocked. More... | |
#define | WAIT_SOFTWARE_TIMER ((lz_task_to_scheduler_message_t)5U) |
Set the task to wait for the specified number of time resolution units, using the software timer. More... | |
Typedefs | |
typedef u_read_write_atomic_t | lz_task_to_scheduler_message_t |
Defines the type used to contain a message that a Task can pass to the scheduler after its time slice has expired. More... | |
typedef void(* | FuncVoidVoid) (void) |
This type definition is needed to exlude confusion with the 'volatile' type qualifier used in the struct declaration below. | |
Functions | |
void | Task_Abort (void) |
Abort the calling task. More... | |
Base task definition and context description.
Describes all types and functions related to tasks.
Definition in file task.h.
#define WAIT_ACTIVATION ((lz_task_to_scheduler_message_t)1U) |
#define WAIT_INTERRUPT ((lz_task_to_scheduler_message_t)2U) |
#define WAIT_MUTEX ((lz_task_to_scheduler_message_t)4U) |
#define WAIT_SOFTWARE_TIMER ((lz_task_to_scheduler_message_t)5U) |
Defines the type used to contain a message that a Task can pass to the scheduler after its time slice has expired.
This type is declared read/write atomic because in the definition of struct Task a message can come along with data, pointed by taskToSchedulerMessageParameter. By writing the pointer first, then writing the message code, we can ensure the integrity of the full message (i.e.: message code + data), assuming the execution is "in-order".
void Task_Abort | ( | void | ) |
Abort the calling task.
This function can be called when some unrecoverable error occured in the context of a task (e.g. when a mandatory pointer is NULL as a function parameter). This will have the consequence of saving the task context (saving all registers and keeping the call stack) and unscheduling the task.