mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-02-05 13:33:51 +00:00
[libcpu/rv64] feat: unify tick.c
The changes unify the tick.c implementations for all risc-v64 architectures, leveraging the CPUTIME feature. This refactoring was necessary to streamline the codebase, and ensure consistent timer handling across different platforms. Changes: - Updated `Kconfig` in `bsp/cvitek/cv18xx_risc-v` to fix formatting issues. - Updated .config for BSPs to update `CPUTIME_TIMER_FREQ` - Updated header of for API `riscv_cputime_init` - Initialized riscv timer on `rt_hw_tick_init` - Refactored `tick.c` and `tick.h` in `libcpu/risc-v/t-head/c906` and `libcpu/risc-v/virt64`: - Replaced direct use of `rdtime` with `clock_cpu_gettime`. - Removed redundant timer frequency definitions. - Added static assertions to check the value of `CPUTIME_TIMER_FREQ`. - Initialized `tick_cycles` based on `CPUTIME_TIMER_FREQ`. - Integrated `ktime` support for tick initialization. Signed-off-by: Shell <smokewood@qq.com> Reviewed-on: https://github.com/RT-Thread/rt-thread/pull/9164 Reviewed-by: Chen Wang <unicorn_wang@outlook.com>
This commit is contained in:
@@ -262,6 +262,15 @@ config ARCH_RISCV64
|
||||
select ARCH_CPU_64BIT
|
||||
bool
|
||||
|
||||
if ARCH_RISCV64
|
||||
config ARCH_USING_RISCV_COMMON64
|
||||
bool
|
||||
depends on ARCH_RISCV64
|
||||
select RT_USING_CPUTIME
|
||||
help
|
||||
Using the common64 implementation under ./libcpu/risc-v
|
||||
endif
|
||||
|
||||
config ARCH_REMAP_KERNEL
|
||||
bool
|
||||
depends on RT_USING_SMART
|
||||
|
||||
Reference in New Issue
Block a user