-
Notifications
You must be signed in to change notification settings - Fork 4
/
trap.h
77 lines (70 loc) · 1.38 KB
/
trap.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
77
#ifndef _TRAP_H_
#define _TRAP_H_
#include "stdint.h"
struct IdtEntry{
uint16_t low;
uint16_t selector;
uint8_t res0;
uint8_t attr;
uint16_t mid;
uint32_t high;
uint32_t res1;
};
struct IdtPtr {
uint16_t limit;
uint64_t addr;
} __attribute__((packed));
struct TrapFrame {
int64_t r15;
int64_t r14;
int64_t r13;
int64_t r12;
int64_t r11;
int64_t r10;
int64_t r9;
int64_t r8;
int64_t rbp;
int64_t rdi;
int64_t rsi;
int64_t rdx;
int64_t rcx;
int64_t rbx;
int64_t rax;
int64_t trapno;
int64_t errorcode;
int64_t rip;
int64_t cs;
int64_t rflags;
int64_t rsp;
int64_t ss;
};
void vector0(void);
void vector1(void);
void vector2(void);
void vector3(void);
void vector4(void);
void vector5(void);
void vector6(void);
void vector7(void);
void vector8(void);
void vector10(void);
void vector11(void);
void vector12(void);
void vector13(void);
void vector14(void);
void vector16(void);
void vector17(void);
void vector18(void);
void vector19(void);
void vector32(void);
void vector33(void);
void vector39(void);
void sysint(void);
void init_idt(void);
void eoi(void);
void load_idt(struct IdtPtr *ptr);
unsigned char read_isr(void);
uint64_t read_cr2(void);
void TrapReturn(void);
uint64_t get_ticks(void);
#endif