diff options
author | Andrzej Zaborowski <balrog@zabor.org> | 2009-08-23 17:19:44 +0200 |
---|---|---|
committer | Andrzej Zaborowski <balrog@zabor.org> | 2009-08-23 17:19:44 +0200 |
commit | 7ef6e71c599aebd066ab1d29be8944bd5c0eb0c2 (patch) | |
tree | 14c73ed8d42ae7c8a635a0d067cd16f20a1c7b82 /hw | |
parent | d074769c5a3357fd843b9b5af0106ca52940cb56 (diff) | |
parent | d453c2c32ed2bf6cfccb6c2463416c4a613eb708 (diff) |
Merge with balrog@git.sv.gnu.org:/srv/git/qemu.git
Diffstat (limited to 'hw')
-rw-r--r-- | hw/esp.c | 16 | ||||
-rw-r--r-- | hw/pci-hotplug.c | 9 | ||||
-rw-r--r-- | hw/slavio_intctl.c | 14 | ||||
-rw-r--r-- | hw/sun4m.c | 15 | ||||
-rw-r--r-- | hw/sun4m.h | 4 |
5 files changed, 39 insertions, 19 deletions
@@ -115,7 +115,9 @@ struct ESPState { #define CMD_TI 0x10 #define CMD_ICCS 0x11 #define CMD_MSGACC 0x12 +#define CMD_PAD 0x18 #define CMD_SATN 0x1a +#define CMD_SEL 0x41 #define CMD_SELATN 0x42 #define CMD_SELATNS 0x43 #define CMD_ENSEL 0x44 @@ -530,15 +532,25 @@ static void esp_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_t val) s->rregs[ESP_RINTR] = INTR_DC; s->rregs[ESP_RSEQ] = 0; break; + case CMD_PAD: + DPRINTF("Transfer padding (%2.2x)\n", val); + s->rregs[ESP_RSTAT] = STAT_TC; + s->rregs[ESP_RINTR] = INTR_FC; + s->rregs[ESP_RSEQ] = 0; + break; case CMD_SATN: DPRINTF("Set ATN (%2.2x)\n", val); break; + case CMD_SEL: + DPRINTF("Select without ATN (%2.2x)\n", val); + handle_satn(s); + break; case CMD_SELATN: - DPRINTF("Set ATN (%2.2x)\n", val); + DPRINTF("Select with ATN (%2.2x)\n", val); handle_satn(s); break; case CMD_SELATNS: - DPRINTF("Set ATN & stop (%2.2x)\n", val); + DPRINTF("Select with ATN & stop (%2.2x)\n", val); handle_satn_stop(s); break; case CMD_ENSEL: diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c index 4da916cca..1f92e09f8 100644 --- a/hw/pci-hotplug.c +++ b/hw/pci-hotplug.c @@ -125,9 +125,8 @@ static PCIDevice *qemu_pci_hot_add_storage(Monitor *mon, monitor_printf(mon, "Parameter addr not supported\n"); return NULL; } - } else if (type == IF_VIRTIO) { - monitor_printf(mon, "virtio requires a backing file/device.\n"); - return NULL; + } else { + dinfo = NULL; } switch (type) { @@ -135,6 +134,10 @@ static PCIDevice *qemu_pci_hot_add_storage(Monitor *mon, dev = pci_create("lsi53c895a", devaddr); break; case IF_VIRTIO: + if (!dinfo) { + monitor_printf(mon, "virtio requires a backing file/device.\n"); + return NULL; + } dev = pci_create("virtio-blk-pci", devaddr); qdev_prop_set_drive(&dev->qdev, "drive", dinfo); break; diff --git a/hw/slavio_intctl.c b/hw/slavio_intctl.c index dbea1f93a..c9bad2607 100644 --- a/hw/slavio_intctl.c +++ b/hw/slavio_intctl.c @@ -220,11 +220,14 @@ static CPUWriteMemoryFunc *slavio_intctlm_mem_write[3] = { slavio_intctlm_mem_writel, }; -void slavio_pic_info(Monitor *mon, void *opaque) +void slavio_pic_info(Monitor *mon, DeviceState *dev) { - SLAVIO_INTCTLState *s = opaque; + SysBusDevice *sd; + SLAVIO_INTCTLState *s; int i; + sd = sysbus_from_qdev(dev); + s = FROM_SYSBUS(SLAVIO_INTCTLState, sd); for (i = 0; i < MAX_CPUS; i++) { monitor_printf(mon, "per-cpu %d: pending 0x%08x\n", i, s->slaves[i].intreg_pending); @@ -233,15 +236,18 @@ void slavio_pic_info(Monitor *mon, void *opaque) s->intregm_pending, s->intregm_disabled); } -void slavio_irq_info(Monitor *mon, void *opaque) +void slavio_irq_info(Monitor *mon, DeviceState *dev) { #ifndef DEBUG_IRQ_COUNT monitor_printf(mon, "irq statistic code not compiled.\n"); #else - SLAVIO_INTCTLState *s = opaque; + SysBusDevice *sd; + SLAVIO_INTCTLState *s; int i; int64_t count; + sd = sysbus_from_qdev(dev); + s = FROM_SYSBUS(SLAVIO_INTCTLState, sd); monitor_printf(mon, "IRQ statistics:\n"); for (i = 0; i < 32; i++) { count = s->irq_count[i]; diff --git a/hw/sun4m.c b/hw/sun4m.c index ddc295a9a..88a0b2511 100644 --- a/hw/sun4m.c +++ b/hw/sun4m.c @@ -209,7 +209,7 @@ static void nvram_init(m48t59_t *nvram, uint8_t *macaddr, const char *cmdline, m48t59_write(nvram, i, image[i]); } -static void *slavio_intctl; +static DeviceState *slavio_intctl; void pic_info(Monitor *mon) { @@ -748,7 +748,6 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size, unsigned long kernel_size; BlockDriverState *fd[MAX_FD]; void *fw_cfg; - DeviceState *dev; DriveInfo *dinfo; /* init CPUs */ @@ -768,16 +767,16 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size, prom_init(hwdef->slavio_base, bios_name); - dev = slavio_intctl_init(hwdef->intctl_base, - hwdef->intctl_base + 0x10000ULL, - cpu_irqs, - 7); + slavio_intctl = slavio_intctl_init(hwdef->intctl_base, + hwdef->intctl_base + 0x10000ULL, + cpu_irqs, + 7); for (i = 0; i < 32; i++) { - slavio_irq[i] = qdev_get_gpio_in(dev, i); + slavio_irq[i] = qdev_get_gpio_in(slavio_intctl, i); } for (i = 0; i < MAX_CPUS; i++) { - slavio_cpu_irq[i] = qdev_get_gpio_in(dev, 32 + i); + slavio_cpu_irq[i] = qdev_get_gpio_in(slavio_intctl, 32 + i); } if (hwdef->idreg_base) { diff --git a/hw/sun4m.h b/hw/sun4m.h index 9f540920a..ce97ee5a7 100644 --- a/hw/sun4m.h +++ b/hw/sun4m.h @@ -23,8 +23,8 @@ static inline void sparc_iommu_memory_write(void *opaque, } /* slavio_intctl.c */ -void slavio_pic_info(Monitor *mon, void *opaque); -void slavio_irq_info(Monitor *mon, void *opaque); +void slavio_pic_info(Monitor *mon, DeviceState *dev); +void slavio_irq_info(Monitor *mon, DeviceState *dev); /* sun4c_intctl.c */ void sun4c_pic_info(Monitor *mon, void *opaque); |