Mark3 Realtime Kernel
quantum.h
Go to the documentation of this file.
1 /*===========================================================================
2  _____ _____ _____ _____
3  ___| _|__ __|_ |__ __|__ |__ __| __ |__ ______
4 | \ / | || \ || | || |/ / ||___ |
5 | \/ | || \ || \ || \ ||___ |
6 |__/\__/|__|_||__|\__\ __||__|\__\ __||__|\__\ __||______|
7  |_____| |_____| |_____| |_____|
8 
9 --[Mark3 Realtime Platform]--------------------------------------------------
10 
11 Copyright (c) 2012 - 2019 m0slevin, all rights reserved.
12 See license.txt for more information
13 =========================================================================== */
22 #pragma once
23 
24 #include "kerneltypes.h"
25 #include "mark3cfg.h"
26 
27 #include "thread.h"
28 #include "timer.h"
29 #include "timerlist.h"
30 #include "timerscheduler.h"
31 
32 #if KERNEL_ROUND_ROBIN
33 namespace Mark3
34 {
35 class Timer;
36 
42 class Quantum
43 {
44 public:
45  static void Init();
46 
54  static void SetInTimer();
55 
60  static void ClearInTimer();
61 
70  static void Update(Thread* pclTargetThread_);
71 
79  static void SetTimerThread(Thread* pclTimerThread_) { m_pclTimerThread = pclTimerThread_; }
80 
84  static void Cancel();
85 
86 private:
89  static uint16_t m_u16TicksRemain;
90  static bool m_bInTimer;
91 };
92 } // namespace Mark3
93 #endif // #if KERNEL_ROUND_ROBIN
static void Update(Thread *pclTargetThread_)
Update Update the current thread being tracked for round-robing scheduling. Note - this has no effect...
Timer list declarations.
static Thread * m_pclTimerThread
Definition: quantum.h:88
Basic data type primatives used throughout the OS.
Timer scheduler declarations.
static void Init()
static void SetTimerThread(Thread *pclTimerThread_)
SetTimerThread Pass the timer thread's Thread pointer to the Quantum module to track against requests...
Definition: quantum.h:79
Timer object declarations.
Definition: atomic.cpp:23
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 SetInTimer()
SetInTimer Set a flag to indicate that the CPU is currently running within the timer-callback routine...
static uint16_t m_u16TicksRemain
Definition: quantum.h:89
The Thread Class. This object providing the fundamental thread control data structures and functions ...
Definition: thread.h:64
static void ClearInTimer()
ClearInTimer Clear the flag once the timer callback function has been completed.
The Quantum Class. Static-class used to implement Thread quantum functionality, which is fundamental ...
Definition: quantum.h:42
static void Cancel()
static bool m_bInTimer
Definition: quantum.h:90
static Thread * m_pclActiveThread
Definition: quantum.h:87