forked from luke8086/boot2c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintr.h
45 lines (37 loc) · 970 Bytes
/
intr.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
/*
* intr.h - A generic function for triggering software interrupts
*
* author: luke8086
* license: GPL-2
*/
#ifndef _INTR_H_
#define _INTR_H_
#include <stdint.h>
/* Container for values of the CPU registers */
struct regs {
union {
struct {
int32_t eax, ebx, ecx, edx;
uint32_t ebp, edi, esi;
};
struct {
int16_t ax, _eax_fill;
int16_t bx, _ebx_fill;
int16_t cx, _ecx_fill;
int16_t dx, _edx_fill;
uint16_t bp, _ebp_fill;
uint16_t di, _edi_fill;
uint16_t si, _esi_fill;
};
struct {
int8_t al, ah; int16_t _eax_fill_;
int8_t bl, bh; int16_t _ebx_fill_;
int8_t cl, ch; int16_t _ecx_fill_;
int8_t dl, dh; int16_t _edx_fill_;
};
};
uint32_t eflags;
};
/* Trigger software interrupt */
void intr(int int_no, struct regs *);
#endif /* _INTR_H_ */