-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathScheduler.h
45 lines (39 loc) · 1.32 KB
/
Scheduler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*****************************************************************************
* Project Name: CKOS
* Authors: Casey Artner & Kenny Deardorff
* Class: CST 352 - Operating Systems
* File: Scheduler.h - CKOS Task Scheduler
*****************************************************************************/
#ifndef CKOS_SCHEDULER
#define CKOS_SCHEDULER
//Define Scheduler Task Node
typedef struct SchThreadNode
{
//char m_threadID;
//int m_priority;
unsigned short int m_stack;
struct SchThreadNode * m_next;
struct SchThreadNode * m_prev;
} SchThread;
//Scheduler Blocked List Node
typedef struct SchBlockedNodeN
{
SchThread * m_thread;
struct SchBlockedNodeN * m_next;
} SchBlockedNode;
//Scheduler List Pointers
extern SchThread * SCHEDULER_CURRENT; //Current Running Task
extern SchThread * SCHEDULER_NEXT;
//extern SchThread * SCHEDULER_PREVIOUS; //Previous task ran
extern SchThread * SCHEDULER_START; //Startup Task
extern SchThread * SCHEDULER_END; //Last node in queue
//Scheduler Functions
void InitScheduler();
void SchPush(unsigned short int node);
void SchSaveCurr(unsigned short int stack);
unsigned short int SchCurr();
unsigned short int SchNext();
void SchRem(unsigned short int node);
void SchBlock(SchBlockedNode ** q);
void SchResume(SchBlockedNode ** q);
#endif /* CKOS_SCHEDULER */