xiaoxiang781216 commented on code in PR #19559:
URL: https://github.com/apache/nuttx/pull/19559#discussion_r3658795308
##########
arch/x86_64/src/intel64/intel64_oneshot_lower.c:
##########
@@ -149,10 +149,18 @@ static void intel64_timer_start_absolute(struct
oneshot_lowerhalf_s *lower,
(struct intel64_oneshot_lowerhalf_s *)lower;
irqstate_t flags = spin_lock_irqsave(&g_oneshotlow_spin);
int ret = intel64_oneshot_current(&priv->oneshot, ¤t_us);
- uint64_t delta_us = expected - current_us;
+ uint64_t delta_us;
DEBUGASSERT(ret == OK);
+ /* The deadline may already have passed -- a watchdog started with a delay
+ * of zero asks for exactly that. Ask for the shortest delay the HPET can
+ * take rather than letting the subtraction wrap, which would set the
+ * comparator so far ahead that the timer never fires at all.
+ */
+
+ delta_us = (expected > current_us) ? expected - current_us : 0;
Review Comment:
remove ()
##########
arch/x86_64/Kconfig:
##########
@@ -202,4 +202,17 @@ config ARCH_PVHBOOT
---help---
This allows x86 QEMU `-kernel` boot in PVH protocol.
+config ARCH_HAVE_SYSCALL
Review Comment:
why not use arch/Kconfig definition
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]