[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/5] sparc: fix floppy TC line setup
From: |
blauwirbel |
Subject: |
[Qemu-devel] [PATCH 1/5] sparc: fix floppy TC line setup |
Date: |
Mon, 30 Jul 2012 16:04:31 +0000 |
From: Blue Swirl <address@hidden>
The qemu_irq for Terminal Count (TC) line between FDC and Slavio misc
device was created only after use, spotted by Clang compiler. Also,
it was not created if the FDC didn't exist.
Rearrange code to fix order. Always create the TC line.
Signed-off-by: Blue Swirl <address@hidden>
---
hw/sun4m.c | 18 +++++++++++++-----
1 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/hw/sun4m.c b/hw/sun4m.c
index a959261..0f909b5 100644
--- a/hw/sun4m.c
+++ b/hw/sun4m.c
@@ -832,6 +832,10 @@ static void cpu_devinit(const char *cpu_model, unsigned
int id,
env->prom_addr = prom_addr;
}
+static void dummy_fdc_tc(void *opaque, int irq, int level)
+{
+}
+
static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size,
const char *boot_device,
const char *kernel_filename,
@@ -942,9 +946,6 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
ram_addr_t RAM_size,
serial_hds[0], serial_hds[1], ESCC_CLOCK, 1);
cpu_halt = qemu_allocate_irqs(cpu_halt_signal, NULL, 1);
- slavio_misc_init(hwdef->slavio_base, hwdef->aux1_base, hwdef->aux2_base,
- slavio_irq[30], fdc_tc);
-
if (hwdef->apc_base) {
apc_init(hwdef->apc_base, cpu_halt[0]);
}
@@ -955,8 +956,13 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
ram_addr_t RAM_size,
fd[0] = drive_get(IF_FLOPPY, 0, 0);
sun4m_fdctrl_init(slavio_irq[22], hwdef->fd_base, fd,
&fdc_tc);
+ } else {
+ fdc_tc = *qemu_allocate_irqs(dummy_fdc_tc, NULL, 1);
}
+ slavio_misc_init(hwdef->slavio_base, hwdef->aux1_base, hwdef->aux2_base,
+ slavio_irq[30], fdc_tc);
+
if (drive_get_max_bus(IF_SCSI) > 0) {
fprintf(stderr, "qemu: too many SCSI bus\n");
exit(1);
@@ -1772,16 +1778,18 @@ static void sun4c_hw_init(const struct sun4c_hwdef
*hwdef, ram_addr_t RAM_size,
slavio_irq[1], serial_hds[0], serial_hds[1],
ESCC_CLOCK, 1);
- slavio_misc_init(0, hwdef->aux1_base, 0, slavio_irq[1], fdc_tc);
-
if (hwdef->fd_base != (target_phys_addr_t)-1) {
/* there is zero or one floppy drive */
memset(fd, 0, sizeof(fd));
fd[0] = drive_get(IF_FLOPPY, 0, 0);
sun4m_fdctrl_init(slavio_irq[1], hwdef->fd_base, fd,
&fdc_tc);
+ } else {
+ fdc_tc = *qemu_allocate_irqs(dummy_fdc_tc, NULL, 1);
}
+ slavio_misc_init(0, hwdef->aux1_base, 0, slavio_irq[1], fdc_tc);
+
if (drive_get_max_bus(IF_SCSI) > 0) {
fprintf(stderr, "qemu: too many SCSI bus\n");
exit(1);
--
1.7.2.5
- Re: [Qemu-devel] [PATCH 2/5] sparc: fix expression with uninitialized initial value, (continued)
- [Qemu-devel] [PATCH 4/5] user: fix accidental AREG0 use, blauwirbel, 2012/07/30
- [Qemu-devel] [PATCH 3/5] qapi: avoid reserved word restrict, blauwirbel, 2012/07/30
- Re: [Qemu-devel] [PATCH 3/5] qapi: avoid reserved word restrict, Paolo Bonzini, 2012/07/31
- Re: [Qemu-devel] [PATCH 3/5] qapi: avoid reserved word restrict, Luiz Capitulino, 2012/07/31
- Re: [Qemu-devel] [PATCH 3/5] qapi: avoid reserved word restrict, Blue Swirl, 2012/07/31
- Re: [Qemu-devel] [PATCH 3/5] qapi: avoid reserved word restrict, Michael Roth, 2012/07/31
- Re: [Qemu-devel] [PATCH 3/5] qapi: avoid reserved word restrict, Blue Swirl, 2012/07/31
- Re: [Qemu-devel] [PATCH 3/5] qapi: avoid reserved word restrict, Michael Roth, 2012/07/31
- Re: [Qemu-devel] [PATCH 3/5] qapi: avoid reserved word restrict, Anthony Liguori, 2012/07/31
[Qemu-devel] [PATCH 1/5] sparc: fix floppy TC line setup,
blauwirbel <=
[Qemu-devel] [PATCH 5/5] configure: disable a few Clang compiler warnings, blauwirbel, 2012/07/30