Mark3 Realtime Kernel
cosched.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 =========================================================================== */
19 #pragma once
20 
21 #include "mark3cfg.h"
22 #include "coroutine.h"
23 #include "colist.h"
24 
25 namespace Mark3 {
34 {
35 public:
36 
42  static void Init();
43 
50  static CoPrioMap* GetPrioMap();
51 
59  static CoList* GetStopList();
60 
68  static CoList* GetCoList(PORT_PRIO_TYPE uPriority_);
69 
77  static Coroutine* Schedule();
78 
79 private:
83 };
84 } // namespace Mark3
The CoList class The CoList class implements a circular-linked-listed structure for coroutine objects...
Definition: colist.h:35
CoRoutine implementation.
static CoList m_clStopList
Definition: cosched.h:81
static CoList * GetStopList()
GetStopList Get the pointer to the coroutine list managing initialized coroutines that are not awaiti...
Definition: cosched.cpp:45
#define PORT_PRIO_TYPE
Type used for bitmap in the PriorityMap class.
Definition: portcfg.h:73
static CoPrioMap * GetPrioMap()
GetPrioMap Get the pointer to the priority map object used by the scheduler.
Definition: cosched.cpp:39
Definition: atomic.cpp:23
The CoScheduler class. This class implements the coroutine scheduler. Similar to the Mark3 thread sch...
Definition: cosched.h:33
static CoPrioMap m_clPrioMap
Definition: cosched.h:82
Mark3 Kernel Configuration This file is used to configure the kernel for your specific application in...
#define PORT_COROUTINE_PRIORITIES
Definition: portcfg.h:47
static CoList m_aclPriorities[PORT_COROUTINE_PRIORITIES]
Definition: cosched.h:80
static CoList * GetCoList(PORT_PRIO_TYPE uPriority_)
GetCoList Retrieve the coroutine list associated with a given priority.
Definition: cosched.cpp:51
The Coroutine class implements a lightweight, run-to-completion task that forms the basis for co-oper...
Definition: coroutine.h:53
The PriorityMapL1 class This class implements a priority bitmap data structure. Each bit in the objec...
Definition: priomapl1.h:45
CoRoutine List structure implementation.
static void Init()
Init Initialize the coroutine scheduler prior to use. Must be called prior to using any other functio...
Definition: cosched.cpp:29
static Coroutine * Schedule()
Schedule Determine what coroutine (if any) is the next to be executed.
Definition: cosched.cpp:60