timer_write(void *opaque, hwaddr addr,

            uint64_t val64, unsigned int size)

{

    struct timerblock *t = opaque;

    struct xlx_timer *xt;

    unsigned int timer;

    uint32_t value = val64;



    addr >>= 2;

    timer = timer_from_addr(addr);

    xt = &t->timers[timer];

    D(fprintf(stderr, "%s addr=%x val=%x (timer=%d off=%d)\n",

             __func__, addr * 4, value, timer, addr & 3));

    /* Further decoding to address a specific timers reg.  */

    addr &= 3;

    switch (addr) 

    {

        case R_TCSR:

            if (value & TCSR_TINT)

                value &= ~TCSR_TINT;



            xt->regs[addr] = value;

            if (value & TCSR_ENT)

                timer_enable(xt);

            break;

 

        default:

            if (addr < ARRAY_SIZE(xt->regs))

                xt->regs[addr] = value;

            break;

    }

    timer_update_irq(t);

}

timer_write(void *opaque, hwaddr addr,

            uint64_t val64, unsigned int size)

{

    struct timerblock *t = opaque;

    struct xlx_timer *xt;

    unsigned int timer;

    uint32_t value = val64;



    addr >>= 2;

    timer = timer_from_addr(addr);

    xt = &t->timers[timer];

    D(fprintf(stderr, "%s addr=%x val=%x (timer=%d off=%d)\n",

             __func__, addr * 4, value, timer, addr & 3));

    

    addr &= 3;

    switch (addr) 

    {

        case R_TCSR:

            if (value & TCSR_TINT)

                value &= ~TCSR_TINT;



            xt->regs[addr] = value;

            if (value & TCSR_ENT)

                timer_enable(xt);

            break;

 

        default:

            if (addr < ARRAY_SIZE(xt->regs))

                xt->regs[addr] = value;

            break;

    }

    timer_update_irq(t);

}

FUNC_0(void *VAR_0, hwaddr VAR_1,

            uint64_t VAR_2, unsigned int VAR_3)

{

    struct timerblock *VAR_4 = VAR_0;

    struct xlx_timer *VAR_5;

    unsigned int VAR_6;

    uint32_t value = VAR_2;



    VAR_1 >>= 2;

    VAR_6 = timer_from_addr(VAR_1);

    VAR_5 = &VAR_4->timers[VAR_6];

    D(fprintf(stderr, "%s VAR_1=%x val=%x (VAR_6=%d off=%d)\n",

             __func__, VAR_1 * 4, value, VAR_6, VAR_1 & 3));

    

    VAR_1 &= 3;

    switch (VAR_1) 

    {

        case R_TCSR:

            if (value & TCSR_TINT)

                value &= ~TCSR_TINT;



            VAR_5->regs[VAR_1] = value;

            if (value & TCSR_ENT)

                timer_enable(VAR_5);

            break;

 

        default:

            if (VAR_1 < ARRAY_SIZE(VAR_5->regs))

                VAR_5->regs[VAR_1] = value;

            break;

    }

    timer_update_irq(VAR_4);

}

FUNC_0(void *VAR_0, hwaddr VAR_1,
uint64_t VAR_2, unsigned int VAR_3)
{ struct timerblock *VAR_4 = VAR_0; struct xlx_timer *VAR_5; unsigned int VAR_6; uint32_t value = VAR_2; VAR_1 >>= 2; VAR_6 = timer_from_addr(VAR_1); VAR_5 = &VAR_4->timers[VAR_6]; D(fprintf(stderr, "%s VAR_1=%x val=%x (VAR_6=%d off=%d)\n",
__func__, VAR_1 * 4, value, VAR_6, VAR_1 & 3)); VAR_1 &= 3; switch (VAR_1)
{ case R_TCSR:
if (value & TCSR_TINT)
value &= ~TCSR_TINT; VAR_5->regs[VAR_1] = value; if (value & TCSR_ENT)
timer_enable(VAR_5); break; default:
if (VAR_1 < ARRAY_SIZE(VAR_5->regs))
VAR_5->regs[VAR_1] = value; break; } timer_update_irq(VAR_4); }