diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-09-11 12:24:04 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-09-11 12:24:04 +0000 |
commit | ab736d4dfd758091ed3d6244f7170dd641739aed (patch) | |
tree | df838e9728a3bb79ee0c988213bdd4971538067e /os | |
parent | 0e436b1cb6c0dea2280b09208a43af636a29ce64 (diff) | |
download | ChibiOS-ab736d4dfd758091ed3d6244f7170dd641739aed.tar.gz ChibiOS-ab736d4dfd758091ed3d6244f7170dd641739aed.tar.bz2 ChibiOS-ab736d4dfd758091ed3d6244f7170dd641739aed.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6292 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r-- | os/nil/include/nil.h | 22 | ||||
-rw-r--r-- | os/nil/ports/ARMCMx/compilers/GCC/niltypes.h | 1 | ||||
-rw-r--r-- | os/nil/ports/ARMCMx/nilcore.h | 25 | ||||
-rw-r--r-- | os/nil/ports/ARMCMx/nilcore_v6m.h | 9 | ||||
-rw-r--r-- | os/nil/ports/ARMCMx/nilcore_v7m.h | 9 |
5 files changed, 39 insertions, 27 deletions
diff --git a/os/nil/include/nil.h b/os/nil/include/nil.h index 98dd2c04e..c6994dfe1 100644 --- a/os/nil/include/nil.h +++ b/os/nil/include/nil.h @@ -128,7 +128,18 @@ typedef struct nil_thread thread_t; #endif
/**
- * @brief System timer resolution in Hz.
+ * @brief System time counter resolution.
+ * @note Allowed values are 16 or 32 bits.
+ */
+#if !defined(NIL_CFG_ST_RESOLUTION) || defined(__DOXYGEN__)
+#define NIL_CFG_ST_RESOLUTION 32
+#endif
+
+/**
+ * @brief System tick frequency.
+ * @note This value together with the @p NIL_CFG_ST_RESOLUTION
+ * option defines the maximum amount of time allowed for
+ * timeouts.
*/
#if !defined(NIL_CFG_ST_FREQUENCY) || defined(__DOXYGEN__)
#define NIL_CFG_ST_FREQUENCY 100
@@ -191,12 +202,17 @@ typedef struct nil_thread thread_t; "ChibiOS/RT instead"
#endif
+#if (NIL_CFG_ST_RESOLUTION != 16) && (NIL_CFG_ST_RESOLUTION != 32)
+#error "invalid NIL_CFG_ST_RESOLUTION specified, must be 16 or 32"
+#endif
+
#if NIL_CFG_ST_FREQUENCY <= 0
-#error "invalid NIL_CFG_ST_FREQUENCY specified"
+#error "invalid NIL_CFG_ST_FREQUENCY specified, must be greated than zero"
#endif
#if (NIL_CFG_ST_TIMEDELTA < 0) || (NIL_CFG_ST_TIMEDELTA == 1)
-#error "invalid NIL_CFG_ST_TIMEDELTA specified"
+#error "invalid NIL_CFG_ST_TIMEDELTA specified, must " \
+ "be zero or greater than one"
#endif
#if NIL_CFG_ENABLE_ASSERTS
diff --git a/os/nil/ports/ARMCMx/compilers/GCC/niltypes.h b/os/nil/ports/ARMCMx/compilers/GCC/niltypes.h index 0925c1daf..8aa7bf7a6 100644 --- a/os/nil/ports/ARMCMx/compilers/GCC/niltypes.h +++ b/os/nil/ports/ARMCMx/compilers/GCC/niltypes.h @@ -51,7 +51,6 @@ /** @} */
typedef uint32_t syssts_t; /**< System status word. */
-typedef uint32_t systime_t; /**< System time. */
typedef uint32_t rtcnt_t; /**< Realtime counter. */
typedef uint8_t tstate_t; /**< Thread state. */
typedef int32_t msg_t; /**< Inter-thread message. */
diff --git a/os/nil/ports/ARMCMx/nilcore.h b/os/nil/ports/ARMCMx/nilcore.h index 85e004dca..9d0303e0a 100644 --- a/os/nil/ports/ARMCMx/nilcore.h +++ b/os/nil/ports/ARMCMx/nilcore.h @@ -110,18 +110,33 @@ asm module.*/
#if !defined(_FROM_ASM_)
-/* The following declarations are there just for Doxygen documentation, the
- real declarations are inside the sub-headers being specific for the
- sub-architectures.*/
-#if defined(__DOXYGEN__)
/**
- * @brief Stack and memory alignment enforcement.
+ * @brief Type of system time.
+ */
+#if (NIL_CFG_ST_RESOLUTION == 32) || defined(__DOXYGEN__)
+typedef uint32_t systime_t;
+#else
+typedef uint16_t systime_t;
+#endif
+
+/**
+ * @brief Type of a generic ARM register.
+ */
+typedef void *regarm_t;
+
+/**
+ * @brief Type of stack and memory alignment enforcement.
* @note In this architecture the stack alignment is enforced to 64 bits,
* 32 bits alignment is supported by hardware but deprecated by ARM,
* the implementation choice is to not offer the option.
*/
typedef uint64_t stkalign_t;
+/* The following declarations are there just for Doxygen documentation, the
+ real declarations are inside the sub-headers being specific for the
+ sub-architectures.*/
+#if defined(__DOXYGEN__)
+
/**
* @brief Interrupt saved context.
* @details This structure represents the stack frame saved during a
diff --git a/os/nil/ports/ARMCMx/nilcore_v6m.h b/os/nil/ports/ARMCMx/nilcore_v6m.h index 38b360781..3c0ff4dbe 100644 --- a/os/nil/ports/ARMCMx/nilcore_v6m.h +++ b/os/nil/ports/ARMCMx/nilcore_v6m.h @@ -147,17 +147,9 @@ #if !defined(_FROM_ASM_)
-/**
- * @brief Generic ARM register.
- */
-typedef void *regarm_t;
-
/* The documentation of the following declarations is in chconf.h in order
to not have duplicated structure names into the documentation.*/
#if !defined(__DOXYGEN__)
-
-typedef uint64_t stkalign_t;
-
struct port_extctx {
regarm_t r0;
regarm_t r1;
@@ -180,7 +172,6 @@ struct port_intctx { regarm_t r7;
regarm_t lr;
};
-
#endif /* !defined(__DOXYGEN__) */
/*===========================================================================*/
diff --git a/os/nil/ports/ARMCMx/nilcore_v7m.h b/os/nil/ports/ARMCMx/nilcore_v7m.h index 256f09f6d..01f222ad8 100644 --- a/os/nil/ports/ARMCMx/nilcore_v7m.h +++ b/os/nil/ports/ARMCMx/nilcore_v7m.h @@ -208,17 +208,9 @@ asm module.*/
#if !defined(_FROM_ASM_)
-/**
- * @brief Generic ARM register.
- */
-typedef void *regarm_t;
-
/* The documentation of the following declarations is in chconf.h in order
to not have duplicated structure names into the documentation.*/
#if !defined(__DOXYGEN__)
-
-typedef uint64_t stkalign_t;
-
struct port_extctx {
regarm_t r0;
regarm_t r1;
@@ -279,7 +271,6 @@ struct port_intctx { regarm_t r11;
regarm_t lr;
};
-
#endif /* !defined(__DOXYGEN__) */
/*===========================================================================*/
|