xref: /kvmtool/x86/include/kvm/interrupt.h (revision d1a26cf05dd727da787c99c62e2c44f5212fd34a)
1 #ifndef KVM__INTERRUPT_H
2 #define KVM__INTERRUPT_H
3 
4 #include <inttypes.h>
5 
6 /*
7  * BIOS data area
8  */
9 #define BDA_START		0xf0000
10 #define BDA_END			0xfffff
11 #define BDA_SIZE		(BDA_END - BDA_START)
12 
13 #define REAL_INTR_BASE		0x0000
14 #define REAL_INTR_VECTORS	256
15 
16 struct real_intr_desc {
17 	uint16_t offset;
18 	uint16_t segment;
19 } __attribute__((packed));
20 
21 #define REAL_INTR_SIZE		(REAL_INTR_VECTORS * sizeof(struct real_intr_desc))
22 
23 struct interrupt_table {
24 	struct real_intr_desc entries[REAL_INTR_VECTORS];
25 };
26 
27 void interrupt_table__copy(struct interrupt_table *self, void *dst, unsigned int size);
28 void interrupt_table__setup(struct interrupt_table *self, struct real_intr_desc *entry);
29 void interrupt_table__set(struct interrupt_table *self, struct real_intr_desc *entry, unsigned int num);
30 
31 #endif /* KVM__INTERRUPT_H */
32