X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Framdisk.c;h=6c18c31e27f3b3d1df20f03ff15052bad4a9a04b;hb=da745a84b3c0ae1127da37991c283b403402a822;hp=cb92ca9a8fc28e875f29b1c130e6a3a777d70ce1;hpb=4acabb7ea8204accd42deb36f27ad01a23527bf6;p=palacios.git diff --git a/palacios/src/devices/ramdisk.c b/palacios/src/devices/ramdisk.c index cb92ca9..6c18c31 100644 --- a/palacios/src/devices/ramdisk.c +++ b/palacios/src/devices/ramdisk.c @@ -40,7 +40,7 @@ #include #include #include - +#include #ifndef TRACE_RAMDISK #undef PrintTrace @@ -2304,6 +2304,33 @@ static void rd_command_aborted(struct vm_device * dev, } +/* +static void init_pci(struct ramdisk_t * ramdisk) { +struct v3_pci_bar bars[6]; + struct pci_device * pci_dev; + int i; + + for (i = 0; i < 6; i++) { + bars[i].type = PCI_BAR_NONE; + bars[i].mem_hook = 0; + bars[i].num_pages = 0; + bars[i].bar_update = NULL; + } + + bars[4].type = PCI_BAR_MEM32; + bars[4].mem_hook = 0; + bars[4].num_pages = 1; + bars[4].bar_update = NULL; + + pci_dev = v3_pci_register_device(ramdisk->pci, PCI_STD_DEVICE, 0, "IDE", -1, bars, NULL, NULL, NULL, NULL); + + + pci_dev->config_header.vendor_id = 0x8086; + pci_dev->config_header.device_id = 0x2421; + + +} + */ static int ramdisk_init_device(struct vm_device *dev) { struct ramdisk_t *ramdisk= (struct ramdisk_t *)dev->private_data; @@ -2364,6 +2391,8 @@ static int ramdisk_init_device(struct vm_device *dev) { + + return 0; } @@ -2386,17 +2415,21 @@ static struct vm_device_ops dev_ops = { -struct vm_device * v3_create_ramdisk() +struct vm_device * v3_create_ramdisk(struct vm_device * pci) { struct ramdisk_t *ramdisk; ramdisk = (struct ramdisk_t *)V3_Malloc(sizeof(struct ramdisk_t)); V3_ASSERT(ramdisk != NULL); + // ramdisk->pci = pci; + PrintDebug("[create_ramdisk]\n"); struct vm_device * device = v3_create_device("RAMDISK", &dev_ops, ramdisk); + + return device; } @@ -2415,28 +2448,7 @@ static void rd_print_state(struct ramdisk_t * ramdisk) { memset((char *)(channels + channel), 0, sizeof(struct channel_t)); } */ - PrintDebug("sizeof(*channels) = %d\n", sizeof(*channels)); - PrintDebug("sizeof(channles->drives[0].controller) = %d\n", sizeof((channels->drives[0].controller))); - PrintDebug("sizeof(channles->drives[0].cdrom) = %d\n", sizeof((channels->drives[0].cdrom))); - PrintDebug("sizeof(channles->drives[0].sense) = %d\n", sizeof((channels->drives[0].sense))); - PrintDebug("sizeof(channles->drives[0].atapi) = %d\n", sizeof((channels->drives[0].atapi))); - - - PrintDebug("sizeof(channles->drives[0].controller.status) = %d\n", - sizeof((channels->drives[0].controller.status))); - PrintDebug("sizeof(channles->drives[0].controller.sector_count) = %d\n", - sizeof((channels->drives[0].controller.sector_count))); - PrintDebug("sizeof(channles->drives[0].controller.interrupt_reason) = %d\n", - sizeof((channels->drives[0].controller.interrupt_reason))); - - PrintDebug("sizeof(channles->drives[0].controller.cylinder_no) = %d\n", - sizeof((channels->drives[0].controller.cylinder_no))); - PrintDebug("sizeof(channles->drives[0].controller.byte_count) = %d\n", - sizeof((channels->drives[0].controller.byte_count))); - - PrintDebug("sizeof(channles->drives[0].controller.control) = %d\n", - sizeof((channels->drives[0].controller.control))); for (channel = 0; channel < MAX_ATA_CHANNEL; channel++){