kvm: Rename ivt_ prefixed entities

Though ivt stands for interrupt vector table it's not that clear, lets use
real_intr_desc for that.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
This commit is contained in:
Cyrill Gorcunov
2015-06-01 16:39:39 +01:00
committed by Will Deacon
parent f315008929
commit bc75b0ae4d
3 changed files with 13 additions and 11 deletions
+7 -5
View File
@@ -3,19 +3,21 @@
#include <inttypes.h>
#define IVT_BASE 0x0000
#define IVT_VECTORS 256
#define REAL_INTR_BASE 0x0000
#define REAL_INTR_VECTORS 256
struct ivt_entry {
struct real_intr_desc {
uint16_t offset;
uint16_t segment;
} __attribute__((packed));
#define REAL_INTR_SIZE (REAL_INTR_VECTORS * sizeof(struct real_intr_desc))
struct interrupt_table {
struct ivt_entry entries[IVT_VECTORS];
struct real_intr_desc entries[REAL_INTR_VECTORS];
};
void interrupt_table__copy(struct interrupt_table *self, void *dst, unsigned int size);
void interrupt_table__setup(struct interrupt_table *self, struct ivt_entry *entry);
void interrupt_table__setup(struct interrupt_table *self, struct real_intr_desc *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 *entry)
void interrupt_table__setup(struct interrupt_table *self, struct real_intr_desc *entry)
{
unsigned int i;
for (i = 0; i < IVT_VECTORS; i++)
for (i = 0; i < REAL_INTR_VECTORS; i++)
self->entries[i] = *entry;
}
+4 -4
View File
@@ -197,7 +197,7 @@ static const char *BZIMAGE_MAGIC = "HdrS";
static bool load_bzimage(struct kvm *self, int fd, const char *kernel_cmdline)
{
struct ivt_entry real_mode_irq;
struct real_intr_desc intr;
struct boot_params boot, *t;
unsigned long setup_sects;
ssize_t setup_size;
@@ -256,13 +256,13 @@ static bool load_bzimage(struct kvm *self, int fd, const char *kernel_cmdline)
t->hdr._pad2[0] = 0xfb; /* sti */
t->hdr._pad2[1] = 0xcf; /* iret */
nr = (void *)&t->hdr._pad2[0] - v;
real_mode_irq = (struct ivt_entry) {
intr = (struct real_intr_desc) {
.segment = nr >> 4,
.offset = (nr - (nr & ~0xf)),
};
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));
interrupt_table__setup(&self->interrupt_table, &intr);
interrupt_table__copy(&self->interrupt_table, p, REAL_INTR_SIZE);
return true;
}