static int pci_front_cmd_update(struct pci_device *pci_dev, pci_cmd_t cmd, uint64_t arg, void * priv_data)
{
+#ifdef V3_CONFIG_DEBUG_PCI_FRONT
struct vm_device * dev = (struct vm_device *)priv_data;
struct pci_front_internal * state = (struct pci_front_internal *)dev->private_data;
uint16_t command = (uint16_t)arg;
+#endif
- PrintDebug(VM_NONE, VCORE_NONE, "pci_front (%s): command update\n", state->name);
+ PrintDebug(VM_NONE, VCORE_NONE, "pci_front (%s): command update 0x%x\n", state->name,command);
- if (v3_host_dev_write_config(state->host_dev, 0x4, &command, 2) != 2) {
- PrintError(dev->vm, VCORE_NONE, "pci_front (%s): cmd update: unable to write all bytes\n", state->name);
- return -1;
- }
+ // Note that the config_update corresponding to this callback
+ // has occurred before this request, and so has already been delivered
+ // to the host_dev interface.
+ //
+ // We do not need to handle the special semantics of cmd_update here
+ // hence nothing...
return 0;
}
// unmap
struct v3_mem_region *old_reg = v3_get_mem_region(vm,V3_MEM_CORE_ANY,(addr_t)state->rom_gpa);
if (old_reg) {
- V3_Print(vm,VCORE_NONE,"pci_front: removing old memory region\n");
+ PrintDebug(vm,VCORE_NONE,"pci_front: removing old memory region\n");
v3_delete_mem_region(vm,old_reg);
}
state->rom_gpa = 0;
state->rom_gpa = new_gpa;
}
- V3_Print(vm,VCORE_NONE,"pci_front: remapped rom to %p (enable=%u)\n",state->rom_gpa,enable) ;
+ PrintDebug(vm,VCORE_NONE,"pci_front: remapped rom to %p (enable=%u)\n",state->rom_gpa,enable) ;
}
#define ROM_ADDR_MASK 0xfffff800
struct vm_device * dev = (struct vm_device *)priv_data;
struct pci_front_internal * state = (struct pci_front_internal *)dev->private_data;
- V3_Print(dev->vm,VCORE_NONE,"pci_front: rom update with value 0x%x\n",*src);
+ PrintDebug(dev->vm,VCORE_NONE,"pci_front: rom update with value 0x%x\n",*src);
// the assumption is that the config_write happened before this
if (((*src) & ROM_ADDR_MASK) == ROM_ADDR_MASK) {
PrintDebug(VM_NONE, VCORE_NONE, "byte %d: %x\n", i, state->config_space[reg_num+i]);
}
- /*
- PrintDebug(VM_NONE, VCORE_NONE, "pci_front config space read callback (%d bytes starting at reg num %x) returning:\n", length, reg_num);
- for (i = 0; i < length/4; i++) {
- PrintDebug(VM_NONE, VCORE_NONE, "%x\n", *(uint32_t*)(&(state->config_space[reg_num]) + i*4));
- }
- */
-
-
-
return 0;
}
char *rom_id;
struct v3_cfg_file *rom_file;
v3_cfg_tree_t *rom;
- void *rom_hpa;
- uint64_t rom_size;
+ void *rom_hpa=0;
+ uint64_t rom_size=0;
}
if (!(rom=v3_cfg_subtree(cfg,"rom"))) {
- V3_Print(vm, VCORE_NONE, "pci_front (%s): no expansion block\n",dev_id);
+ PrintDebug(vm, VCORE_NONE, "pci_front (%s): no expansion block\n",dev_id);
rom_file = 0;
rom_hpa=0;
} else {
memcpy(V3_VAddr(rom_hpa),rom_file->data,rom_size);
}
- V3_Print(vm,VCORE_NONE,"pci_front (%s): rom %s tag %s size 0x%llx hpa %p\n",
+ PrintDebug(vm,VCORE_NONE,"pci_front (%s): rom %s tag %s size 0x%llx hpa %p\n",
dev_id,rom_id,rom_file->tag,rom_file->size,rom_hpa);
}