Lines Matching refs:timeridx
2531 static CPAccessResult gt_counter_access(CPUARMState *env, int timeridx, in gt_counter_access() argument
2542 return (extract32(env->cp15.cnthctl_el2, timeridx, 1) in gt_counter_access()
2547 if (!extract32(env->cp15.c14_cntkctl, timeridx, 1)) { in gt_counter_access()
2553 if (has_el2 && timeridx == GTIMER_PHYS && in gt_counter_access()
2559 if (has_el2 && timeridx == GTIMER_VIRT) { in gt_counter_access()
2569 static CPAccessResult gt_timer_access(CPUARMState *env, int timeridx, in gt_timer_access() argument
2580 return (extract32(env->cp15.cnthctl_el2, 9 - timeridx, 1) in gt_timer_access()
2588 if (!extract32(env->cp15.c14_cntkctl, 9 - timeridx, 1)) { in gt_timer_access()
2594 if (has_el2 && timeridx == GTIMER_PHYS) { in gt_timer_access()
2607 if (has_el2 && timeridx == GTIMER_VIRT) { in gt_timer_access()
2678 static void gt_update_irq(ARMCPU *cpu, int timeridx) in gt_update_irq() argument
2684 int irqstate = (env->cp15.c14_timer[timeridx].ctl & 6) == 4; in gt_update_irq()
2691 ((timeridx == GTIMER_VIRT && (cnthctl & R_CNTHCTL_CNTVMASK_MASK)) || in gt_update_irq()
2692 (timeridx == GTIMER_PHYS && (cnthctl & R_CNTHCTL_CNTPMASK_MASK)))) { in gt_update_irq()
2696 qemu_set_irq(cpu->gt_timer_outputs[timeridx], irqstate); in gt_update_irq()
2697 trace_arm_gt_update_irq(timeridx, irqstate); in gt_update_irq()
2730 static void gt_recalc_timer(ARMCPU *cpu, int timeridx) in gt_recalc_timer() argument
2732 ARMGenericTimer *gt = &cpu->env.cp15.c14_timer[timeridx]; in gt_recalc_timer()
2739 uint64_t offset = timeridx == GTIMER_VIRT ? in gt_recalc_timer()
2779 timer_mod_ns(cpu->gt_timer[timeridx], INT64_MAX); in gt_recalc_timer()
2781 timer_mod(cpu->gt_timer[timeridx], nexttick); in gt_recalc_timer()
2783 trace_arm_gt_recalc(timeridx, nexttick); in gt_recalc_timer()
2787 timer_del(cpu->gt_timer[timeridx]); in gt_recalc_timer()
2788 trace_arm_gt_recalc_disabled(timeridx); in gt_recalc_timer()
2790 gt_update_irq(cpu, timeridx); in gt_recalc_timer()
2794 int timeridx) in gt_timer_reset() argument
2798 timer_del(cpu->gt_timer[timeridx]); in gt_timer_reset()
2834 int timeridx, in gt_cval_write() argument
2837 trace_arm_gt_cval_write(timeridx, value); in gt_cval_write()
2838 env->cp15.c14_timer[timeridx].cval = value; in gt_cval_write()
2839 gt_recalc_timer(env_archcpu(env), timeridx); in gt_cval_write()
2843 int timeridx) in gt_tval_read() argument
2847 switch (timeridx) { in gt_tval_read()
2857 return (uint32_t)(env->cp15.c14_timer[timeridx].cval - in gt_tval_read()
2862 int timeridx, in gt_tval_write() argument
2867 switch (timeridx) { in gt_tval_write()
2877 trace_arm_gt_tval_write(timeridx, value); in gt_tval_write()
2878 env->cp15.c14_timer[timeridx].cval = gt_get_countervalue(env) - offset + in gt_tval_write()
2880 gt_recalc_timer(env_archcpu(env), timeridx); in gt_tval_write()
2884 int timeridx, in gt_ctl_write() argument
2888 uint32_t oldval = env->cp15.c14_timer[timeridx].ctl; in gt_ctl_write()
2890 trace_arm_gt_ctl_write(timeridx, value); in gt_ctl_write()
2891 env->cp15.c14_timer[timeridx].ctl = deposit64(oldval, 0, 2, value); in gt_ctl_write()
2894 gt_recalc_timer(cpu, timeridx); in gt_ctl_write()
2900 trace_arm_gt_imask_toggle(timeridx); in gt_ctl_write()
2901 gt_update_irq(cpu, timeridx); in gt_ctl_write()
2960 int timeridx = gt_phys_redir_timeridx(env); in gt_phys_redir_cval_read() local
2961 return env->cp15.c14_timer[timeridx].cval; in gt_phys_redir_cval_read()
2967 int timeridx = gt_phys_redir_timeridx(env); in gt_phys_redir_cval_write() local
2968 gt_cval_write(env, ri, timeridx, value); in gt_phys_redir_cval_write()
2974 int timeridx = gt_phys_redir_timeridx(env); in gt_phys_redir_tval_read() local
2975 return gt_tval_read(env, ri, timeridx); in gt_phys_redir_tval_read()
2981 int timeridx = gt_phys_redir_timeridx(env); in gt_phys_redir_tval_write() local
2982 gt_tval_write(env, ri, timeridx, value); in gt_phys_redir_tval_write()
2988 int timeridx = gt_phys_redir_timeridx(env); in gt_phys_redir_ctl_read() local
2989 return env->cp15.c14_timer[timeridx].ctl; in gt_phys_redir_ctl_read()
2995 int timeridx = gt_phys_redir_timeridx(env); in gt_phys_redir_ctl_write() local
2996 gt_ctl_write(env, ri, timeridx, value); in gt_phys_redir_ctl_write()
3083 int timeridx = gt_virt_redir_timeridx(env); in gt_virt_redir_cval_read() local
3084 return env->cp15.c14_timer[timeridx].cval; in gt_virt_redir_cval_read()
3090 int timeridx = gt_virt_redir_timeridx(env); in gt_virt_redir_cval_write() local
3091 gt_cval_write(env, ri, timeridx, value); in gt_virt_redir_cval_write()
3097 int timeridx = gt_virt_redir_timeridx(env); in gt_virt_redir_tval_read() local
3098 return gt_tval_read(env, ri, timeridx); in gt_virt_redir_tval_read()
3104 int timeridx = gt_virt_redir_timeridx(env); in gt_virt_redir_tval_write() local
3105 gt_tval_write(env, ri, timeridx, value); in gt_virt_redir_tval_write()
3111 int timeridx = gt_virt_redir_timeridx(env); in gt_virt_redir_ctl_read() local
3112 return env->cp15.c14_timer[timeridx].ctl; in gt_virt_redir_ctl_read()
3118 int timeridx = gt_virt_redir_timeridx(env); in gt_virt_redir_ctl_write() local
3119 gt_ctl_write(env, ri, timeridx, value); in gt_virt_redir_ctl_write()