summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-08-06 18:28:33 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-08-06 18:28:33 -0600
commitb66e8cbe7e23dc9315b1d0e0cf613a35bb21423d (patch)
treea6d6e64ff98c87d22297115b8ff5881758eb4a79 /nuttx
parenta9be29403bd2637adbcc8e15d2bcea678c7c1e28 (diff)
downloadpx4-nuttx-b66e8cbe7e23dc9315b1d0e0cf613a35bb21423d.tar.gz
px4-nuttx-b66e8cbe7e23dc9315b1d0e0cf613a35bb21423d.tar.bz2
px4-nuttx-b66e8cbe7e23dc9315b1d0e0cf613a35bb21423d.zip
Added another tickless OS interface to get the timer remaining on the interval timer.
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/include/nuttx/arch.h79
1 files changed, 54 insertions, 25 deletions
diff --git a/nuttx/include/nuttx/arch.h b/nuttx/include/nuttx/arch.h
index 8442291b1..8f2bd3cf9 100644
--- a/nuttx/include/nuttx/arch.h
+++ b/nuttx/include/nuttx/arch.h
@@ -1081,6 +1081,33 @@ int up_timer_start(FAR const struct timespec *tp);
#endif
/****************************************************************************
+ * Name: up_timer_remaining
+ *
+ * Description:
+ * Return the time remaining until the next timer expiratino.
+ *
+ * Provided by platform-specific code and called from the RTOS base code.
+ *
+ * Input Parameters:
+ * tp - Location to return the remaining time. Zero should be returned
+ * if the timer is not active.
+ *
+ * Returned Value:
+ * Zero (OK) is returned on success; a negated errno value is returned on
+ * any failure.
+ *
+ * Assumptions:
+ * May be called from interrupt level handling or from the normal tasking
+ * level. Interrupts may need to be disabled internally to assure
+ * non-reentrancy.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_SCHED_TICKLESS
+int up_timer_remaining(FAR struct timespec *tp);
+#endif
+
+/****************************************************************************
* Name: up_timer_resolution
*
* Description:
@@ -1186,15 +1213,37 @@ void up_cxxinitialize(void);
* Name: sched_process_timer
*
* Description:
- * This function handles system timer events.
- * The timer interrupt logic itself is implemented in the
- * architecture specific code, but must call the following OS
- * function periodically -- the calling interval must be
- * MSEC_PER_TICK.
+ * This function handles system timer events (only when
+ * CONFIG_SCHED_TICKLESS is *not* defined). The timer interrupt logic
+ * itself is implemented in the architecture specific code, but must call
+ * the following OS function periodically -- the calling interval must
+ * be MSEC_PER_TICK.
*
****************************************************************************/
+#ifndef CONFIG_SCHED_TICKLESS
void sched_process_timer(void);
+#endif
+
+/****************************************************************************
+ * Name: sched_timer_expiration
+ *
+ * Description:
+ * if CONFIG_SCHED_TICKLESS is defined, then this function is provided by
+ * the RTOS base code and called from platform-specific code when the
+ * interval timer used to implemented the tick-less OS expires.
+ *
+ * Input Parameters:
+ *
+ * Returned Value:
+ * Base code implementation assumes that this function is called from
+ * interrupt handling logic with interrupts disabled.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_SCHED_TICKLESS
+void sched_timer_expiration(void);
+#endif
/************************************************************************
* Name: sched_process_cpuload
@@ -1231,26 +1280,6 @@ void weak_function sched_process_cpuload(void);
void irq_dispatch(int irq, FAR void *context);
/****************************************************************************
- * Name: sched_timer_expiration
- *
- * Description:
- * if CONFIG_SCHED_TICKLESS is defined, then this function is provided by
- * the RTOS base code and called from platform-specific code when the
- * interval timer used to implemented the tick-less OS expires.
- *
- * Input Parameters:
- *
- * Returned Value:
- * Base code implementation assumes that this function is called from
- * interrupt handling logic with interrupts disabled.
- *
- ****************************************************************************/
-
-#ifdef CONFIG_SCHED_TICKLESS
-void sched_timer_expiration(void);
-#endif
-
-/****************************************************************************
* Name: up_check_stack and friends
*
* Description: