Revision 972abbe0

b/vl.c
578 578

  
579 579
struct QEMUClock {
580 580
    int type;
581
    int enabled;
581 582
    /* XXX: add frequency */
582 583
};
583 584

  
......
812 813
    QEMUClock *clock;
813 814
    clock = qemu_mallocz(sizeof(QEMUClock));
814 815
    clock->type = type;
816
    clock->enabled = 1;
815 817
    return clock;
816 818
}
817 819

  
820
static void qemu_clock_enable(QEMUClock *clock, int enabled)
821
{
822
    clock->enabled = enabled;
823
}
824

  
818 825
QEMUTimer *qemu_new_timer(QEMUClock *clock, QEMUTimerCB *cb, void *opaque)
819 826
{
820 827
    QEMUTimer *ts;
......
907 914
{
908 915
    QEMUTimer **ptimer_head, *ts;
909 916
    int64_t current_time;
917
   
918
    if (!clock->enabled)
919
        return;
910 920

  
911 921
    current_time = qemu_get_clock (clock);
912 922
    ptimer_head = &active_timers[clock->type];
......
1017 1027

  
1018 1028
    /* vm time timers */
1019 1029
    if (vm_running) {
1020
        if (!cur_cpu || likely(!(cur_cpu->singlestep_enabled & SSTEP_NOTIMER)))
1021
            qemu_run_timers(vm_clock);
1030
        qemu_run_timers(vm_clock);
1022 1031
    }
1023 1032

  
1024 1033
    qemu_run_timers(rt_clock);
......
3969 3978
    for (; next_cpu != NULL; next_cpu = next_cpu->next_cpu) {
3970 3979
        CPUState *env = cur_cpu = next_cpu;
3971 3980

  
3981
        qemu_clock_enable(vm_clock,
3982
                          (cur_cpu->singlestep_enabled & SSTEP_NOTIMER) == 0);
3983

  
3972 3984
        if (alarm_timer->pending)
3973 3985
            break;
3974 3986
        if (cpu_can_run(env))

Also available in: Unified diff