-
Notifications
You must be signed in to change notification settings - Fork 0
/
scheduler.h
76 lines (54 loc) · 970 Bytes
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
** SCCS ID: @(#)scheduler.h 1.1 4/9/14
**
** File: scheduler.h
**
** Author: CSCI-452 class of 20135
**
** Contributor:
**
** Description: Scheduler/dispatcher module declarations
*/
#ifndef _SCHEDULER_H_
#define _SCHEDULER_H_
#include "common.h"
/*
** General (C and/or assembly) definitions
*/
#ifndef __SP_ASM__
/*
** Start of C-only definitions
*/
#include "process.h"
#include "queue.h"
// number of ready queues - one per priority level
#define N_READYQ N_PRIOS
/*
** Types
*/
/*
** Globals
*/
extern pcb_t *_current; // the currently-running process
extern queue_t _ready[]; // the MLQ ready queue structure
/*
** Prototypes
*/
/*
** initialize the scheduler module
*/
void _sched_init( void );
/*
** schedule a process for execution according to its priority
*/
void _schedule( pcb_t *pcb );
/*
** give the CPU to a process
*/
void _dispatch( void );
/*
** go all Arnold on the current process
*/
void _terminate( void );
#endif
#endif