!sched/clock: remove CONFIG_SYSTEM_TIME64 and always use 64-bit time

The 32-bit system clock has a limited range (~497 days) and the
configuration knob is no longer worth the complexity given that
practically every modern target already enables it.  Make 64-bit
time_t/clock_t/sclock_t/nuttx_time_t the only supported flavor.

Specifically:
  - Drop the SYSTEM_TIME64 Kconfig option and its dependent
    PERF_OVERFLOW_CORRECTION/HRTIMER guards in sched/Kconfig.
  - Remove every #ifdef CONFIG_SYSTEM_TIME64 branch in headers
    (include/{sys/types.h,limits.h,inttypes.h,nuttx/clock.h,
    nuttx/fs/hostfs.h}) and core code paths
    (sched/clock/clock.h, drivers/power/pm/pm_procfs.c,
    drivers/rpmsg/rpmsg_ping.c, fs/procfs/fs_procfsuptime.c,
    libs/libc/wqueue/work_usrthread.c,
    arch/avr/src/avrdx/avrdx_timerisr_tickless_alarm.c).
  - Strip CONFIG_SYSTEM_TIME64=y from every board defconfig.
  - Update Documentation/guides/rust.rst accordingly.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2026-05-03 15:54:17 +08:00 committed by Xiang Xiao
parent 1b3af76bf3
commit c6654b1106
187 changed files with 147 additions and 338 deletions

View file

@ -330,7 +330,7 @@ static ssize_t critmon_read_cpu(FAR struct critmon_file_s *attr,
}
elapsed = clock() * CONFIG_USEC_PER_TICK;
rate = (uint64_t)(all_time.tv_sec * 1000000 + all_time.tv_nsec / 1000) *
rate = (all_time.tv_sec * 1000000 + all_time.tv_nsec / 1000) *
1000000 / elapsed;
/* Generate output for all busywait time to enter csection(get spinlock) */

View file

@ -195,11 +195,7 @@ static ssize_t uptime_read(FAR struct file *filep, FAR char *buffer,
#if defined(CONFIG_HAVE_DOUBLE) && defined(CONFIG_LIBC_FLOATINGPOINT)
double now;
#else
# if defined(CONFIG_SYSTEM_TIME64)
uint64_t sec;
# else
uint32_t sec;
# endif
unsigned int remainder;
unsigned int csec;
#endif
@ -250,13 +246,8 @@ static ssize_t uptime_read(FAR struct file *filep, FAR char *buffer,
/* Convert the seconds + hundredths of seconds to a string */
#ifdef CONFIG_SYSTEM_TIME64
linesize = procfs_snprintf(attr->line, UPTIME_LINELEN,
"%7" PRIu64 ".%02u\n", sec, csec);
#else
linesize = procfs_snprintf(attr->line, UPTIME_LINELEN,
"%7" PRIu32 ".%02u\n", sec, csec);
#endif
#endif
/* Save the linesize in case we are re-entered with f_pos > 0 */