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

« back to all changes in this revision

Viewing changes to hw/timer/mc146818rtc.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:
814
814
    visit_end_struct(v, errp);
815
815
}
816
816
 
817
 
static int rtc_initfn(ISADevice *dev)
 
817
static void rtc_realizefn(DeviceState *dev, Error **errp)
818
818
{
 
819
    ISADevice *isadev = ISA_DEVICE(dev);
819
820
    RTCState *s = MC146818_RTC(dev);
820
821
    int base = 0x70;
821
822
 
836
837
        s->base_year = 0;
837
838
    }
838
839
 
839
 
    rtc_set_date_from_host(dev);
 
840
    rtc_set_date_from_host(isadev);
840
841
 
841
842
#ifdef TARGET_I386
842
843
    switch (s->lost_tick_policy) {
847
848
    case LOST_TICK_DISCARD:
848
849
        break;
849
850
    default:
850
 
        return -EINVAL;
 
851
        error_setg(errp, "Invalid lost tick policy.");
 
852
        return;
851
853
    }
852
854
#endif
853
855
 
861
863
    s->suspend_notifier.notify = rtc_notify_suspend;
862
864
    qemu_register_suspend_notifier(&s->suspend_notifier);
863
865
 
864
 
    memory_region_init_io(&s->io, &cmos_ops, s, "rtc", 2);
865
 
    isa_register_ioport(dev, &s->io, base);
 
866
    memory_region_init_io(&s->io, OBJECT(s), &cmos_ops, s, "rtc", 2);
 
867
    isa_register_ioport(isadev, &s->io, base);
866
868
 
867
 
    qdev_set_legacy_instance_id(&dev->qdev, base, 3);
 
869
    qdev_set_legacy_instance_id(dev, base, 3);
868
870
    qemu_register_reset(rtc_reset, s);
869
871
 
870
872
    object_property_add(OBJECT(s), "date", "struct tm",
871
873
                        rtc_get_date, NULL, NULL, s, NULL);
872
 
 
873
 
    return 0;
874
874
}
875
875
 
876
876
ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
902
902
static void rtc_class_initfn(ObjectClass *klass, void *data)
903
903
{
904
904
    DeviceClass *dc = DEVICE_CLASS(klass);
905
 
    ISADeviceClass *ic = ISA_DEVICE_CLASS(klass);
906
 
    ic->init = rtc_initfn;
 
905
 
 
906
    dc->realize = rtc_realizefn;
907
907
    dc->no_user = 1;
908
908
    dc->vmsd = &vmstate_rtc;
909
909
    dc->props = mc146818rtc_properties;