| /openbmc/qemu/hw/rtc/ |
| H A D | rs5c372.c | 48 struct tm now; in capture_current_time() local 49 qemu_get_timedate(&now, s->offset); in capture_current_time() 50 s->nvram[0] = to_bcd(now.tm_sec); in capture_current_time() 51 s->nvram[1] = to_bcd(now.tm_min); in capture_current_time() 53 s->nvram[2] = to_bcd(now.tm_hour); in capture_current_time() 55 int tmp = now.tm_hour; in capture_current_time() 65 s->nvram[3] = (now.tm_wday + s->wday_offset) % 7 + 1; in capture_current_time() 66 s->nvram[4] = to_bcd(now.tm_mday); in capture_current_time() 67 s->nvram[5] = to_bcd(now.tm_mon + 1); in capture_current_time() 68 s->nvram[6] = to_bcd(now.tm_year - 100); in capture_current_time() [all …]
|
| 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() 82 s->nvram[3] = (now.tm_wday + s->wday_offset) % 7 + 1; 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() [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()
|
| /openbmc/u-boot/arch/arm/mach-omap2/ |
| H A D | timer.c | 59 unsigned long now, last = readl(&timer_base->tcrr); in __udelay() local 62 now = readl(&timer_base->tcrr); in __udelay() 63 if (last > now) /* count up timer overflow */ in __udelay() 64 tmo -= TIMER_OVERFLOW_VAL - last + now + 1; in __udelay() 66 tmo -= now - last; in __udelay() 67 last = now; in __udelay() 74 ulong now = readl(&timer_base->tcrr) / (TIMER_CLOCK / CONFIG_SYS_HZ); in get_timer_masked() local 76 if (now >= gd->arch.lastinc) { /* normal mode (non roll) */ in get_timer_masked() 78 gd->arch.tbl += (now - gd->arch.lastinc); in get_timer_masked() 81 CONFIG_SYS_HZ)) - gd->arch.lastinc) + now; in get_timer_masked() [all …]
|
| /openbmc/u-boot/arch/nds32/cpu/n1213/ag101/ |
| H A D | timer.c | 96 ulong now = readl(&tmr->timer3_counter) / (TIMER_CLOCK / CONFIG_SYS_HZ); in get_timer_masked() local 98 ulong now = readl(&tmr->timer3_counter) / in get_timer_masked() local 102 debug("%s(): now = %lx, lastdec = %lx\n", __func__, now, lastdec); in get_timer_masked() 104 if (lastdec >= now) { in get_timer_masked() 109 timestamp += lastdec - now; in get_timer_masked() 120 timestamp += lastdec + TIMER_LOAD_VAL - now; in get_timer_masked() 123 lastdec = now; in get_timer_masked() 155 unsigned long now, last = readl(&tmr->timer3_counter); in __udelay() local 159 now = readl(&tmr->timer3_counter); in __udelay() 160 if (now > last) /* count down timer overflow */ in __udelay() [all …]
|
| /openbmc/u-boot/arch/arm/cpu/armv7/sunxi/ |
| H A D | timer.c | 61 ulong now = TICKS_TO_HZ(read_timer()); in get_timer_masked() local 63 if (now >= gd->arch.lastinc) /* normal (non rollover) */ in get_timer_masked() 64 gd->arch.tbl += (now - gd->arch.lastinc); in get_timer_masked() 68 - gd->arch.lastinc) + now; in get_timer_masked() 70 gd->arch.lastinc = now; in get_timer_masked() 84 ulong now, last = read_timer(); in __udelay() local 87 now = read_timer(); in __udelay() 88 if (now > last) /* normal (non rollover) */ in __udelay() 89 tmo -= now - last; in __udelay() 91 tmo -= TIMER_LOAD_VAL - last + now; in __udelay() [all …]
|
| /openbmc/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()
|
| /openbmc/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() 62 && timer_expired(gictimer->vptimers[i].qtimer, now)) { in mips_gictimer_get_sh_count() 64 gic_vptimer_expire(gictimer, i, now); in mips_gictimer_get_sh_count() 67 return gictimer->sh_counterlo + (uint32_t)(now / TIMER_PERIOD); in mips_gictimer_get_sh_count() [all …]
|
| /openbmc/u-boot/board/armltd/integrator/ |
| H A D | timer.c | 102 unsigned long long now = READ_TIMER; in get_timer_masked() local 104 if(now > lastdec) { in get_timer_masked() 106 total_count += lastdec + TIMER_LOAD_VAL + 1 - now; in get_timer_masked() 108 total_count += lastdec - now; in get_timer_masked() 110 lastdec = now; in get_timer_masked() 113 now = total_count; in get_timer_masked() 114 do_div(now, div_timer); in get_timer_masked() 115 timestamp = now; in get_timer_masked()
|
| /openbmc/dbus-sensors/src/external/ |
| H A D | ExternalSensor.cpp | 32 objServer(objectServer), writeLast(std::chrono::steady_clock::now()), in ExternalSensor() 83 std::function<void(std::chrono::steady_clock::time_point now)>&& in initWriteHook() 128 const std::chrono::steady_clock::time_point& now) const in isAliveAndFresh() 136 // If age, as of now, is less than timeout, it is deemed fresh in writeBegin() argument 138 return (ageElapsed(now) < writeTimeout); in writeBegin() 142 const std::chrono::steady_clock::time_point& now) in writeBegin() 151 writeLast = now; in writeInvalidate() 173 const std::chrono::steady_clock::time_point& now) const in ageRemaining() 176 return (now - writeLast); in ageRemaining() 180 const std::chrono::steady_clock::time_point& now) cons 190 auto now = std::chrono::steady_clock::now(); externalSetTrigger() local [all...] |
| H A D | ExternalSensor.hpp | 33 std::function<void(std::chrono::steady_clock::time_point now)>&& 41 const std::chrono::steady_clock::time_point& now) const; 44 void writeBegin(const std::chrono::steady_clock::time_point& now); 51 const std::chrono::steady_clock::time_point& now) const; 55 const std::chrono::steady_clock::time_point& now) const; 64 std::function<void(const std::chrono::steady_clock::time_point& now)>
|
| /openbmc/qemu/hw/misc/ |
| H A D | mps2-fpgaio.c | 42 static uint32_t counter_from_tickoff(int64_t now, int64_t tick_offset, int frq) in counter_from_tickoff() argument 44 return muldiv64(now - tick_offset, frq, NANOSECONDS_PER_SECOND); in counter_from_tickoff() 47 static int64_t tickoff_from_counter(int64_t now, uint32_t count, int frq) in tickoff_from_counter() argument 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() 153 r = counter_from_tickoff(now, s->clk1hz_tick_offset, 1); in mps2_fpgaio_read() 156 now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); in mps2_fpgaio_read() [all …]
|
| /openbmc/u-boot/drivers/rtc/ |
| H A D | ftrtc010.c | 77 unsigned long now; in rtc_get() local 83 now = (ftrtc010_time() + readl(&rtc->record)) / RTC_DIV_COUNT; in rtc_get() 85 now = ftrtc010_time() + readl(&rtc->record); in rtc_get() 88 rtc_to_tm(now, tmp); in rtc_get() 99 unsigned long now; in rtc_set() local 108 now = ftrtc010_time(); in rtc_set() 110 debug("%s(): write %lx to record register\n", __func__, new - now); in rtc_set() 112 writel(new - now, &rtc->record); in rtc_set()
|
| H A D | i2c_rtc_emul.c | 78 struct rtc_time now; in reset_time() local 80 os_localtime(&now); in reset_time() 81 plat->base_time = rtc_mktime(&now); in reset_time() 90 long now; in sandbox_i2c_rtc_get() local 94 now = rtc_mktime(&tm_now); in sandbox_i2c_rtc_get() 96 now = plat->base_time; in sandbox_i2c_rtc_get() 99 rtc_to_tm(now + plat->offset, time); in sandbox_i2c_rtc_get() 108 long now; in sandbox_i2c_rtc_set() local 112 now = rtc_mktime(&tm_now); in sandbox_i2c_rtc_set() 114 now = plat->base_time; in sandbox_i2c_rtc_set() [all …]
|
| /openbmc/u-boot/arch/arm/mach-at91/arm920t/ |
| H A D | timer.c | 59 u32 now; in get_timer_raw() local 61 now = readl(&tc->tc[0].cv) & 0x0000ffff; in get_timer_raw() 63 if (now >= gd->arch.lastinc) { in get_timer_raw() 65 gd->arch.tbl += now - gd->arch.lastinc; in get_timer_raw() 68 gd->arch.tbl += now + TIMER_LOAD_VAL - gd->arch.lastinc; in get_timer_raw() 70 gd->arch.lastinc = now; in get_timer_raw() 98 u32 now = get_timer_raw(); in __udelay() local 99 diff = endtime - now; in __udelay()
|
| /openbmc/u-boot/drivers/watchdog/ |
| H A D | tangier_wdt.c | 31 unsigned long now; in hw_watchdog_reset() local 34 now = timer_get_us(); in hw_watchdog_reset() 36 now = rdtsc() / 1000; in hw_watchdog_reset() 39 if (last > now) in hw_watchdog_reset() 42 if (unlikely((now - last) > (WDT_PRETIMEOUT / 2) * 1000000)) { in hw_watchdog_reset() 43 last = now; in hw_watchdog_reset()
|
| /openbmc/qemu/util/ |
| H A D | timed-average.c | 59 static void update_expiration(TimedAverageWindow *w, int64_t now, in update_expiration() argument 63 int64_t elapsed = (now - w->expiration) % period; in update_expiration() 67 w->expiration = now + remaining; in update_expiration() 102 int64_t now = qemu_clock_get_ns(clock_type); in timed_average_init() local 117 ta->windows[0].expiration = now + ta->period / 2; in timed_average_init() 118 ta->windows[1].expiration = now + ta->period; in timed_average_init() 130 int64_t now = qemu_clock_get_ns(ta->clock_type); in check_expirations() local 138 if (w->expiration <= now) { in check_expirations() 140 update_expiration(w, now, ta->period); in check_expirations() 153 int64_t remaining = ta->windows[ta->current].expiration - now; in check_expirations()
|
| /openbmc/telemetry/tests/src/fakes/ |
| H A D | clock_fake.hpp | 17 return ClockFake::toTimestamp(now); in timestamp() 22 now += delta; in advance() 27 now = time_point{timeSinceEpoch}; in set() 32 now = time_point{Milliseconds{0u}}; in reset() 36 time_point now = clock::now(); member
|
| /openbmc/openbmc/poky/meta/recipes-devtools/dosfstools/dosfstools/ |
| H A D | source-date-epoch.patch | 38 time_t now; 48 - now = time(NULL); 49 - mtime = (now != (time_t)-1) ? localtime(&now) : NULL; 56 + now = conversion; 58 + || errno != 0 || (long long)now != conversion) { 62 + mtime = gmtime(&now); 64 + now = time(NULL); 65 + mtime = (now != (time_t)-1) ? localtime(&now) : NULL; 86 struct timeval now; 88 - if (gettimeofday(&now, NULL) != 0 || now.tv_sec == (time_t)-1 || now.tv_sec < 0) { [all …]
|
| /openbmc/u-boot/arch/arm/cpu/arm926ejs/mxs/ |
| H A D | timer.c | 84 uint32_t now; in get_ticks() local 89 now = readl(&timrot_regs->hw_timrot_timcount0) >> in get_ticks() 92 now = readl(&timrot_regs->hw_timrot_running_count0); in get_ticks() 97 if (lastdec >= now) { in get_ticks() 102 timestamp += (lastdec - now); in get_ticks() 105 timestamp += (TIMER_LOAD_VAL - now) + lastdec; in get_ticks() 108 lastdec = now; in get_ticks()
|
| /openbmc/openbmc/poky/bitbake/lib/toaster/tests/browser/ |
| H A D | test_builddashboard_page_artifacts.py | 58 now = timezone.now() 60 started_on=now, completed_on=now, outcome=Build.SUCCEEDED) 83 now = timezone.now() 85 started_on=now, completed_on=timezone.now(), 139 now = timezone.now() 141 started_on=now, completed_on=timezone.now(),
|
| /openbmc/u-boot/arch/m68k/lib/ |
| H A D | time.c | 36 uint start, now, tmp; in __udelay() local 53 start = now = timerp->tcn; in __udelay() 54 while (now < start + tmp) in __udelay() 55 now = timerp->tcn; in __udelay() 156 unsigned short now, diff; in get_timer() local 159 now = timerp->pcntr; in get_timer() 160 diff = -(now - lastinc); in get_timer() 163 lastinc = now; in get_timer()
|
| /openbmc/libpldm/src/transport/ |
| H A D | transport.c | 136 struct timespec now; in clock_gettimeval() local 139 rc = libpldm_clock_gettime(clockid, &now); in clock_gettimeval() 144 timespec_to_timeval(&now, tv); in clock_gettimeval() 167 struct timeval now; in pldm_transport_send_recv_msg() local 202 ret = clock_gettimeval(CLOCK_MONOTONIC, &now); in pldm_transport_send_recv_msg() 207 timeradd(&now, &max_response_interval, &end); in pldm_transport_send_recv_msg() 209 while (timercmp(&now, &end, <)) { in pldm_transport_send_recv_msg() 212 timersub(&end, &now, &remaining); in pldm_transport_send_recv_msg() 225 ret = clock_gettimeval(CLOCK_MONOTONIC, &now); in pldm_transport_send_recv_msg()
|
| /openbmc/sdbusplus/test/event/ |
| H A D | event.cpp | 19 auto start = std::chrono::steady_clock::now(); in TEST_F() 21 auto stop = std::chrono::steady_clock::now(); in TEST_F() 33 auto start = std::chrono::steady_clock::now(); in TEST_F() 35 auto stop = std::chrono::steady_clock::now(); in TEST_F() 74 auto start = std::chrono::steady_clock::now(); in TEST_F() 77 auto stop = std::chrono::steady_clock::now(); in TEST_F()
|