forked from DouglasSherk/RTOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpcb.h
73 lines (52 loc) · 1.06 KB
/
pcb.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
/**
Header file for the process control block (pcb).
**/
#ifndef PCB_H
#define PCB_H
#ifdef _WIN32
#pragma once
#endif
#include "rtx_base.h"
#include "process.h"
#include "msgenv.h"
#include <setjmp.h>
// Class definition for a generic PCB. Suitable for any process.
class PCB
{
WATCH_INITIALIZATION( PCB );
protected:
PROCESS_ID m_id;
// Pointer to the process the pcb represents.
Process * m_model;
rtx_stl::queue<MsgEnv> m_envelope_inbox;
PCB( Process * );
public:
~PCB();
friend class Kernel;
};
// User PCB (for user processes) class definition.
class UPCB : public PCB
{
WATCH_INITIALIZATION( UPCB );
protected:
PROCESS_PRIORITY m_priority;
PROCESS_STATUS m_status;
byte * m_stack;
jmp_buf m_context;
UPCB( Process * );
public:
~UPCB();
friend class Kernel;
};
class IPCB : public PCB
{
WATCH_INITIALIZATION( IPCB );
protected:
// unix signals which the i-process handles.
int m_signals_handled;
IPCB( Process * );
public:
~IPCB();
friend class Kernel;
};
#endif