static void mv88w8618_pit_write(void *opaque, target_phys_addr_t offset,

                                uint32_t value)

{

    mv88w8618_pit_state *s = opaque;

    mv88w8618_timer_state *t;

    int i;



    switch (offset) {

    case MP_PIT_TIMER1_LENGTH ... MP_PIT_TIMER4_LENGTH:

        t = &s->timer[offset >> 2];

        t->limit = value;

        ptimer_set_limit(t->ptimer, t->limit, 1);

        break;



    case MP_PIT_CONTROL:

        for (i = 0; i < 4; i++) {

            if (value & 0xf) {

                t = &s->timer[i];

                ptimer_set_limit(t->ptimer, t->limit, 0);

                ptimer_set_freq(t->ptimer, t->freq);

                ptimer_run(t->ptimer, 0);

            }

            value >>= 4;

        }

        break;



    case MP_BOARD_RESET:

        if (value == MP_BOARD_RESET_MAGIC) {

            qemu_system_reset_request();

        }

        break;

    }

}

static void mv88w8618_pit_write(void *opaque, target_phys_addr_t offset,

                                uint32_t value)

{

    mv88w8618_pit_state *s = opaque;

    mv88w8618_timer_state *t;

    int i;



    switch (offset) {

    case MP_PIT_TIMER1_LENGTH ... MP_PIT_TIMER4_LENGTH:

        t = &s->timer[offset >> 2];

        t->limit = value;

        ptimer_set_limit(t->ptimer, t->limit, 1);

        break;



    case MP_PIT_CONTROL:

        for (i = 0; i < 4; i++) {

            if (value & 0xf) {

                t = &s->timer[i];

                ptimer_set_limit(t->ptimer, t->limit, 0);

                ptimer_set_freq(t->ptimer, t->freq);

                ptimer_run(t->ptimer, 0);

            }

            value >>= 4;

        }

        break;



    case MP_BOARD_RESET:

        if (value == MP_BOARD_RESET_MAGIC) {

            qemu_system_reset_request();

        }

        break;

    }

}

static void FUNC_0(void *VAR_0, target_phys_addr_t VAR_1,

                                uint32_t VAR_2)

{

    mv88w8618_pit_state *s = VAR_0;

    mv88w8618_timer_state *t;

    int VAR_3;



    switch (VAR_1) {

    case MP_PIT_TIMER1_LENGTH ... MP_PIT_TIMER4_LENGTH:

        t = &s->timer[VAR_1 >> 2];

        t->limit = VAR_2;

        ptimer_set_limit(t->ptimer, t->limit, 1);

        break;



    case MP_PIT_CONTROL:

        for (VAR_3 = 0; VAR_3 < 4; VAR_3++) {

            if (VAR_2 & 0xf) {

                t = &s->timer[VAR_3];

                ptimer_set_limit(t->ptimer, t->limit, 0);

                ptimer_set_freq(t->ptimer, t->freq);

                ptimer_run(t->ptimer, 0);

            }

            VAR_2 >>= 4;

        }

        break;



    case MP_BOARD_RESET:

        if (VAR_2 == MP_BOARD_RESET_MAGIC) {

            qemu_system_reset_request();

        }

        break;

    }

}

static void FUNC_0(void *VAR_0, target_phys_addr_t VAR_1,
uint32_t VAR_2)
{ mv88w8618_pit_state *s = VAR_0; mv88w8618_timer_state *t; int VAR_3; switch (VAR_1) { case MP_PIT_TIMER1_LENGTH ... MP_PIT_TIMER4_LENGTH:
t = &s->timer[VAR_1 >> 2]; t->limit = VAR_2; ptimer_set_limit(t->ptimer, t->limit, 1); break; case MP_PIT_CONTROL:
for (VAR_3 = 0; VAR_3 < 4; VAR_3++) { if (VAR_2 & 0xf) { t = &s->timer[VAR_3]; ptimer_set_limit(t->ptimer, t->limit, 0); ptimer_set_freq(t->ptimer, t->freq); ptimer_run(t->ptimer, 0); } VAR_2 >>= 4; } break; case MP_BOARD_RESET:
if (VAR_2 == MP_BOARD_RESET_MAGIC) { qemu_system_reset_request(); } break; } }