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_INTR_SIZE (REAL_INTR_VECTORS * sizeof(struct real_intr_desc)) 13 14 struct interrupt_table { 15 struct real_intr_desc entries[REAL_INTR_VECTORS]; 16 }; 17 18 void interrupt_table__copy(struct interrupt_table *self, void *dst, unsigned int size); 19 void interrupt_table__setup(struct interrupt_table *self, struct real_intr_desc *entry); 20 void interrupt_table__set(struct interrupt_table *self, struct real_intr_desc *entry, unsigned int num); 21 22 #endif /* KVM__INTERRUPT_H */ 23