summaryrefslogtreecommitdiff
path: root/hw/sun4m.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-07-16 14:15:34 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-07-16 14:15:34 +0000
commita1961a4b313b346213439ca0e3e1e9ea69169bf4 (patch)
treea283903c71928c327278e10205da53e893c90d71 /hw/sun4m.c
parent666713c0711abbc591a867b5ff31fbc6ba53bf28 (diff)
Sparc32: convert slavio interrupt controller to qdev
Also increase QDEV_MAX_IRQ. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/sun4m.c')
-rw-r--r--hw/sun4m.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/hw/sun4m.c b/hw/sun4m.c
index f348a9c7d8..220eaae3eb 100644
--- a/hw/sun4m.c
+++ b/hw/sun4m.c
@@ -563,7 +563,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size,
CPUState *envs[MAX_CPUS];
unsigned int i;
void *iommu, *espdma, *ledma, *nvram;
- qemu_irq *cpu_irqs[MAX_CPUS], *slavio_irq, *slavio_cpu_irq,
+ qemu_irq *cpu_irqs[MAX_CPUS], slavio_irq[32], slavio_cpu_irq[MAX_CPUS],
espdma_irq, ledma_irq;
qemu_irq *esp_reset, *le_reset;
qemu_irq fdc_tc;
@@ -572,6 +572,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size,
BlockDriverState *fd[MAX_FD];
int drive_index;
void *fw_cfg;
+ DeviceState *dev;
/* init CPUs */
if (!cpu_model)
@@ -590,12 +591,18 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size,
prom_init(hwdef->slavio_base, bios_name);
- slavio_intctl = slavio_intctl_init(hwdef->intctl_base,
- hwdef->intctl_base + 0x10000ULL,
- &hwdef->intbit_to_level[0],
- &slavio_irq, &slavio_cpu_irq,
- cpu_irqs,
- hwdef->clock_irq);
+ dev = slavio_intctl_init(hwdef->intctl_base,
+ hwdef->intctl_base + 0x10000ULL,
+ &hwdef->intbit_to_level[0],
+ cpu_irqs,
+ hwdef->clock_irq);
+
+ for (i = 0; i < 32; i++) {
+ slavio_irq[i] = qdev_get_gpio_in(dev, i);
+ }
+ for (i = 0; i < MAX_CPUS; i++) {
+ slavio_cpu_irq[i] = qdev_get_gpio_in(dev, 32 + i);
+ }
if (hwdef->idreg_base) {
idreg_init(hwdef->idreg_base);