mirror of
https://github.com/apache/nuttx.git
synced 2025-12-07 01:44:23 +08:00
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:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user