~ubuntu-branches/ubuntu/precise/qemu-kvm/precise

« back to all changes in this revision

Viewing changes to hw/pl031.c

  • Committer: Serge Hallyn
  • Date: 2011-10-19 07:37:43 UTC
  • mfrom: (1.2.7)
  • Revision ID: serge.hallyn@ubuntu.com-20111019073743-7i7n9irsxlm38wic
Tags: 0.15.0+noroms-0ubuntu1
* New upstream release
* Remaining changes from upstream:
  - removed all binary roms and tests/pi_10.com
* Removed Detect-and-use-GCC-atomic-builtins-for-locking.patch - non-NPTL
  implementations were removed with commit
  02615337ef295443daa03233e492194e289a807e
* Drop spice-qxl-locking-fix-for-qemu-kvm.patch - should be unnecessary
  as of commit 196a778428989217b82de042725dc8eb29c8f8d8
* drop patches applied upstream:
  - CVE-2011-1751.diff
  - virtio-guard-against-negative-vq-notifies-CVE-2011-2512.diff
  - CVE-2011-2527.patch
  - fix-pa-configure.patch
* Refreshed the remaining patches:
  - larger_default_ram_size.patch
  - CVE-2011-2212-virtqueue-indirect-overflow.patch
  - qemuifup-fix-paths.patch
  - vpc.patch
* e1000-Dont-set-the-Capabilities-List-bit.patch - switched to the
  cherrypicked upstream patch (as the source file changed quite a bit,
  and the hand-ported patch backported to 0.14.1 does not apply).
* Drop qemu-kvm-spice (all changes from 0.14.1+noroms-0ubuntu7), it will
  need its own source package (LP: #878162)

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
 
81
81
static uint32_t pl031_get_count(pl031_state *s)
82
82
{
83
 
    /* This assumes qemu_get_clock returns the time since the machine was
 
83
    /* This assumes qemu_get_clock_ns returns the time since the machine was
84
84
       created.  */
85
 
    return s->tick_offset + qemu_get_clock(vm_clock) / get_ticks_per_sec();
 
85
    return s->tick_offset + qemu_get_clock_ns(vm_clock) / get_ticks_per_sec();
86
86
}
87
87
 
88
88
static void pl031_set_alarm(pl031_state *s)
90
90
    int64_t now;
91
91
    uint32_t ticks;
92
92
 
93
 
    now = qemu_get_clock(vm_clock);
 
93
    now = qemu_get_clock_ns(vm_clock);
94
94
    ticks = s->tick_offset + now / get_ticks_per_sec();
95
95
 
96
96
    /* The timer wraps around.  This subtraction also wraps in the same way,
161
161
        pl031_update(s);
162
162
        break;
163
163
    case RTC_ICR:
164
 
        /* The PL031 documentation (DDI0224B) states that the interupt is
 
164
        /* The PL031 documentation (DDI0224B) states that the interrupt is
165
165
           cleared when bit 0 of the written value is set.  However the
166
166
           arm926e documentation (DDI0287B) states that the interrupt is
167
167
           cleared when any value is written.  */
217
217
    qemu_get_timedate(&tm, 0);
218
218
    s->tick_offset = mktimegm(&tm);
219
219
 
220
 
    s->timer = qemu_new_timer(vm_clock, pl031_interrupt, s);
 
220
    s->timer = qemu_new_timer_ns(vm_clock, pl031_interrupt, s);
221
221
    return 0;
222
222
}
223
223