summaryrefslogtreecommitdiffstats
path: root/nuttx/sched/clock_internal.h
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2007-03-21 17:21:26 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2007-03-21 17:21:26 +0000
commitb3a170538fe8e74012a3bfff1804c52d792249bd (patch)
tree15bd94438dbb8fd1f655598700f34c79dd3af092 /nuttx/sched/clock_internal.h
parenta9a8941d9337edb75bbce108e6ba1300e48076b1 (diff)
Added support for POSIX timers
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@111 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/sched/clock_internal.h')
-rw-r--r--nuttx/sched/clock_internal.h32
1 files changed, 18 insertions, 14 deletions
diff --git a/nuttx/sched/clock_internal.h b/nuttx/sched/clock_internal.h
index e97c468b7e..85cb13f065 100644
--- a/nuttx/sched/clock_internal.h
+++ b/nuttx/sched/clock_internal.h
@@ -1,4 +1,4 @@
-/************************************************************
+/********************************************************************************
* clock_internal.h
*
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
@@ -31,21 +31,21 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ********************************************************************************/
#ifndef __CLOCK_INTERNAL_H
#define __CLOCK_INTERNAL_H
-/************************************************************
+/********************************************************************************
* Included Files
- ************************************************************/
+ ********************************************************************************/
#include <sys/types.h>
#include <nuttx/compiler.h>
-/************************************************************
+/********************************************************************************
* Definitions
- ************************************************************/
+ ********************************************************************************/
/* Timing constants */
@@ -59,7 +59,7 @@
#define MSEC_PER_TICK 10
#define USEC_PER_TICK (MSEC_PER_TICK * USEC_PER_MSEC)
#define NSEC_PER_TICK (MSEC_PER_TICK * NSEC_PER_MSEC)
-#define TICK_PER_SEC (MSEC_PER_SEC / MSEC_PER_TICK)
+#define TICK_PER_SEC (MSEC_PER_SEC / MSEC_PER_TICK)
#define MSEC2TICK(msec) (((msec)+(MSEC_PER_TICK/2))/MSEC_PER_TICK)
#define USEC2TICK(usec) (((usec)+(USEC_PER_TICK/2))/USEC_PER_TICK)
@@ -73,25 +73,29 @@
# define GREG_DAY 15
#endif /* CONFIG_JULIAN_TIME */
-/************************************************************
+/********************************************************************************
* Public Type Definitions
- ************************************************************/
+ ********************************************************************************/
-/************************************************************
+/********************************************************************************
* Global Variables
- ************************************************************/
+ ********************************************************************************/
extern volatile uint32 g_system_timer;
extern struct timespec g_basetime;
-extern uint32 g_tickbias;
+extern uint32 g_tickbias;
-/************************************************************
+/********************************************************************************
* Public Function Prototypes
- ************************************************************/
+ ********************************************************************************/
extern void weak_function clock_initialize(void);
extern void weak_function clock_timer(void);
extern time_t clock_calendar2utc(int year, int month, int day);
+extern int clock_abstime2ticks(clockid_t clockid, const struct timespec *abstime,
+ int *ticks);
+extern int clock_time2ticks(const struct timespec *reltime, int *ticks);
+extern int clock_ticks2time(int ticks, struct timespec *reltime);
#endif /* __CLOCK_INTERNAL_H */