Skip to content

Commit

Permalink
Cast time_delta for more intuitive
Browse files Browse the repository at this point in the history
  • Loading branch information
chiangkd committed Jul 15, 2024
1 parent 779f478 commit 6b116ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clint.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ void clint_update_interrupts(hart_t *hart, clint_state_t *clint)
{
uint64_t time_delta =
clint->mtimecmp[hart->mhartid] - semu_timer_gettime(&hart->time);
if (time_delta & 0x8000000000000000 || time_delta == 0)
if ((int32_t)time_delta <= 0)
hart->sip |= RV_INT_STI_BIT;
else
hart->sip &= ~RV_INT_STI_BIT;
Expand Down

0 comments on commit 6b116ab

Please sign in to comment.