|
Lazuli
|
Lazuli scheduler interface. More...
#include <stdint.h>#include <Lazuli/common.h>#include <Lazuli/lazuli.h>#include <Lazuli/mutex.h>#include <Lazuli/sys/task.h>Go to the source code of this file.
Functions | |
| void | Scheduler_Init (void) |
| Initialize the scheduler prior to running it. | |
| void | Scheduler_AbortTask (void) |
| Abort the current running task. | |
| void | Scheduler_HandleInterrupt (const uint8_t interruptCode) |
| This function is called by arch-specific interrupt handling routine. | |
| void | Scheduler_HandleClockTick (void *const sp) |
| This function is called when a clock tick occurred, catch by the interrupt handler. | |
| void | Scheduler_WaitEvent (void *const sp, const uint8_t eventCode) |
| This function is called from arch-specific Wait routine in order to get the current running task wait for a particular event, after saving its context. | |
| void | Scheduler_WakeupTasksWaitingMutex (Lz_Mutex *const mutex) |
| Wake up all tasks waiting for a mutex. | |
| Task * | Scheduler_GetCurrentTask (void) |
| Get a pointer to the current running task. | |
| void | Scheduler_SleepUntilEndOfTimeSlice (void) |
| Put the current task to sleep until the end of its time slice. | |
Variables | |
| void(*)(void) | ReverseBytesOfFunctionPointer (void(*const pointer)(void)) |
| Reverse the bytes of a function pointer. | |
Lazuli scheduler interface.
The kernel API of the scheduler.
This file describes the kernel interface of the Lazuli scheduler.
Definition in file scheduler.h.
| void Scheduler_Init | ( | void | ) |
Initialize the scheduler prior to running it.
This function is called by kernel initialization.
Definition at line 632 of file scheduler.c.
| void Scheduler_AbortTask | ( | void | ) |
Abort the current running task.
This function is to be called by the kernel if some unrecoverable error occured in the context of a task (e.g. when a mandatory pointer is NULL as a function, or a division by zero).
Definition at line 651 of file scheduler.c.
| void Scheduler_HandleInterrupt | ( | const uint8_t | interruptCode | ) |
This function is called by arch-specific interrupt handling routine.
This function is executed in the context of the current running task, i.e. on its stack.
| interruptCode | The code of the interrupt being handled. |
Definition at line 663 of file scheduler.c.
| void Scheduler_HandleClockTick | ( | void *const | sp | ) |
This function is called when a clock tick occurred, catch by the interrupt handler.
| sp | The stack pointer of the current running task after saving its context. |
Definition at line 686 of file scheduler.c.
| void Scheduler_WaitEvent | ( | void *const | sp, |
| const uint8_t | eventCode | ||
| ) |
This function is called from arch-specific Wait routine in order to get the current running task wait for a particular event, after saving its context.
| sp | The stack pointer of the current running task after saving its context. |
| eventCode | The code of the event the task is waiting for. |
| void Scheduler_WakeupTasksWaitingMutex | ( | Lz_Mutex *const | mutex | ) |
Wake up all tasks waiting for a mutex.
| mutex | A pointer to the mutex the tasks are waiting for. |
Definition at line 700 of file scheduler.c.
| Task * Scheduler_GetCurrentTask | ( | void | ) |
Get a pointer to the current running task.
Definition at line 726 of file scheduler.c.
| void Scheduler_SleepUntilEndOfTimeSlice | ( | void | ) |
Put the current task to sleep until the end of its time slice.
Definition at line 732 of file scheduler.c.
| void(*)(void) ReverseBytesOfFunctionPointer(void(*const pointer)(void)) | ( | void(*)(void) | pointer | ) |
Reverse the bytes of a function pointer.
| pointer | A function pointer. |
pointer. Definition at line 34 of file scheduler.h.