diff options
author | Paolo Bonzini | 2013-04-18 18:44:03 +0200 |
---|---|---|
committer | Anthony Liguori | 2013-04-29 19:16:57 +0200 |
commit | f81222bc0cf68464fe82117521917cc1533c3ff4 (patch) | |
tree | 9c23c1c62ce41a647ab30da7786686a2fe61ece9 | |
parent | qom: do not return root for empty path (diff) | |
download | qemu-f81222bc0cf68464fe82117521917cc1533c3ff4.tar.gz qemu-f81222bc0cf68464fe82117521917cc1533c3ff4.tar.xz qemu-f81222bc0cf68464fe82117521917cc1533c3ff4.zip |
audio: look for the ISA and PCI buses
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366303444-24620-8-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r-- | arch_init.c | 16 | ||||
-rw-r--r-- | hw/i386/pc_piix.c | 3 | ||||
-rw-r--r-- | hw/i386/pc_q35.c | 2 | ||||
-rw-r--r-- | hw/mips/mips_jazz.c | 2 | ||||
-rw-r--r-- | hw/mips/mips_malta.c | 2 | ||||
-rw-r--r-- | hw/ppc/prep.c | 2 | ||||
-rw-r--r-- | include/sysemu/arch_init.h | 2 |
7 files changed, 17 insertions, 12 deletions
diff --git a/arch_init.c b/arch_init.c index 655dfa5d3b..49c5dc27e6 100644 --- a/arch_init.c +++ b/arch_init.c @@ -987,20 +987,26 @@ void select_soundhw(const char *optarg) } } -void audio_init(ISABus *isa_bus, PCIBus *pci_bus) +void audio_init(void) { struct soundhw *c; + ISABus *isa_bus = (ISABus *) object_resolve_path_type("", TYPE_ISA_BUS, NULL); + PCIBus *pci_bus = (PCIBus *) object_resolve_path_type("", TYPE_PCI_BUS, NULL); for (c = soundhw; c->name; ++c) { if (c->enabled) { if (c->isa) { - if (isa_bus) { - c->init.init_isa(isa_bus); + if (!isa_bus) { + fprintf(stderr, "ISA bus not available for %s\n", c->name); + exit(1); } + c->init.init_isa(isa_bus); } else { - if (pci_bus) { - c->init.init_pci(pci_bus); + if (!pci_bus) { + fprintf(stderr, "PCI bus not available for %s\n", c->name); + exit(1); } + c->init.init_pci(pci_bus); } } } diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 08dd61d1d8..da91e7065d 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -88,7 +88,6 @@ static void pc_init1(MemoryRegion *system_memory, void *fw_cfg = NULL; pc_cpus_init(cpu_model); - pc_acpi_init("acpi-dsdt.aml"); if (kvmclock_enabled) { kvmclock_create(); @@ -194,7 +193,7 @@ static void pc_init1(MemoryRegion *system_memory, } } - audio_init(isa_bus, pci_enabled ? pci_bus : NULL); + audio_init(); pc_cmos_init(below_4g_mem_size, above_4g_mem_size, boot_device, floppy, idebus[0], idebus[1], rtc_state); diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index f16089387c..7ed0cd4a4b 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -189,7 +189,7 @@ static void pc_q35_init(QEMUMachineInitArgs *args) /* the rest devices to which pci devfn is automatically assigned */ pc_vga_init(isa_bus, host_bus); - audio_init(isa_bus, host_bus); + audio_init(); pc_nic_init(isa_bus, host_bus); if (pci_enabled) { pc_pci_device_init(host_bus); diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c index fd3a5f93f9..822d3006e2 100644 --- a/hw/mips/mips_jazz.c +++ b/hw/mips/mips_jazz.c @@ -290,7 +290,7 @@ static void mips_jazz_init(MemoryRegion *address_space, /* Sound card */ /* FIXME: missing Jazz sound at 0x8000c000, rc4030[2] */ - audio_init(isa_bus, NULL); + audio_init(); /* NVRAM */ dev = qdev_create(NULL, "ds1225y"); diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 86f42b2ede..a2d01e158f 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -986,7 +986,7 @@ void mips_malta_init(QEMUMachineInitArgs *args) fdctrl_init_isa(isa_bus, fd); /* Sound card */ - audio_init(isa_bus, pci_bus); + audio_init(); /* Network card */ network_init(); diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index cceab3ead9..82bd27ec8d 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -660,7 +660,7 @@ static void ppc_prep_init(QEMUMachineInitArgs *args) register_ioport_write(0x0F00, 4, 1, &PPC_debug_write, NULL); /* Initialize audio subsystem */ - audio_init(isa_bus, pci_bus); + audio_init(); } static QEMUMachine prep_machine = { diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h index f18de333a2..dece913e7b 100644 --- a/include/sysemu/arch_init.h +++ b/include/sysemu/arch_init.h @@ -30,7 +30,7 @@ void select_soundhw(const char *optarg); void do_acpitable_option(const QemuOpts *opts); void do_smbios_option(const char *optarg); void cpudef_init(void); -void audio_init(ISABus *isa_bus, PCIBus *pci_bus); +void audio_init(void); int tcg_available(void); int kvm_available(void); int xen_available(void); |