~ubuntu-branches/ubuntu/trusty/qemu/trusty

« back to all changes in this revision

Viewing changes to hw/audio/gus.c

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2013-10-22 22:47:07 UTC
  • mfrom: (1.8.3) (10.1.42 sid)
  • Revision ID: package-import@ubuntu.com-20131022224707-1lya34fw3k3f24tv
Tags: 1.6.0+dfsg-2ubuntu1
* Merge 1.6.0~rc0+dfsg-2exp from debian experimental.  Remaining changes:
  - debian/control
    * update maintainer
    * remove libiscsi, usb-redir, vde, vnc-jpeg, and libssh2-1-dev
      from build-deps
    * enable rbd
    * add qemu-system and qemu-common B/R to qemu-keymaps
    * add D:udev, R:qemu, R:qemu-common and B:qemu-common to
      qemu-system-common
    * qemu-system-arm, qemu-system-ppc, qemu-system-sparc:
      - add qemu-kvm to Provides
      - add qemu-common, qemu-kvm, kvm to B/R
      - remove openbios-sparc from qemu-system-sparc D
      - drop openbios-ppc and openhackware Depends to Suggests (for now)
    * qemu-system-x86:
      - add qemu-common to Breaks/Replaces.
      - add cpu-checker to Recommends.
    * qemu-user: add B/R:qemu-kvm
    * qemu-kvm:
      - add armhf armel powerpc sparc to Architecture
      - C/R/P: qemu-kvm-spice
    * add qemu-common package
    * drop qemu-slof which is not packaged in ubuntu
  - add qemu-system-common.links for tap ifup/down scripts and OVMF link.
  - qemu-system-x86.links:
    * remove pxe rom links which are in kvm-ipxe
    * add symlink for kvm.1 manpage
  - debian/rules
    * add kvm-spice symlink to qemu-kvm
    * call dh_installmodules for qemu-system-x86
    * update dh_installinit to install upstart script
    * run dh_installman (Closes: #709241) (cherrypicked from 1.5.0+dfsg-2)
  - Add qemu-utils.links for kvm-* symlinks.
  - Add qemu-system-x86.qemu-kvm.upstart and .default
  - Add qemu-system-x86.modprobe to set nesting=1
  - Add qemu-system-common.preinst to add kvm group
  - qemu-system-common.postinst: remove bad group acl if there, then have
    udev relabel /dev/kvm.
  - New linaro patches from qemu-linaro rebasing branch
  - Dropped patches:
    * xen-simplify-xen_enabled.patch
    * sparc-linux-user-fix-missing-symbols-in-.rel-.rela.plt-sections.patch
    * main_loop-do-not-set-nonblocking-if-xen_enabled.patch
    * xen_machine_pv-do-not-create-a-dummy-CPU-in-machine-.patch
    * virtio-rng-fix-crash
  - Kept patches:
    * expose_vms_qemu64cpu.patch - updated
    * linaro arm patches from qemu-linaro rebasing branch
  - New patches:
    * fix-pci-add: change CONFIG variable in ifdef to make sure that
      pci_add is defined.
* Add linaro patches
* Add experimental mach-virt patches for arm virtualization.
* qemu-system-common.install: add debian/tmp/usr/lib to install the
  qemu-bridge-helper

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
#define IO_WRITE_PROTO(name) \
47
47
    static void name (void *opaque, uint32_t nport, uint32_t val)
48
48
 
 
49
#define TYPE_GUS "gus"
 
50
#define GUS(obj) OBJECT_CHECK (GUSState, (obj), TYPE_GUS)
 
51
 
49
52
typedef struct GUSState {
50
53
    ISADevice dev;
51
54
    GUSEmuState emu;
248
251
    PORTIO_END_OF_LIST (),
249
252
};
250
253
 
251
 
static int gus_initfn (ISADevice *dev)
 
254
static void gus_realizefn (DeviceState *dev, Error **errp)
252
255
{
253
 
    GUSState *s = DO_UPCAST (GUSState, dev, dev);
 
256
    ISADevice *d = ISA_DEVICE(dev);
 
257
    GUSState *s = GUS (dev);
254
258
    struct audsettings as;
255
259
 
256
260
    AUD_register_card ("gus", &s->card);
271
275
 
272
276
    if (!s->voice) {
273
277
        AUD_remove_card (&s->card);
274
 
        return -1;
 
278
        error_setg(errp, "No voice");
 
279
        return;
275
280
    }
276
281
 
277
282
    s->shift = 2;
278
283
    s->samples = AUD_get_buffer_size_out (s->voice) >> s->shift;
279
284
    s->mixbuf = g_malloc0 (s->samples << s->shift);
280
285
 
281
 
    isa_register_portio_list (dev, s->port, gus_portio_list1, s, "gus");
282
 
    isa_register_portio_list (dev, (s->port + 0x100) & 0xf00,
 
286
    isa_register_portio_list (d, s->port, gus_portio_list1, s, "gus");
 
287
    isa_register_portio_list (d, (s->port + 0x100) & 0xf00,
283
288
                              gus_portio_list2, s, "gus");
284
289
 
285
290
    DMA_register_channel (s->emu.gusdma, GUS_read_DMA, s);
286
291
    s->emu.himemaddr = s->himem;
287
292
    s->emu.gusdatapos = s->emu.himemaddr + 1024 * 1024 + 32;
288
293
    s->emu.opaque = s;
289
 
    isa_init_irq (dev, &s->pic, s->emu.gusirq);
 
294
    isa_init_irq (d, &s->pic, s->emu.gusirq);
290
295
 
291
296
    AUD_set_active_out (s->voice, 1);
292
 
 
293
 
    return 0;
294
297
}
295
298
 
296
299
static int GUS_init (ISABus *bus)
297
300
{
298
 
    isa_create_simple (bus, "gus");
 
301
    isa_create_simple (bus, TYPE_GUS);
299
302
    return 0;
300
303
}
301
304
 
310
313
static void gus_class_initfn (ObjectClass *klass, void *data)
311
314
{
312
315
    DeviceClass *dc = DEVICE_CLASS (klass);
313
 
    ISADeviceClass *ic = ISA_DEVICE_CLASS (klass);
314
 
    ic->init = gus_initfn;
 
316
 
 
317
    dc->realize = gus_realizefn;
 
318
    set_bit(DEVICE_CATEGORY_SOUND, dc->categories);
315
319
    dc->desc = "Gravis Ultrasound GF1";
316
320
    dc->vmsd = &vmstate_gus;
317
321
    dc->props = gus_properties;
318
322
}
319
323
 
320
324
static const TypeInfo gus_info = {
321
 
    .name          = "gus",
 
325
    .name          = TYPE_GUS,
322
326
    .parent        = TYPE_ISA_DEVICE,
323
327
    .instance_size = sizeof (GUSState),
324
328
    .class_init    = gus_class_initfn,