-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathivtentry.h
51 lines (37 loc) · 942 Bytes
/
ivtentry.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
/*
* ivtentry.h
*
* Created on: May 19, 2018
* Author: OS1
*/
#ifndef IVTENTRY_H_
#define IVTENTRY_H_
#include "symbols.h"
#include "system.h"
//system.h is included because there is a definition for type pInterrupt
// typedef void interrupt (*pInterrupt) (...);
class KernelEv;
class IVTEntry {
public:
IVTEntry (IVTNo ivtno, pInterrupt newInterrupt);
friend class KernelEv;
friend class Event;
~IVTEntry();
void callOld();
void signal();
private:
pInterrupt oldInterrupt; //old interrupt routine
IVTNo ivtno;
KernelEv* myImpl;
static volatile IVTEntry* entries[256];
};
#define PREPAREENTRY(numEntry,callFlag)\
void interrupt interr##numEntry(...);\
IVTEntry entry##numEntry(numEntry,interr##numEntry);\
void interrupt interr##numEntry(...){\
entry##numEntry.signal();\
if (callFlag != 0){\
entry##numEntry.callOld();\
}\
}
#endif /* IVTENTRY_H_ */