/qemu/hw/rtc/ |
H A D | ds1338.c | 65 struct tm now; in capture_current_time() local 66 qemu_get_timedate(&now, s->offset); in capture_current_time() 67 s->nvram[0] = to_bcd(now.tm_sec); in capture_current_time() 68 s->nvram[1] = to_bcd(now.tm_min); in capture_current_time() 70 int tmp = now.tm_hour; in capture_current_time() 80 s->nvram[2] = to_bcd(now.tm_hour); in capture_current_time() 83 s->nvram[4] = to_bcd(now.tm_mday); in capture_current_time() 84 s->nvram[5] = to_bcd(now.tm_mon + 1); in capture_current_time() 85 s->nvram[6] = to_bcd(now.tm_year - 100); in capture_current_time() 144 struct tm now; in ds1338_send() local [all …]
|
H A D | m41t80.c | 49 struct tm now; in m41t80_recv() local 56 qemu_get_timedate(&now, -1); in m41t80_recv() 63 return to_bcd(now.tm_sec); in m41t80_recv() 65 return to_bcd(now.tm_min); in m41t80_recv() 67 return to_bcd(now.tm_hour); in m41t80_recv() 69 return to_bcd(now.tm_wday); in m41t80_recv() 71 return to_bcd(now.tm_mday); in m41t80_recv() 73 return to_bcd(now.tm_mon + 1); in m41t80_recv() 75 return to_bcd(now.tm_year % 100); in m41t80_recv()
|
H A D | aspeed_rtc.c | 50 struct tm now; in aspeed_rtc_get_counter() local 52 qemu_get_timedate(&now, rtc->offset); in aspeed_rtc_get_counter() 56 return (now.tm_mday << 24) | (now.tm_hour << 16) | in aspeed_rtc_get_counter() 57 (now.tm_min << 8) | now.tm_sec; in aspeed_rtc_get_counter() 59 cent = (now.tm_year + 1900) / 100; in aspeed_rtc_get_counter() 60 year = now.tm_year % 100; in aspeed_rtc_get_counter() 62 ((now.tm_mon + 1) & 0xf); in aspeed_rtc_get_counter()
|
H A D | allwinner-rtc.c | 273 struct tm now; in allwinner_rtc_reset() local 279 qemu_get_timedate(&now, 0); in allwinner_rtc_reset() 283 s->regs[REG_YYMMDD] = ((now.tm_year + 1900 - s->base_year) << 16) | in allwinner_rtc_reset() 284 ((now.tm_mon + 1) << 8) | in allwinner_rtc_reset() 285 now.tm_mday; in allwinner_rtc_reset() 286 s->regs[REG_HHMMSS] = (((now.tm_wday + 6) % 7) << 29) | in allwinner_rtc_reset() 287 (now.tm_hour << 16) | in allwinner_rtc_reset() 288 (now.tm_min << 8) | in allwinner_rtc_reset() 289 now.tm_sec; in allwinner_rtc_reset()
|
H A D | xlnx-zynqmp-rtc.c | 59 int64_t now = qemu_clock_get_ns(rtc_clock); in rtc_get_count() local 60 return s->tick_offset + now / NANOSECONDS_PER_SECOND; in rtc_get_count() 219 int64_t now = qemu_clock_get_ns(rtc_clock) / NANOSECONDS_PER_SECOND; in rtc_pre_save() local 222 s->tick_offset = s->tick_offset + now; in rtc_pre_save() 230 int64_t now = qemu_clock_get_ns(rtc_clock) / NANOSECONDS_PER_SECOND; in rtc_post_load() local 236 s->tick_offset = s->tick_offset - now; in rtc_post_load()
|
/qemu/hw/timer/ |
H A D | mips_gictimer.c | 21 uint32_t vp_index, uint64_t now) in gic_vptimer_update() argument 27 (uint32_t)(now / TIMER_PERIOD); in gic_vptimer_update() 28 next = now + (uint64_t)wait * TIMER_PERIOD; in gic_vptimer_update() 34 uint64_t now) in gic_vptimer_expire() argument 41 gic_vptimer_update(gictimer, vp_index, now); in gic_vptimer_expire() 58 uint64_t now; in mips_gictimer_get_sh_count() local 59 now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in mips_gictimer_get_sh_count() 64 gic_vptimer_expire(gictimer, i, now); in mips_gictimer_get_sh_count() 74 uint64_t now; in mips_gictimer_store_sh_count() local 80 now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in mips_gictimer_store_sh_count() [all …]
|
H A D | nrf51_timer.c | 58 static void rearm_timer(NRF51TimerState *s, int64_t now) in rearm_timer() argument 83 timer_mod_ns(&s->timer, now + min_ns); in rearm_timer() 101 int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in timer_expire() local 116 ticks = update_counter(s, now); in timer_expire() 123 s->timer_start_ns = now; in timer_expire() 138 rearm_timer(s, now); in timer_expire() 203 uint64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in nrf51_timer_write() local 214 rearm_timer(s, now); in nrf51_timer_write() 232 s->timer_start_ns = now; in nrf51_timer_write() 236 rearm_timer(s, now); in nrf51_timer_write() [all …]
|
H A D | sse-counter.c | 140 uint64_t sse_counter_for_timestamp(SSECounter *s, uint64_t now) in sse_counter_for_timestamp() argument 150 ticks = clock_ns_to_ticks(s->clk, now - s->ns_then); in sse_counter_for_timestamp() 180 uint64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in sse_write_cntcv() local 181 uint64_t cntcv = sse_counter_for_timestamp(s, now); in sse_write_cntcv() 185 s->ns_then = now; in sse_write_cntcv() 272 s->ticks_then = sse_counter_for_timestamp(s, now); in sse_counter_control_write() 273 s->ns_then = now; in sse_counter_control_write() 391 uint64_t now; in sse_clk_callback() local 401 now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in sse_clk_callback() 402 s->ticks_then = sse_counter_for_timestamp(s, now); in sse_clk_callback() [all …]
|
H A D | sifive_pwm.c | 149 uint64_t now = sifive_pwm_ns_to_ticks(s, in sifive_pwm_interrupt() local 168 s->tick_offset = now; in sifive_pwm_interrupt() 189 s->tick_offset = (now - s->tick_offset) & PWMCOUNT_MASK; in sifive_pwm_interrupt() 226 uint64_t now = sifive_pwm_ns_to_ticks(s, in sifive_pwm_read() local 238 cur_time = now - cur_time; in sifive_pwm_read() 251 cur_time = now - cur_time; in sifive_pwm_read() 278 uint64_t now = sifive_pwm_ns_to_ticks(s, in sifive_pwm_write() local 338 new_offset = now - new_offset; in sifive_pwm_write() 348 new_offset = now - new_offset; in sifive_pwm_write() 377 uint64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in sifive_pwm_reset() local [all …]
|
H A D | stm32f2xx_timer.c | 45 static void stm32f2xx_timer_set_alarm(STM32F2XXTimerState *s, int64_t now); 74 static void stm32f2xx_timer_set_alarm(STM32F2XXTimerState *s, int64_t now) in stm32f2xx_timer_set_alarm() argument 85 now_ticks = stm32f2xx_ns_to_ticks(s, now); in stm32f2xx_timer_set_alarm() 100 int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in stm32f2xx_timer_reset() local 121 s->tick_offset = stm32f2xx_ns_to_ticks(s, now); in stm32f2xx_timer_reset() 184 int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in stm32f2xx_timer_write() local 223 timer_val = stm32f2xx_ns_to_ticks(s, now) - s->tick_offset; in stm32f2xx_timer_write() 231 stm32f2xx_timer_set_alarm(s, now); in stm32f2xx_timer_write() 263 s->tick_offset = stm32f2xx_ns_to_ticks(s, now) - timer_val; in stm32f2xx_timer_write() 264 stm32f2xx_timer_set_alarm(s, now); in stm32f2xx_timer_write()
|
H A D | ibex_timer.c | 66 uint64_t now = cpu_riscv_read_rtc(s->timebase_freq); in ibex_timer_update_irqs() local 76 if (s->mtimecmp <= now) { in ibex_timer_update_irqs() 92 diff = s->mtimecmp - now; in ibex_timer_update_irqs() 139 uint64_t now = cpu_riscv_read_rtc(s->timebase_freq); in ibex_timer_read() local 154 retvalue = now; in ibex_timer_read() 157 retvalue = now >> 32; in ibex_timer_read()
|
H A D | bcm2835_systmr.c | 77 uint64_t now; in bcm2835_systmr_write() local 93 now = qemu_clock_get_us(QEMU_CLOCK_VIRTUAL); in bcm2835_systmr_write() 95 triggers_delay_us = value - now; in bcm2835_systmr_write() 97 timer_mod(&s->tmr[index].timer, now + triggers_delay_us); in bcm2835_systmr_write()
|
H A D | npcm7xx_timer.c | 83 int64_t now; in npcm7xx_timer_start() local 85 now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in npcm7xx_timer_start() 86 t->expires_ns = now + t->remaining_ns; in npcm7xx_timer_start() 93 int64_t now; in npcm7xx_timer_pause() local 96 now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in npcm7xx_timer_pause() 97 t->remaining_ns = t->expires_ns - now; in npcm7xx_timer_pause() 251 int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in npcm7xx_timer_read_tdr() local 253 return npcm7xx_timer_ns_to_count(t, t->base_timer.expires_ns - now); in npcm7xx_timer_read_tdr()
|
/qemu/hw/misc/ |
H A D | mps2-fpgaio.c | 49 return now - muldiv64(count, NANOSECONDS_PER_SECOND, frq); in tickoff_from_counter() 59 int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in resync_counter() local 60 int64_t elapsed = now - s->pscntr_sync_ticks; in resync_counter() 127 int64_t now; in mps2_fpgaio_read() local 152 now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in mps2_fpgaio_read() 156 now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in mps2_fpgaio_read() 190 int64_t now; in mps2_fpgaio_write() local 227 now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in mps2_fpgaio_write() 231 now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in mps2_fpgaio_write() 259 int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in mps2_fpgaio_reset() local [all …]
|
/qemu/target/loongarch/tcg/ |
H A D | constant_timer.c | 25 uint64_t now, expire; in cpu_loongarch_get_constant_timer_ticks() local 27 now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in cpu_loongarch_get_constant_timer_ticks() 30 return (expire - now) / TIMER_PERIOD; in cpu_loongarch_get_constant_timer_ticks() 37 uint64_t now, next; in cpu_loongarch_store_constant_timer_config() local 41 now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in cpu_loongarch_store_constant_timer_config() 42 next = now + (value & CONSTANT_TIMER_TICK_MASK) * TIMER_PERIOD; in cpu_loongarch_store_constant_timer_config() 53 uint64_t now, next; in loongarch_constant_timer_cb() local 56 now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in loongarch_constant_timer_cb() 57 next = now + (env->CSR_TCFG & CONSTANT_TIMER_TICK_MASK) * TIMER_PERIOD; in loongarch_constant_timer_cb()
|
/qemu/util/ |
H A D | timed-average.c | 57 static void update_expiration(TimedAverageWindow *w, int64_t now, in update_expiration() argument 61 int64_t elapsed = (now - w->expiration) % period; in update_expiration() 65 w->expiration = now + remaining; in update_expiration() 100 int64_t now = qemu_clock_get_ns(clock_type); in timed_average_init() local 115 ta->windows[0].expiration = now + ta->period / 2; in timed_average_init() 116 ta->windows[1].expiration = now + ta->period; in timed_average_init() 128 int64_t now = qemu_clock_get_ns(ta->clock_type); in check_expirations() local 136 if (w->expiration <= now) { in check_expirations() 138 update_expiration(w, now, ta->period); in check_expirations() 151 int64_t remaining = ta->windows[ta->current].expiration - now; in check_expirations()
|
H A D | throttle.c | 59 static void throttle_do_leak(ThrottleState *ts, int64_t now) in throttle_do_leak() argument 62 int64_t delta_ns = now - ts->previous_leak; in throttle_do_leak() 65 ts->previous_leak = now; in throttle_do_leak() 177 int64_t now, in throttle_compute_timer() argument 183 throttle_do_leak(ts, now); in throttle_compute_timer() 190 *next_timestamp = now + wait; in throttle_compute_timer() 195 *next_timestamp = now; in throttle_compute_timer() 436 int64_t now = qemu_clock_get_ns(tt->clock_type); in throttle_schedule_timer() local 447 now, in throttle_schedule_timer()
|
/qemu/hw/openrisc/ |
H A D | cputimer.c | 50 uint64_t now; in cpu_openrisc_count_update() local 55 now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in cpu_openrisc_count_update() 56 or1k_timer->ttcr += (uint32_t)((now - or1k_timer->last_clk) in cpu_openrisc_count_update() 58 or1k_timer->last_clk = now; in cpu_openrisc_count_update() 65 uint64_t now, next; in cpu_openrisc_timer_update() local 72 now = or1k_timer->last_clk; in cpu_openrisc_timer_update() 80 next = now + (uint64_t)wait * TIMER_PERIOD; in cpu_openrisc_timer_update()
|
/qemu/include/qemu/ |
H A D | ratelimit.h | 42 int64_t now = qemu_clock_get_ns(QEMU_CLOCK_REALTIME); in ratelimit_calculate_delay() local 52 if (limit->slice_end_time < now) { in ratelimit_calculate_delay() 55 limit->slice_start_time = now; in ratelimit_calculate_delay() 56 limit->slice_end_time = now + limit->slice_ns; in ratelimit_calculate_delay() 72 return limit->slice_end_time - now; in ratelimit_calculate_delay()
|
/qemu/hw/ppc/ |
H A D | ppc.c | 731 n = ns_to_tb(tb_env->decr_freq, now); in __cpu_ppc_load_decr() 909 int64_t now; in cpu_ppc_store_decr() local 922 now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in cpu_ppc_store_decr() 923 decr = _cpu_ppc_load_decr(env, now); in cpu_ppc_store_decr() 953 int64_t now; in cpu_ppc_store_hdecr() local 956 now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in cpu_ppc_store_hdecr() 957 hdecr = _cpu_ppc_load_hdecr(env, now); in cpu_ppc_store_hdecr() 1188 uint64_t now, next; in cpu_4xx_fit_cb() local 1192 now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in cpu_4xx_fit_cb() 1224 uint64_t now, next; in start_stop_pit() local [all …]
|
H A D | ppc_booke.c | 139 uint64_t now; in booke_update_fixed_timer() local 149 now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in booke_update_fixed_timer() 150 tb = cpu_ppc_get_tb(tb_env, now, tb_env->tb_offset); in booke_update_fixed_timer() 166 *next = now + muldiv64(ticks, NANOSECONDS_PER_SECOND, tb_env->tb_freq); in booke_update_fixed_timer() 167 if ((*next < now) || (*next > INT64_MAX)) { in booke_update_fixed_timer() 176 if (*next == now) { in booke_update_fixed_timer() 183 *next = MAX(*next, now + SCALE_MS); in booke_update_fixed_timer()
|
/qemu/tests/qemu-iotests/ |
H A D | 108.out | 18 Double checking the fixed image now... 42 Double checking the fixed image now... 59 Double checking the fixed image now... 76 Double checking the fixed image now... 92 Double checking the fixed image now... 108 Double checking the fixed image now... 126 Double checking the fixed image now... 148 Double checking the fixed image now... 189 Double checking the fixed image now...
|
/qemu/hw/dma/ |
H A D | i8257.c | 127 r->now[ADDR] = r->base[ADDR] << d->dshift; in i8257_init_chan() 128 r->now[COUNT] = 0; in i8257_init_chan() 154 val = (r->base[COUNT] << d->dshift) - r->now[COUNT]; in i8257_read_chan() 156 val = r->now[ADDR] + r->now[COUNT] * dir; in i8257_read_chan() 340 r->now[COUNT], (r->base[COUNT] + 1) << ncont); in i8257_channel_run() 341 r->now[COUNT] = n; in i8257_channel_run() 406 hwaddr addr = ((r->pageh & 0x7f) << 24) | (r->page << 16) | r->now[ADDR]; in i8257_dma_read_memory() 434 hwaddr addr = ((r->pageh & 0x7f) << 24) | (r->page << 16) | r->now[ADDR]; in i8257_dma_write_memory() 521 VMSTATE_INT32_ARRAY(now, I8257Regs, 2),
|
/qemu/hw/sparc64/ |
H A D | sparc64.c | 232 int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in cpu_tick_set_limit() local 240 if (expires < now) { in cpu_tick_set_limit() 241 expires = now + 1; in cpu_tick_set_limit() 248 now - timer->clock_offset, in cpu_tick_set_limit() 252 expires - now, timer->frequency in cpu_tick_set_limit()
|
/qemu/tests/migration/ |
H A D | stress.c | 150 static unsigned long long now(void) in now() function 181 before = now(); in stressone() 197 after = now(); in stressone() 200 before = now(); in stressone()
|