From 6b116abd0717cf55bc2001d74a73882599cc4d6e Mon Sep 17 00:00:00 2001 From: chiangkd Date: Tue, 16 Jul 2024 01:23:17 +0800 Subject: [PATCH] Cast time_delta for more intuitive --- clint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clint.c b/clint.c index 0588231..050f4cd 100644 --- a/clint.c +++ b/clint.c @@ -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;