Revision f6503059 hw/omap.c

b/hw/omap.c
4345 4345
    int pm_am;
4346 4346
    int auto_comp;
4347 4347
    int round;
4348
    struct tm *(*convert)(const time_t *timep, struct tm *result);
4349 4348
    struct tm alarm_tm;
4350 4349
    time_t alarm_ti;
4351 4350

  
......
4668 4667
        s->round = 0;
4669 4668
    }
4670 4669

  
4671
    localtime_r(&s->ti, &s->current_tm);
4670
    memcpy(&s->current_tm, localtime(&s->ti), sizeof(s->current_tm));
4672 4671

  
4673 4672
    if ((s->interrupts & 0x08) && s->ti == s->alarm_ti) {
4674 4673
        s->status |= 0x40;
......
4719 4718

  
4720 4719
static void omap_rtc_reset(struct omap_rtc_s *s)
4721 4720
{
4721
    struct tm tm;
4722

  
4722 4723
    s->interrupts = 0;
4723 4724
    s->comp_reg = 0;
4724 4725
    s->running = 0;
......
4729 4730
    memset(&s->alarm_tm, 0, sizeof(s->alarm_tm));
4730 4731
    s->alarm_tm.tm_mday = 0x01;
4731 4732
    s->status = 1 << 7;
4732
    time(&s->ti);
4733
    s->ti = mktime(s->convert(&s->ti, &s->current_tm));
4733
    qemu_get_timedate(&tm, 0);
4734
    s->ti = mktime(&tm);
4734 4735

  
4735 4736
    omap_rtc_alarm_update(s);
4736 4737
    omap_rtc_tick(s);
......
4747 4748
    s->irq = irq[0];
4748 4749
    s->alarm = irq[1];
4749 4750
    s->clk = qemu_new_timer(rt_clock, omap_rtc_tick, s);
4750
    s->convert = rtc_utc ? gmtime_r : localtime_r;
4751 4751

  
4752 4752
    omap_rtc_reset(s);
4753 4753

  

Also available in: Unified diff