32 #include <avr/interrupt.h> 60 #endif // #if KERNEL_STACK_CHECK 74 for (i = 2; i <= 23; i++)
117 #if KERNEL_ROUND_ROBIN 123 #endif // #if KERNEL_ROUND_ROBIN K_WORD * m_pwStack
Pointer to the thread's stack.
static void Update(Thread *pclTargetThread_)
Update Update the current thread being tracked for round-robing scheduling. Note - this has no effect...
#define K_WORD
Size of a data word.
Basic data type primatives used throughout the OS.
static void StartThreads()
StartThreads Function to start the scheduler, initial threads, etc.
Kernel initialization and startup class.
ISR(INT2_vect) __attribute__((signal
ISR(INT2 _vect) SWI using INT2 - used to trigger a context switch.
uint16_t m_u16StackSize
Size of the stack (in bytes)
#define PORT_PUSH_TO_STACK(x, y)
Push a value y to the stack pointer x and decrement the stack pointer.
K_WORD * m_pwStackTop
Pointer to the top of the thread's stack.
ThreadEntryFunc m_pfEntryPoint
The entry-point function called when the thread starts.
void * m_pvArg
Pointer to the argument passed into the thread's entrypoint.
Mark3 Kernel Configuration This file is used to configure the kernel for your specific application in...
Platform independent thread class declarations Threads are an atomic unit of execution, and each instance of the thread class represents an instance of a program running of the processor. The Thread is the fundmanetal user-facing object in the kernel - it is what makes multiprocessing possible from application code.
static void Start(void)
Start Starts the kernel time (must be configured first)
#define Thread_SaveContext()
Save the context of the Thread.
Mark3::Thread * g_pclCurrent
Kernel Software interrupt declarations.
ATMega1284p Multithreading support.
The Thread Class. This object providing the fundamental thread control data structures and functions ...
Mark3::Thread * g_pclNext
static void InitStack(Thread *pstThread_)
InitStack Initialize the thread's stack.
static void CompleteStart()
CompleteStart Call this from the thread initialization code at the point that the scheduler is to be ...
static void Start(void)
Start Enable ("Start") the software interrupt functionality.
static void Schedule()
Schedule Run the scheduler, determines the next thread to run based on the current state of the threa...
static void Thread_Switch(void)
#define KERNEL_STACK_CHECK
static void Config(void)
Config Configure the software interrupt - must be called before any other software interrupt function...
Kernel Timer Class declaration.
#define Thread_RestoreContext()
Restore the context of the Thread.
Thread Quantum declarations for Round-Robin Scheduling.
static void Config(void)
Config Initializes the kernel timer before use.
static bool SetScheduler(bool bEnable_)
SetScheduler Set the active state of the scheduler. When the scheduler is disabled, the next thread is never set; the currently running thread will run forever until the scheduler is enabled again. Care must be taken to ensure that we don't end up trying to block while the scheduler is disabled, otherwise the system ends up in an unusable state.