static void win32_rearm_timer(struct qemu_alarm_timer *t)

{

    struct qemu_alarm_win32 *data = t->priv;

    uint64_t nearest_delta_us;



    if (!active_timers[QEMU_TIMER_REALTIME] &&

                !active_timers[QEMU_TIMER_VIRTUAL])

        return;



    nearest_delta_us = qemu_next_deadline_dyntick();

    nearest_delta_us /= 1000;



    timeKillEvent(data->timerId);



    data->timerId = timeSetEvent(1,

                        data->period,

                        host_alarm_handler,

                        (DWORD)t,

                        TIME_ONESHOT | TIME_PERIODIC);



    if (!data->timerId) {

        fprintf(stderr, "Failed to re-arm win32 alarm timer %ld\n",

                GetLastError());



        timeEndPeriod(data->period);

        exit(1);

    }

}

static void win32_rearm_timer(struct qemu_alarm_timer *t)

{

    struct qemu_alarm_win32 *data = t->priv;

    uint64_t nearest_delta_us;



    if (!active_timers[QEMU_TIMER_REALTIME] &&

                !active_timers[QEMU_TIMER_VIRTUAL])

        return;



    nearest_delta_us = qemu_next_deadline_dyntick();

    nearest_delta_us /= 1000;



    timeKillEvent(data->timerId);



    data->timerId = timeSetEvent(1,

                        data->period,

                        host_alarm_handler,

                        (DWORD)t,

                        TIME_ONESHOT | TIME_PERIODIC);



    if (!data->timerId) {

        fprintf(stderr, "Failed to re-arm win32 alarm timer %ld\n",

                GetLastError());



        timeEndPeriod(data->period);

        exit(1);

    }

}

static void FUNC_0(struct qemu_alarm_timer *VAR_0)

{

    struct qemu_alarm_win32 *VAR_1 = VAR_0->priv;

    uint64_t nearest_delta_us;



    if (!active_timers[QEMU_TIMER_REALTIME] &&

                !active_timers[QEMU_TIMER_VIRTUAL])

        return;



    nearest_delta_us = qemu_next_deadline_dyntick();

    nearest_delta_us /= 1000;



    timeKillEvent(VAR_1->timerId);



    VAR_1->timerId = timeSetEvent(1,

                        VAR_1->period,

                        host_alarm_handler,

                        (DWORD)VAR_0,

                        TIME_ONESHOT | TIME_PERIODIC);



    if (!VAR_1->timerId) {

        fprintf(stderr, "Failed to re-arm win32 alarm timer %ld\n",

                GetLastError());



        timeEndPeriod(VAR_1->period);

        exit(1);

    }

}

static void FUNC_0(struct qemu_alarm_timer *VAR_0)
{ struct qemu_alarm_win32 *VAR_1 = VAR_0->priv; uint64_t nearest_delta_us; if (!active_timers[QEMU_TIMER_REALTIME] &&
!active_timers[QEMU_TIMER_VIRTUAL])
return; nearest_delta_us = qemu_next_deadline_dyntick(); nearest_delta_us /= 1000; timeKillEvent(VAR_1->timerId); VAR_1->timerId = timeSetEvent(1,
VAR_1->period,
host_alarm_handler,
(DWORD)VAR_0,
TIME_ONESHOT | TIME_PERIODIC); if (!VAR_1->timerId) { fprintf(stderr, "Failed to re-arm win32 alarm timer %ld\n",
GetLastError()); timeEndPeriod(VAR_1->period); exit(1); } }