aboutsummaryrefslogtreecommitdiff
path: root/hw/pl031.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-02-17 11:42:19 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-02-17 11:42:19 +0000
commitf650305967f3e9a2fe96f59de3062fd9e8b189d0 (patch)
tree4788c0aea4647bae6201094af7b2b6c752ccad74 /hw/pl031.c
parenta0d69e0097cb87e3b384ab2caa2341d097b25313 (diff)
downloadqemu-f650305967f3e9a2fe96f59de3062fd9e8b189d0.zip
qemu-f650305967f3e9a2fe96f59de3062fd9e8b189d0.tar.gz
qemu-f650305967f3e9a2fe96f59de3062fd9e8b189d0.tar.bz2
Unify RTCs that use host time, fix M48t59 alarm.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3984 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/pl031.c')
-rw-r--r--hw/pl031.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/hw/pl031.c b/hw/pl031.c
index 68e9005..bb5a69d 100644
--- a/hw/pl031.c
+++ b/hw/pl031.c
@@ -195,8 +195,7 @@ void pl031_init(uint32_t base, qemu_irq irq)
{
int iomemtype;
pl031_state *s;
- time_t ti;
- struct tm *tm;
+ struct tm tm;
s = qemu_mallocz(sizeof(pl031_state));
if (!s)
@@ -211,12 +210,8 @@ void pl031_init(uint32_t base, qemu_irq irq)
s->base = base;
s->irq = irq;
/* ??? We assume vm_clock is zero at this point. */
- time(&ti);
- if (rtc_utc)
- tm = gmtime(&ti);
- else
- tm = localtime(&ti);
- s->tick_offset = mktime(tm);
+ qemu_get_timedate(&tm, 0);
+ s->tick_offset = mktime(&tm);
s->timer = qemu_new_timer(vm_clock, pl031_interrupt, s);
}