kvm tools: Add ivshmem device
[linux-2.6/next.git] / tools / kvm / interrupt.c
blobe4636c485b0af14368f5c6864c987d35f2db394e
1 #include "kvm/interrupt.h"
3 #include "kvm/util.h"
5 #include <string.h>
7 void interrupt_table__copy(struct interrupt_table *itable, void *dst, unsigned int size)
9 if (size < sizeof(itable->entries))
10 die("An attempt to overwrite host memory");
12 memcpy(dst, itable->entries, sizeof(itable->entries));
15 void interrupt_table__setup(struct interrupt_table *itable, struct real_intr_desc *entry)
17 unsigned int i;
19 for (i = 0; i < REAL_INTR_VECTORS; i++)
20 itable->entries[i] = *entry;
23 void interrupt_table__set(struct interrupt_table *itable, struct real_intr_desc *entry, unsigned int num)
25 if (num < REAL_INTR_VECTORS)
26 itable->entries[num] = *entry;