arch/arm: Fix the arm timer's maximum delay to be a 64-bit integer.

This commit fixed the arm generic timer's maximum delay.

Signed-off-by: husong1 <husong1@xiaomi.com>
This commit is contained in:
husong1
2025-10-13 10:46:50 +08:00
committed by Xiang Xiao
parent 80463c8b06
commit 482de93342
3 changed files with 10 additions and 6 deletions

View File

@@ -33,6 +33,8 @@
#include <arch/barriers.h>
#include <arch/irq.h>
#include <sys/param.h>
#include "arm_timer.h"
#include "gic.h"
@@ -102,7 +104,7 @@ static int arm_timer_interrupt(int irq, void *regs, void *arg)
static clkcnt_t arm_oneshot_max_delay(struct oneshot_lowerhalf_s *lower)
{
return UINT32_MAX;
return UINT64_MAX;
}
static clkcnt_t arm_oneshot_current(struct oneshot_lowerhalf_s *lower)
@@ -121,7 +123,7 @@ static void arm_oneshot_start_absolute(struct oneshot_lowerhalf_s *lower,
static void arm_oneshot_start(struct oneshot_lowerhalf_s *lower,
clkcnt_t delta)
{
arm_timer_phy_set_relative(delta);
arm_timer_phy_set_relative(MIN(UINT32_MAX, delta));
}
static void arm_oneshot_cancel(struct oneshot_lowerhalf_s *lower)

View File

@@ -32,6 +32,8 @@
#include <arch/barriers.h>
#include <sys/param.h>
#include "arm_timer.h"
#include "gic.h"
@@ -98,7 +100,7 @@ static int arm_timer_interrupt(int irq, void *regs, void *arg)
static clkcnt_t arm_oneshot_max_delay(struct oneshot_lowerhalf_s *lower)
{
return UINT32_MAX;
return UINT64_MAX;
}
static clkcnt_t arm_oneshot_current(struct oneshot_lowerhalf_s *lower)
@@ -117,7 +119,7 @@ static void arm_oneshot_start_absolute(struct oneshot_lowerhalf_s *lower,
static void arm_oneshot_start(struct oneshot_lowerhalf_s *lower,
clkcnt_t delta)
{
arm_timer_phy_set_relative(delta);
arm_timer_phy_set_relative(MIN(UINT32_MAX, delta));
arm_timer_phy_set_irq_mask(false);
}

View File

@@ -132,7 +132,7 @@ static int arm_oneshot_compare_isr(int irq, void *regs, void *arg)
static clkcnt_t arm_oneshot_max_delay(struct oneshot_lowerhalf_s *lower)
{
return UINT32_MAX;
return UINT64_MAX;
}
static clkcnt_t arm_oneshot_current(struct oneshot_lowerhalf_s *lower)
@@ -151,7 +151,7 @@ static void arm_oneshot_start_absolute(struct oneshot_lowerhalf_s *lower,
static void arm_oneshot_start(struct oneshot_lowerhalf_s *lower,
clkcnt_t delta)
{
arm_timer_phy_set_relative(delta);
arm_timer_phy_set_relative(delta <= UINT32_MAX ? delta : UINT32_MAX);
}
static void arm_oneshot_cancel(struct oneshot_lowerhalf_s *lower)