mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-09-05 13:11:44 +00:00
kvm: Clean up interrupt_table__setup()
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
This commit is contained in:
committed by
Will Deacon
parent
da8883c13e
commit
4b62331f45
@@ -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
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user