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

« back to all changes in this revision

Viewing changes to hw/audio/adlib.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:
283
283
    AUD_remove_card (&s->card);
284
284
}
285
285
 
286
 
static int Adlib_initfn (ISADevice *dev)
 
286
static MemoryRegionPortio adlib_portio_list[] = {
 
287
    { 0, 4, 1, .read = adlib_read, .write = adlib_write, },
 
288
    { 0, 2, 1, .read = adlib_read, .write = adlib_write, },
 
289
    { 0x388, 4, 1, .read = adlib_read, .write = adlib_write, },
 
290
    PORTIO_END_OF_LIST(),
 
291
};
 
292
 
 
293
static void adlib_realizefn (DeviceState *dev, Error **errp)
287
294
{
288
295
    AdlibState *s = ADLIB(dev);
 
296
    PortioList *port_list = g_new(PortioList, 1);
289
297
    struct audsettings as;
290
298
 
291
299
    if (glob_adlib) {
292
 
        dolog ("Cannot create more than 1 adlib device\n");
293
 
        return -1;
 
300
        error_setg (errp, "Cannot create more than 1 adlib device");
 
301
        return;
294
302
    }
295
303
    glob_adlib = s;
296
304
 
297
305
#ifdef HAS_YMF262
298
306
    if (YMF262Init (1, 14318180, s->freq)) {
299
 
        dolog ("YMF262Init %d failed\n", s->freq);
300
 
        return -1;
 
307
        error_setg (errp, "YMF262Init %d failed", s->freq);
 
308
        return;
301
309
    }
302
310
    else {
303
311
        YMF262SetTimerHandler (0, timer_handler, 0);
306
314
#else
307
315
    s->opl = OPLCreate (OPL_TYPE_YM3812, 3579545, s->freq);
308
316
    if (!s->opl) {
309
 
        dolog ("OPLCreate %d failed\n", s->freq);
310
 
        return -1;
 
317
        error_setg (errp, "OPLCreate %d failed", s->freq);
 
318
        return;
311
319
    }
312
320
    else {
313
321
        OPLSetTimerHandler (s->opl, timer_handler, 0);
332
340
        );
333
341
    if (!s->voice) {
334
342
        Adlib_fini (s);
335
 
        return -1;
 
343
        error_setg (errp, "Initializing audio voice failed");
 
344
        return;
336
345
    }
337
346
 
338
347
    s->samples = AUD_get_buffer_size_out (s->voice) >> SHIFT;
339
348
    s->mixbuf = g_malloc0 (s->samples << SHIFT);
340
349
 
341
 
    register_ioport_read (0x388, 4, 1, adlib_read, s);
342
 
    register_ioport_write (0x388, 4, 1, adlib_write, s);
343
 
 
344
 
    register_ioport_read (s->port, 4, 1, adlib_read, s);
345
 
    register_ioport_write (s->port, 4, 1, adlib_write, s);
346
 
 
347
 
    register_ioport_read (s->port + 8, 2, 1, adlib_read, s);
348
 
    register_ioport_write (s->port + 8, 2, 1, adlib_write, s);
349
 
 
350
 
    return 0;
 
350
    adlib_portio_list[1].offset = s->port;
 
351
    adlib_portio_list[2].offset = s->port + 8;
 
352
    portio_list_init (port_list, OBJECT(s), adlib_portio_list, s, "adlib");
 
353
    portio_list_add (port_list, isa_address_space_io(&s->parent_obj), 0);
351
354
}
352
355
 
353
356
static Property adlib_properties[] = {
359
362
static void adlib_class_initfn (ObjectClass *klass, void *data)
360
363
{
361
364
    DeviceClass *dc = DEVICE_CLASS (klass);
362
 
    ISADeviceClass *ic = ISA_DEVICE_CLASS (klass);
363
 
    ic->init = Adlib_initfn;
 
365
 
 
366
    dc->realize = adlib_realizefn;
 
367
    set_bit(DEVICE_CATEGORY_SOUND, dc->categories);
364
368
    dc->desc = ADLIB_DESC;
365
369
    dc->props = adlib_properties;
366
370
}