void ptimer_run(ptimer_state *s, int oneshot)

{

    bool was_disabled = !s->enabled;



    if (was_disabled && s->period == 0) {

        fprintf(stderr, "Timer with period zero, disabling\n");

        return;

    }

    s->enabled = oneshot ? 2 : 1;

    if (was_disabled) {

        s->next_event = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);

        ptimer_reload(s);

    }

}

void ptimer_run(ptimer_state *s, int oneshot)

{

    bool was_disabled = !s->enabled;



    if (was_disabled && s->period == 0) {

        fprintf(stderr, "Timer with period zero, disabling\n");

        return;

    }

    s->enabled = oneshot ? 2 : 1;

    if (was_disabled) {

        s->next_event = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);

        ptimer_reload(s);

    }

}

void FUNC_0(ptimer_state *VAR_0, int VAR_1)

{

    bool was_disabled = !VAR_0->enabled;



    if (was_disabled && VAR_0->period == 0) {

        fprintf(stderr, "Timer with period zero, disabling\n");

        return;

    }

    VAR_0->enabled = VAR_1 ? 2 : 1;

    if (was_disabled) {

        VAR_0->next_event = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);

        ptimer_reload(VAR_0);

    }

}

void FUNC_0(ptimer_state *VAR_0, int VAR_1)
{ bool was_disabled = !VAR_0->enabled; if (was_disabled && VAR_0->period == 0) { fprintf(stderr, "Timer with period zero, disabling\n"); return; } VAR_0->enabled = VAR_1 ? 2 : 1; if (was_disabled) { VAR_0->next_event = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); ptimer_reload(VAR_0); } }