summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/inline/rtems/posix/timer.inl
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-19 15:08:53 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-22 16:57:24 +0200
commitf17c7798288c530cda114db266dd6790c70f8b28 (patch)
treee60d2ce825ff6c1bebced34e0fdb6753648cb645 /cpukit/posix/inline/rtems/posix/timer.inl
parentscore: Avoid direct usage of _Thread_Executing (diff)
downloadrtems-f17c7798288c530cda114db266dd6790c70f8b28.tar.bz2
posix: Create timer implementation header
Move implementation specific parts of timer.h and timer.inl into new header file timerimpl.h. The timer.h contains now only the application visible API.
Diffstat (limited to '')
-rw-r--r--cpukit/posix/include/rtems/posix/timerimpl.h (renamed from cpukit/posix/inline/rtems/posix/timer.inl)71
1 files changed, 67 insertions, 4 deletions
diff --git a/cpukit/posix/inline/rtems/posix/timer.inl b/cpukit/posix/include/rtems/posix/timerimpl.h
index bc1db80c88..73f953b45e 100644
--- a/cpukit/posix/inline/rtems/posix/timer.inl
+++ b/cpukit/posix/include/rtems/posix/timerimpl.h
@@ -16,12 +16,71 @@
* http://www.rtems.com/license/LICENSE.
*/
-#ifndef _RTEMS_POSIX_TIMER_H
-# error "Never use <rtems/posix/timer.inl> directly; include <rtems/posix/timer.h> instead."
+#ifndef _RTEMS_POSIX_TIMERIMPL_H
+#define _RTEMS_POSIX_TIMERIMPL_H
+
+#include <rtems/posix/timer.h>
+
+#ifdef __cplusplus
+extern "C" {
#endif
-#ifndef _RTEMS_POSIX_TIMER_INL
-#define _RTEMS_POSIX_TIMER_INL
+/* Timer is free */
+#define POSIX_TIMER_STATE_FREE 0x01
+
+/* Created timer but not running */
+#define POSIX_TIMER_STATE_CREATE_NEW 0x02
+
+/* Created timer and running */
+#define POSIX_TIMER_STATE_CREATE_RUN 0x03
+
+/* Created, ran and stopped timer */
+#define POSIX_TIMER_STATE_CREATE_STOP 0x04
+
+/* Indicates that the fire time is relative to the current one */
+#define POSIX_TIMER_RELATIVE 0
+
+/*
+ * POSIX defines TIMER_ABSTIME but no constant for relative. So
+ * we have one internally but we need to be careful it has a different
+ * value.
+ */
+#if (POSIX_TIMER_RELATIVE == TIMER_ABSTIME)
+#error "POSIX_TIMER_RELATIVE == TIMER_ABSTIME"
+#endif
+
+/*
+ * _POSIX_Timers_Manager_initialization
+ *
+ * DESCRIPTION:
+ *
+ * This routine performs the initialization necessary for this manager.
+ */
+void _POSIX_Timer_Manager_initialization(void);
+
+/*
+ * @brief Operation that is run when a timer expires
+ *
+ * Timer TSR
+ */
+void _POSIX_Timer_TSR(Objects_Id timer, void *data);
+
+/*
+ * Watchdog Insert helper
+ */
+bool _POSIX_Timer_Insert_helper(
+ Watchdog_Control *timer,
+ Watchdog_Interval ticks,
+ Objects_Id id,
+ Watchdog_Service_routine_entry TSR,
+ void *arg
+);
+
+/*
+ * The following defines the information control block used to manage
+ * this class of objects.
+ */
+POSIX_EXTERN Objects_Information _POSIX_Timer_Information;
/*
* _POSIX_Timer_Allocate
@@ -89,5 +148,9 @@ RTEMS_INLINE_ROUTINE bool _POSIX_Timer_Is_null (
return (the_timer == NULL);
}
+#ifdef __cplusplus
+}
+#endif
+
#endif
/* end of include file */