summaryrefslogtreecommitdiff
path: root/components/libc/compilers/common/ctime.c
AgeCommit message (Collapse)Author
2026-08-21[fix][libc] fix timegm month overflow calculationHui Su
The original overflow logic used __spm[tm_mon] as the current month's length when normalizing tm_mday. This produced incorrect dates after crossing month boundaries and left zero or negative days unnormalized. Use the difference between adjacent cumulative day offsets with leap-year handling. Normalize overflow in tm_sec, tm_min, tm_hour, tm_mday, and tm_mon to keep the affected broken-down fields normalized. Add regression tests for month boundaries, leap years, large offsets, zero and negative days, negative time fields, combined overflow, and boundary carry cases. Close #11686 Signed-off-by: Hui Su <[email protected]>
2026-06-29[dm][ptp] support Precision Time Protocol (PTP) IEEE 1588 clockGuEe-GUI
Signed-off-by: GuEe-GUI <[email protected]>
2026-04-30添加 vdso readtime 更新逻辑rcitach
2026-01-31[components][clock_time] Refactor time subsystem around clock_time (#11111)Bernard Xiong
* [components][clock_time] Refactor time subsystem around clock_time Introduce the clock_time core with clock source/event separation, high-resolution scheduling, and boot-time helpers, plus clock_timer adapters for timer peripherals. Remove legacy ktime/cputime/hwtimer implementations and migrate arch and BSP time paths to the new subsystem while keeping POSIX time integration functional. Update drivers, Kconfig/SConscript wiring, documentation, and tests; add clock_time overview docs and align naming to clock_boottime/clock_hrtimer/clock_timer. * [components][clock_time] Use BSP-provided clock timer frequency on riscv64 * [risc-v] Use runtime clock timer frequency for tick and delays * [bsp] Add clock timer frequency hooks for riscv64 boards * [bsp] Update Renesas RA driver doc clock_timer link * [bsp] Sync zynqmp-r5-axu4ev rtconfig after config refresh * [bsp][rk3500] Update rk3500 clock configuration * [bsp][hpmicro] Add rt_hw_us_delay hook and update board delays * [bsp][stm32l496-st-nucleo] enable clock_time for hwtimer sample in ci * [bsp][hpmicro] Fix rtconfig include scope for hpm6750evk Move rtconfig.h include outside the ENET_MULTIPLE_PORT guard for hpm6750evk and hpm6750evk2 so configuration macros are available regardless of ENET settings. * [bsp][raspi3] select clock time for systimer * [bsp][hpm5300evk] Trim trailing blank line * [bsp][hpm5301evklite] Trim trailing blank line * [bsp][hpm5e00evk] Trim trailing blank line * [bsp][hpm6200evk] Trim trailing blank line * [bsp][hpm6300evk] Trim trailing blank line * [bsp][hpm6750evk] Trim trailing blank line * [bsp][hpm6750evk2] Trim trailing blank line * [bsp][hpm6750evkmini] Trim trailing blank line * [bsp][hpm6800evk] Trim trailing blank line * [bsp][hpm6e00evk] Trim trailing blank line * [bsp][nxp] switch lpc178x to gcc and remove mcx timer source * [bsp][stm32] fix the CONFIG_RT_USING_CLOCK_TIME issue. * [docs][clock_time] add clock time documentation * [docs][clock_time] Update clock time subsystem documentation - Update device driver index to use correct page reference - Clarify upper layer responsibilities in architecture overview - Update README to describe POSIX/libc, Soft RTC, and device driver usage - Refine architecture diagram with improved layout and color scheme - Remove obsolete clock_timer.md file * [kernel][utest] Trim trailing space * [clock_time] Fix hrtimer wrap handling * [clock_time] fix the static rt_inline issue * [clock_time] fix the rt_clock_hrtimer_control result issue
2026-01-17[fix] fix normalization issue of mktime and timegmmilo
2025-10-13compute ns with rt_int64_t instead of int64_t in ctime.cYonggang Luo
2024-12-06[components] When rtc is not enabled, use other clock sources instead (#9747)wycwyhwyq
When rtc is not enabled, use other clock sources instead Signed-off-by: wycwyhwyq <[email protected]>
2024-11-01[libc] modify function names to resolve naming conflictsrcitachi
2024-09-03[libc] 修复 ctime()死机问题yandld
2024-08-12Add RT_USING_RTC conditional compilation protection in ctimer.cZ8MAN8
Analysis: There is still an omission in the preprocessing control of _control_rtc in 24b0a81 ("Add RT_USING_RTC conditional compilation protection in ctimer.c") Solution: Add RT_USING_RTC preprocessing control to missing _control_rtc Signed-off-by: Shicheng Chu <[email protected]>
2024-08-11Add RT_USING_RTC conditional compilation protection in ctimer.cZ8MAN8
Analysis: RT_USING_RTC preprocessing is used in 47cd52d ("修复不 使能 RT_USING_DEVICE 时编译报错") to control the reference of rtdevice.h, as well as the implementation and call of _control_rtc, but there are some omissions. Solution: Add RT_USING_RTC preprocessing control to missing _control_rtc Signed-off-by: Shicheng Chu <[email protected]> Reviewed-by: Chen Wang <[email protected]>
2024-08-04修复不使能 RT_USING_DEVICE 时编译报错 (#9145)马龙伟
* 修复不使能 RT_USING_DEVICE 时编译报错 * 删除 ctime.c 中多余引用
2024-06-23[components][ktime]support period ktime timeout and multiple ktimer_hrtimer ↵zms123456
(#8972) * support period time * enable multiple ktimer * mv set delay_cnt to hrtimer_start * add ktime debug info * change current_irq_begin to local var * fix bug: setting current timer and setting timeout in driver aren't atomicly * create->init * refactoring ktime
2024-04-22[components][drivers]improve ktimer sleep (#8838)zms123456
improve ktimer sleep
2024-03-30[fixup] aarch64 UMP compiler error (#8677)Shell
Signed-off-by: Shell <[email protected]>
2024-03-28sync smart & dfs (#8672)Shell
Signed-off-by: xqyjlj <[email protected]> Signed-off-by: Shell <[email protected]> Co-authored-by: xqyjlj <[email protected]>
2023-11-16[libc] update ctime.c compatible with old driversguozhanxin
2023-10-31[libc] [ctime] fix rt_timespec_to_tick fun internal data overflow (#8198)kk
2023-10-26[ctime] fixup of data racing (#8187)Shell
Signed-off-by: Shell <[email protected]>
2023-10-25🎈 perf: perf rt_hw_interrupt_disable/enable (#8042)xqyjlj
Signed-off-by: Shell <[email protected]> Co-authored-by: Shell <[email protected]>
2023-10-24[libc][time]修复MDK编译环境下difftime()函数多重定义的问题 ↵梁生
(#8174)
2023-08-28[ctime] 避免时区为负数时引入的隐式转换问题TangZhenye
2023-08-23cleanup: fix building warningsgeniusgogo
2023-08-13[libc][timezone] implement lightweith timezone configurationMeco Man
2023-08-08[libc][time] silence the incorrect type warningMeco Man
2023-08-01[components/ctime] fix the free of rt_work (#7882)Shell
Signed-off-by: Shell <[email protected]>
2023-07-22[smart] fix possible memory leak (#7832)Shell
Signed-off-by: Shell <[email protected]>
2023-07-21[libc][time] cleanup codeMeco Man
2023-07-20✨ feat(ktime): add RT_USING_KTIME to kconfig buildxqyjlj
2023-07-20[component/lwp] support more feature of signal from IEEE Std 1003.1-2017 (#7828)Shell
Signed-off-by: Shell <[email protected]>
2023-07-17[time]时钟框架重构 (#7794)xqyjlj
2023-06-29[libc]更新 libc timer id 分配方式 (#7744)zhkag
2023-06-13[libc][ctime] move null pointer check before dereferenceMingjie Shen
This null check was redundant because the pointer timep was dereferenced in any case.
2023-06-07[simulator] 修复 linux simulator 编译运行失败zhkag
2023-05-31[ctime]解决clock_gettime计算出来的nsec超过1sec的问题goldengrandpa
2023-04-22🎈 perf(components/libc/compilers/common/ctime.c): if define cputime, then ↵xqyjlj
CLOCK_REALTIME use cputime (#7343)
2023-04-13🐞 fix(components/drivers): fix cpu timer in multithreading (#7222)xqyjlj
* 🐞 fix(components/drivers): fix cpu timer in multithreading * 🎈 perf(components): change double to uint64_t * 🎈 perf(components): add UL suffix
2023-03-30[libc][ctime] stime clear tv.tv_usec as zeroLei Peng
when using stime set rtc time, tv.tv_usec not 0,but always is 0xdeadbeef, make set time error
2023-02-27fixed ctime timer_delete timerid parameter check. (#6977)geniusgogo
* fixed ctime timer_delete timerid parameter check.
2023-02-15Improve timer accuracy and realize (#6926)zhkag
* add cputimer frame * add cputime sleep * ctime use cputime * Processing cputime has no timeout function * Migration cputime Code * formatting file * 整理代码 * add document copyright information * 改 cputime_timer 为 cputimer * 简化 _cputimer_list 初始化 * rt_cputimer_create -> rt_cputimer_init * Remove RT_USING_CPUTIME and code cleanup. * Remove RT_USING_CPUTIME in cputimer.c * Set set_next_timeout as static function. --------- Co-authored-by: Bernard Xiong <[email protected]>
2023-02-13[ci] fix build error.guozhanxin
2023-02-09修复编译警告zhkag
2023-02-07修复纳秒微妙混用转换错误zhkag
2023-02-07移除无用代码zhkag
2023-02-07add timer lockzhkag
2023-02-07update timerzhkag
2023-01-10fix cputime and ctime.xieyangrun
2022-12-29[libc][time] 修正POSIX 时间相关函数返回值错误Meco Man
2022-12-16[rt-smart] 弱化 RT_USING_LWP,使用 RT_USING_SMART 作为宏配置 (#6740)guo
* [dfs] sync cromfs * [rt-smart]Weaken RT_USING_LWP, use RT_USING_SMART as macro configuration * [format] fix some format issue.
2022-12-11[rtdef] use lower-case to define attributes (#6728)Man, Jianting (Meco)
* [rtdef] rename RT_WEAK attribute as rt_weak * [rtdef] rename RT_USED attribute as rt_used * [rtdef] rename RT_SECTION attribute as rt_section * [rtdef] rename ALIGN attribute as rt_align * [legacy] add RT_USED ALIGN RT_SECTION RT_WEAK as legacy support