xiaoxiang781216 commented on code in PR #17573:
URL: https://github.com/apache/nuttx/pull/17573#discussion_r2653643322


##########
include/nuttx/hrtimer.h:
##########
@@ -97,11 +97,14 @@ struct hrtimer_node_s
 
 struct hrtimer_s
 {
-  hrtimer_node_t          node;    /* RB-tree node for sorted insertion */
-  enum hrtimer_state_e    state;   /* Current timer state */
-  hrtimer_cb              func;    /* Expiration callback function */
-  FAR void               *arg;     /* Argument passed to callback */
-  uint64_t                expired; /* Absolute expiration time (ns) */
+  hrtimer_node_t  node;        /* RB-tree node for sorted insertion */

Review Comment:
   remove the extra space



##########
sched/hrtimer/hrtimer_cancel.c:
##########
@@ -41,12 +41,8 @@
 
 #define HRTIMER_CANCEL_SYNC_DELAY_MS  5
 
-#ifdef CONFIG_SMP
-#  define hrtimer_is_free(hrtimer) (((hrtimer)->state == 
HRTIMER_STATE_INACTIVE) && \
-                                    ((hrtimer)->cpus == 0))
-#else
-#  define hrtimer_is_free(hrtimer) ((hrtimer)->state == HRTIMER_STATE_INACTIVE)
-#endif
+#define hrtimer_is_free(hrtimer) (((hrtimer)->state == HRTIMER_STATE_INACTIVE) 
&& \

Review Comment:
   dito



##########
include/nuttx/hrtimer.h:
##########
@@ -102,9 +102,7 @@ struct hrtimer_s
   hrtimer_cb func;             /* Expiration callback function */
   FAR void *arg;               /* Argument passed to callback */
   uint64_t expired;            /* Absolute expiration time (ns) */
-#ifdef CONFIG_SMP

Review Comment:
   remove this patch from pr



##########
sched/hrtimer/hrtimer_cancel.c:
##########
@@ -27,6 +27,7 @@
 #include <nuttx/config.h>
 #include <nuttx/arch.h>
 #include <nuttx/clock.h>
+#include "sched/sched.h"

Review Comment:
   move after line 4



##########
drivers/timers/arch_alarm.c:
##########
@@ -118,8 +118,10 @@ static void ndelay_accurate(unsigned long nanoseconds)
 static void oneshot_callback(FAR struct oneshot_lowerhalf_s *lower,
                              FAR void *arg)
 {
-#ifdef CONFIG_SCHED_TICKLESS
-  nxsched_timer_expiration();
+#if defined(CONFIG_HRTIMER) || \
+    defined(CONFIG_SCHED_TICKLESS)

Review Comment:
   merge to one line



##########
sched/hrtimer/hrtimer_cancel.c:
##########


Review Comment:
   how to handle call hrtimer_cancel_sync in the interrupt context



##########
sched/sched/sched_processtimer.c:
##########
@@ -204,3 +328,31 @@ void nxsched_process_timer(void)
   board_timerhook();
 #endif
 }
+#endif
+
+/****************************************************************************
+ * System Timer Hooks
+ *
+ * These are standard interfaces that are exported by the OS
+ * for use by the architecture specific logic
+ *
+ ****************************************************************************/
+
+void nxsched_process_timer(void)
+{
+#if defined(CONFIG_HRTIMER)
+  /* High-resolution timer-based scheduling */
+
+  nxsched_process_hrtimer();
+
+#elif !defined(CONFIG_SCHED_TICKLESS)

Review Comment:
   `#elif defined(CONFIG_SCHED_TICKLESS)`



-- 
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]

Reply via email to