summaryrefslogtreecommitdiff
path: root/nuttx/include/nuttx/clock.h
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-15 16:20:25 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-15 16:20:25 +0000
commit3a3fe9efb1e3f0fe6a756b8e4d2fa48d5564137b (patch)
tree13d2c82c982b760b250741f7167faf0d509ecbc4 /nuttx/include/nuttx/clock.h
parentf1893cbaf513c7f0fbca77240fc59707ad039734 (diff)
downloadnuttx-3a3fe9efb1e3f0fe6a756b8e4d2fa48d5564137b.tar.gz
nuttx-3a3fe9efb1e3f0fe6a756b8e4d2fa48d5564137b.tar.bz2
nuttx-3a3fe9efb1e3f0fe6a756b8e4d2fa48d5564137b.zip
Add code changes from Uros
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3507 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include/nuttx/clock.h')
-rw-r--r--nuttx/include/nuttx/clock.h56
1 files changed, 35 insertions, 21 deletions
diff --git a/nuttx/include/nuttx/clock.h b/nuttx/include/nuttx/clock.h
index e06d2c0dd..4d641696f 100644
--- a/nuttx/include/nuttx/clock.h
+++ b/nuttx/include/nuttx/clock.h
@@ -49,19 +49,6 @@
* Pro-processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
-/* Access to raw system clock ***********************************************/
-/* The system timer/counter is supported only if (1) the system clock is not
- * disabled and (2) we are not configured to use a hardware periodic timer
- * for system time.
- */
-
-#undef __HAVE_SYSTEM_COUNTER
-#if !defined(CONFIG_DISABLE_CLOCK) && !defined(CONFIG_PTIMER)
-# define __HAVE_SYSTEM_COUNTER 1
-#else
-# define __HAVE_SYSTEM_COUNTER 0
-#endif
-
/* Efficient, direct access to OS global timer variables will be supported
* if the execution environment has direct access to kernel global data.
* The code in this execution context can access the kernel global data
@@ -157,10 +144,6 @@ extern volatile uint32_t g_uptime;
* Global Function Prototypes
****************************************************************************/
-/****************************************************************************
- * Global Function Prototypes
- ****************************************************************************/
-
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
@@ -168,15 +151,46 @@ extern "C" {
#define EXTERN extern
#endif
-/* Indirect access to the system time is required if (1) we are using a
- * hardware periodic timer, OR (2) the execution environment does not have
- * direct access to kernel global data
- */
+/****************************************************************************
+ * Function: clock_systimer
+ *
+ * Description:
+ * Return the current value of the system timer counter. Indirect access
+ * to the system timer counter is required through this function if (1) we
+ * are using a hardware periodic timer, OR (2) the execution environment
+ * does not have direct access to kernel global data
+ *
+ * Parameters:
+ * None
+ *
+ * Return Value:
+ * The current value of the system timer counter
+ *
+ * Assumptions:
+ *
+ ****************************************************************************/
#if defined(CONFIG_PTIMER) || !__HAVE_KERNEL_GLOBALS
EXTERN uint32_t clock_systimer(void);
#endif
+/****************************************************************************
+ * Function: clock_uptime
+ *
+ * Description:
+ * Return the current value of the system timer counter, which is only
+ * enabled when system is in active mode.
+ *
+ * Parameters:
+ * None
+ *
+ * Return Value:
+ * The current value of the system time counter
+ *
+ * Assumptions:
+ *
+ ****************************************************************************/
+
#if defined(CONFIG_UPTIME) && !__HAVE_KERNEL_GLOBALS
EXTERN time_t clock_uptime(void);
#endif