mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
audio: consolidate audio_init()
consolidate audio_init() and remove references to shoundhw. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
bec43cc3b6
commit
0dfa5ef90d
8 changed files with 41 additions and 80 deletions
35
arch_init.c
35
arch_init.c
|
@ -461,7 +461,18 @@ void qemu_service_io(void)
|
|||
}
|
||||
|
||||
#ifdef HAS_AUDIO
|
||||
struct soundhw soundhw[] = {
|
||||
struct soundhw {
|
||||
const char *name;
|
||||
const char *descr;
|
||||
int enabled;
|
||||
int isa;
|
||||
union {
|
||||
int (*init_isa) (qemu_irq *pic);
|
||||
int (*init_pci) (PCIBus *bus);
|
||||
} init;
|
||||
};
|
||||
|
||||
static struct soundhw soundhw[] = {
|
||||
#ifdef HAS_AUDIO_CHOICE
|
||||
#if defined(TARGET_I386) || defined(TARGET_MIPS)
|
||||
{
|
||||
|
@ -610,10 +621,32 @@ void select_soundhw(const char *optarg)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void audio_init(qemu_irq *isa_pic, PCIBus *pci_bus)
|
||||
{
|
||||
struct soundhw *c;
|
||||
|
||||
for (c = soundhw; c->name; ++c) {
|
||||
if (c->enabled) {
|
||||
if (c->isa) {
|
||||
if (isa_pic) {
|
||||
c->init.init_isa(isa_pic);
|
||||
}
|
||||
} else {
|
||||
if (pci_bus) {
|
||||
c->init.init_pci(pci_bus);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
void select_soundhw(const char *optarg)
|
||||
{
|
||||
}
|
||||
void audio_init(qemu_irq *isa_pic, PCIBus *pci_bus)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
int qemu_uuid_parse(const char *str, uint8_t *uuid)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue