diff options
| author | xqyjlj <[email protected]> | 2023-07-17 20:11:58 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-07-17 20:11:58 +0800 |
| commit | 0eb75ced70a514051fcc6a8f1d232e195b15b4a0 (patch) | |
| tree | a025fe349198fa0fe6f972ea1100ac31ba64787a /libcpu | |
| parent | b424169e1742c1b19d039f9871dd3c672ea7b729 (diff) | |
[time]时钟框架重构 (#7794)
Diffstat (limited to 'libcpu')
| -rw-r--r-- | libcpu/risc-v/virt64/tick.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libcpu/risc-v/virt64/tick.c b/libcpu/risc-v/virt64/tick.c index 8fdbe0809f..cd628f0835 100644 --- a/libcpu/risc-v/virt64/tick.c +++ b/libcpu/risc-v/virt64/tick.c @@ -28,7 +28,6 @@ static uint64_t get_ticks() int tick_isr(void) { // uint64_t core_id = current_coreid(); - int tick_cycles = 40000; // clint->mtimecmp[core_id] += tick_cycles; rt_tick_increase(); sbi_set_timer(get_ticks() + tick_cycles); @@ -41,14 +40,12 @@ int rt_hw_tick_init(void) { /* Read core id */ // unsigned long core_id = current_coreid(); - unsigned long interval = 1000/RT_TICK_PER_SECOND; /* Clear the Supervisor-Timer bit in SIE */ clear_csr(sie, SIP_STIP); /* calculate the tick cycles */ - // tick_cycles = interval * sysctl_clock_get_freq(SYSCTL_CLOCK_CPU) / CLINT_CLOCK_DIV / 1000ULL - 1; - tick_cycles = 40000; + tick_cycles = CPUTIME_TIMER_FREQ / RT_TICK_PER_SECOND; /* Set timer */ sbi_set_timer(get_ticks() + tick_cycles); |
