static void booke_update_fixed_timer(CPUPPCState         *env,

                                     uint8_t           target_bit,

                                     uint64_t          *next,

                                     struct QEMUTimer *timer)

{

    ppc_tb_t *tb_env = env->tb_env;

    uint64_t lapse;

    uint64_t tb;

    uint64_t period = 1 << (target_bit + 1);

    uint64_t now;



    now = qemu_get_clock_ns(vm_clock);

    tb  = cpu_ppc_get_tb(tb_env, now, tb_env->tb_offset);



    lapse = period - ((tb - (1 << target_bit)) & (period - 1));



    *next = now + muldiv64(lapse, get_ticks_per_sec(), tb_env->tb_freq);



    /* XXX: If expire time is now. We can't run the callback because we don't

     * have access to it. So we just set the timer one nanosecond later.

     */



    if (*next == now) {

        (*next)++;

    }



    qemu_mod_timer(timer, *next);

}

static void booke_update_fixed_timer(CPUPPCState         *env,

                                     uint8_t           target_bit,

                                     uint64_t          *next,

                                     struct QEMUTimer *timer)

{

    ppc_tb_t *tb_env = env->tb_env;

    uint64_t lapse;

    uint64_t tb;

    uint64_t period = 1 << (target_bit + 1);

    uint64_t now;



    now = qemu_get_clock_ns(vm_clock);

    tb  = cpu_ppc_get_tb(tb_env, now, tb_env->tb_offset);



    lapse = period - ((tb - (1 << target_bit)) & (period - 1));



    *next = now + muldiv64(lapse, get_ticks_per_sec(), tb_env->tb_freq);



    







    if (*next == now) {

        (*next)++;

    }



    qemu_mod_timer(timer, *next);

}

    uint64_t lapse;     uint64_t period = 1 << (target_bit + 1);     lapse = period - ((tb - (1 << target_bit)) & (period - 1));     *next = now + muldiv64(lapse, get_ticks_per_sec(), tb_env->tb_freq);
static void FUNC_0(CPUPPCState         *VAR_0,

                                     uint8_t           VAR_1,

                                     uint64_t          *VAR_2,

                                     struct QEMUTimer *VAR_3)

{

    ppc_tb_t *tb_env = VAR_0->tb_env;

    uint64_t lapse;

    uint64_t tb;

    uint64_t period = 1 << (VAR_1 + 1);

    uint64_t now;



    now = qemu_get_clock_ns(vm_clock);

    tb  = cpu_ppc_get_tb(tb_env, now, tb_env->tb_offset);



    lapse = period - ((tb - (1 << VAR_1)) & (period - 1));



    *VAR_2 = now + muldiv64(lapse, get_ticks_per_sec(), tb_env->tb_freq);



    







    if (*VAR_2 == now) {

        (*VAR_2)++;

    }



    qemu_mod_timer(VAR_3, *VAR_2);

}

static void FUNC_0(CPUPPCState         *VAR_0,
uint8_t           VAR_1,
uint64_t          *VAR_2,
struct QEMUTimer *VAR_3)
{ ppc_tb_t *tb_env = VAR_0->tb_env; uint64_t lapse; uint64_t tb; uint64_t period = 1 << (VAR_1 + 1); uint64_t now; now = qemu_get_clock_ns(vm_clock); tb  = cpu_ppc_get_tb(tb_env, now, tb_env->tb_offset); lapse = period - ((tb - (1 << VAR_1)) & (period - 1)); *VAR_2 = now + muldiv64(lapse, get_ticks_per_sec(), tb_env->tb_freq); if (*VAR_2 == now) { (*VAR_2)++; } qemu_mod_timer(VAR_3, *VAR_2); }