*
*/
-#include"vl.h"
+#include "hw.h"
+#include "primecell.h"
+#include "qemu-timer.h"
+#include "sysemu.h"
//#define DEBUG_PL031
{
int iomemtype;
pl031_state *s;
- time_t ti;
- struct tm *tm;
+ struct tm tm;
s = qemu_mallocz(sizeof(pl031_state));
if (!s)
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);
}