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

« back to all changes in this revision

Viewing changes to debian/patches/linaro-patches/0010-omap_gptimer-Support-ticks-per-sec-32-bit-values.patch

  • 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:
 
1
From 2fde986e484d388efeada6e870ee30646a681317 Mon Sep 17 00:00:00 2001
 
2
From: Peter Maydell <peter.maydell@linaro.org>
 
3
Date: Mon, 18 Feb 2013 16:58:24 +0000
 
4
Subject: [PATCH 10/71] omap_gptimer: Support ticks-per-sec > 32 bit values
 
5
 
 
6
TODO: need to review this change still
 
7
---
 
8
 hw/timer/omap_gptimer.c | 37 +++++++++++++++++++++++++++++--------
 
9
 1 file changed, 29 insertions(+), 8 deletions(-)
 
10
 
 
11
diff --git a/hw/timer/omap_gptimer.c b/hw/timer/omap_gptimer.c
 
12
index ac389d8..10cf5d1 100644
 
13
--- a/hw/timer/omap_gptimer.c
 
14
+++ b/hw/timer/omap_gptimer.c
 
15
@@ -100,11 +100,19 @@ static inline void omap_gp_timer_out(struct omap_gp_timer_s *timer, int level)
 
16
 
 
17
 static inline uint32_t omap_gp_timer_read(struct omap_gp_timer_s *timer)
 
18
 {
 
19
-    uint64_t distance;
 
20
+    uint64_t distance, rate;
 
21
 
 
22
     if (timer->st && timer->rate) {
 
23
         distance = qemu_get_clock_ns(vm_clock) - timer->time;
 
24
-        distance = muldiv64(distance, timer->rate, timer->ticks_per_sec);
 
25
+
 
26
+        /*if ticks_per_sec is bigger than 32bit we cannot use muldiv64*/
 
27
+        if (timer->ticks_per_sec > 0xffffffff) {
 
28
+            distance /= get_ticks_per_sec() / 1000; /*distance ms*/
 
29
+            rate = timer->rate >> (timer->pre ? timer->ptv + 1 : 0);
 
30
+            distance = muldiv64(distance, rate, 1000);
 
31
+        } else {
 
32
+            distance = muldiv64(distance, timer->rate, timer->ticks_per_sec);
 
33
+        }
 
34
 
 
35
         if (distance >= 0xffffffff - timer->val)
 
36
             return 0xffffffff;
 
37
@@ -124,19 +132,32 @@ static inline void omap_gp_timer_sync(struct omap_gp_timer_s *timer)
 
38
 
 
39
 static inline void omap_gp_timer_update(struct omap_gp_timer_s *timer)
 
40
 {
 
41
-    int64_t expires, matches;
 
42
+    int64_t expires, matches, rate;
 
43
 
 
44
     if (timer->st && timer->rate) {
 
45
-        expires = muldiv64(0x100000000ll - timer->val,
 
46
-                        timer->ticks_per_sec, timer->rate);
 
47
+        if (timer->ticks_per_sec > 0xffffffff) {
 
48
+            rate = timer->rate >> (timer->pre ? timer->ptv + 1 : 0);
 
49
+            expires = muldiv64(0x100000000ll - timer->val,
 
50
+                               get_ticks_per_sec(), rate);
 
51
+        } else {
 
52
+            expires = muldiv64(0x100000000ll - timer->val,
 
53
+                               timer->ticks_per_sec, timer->rate);
 
54
+        }
 
55
         qemu_mod_timer(timer->timer, timer->time + expires);
 
56
 
 
57
         if (timer->ce && timer->match_val >= timer->val) {
 
58
-            matches = muldiv64(timer->match_val - timer->val,
 
59
-                            timer->ticks_per_sec, timer->rate);
 
60
+            if (timer->ticks_per_sec > 0xffffffff) {
 
61
+                rate = timer->rate >> (timer->pre ? timer->ptv + 1 : 0);
 
62
+                matches = muldiv64(timer->match_val - timer->val,
 
63
+                                   get_ticks_per_sec(), rate);
 
64
+            } else {
 
65
+                matches = muldiv64(timer->match_val - timer->val,
 
66
+                                   timer->ticks_per_sec, timer->rate);
 
67
+            }
 
68
             qemu_mod_timer(timer->match, timer->time + matches);
 
69
-        } else
 
70
+        } else {
 
71
             qemu_del_timer(timer->match);
 
72
+        }
 
73
     } else {
 
74
         qemu_del_timer(timer->timer);
 
75
         qemu_del_timer(timer->match);
 
76
-- 
 
77
1.8.3.2
 
78