1 #ifndef KVM__INTERRUPT_H 2 #define KVM__INTERRUPT_H 3 4 #include <inttypes.h> 5 #include "kvm/bios.h" 6 7 struct real_intr_desc { 8 uint16_t offset; 9 uint16_t segment; 10 } __attribute__((packed)); 11 12 #define REAL_SEGMENT_SHIFT 4 13 #define REAL_SEGMENT(addr) ((addr) >> REAL_SEGMENT_SHIFT) 14 #define REAL_INTR_SIZE (REAL_INTR_VECTORS * sizeof(struct real_intr_desc)) 15 16 struct interrupt_table { 17 struct real_intr_desc entries[REAL_INTR_VECTORS]; 18 }; 19 20 void interrupt_table__copy(struct interrupt_table *self, void *dst, unsigned int size); 21 void interrupt_table__setup(struct interrupt_table *self, struct real_intr_desc *entry); 22 void interrupt_table__set(struct interrupt_table *self, struct real_intr_desc *entry, unsigned int num); 23 24 /* 25 * BIOS stubs 26 */ 27 extern unsigned char intfake[]; 28 extern unsigned int intfake_size; 29 extern unsigned char int10[]; 30 extern unsigned int int10_size; 31 32 #endif /* KVM__INTERRUPT_H */ 33