kvm: Clean up interrupt_table__setup()

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
This commit is contained in:
Pekka Enberg
2015-06-01 16:39:39 +01:00
committed by Will Deacon
parent da8883c13e
commit 4b62331f45
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -16,6 +16,6 @@ struct interrupt_table {
};
void interrupt_table__copy(struct interrupt_table *self, void *dst, unsigned int size);
void interrupt_table__setup(struct interrupt_table *self, struct ivt_entry e);
void interrupt_table__setup(struct interrupt_table *self, struct ivt_entry *entry);
#endif /* KVM__INTERRUPT_H */
+2 -2
View File
@@ -12,10 +12,10 @@ void interrupt_table__copy(struct interrupt_table *self, void *dst, unsigned int
memcpy(dst, self->entries, sizeof(self->entries));
}
void interrupt_table__setup(struct interrupt_table *self, struct ivt_entry e)
void interrupt_table__setup(struct interrupt_table *self, struct ivt_entry *entry)
{
unsigned int i;
for (i = 0; i < IVT_VECTORS; i++)
self->entries[i] = e;
self->entries[i] = *entry;
}
+4 -4
View File
@@ -198,9 +198,9 @@ static const char *BZIMAGE_MAGIC = "HdrS";
static bool load_bzimage(struct kvm *self, int fd, const char *kernel_cmdline)
{
unsigned long setup_sects;
struct boot_params boot, *t;
struct ivt_entry real_mode_irq;
struct boot_params boot, *t;
unsigned long setup_sects;
ssize_t setup_size;
void *p, *v;
int nr;
@@ -252,7 +252,7 @@ static bool load_bzimage(struct kvm *self, int fd, const char *kernel_cmdline)
* we need a place for 2 bytes so lets do
* a hack and use spare place in bootparams
*/
t = (struct boot_params *)guest_real_to_host(self, BOOT_LOADER_SELECTOR, BOOT_LOADER_IP);
t = guest_real_to_host(self, BOOT_LOADER_SELECTOR, BOOT_LOADER_IP);
v = guest_flat_to_host(self, 0);
t->hdr._pad2[0] = 0xfb; /* sti */
t->hdr._pad2[1] = 0xcf; /* iret */
@@ -261,7 +261,7 @@ static bool load_bzimage(struct kvm *self, int fd, const char *kernel_cmdline)
.segment = nr >> 4,
.offset = (nr - (nr & ~0xf)),
};
interrupt_table__setup(&self->interrupt_table, real_mode_irq);
interrupt_table__setup(&self->interrupt_table, &real_mode_irq);
p = guest_flat_to_host(self, 0);
interrupt_table__copy(&self->interrupt_table, p, IVT_VECTORS * sizeof(real_mode_irq));