.irq_line = VIRTIO_BLK_IRQ,
};
+#define PCI_VIRTIO_BLK_DEVNUM 1
+
void blk_virtio__init(struct kvm *self)
{
if (!self->disk_image)
device.blk_config.capacity = self->disk_image->size / SECTOR_SIZE;
- pci__register(&blk_virtio_pci_device, 1);
+ pci__register(&blk_virtio_pci_device, PCI_VIRTIO_BLK_DEVNUM);
- ioport__register(IOPORT_VIRTIO_BLK, &blk_virtio_io_ops, 256);
+ ioport__register(IOPORT_VIRTIO_BLK, &blk_virtio_io_ops, IOPORT_VIRTIO_BLK_SIZE);
}
#include <stdint.h>
/* some ports we reserve for own use */
-#define IOPORT_DBG 0xe0
-#define IOPORT_VIRTIO_BLK 0xc200 /* Virtio block device */
+#define IOPORT_DBG 0xe0
+#define IOPORT_VIRTIO_BLK 0xc200 /* Virtio block device */
+#define IOPORT_VIRTIO_BLK_SIZE 256
+#define IOPORT_VIRTIO_CONSOLE 0xd200 /* Virtio console device */
+#define IOPORT_VIRTIO_CONSOLE_SIZE 256
struct kvm;