From: Jack Lange Date: Fri, 20 Mar 2009 22:04:05 +0000 (-0500) Subject: fixed printf format bugs X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=da745a84b3c0ae1127da37991c283b403402a822 fixed printf format bugs --- diff --git a/palacios/src/devices/cdrom.c b/palacios/src/devices/cdrom.c index b46a361..43dafd8 100644 --- a/palacios/src/devices/cdrom.c +++ b/palacios/src/devices/cdrom.c @@ -77,14 +77,14 @@ static rd_bool cdrom_read_toc(void * private_data, uint8_t* buf, int* length, rd static uint32_t cdrom_capacity(void * private_data) { struct cdrom_state * cdrom = (struct cdrom_state *)private_data; - PrintDebug("[cdrom_capacity] s_ramdiskSize = %d\n", cdrom->capacity_in_bytes); + PrintDebug("[cdrom_capacity] s_ramdiskSize = %lu\n", cdrom->capacity_in_bytes); if (cdrom->lba) { if (cdrom->capacity_in_bytes % 2048) { - PrintDebug("\t\t capacity in LBA is %d\n", (cdrom->capacity_in_bytes / 2048) + 1); + PrintDebug("\t\t capacity in LBA is %lu\n", (cdrom->capacity_in_bytes / 2048) + 1); return (cdrom->capacity_in_bytes / 2048) + 1; } else { - PrintDebug("\t\t capacity in LBA is %d\n", cdrom->capacity_in_bytes / 2048); + PrintDebug("\t\t capacity in LBA is %lu\n", cdrom->capacity_in_bytes / 2048); return cdrom->capacity_in_bytes / 2048; } } else { @@ -102,7 +102,7 @@ static void cdrom_read_block(void * private_data, uint8_t * buf, int lba)/* __at V3_ASSERT(lba != 0); - PrintDebug("[cdrom_read_block] lba = %d (cdrom_image_start=%x)\n", lba, cdrom->image_addr); + PrintDebug("[cdrom_read_block] lba = %d (cdrom_image_start=%p)\n", lba, (void*)cdrom->image_addr); memcpy(buf, (uchar_t *)(cdrom->image_addr + lba * 2048), 2048); //PrintDebug("Returning from read block\n"); return; @@ -139,7 +139,7 @@ static struct cdrom_ops cd_ops = { static int cdrom_device_init(struct vm_device * dev) { struct cdrom_state * cdrom = (struct cdrom_state *)dev->private_data; PrintDebug("[cdrom_init]\n"); - PrintDebug("CDIMAGE located at: %x\n", cdrom->image_addr); + PrintDebug("CDIMAGE located at: %p\n", (void *)cdrom->image_addr); //FIXME:lba cdrom->lba = 1; diff --git a/palacios/src/devices/generic.c b/palacios/src/devices/generic.c index cc26934..cc9cc69 100644 --- a/palacios/src/devices/generic.c +++ b/palacios/src/devices/generic.c @@ -220,7 +220,7 @@ static int generic_init_device(struct vm_device * dev) { list_for_each_entry(tmp, &(state->port_list), range_link) { uint_t i = 0; - PrintDebug("generic: hooking ports 0x%x to 0x%x as %x\n", + PrintDebug("generic: hooking ports 0x%x to 0x%x as %s\n", tmp->start, tmp->end, (tmp->type == GENERIC_PRINT_AND_PASSTHROUGH) ? "print-and-passthrough" : "print-and-ignore"); @@ -251,12 +251,12 @@ static int generic_init_device(struct vm_device * dev) { list_for_each_entry(tmp, &(state->mem_list), range_link) { - PrintDebug("generic: hooking addresses 0x%x to 0x%x\n", + PrintDebug("generic: hooking addresses 0x%p to 0x%p\n", tmp->start, tmp->end); if (v3_dev_hook_mem(dev, tmp->start, tmp->end)) { - PrintDebug("generic: Can't hook addresses 0x%x to 0x%x (already hooked?)\n", + PrintDebug("generic: Can't hook addresses 0x%p to 0x%p (already hooked?)\n", tmp->start, tmp->end); } } @@ -331,11 +331,11 @@ static int generic_deinit_device(struct vm_device * dev) { list_for_each_entry_safe(cur, tmp, &(state->mem_list), range_link) { - PrintDebug("generic: unhooking addresses 0x%x to 0x%x\n", + PrintDebug("generic: unhooking addresses 0x%p to 0x%p\n", cur->start, cur->end); if (v3_dev_unhook_mem(dev, cur->start, cur->end)) { - PrintDebug("generic: Can't unhook addresses 0x%x to 0x%x (already unhooked?)\n", + PrintDebug("generic: Can't unhook addresses 0x%p to 0x%p (already unhooked?)\n", cur->start, cur->end); } @@ -404,7 +404,7 @@ int v3_generic_add_port_range(struct vm_device * dev, uint_t start, uint_t end, range->type = type; - PrintDebug("generic: Adding Port Range: 0x%x to 0x%x as %x\n", + PrintDebug("generic: Adding Port Range: 0x%x to 0x%x as %s\n", range->start, range->end, (range->type == GENERIC_PRINT_AND_PASSTHROUGH) ? "print-and-passthrough" : "print-and-ignore"); diff --git a/palacios/src/devices/ramdisk.c b/palacios/src/devices/ramdisk.c index 7ad7f9b..6c18c31 100644 --- a/palacios/src/devices/ramdisk.c +++ b/palacios/src/devices/ramdisk.c @@ -2448,29 +2448,8 @@ 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++){