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. More... | |
void | Scheduler_AbortTask (void *const sp) |
Call the appropriate scheduler to abort the curent running task. More... | |
void | Scheduler_HandleInterrupt (const uint8_t interruptCode) |
This function is called by arch-specific interrupt handling routine. More... | |
void | Scheduler_HandleClockTick (void *const sp) |
This function is called when a clock tick occured, catch by the interrupt handler. More... | |
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. More... | |
void | Scheduler_WakeupTasksWaitingMutex (Lz_Mutex *const mutex) |
Wake up all tasks waiting for a mutex. More... | |
Task * | Scheduler_GetCurrentTask (void) |
Get a pointer to the current running task. More... | |
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. More... | |
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 613 of file scheduler.c.
void Scheduler_AbortTask | ( | void *const | sp | ) |
Call the appropriate scheduler to abort the curent running task.
sp | The stack pointer of the running task after saving its context. |
Definition at line 632 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 657 of file scheduler.c.
void Scheduler_HandleClockTick | ( | void *const | sp | ) |
This function is called when a clock tick occured, catch by the interrupt handler.
sp | The stack pointer of the current running task after saving its context. |
Definition at line 680 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 694 of file scheduler.c.
Task* Scheduler_GetCurrentTask | ( | void | ) |
Get a pointer to the current running task.
Definition at line 720 of file scheduler.c.
void(*)(void) ReverseBytesOfFunctionPointer(void(*const pointer)(void)) |
Reverse the bytes of a function pointer.
pointer | A function pointer. |
pointer
. Definition at line 35 of file scheduler.h.