aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-09-03 08:48:20 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-09-03 08:48:20 +0000
commit9d0c6fb8bf7bf63c137d7c19fdefc7760d2f133a (patch)
tree86acab83e6b86703239954be6d8240cf49accb8b /os
parent156a195bf72bd366f91e03c170ad4b344797778a (diff)
downloadChibiOS-9d0c6fb8bf7bf63c137d7c19fdefc7760d2f133a.tar.gz
ChibiOS-9d0c6fb8bf7bf63c137d7c19fdefc7760d2f133a.tar.bz2
ChibiOS-9d0c6fb8bf7bf63c137d7c19fdefc7760d2f133a.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6250 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/hal/ports/STM32F0xx/stm32_dma.h8
-rw-r--r--os/hal/ports/STM32F30x/stm32_dma.h8
-rw-r--r--os/hal/ports/STM32F4xx/stm32_dma.h8
-rw-r--r--os/rt/include/ch.h42
-rw-r--r--os/rt/ports/ARMCMx/chcore_timer.h62
-rw-r--r--os/rt/ports/ARMCMx/chcore_v6m.h6
-rw-r--r--os/rt/ports/ARMCMx/chcore_v7m.h6
-rw-r--r--os/rt/ports/ARMCMx/compilers/GCC/chtypes.h19
8 files changed, 65 insertions, 94 deletions
diff --git a/os/hal/ports/STM32F0xx/stm32_dma.h b/os/hal/ports/STM32F0xx/stm32_dma.h
index 277ebf4d4..3acff9647 100644
--- a/os/hal/ports/STM32F0xx/stm32_dma.h
+++ b/os/hal/ports/STM32F0xx/stm32_dma.h
@@ -380,10 +380,10 @@ extern const stm32_dma_stream_t _stm32_dma_streams[STM32_DMA_STREAMS];
extern "C" {
#endif
void dmaInit(void);
- bool_t dmaStreamAllocate(const stm32_dma_stream_t *dmastp,
- uint32_t priority,
- stm32_dmaisr_t func,
- void *param);
+ bool dmaStreamAllocate(const stm32_dma_stream_t *dmastp,
+ uint32_t priority,
+ stm32_dmaisr_t func,
+ void *param);
void dmaStreamRelease(const stm32_dma_stream_t *dmastp);
#ifdef __cplusplus
}
diff --git a/os/hal/ports/STM32F30x/stm32_dma.h b/os/hal/ports/STM32F30x/stm32_dma.h
index 2415f00f2..21c97a38b 100644
--- a/os/hal/ports/STM32F30x/stm32_dma.h
+++ b/os/hal/ports/STM32F30x/stm32_dma.h
@@ -392,10 +392,10 @@ extern const stm32_dma_stream_t _stm32_dma_streams[STM32_DMA_STREAMS];
extern "C" {
#endif
void dmaInit(void);
- bool_t dmaStreamAllocate(const stm32_dma_stream_t *dmastp,
- uint32_t priority,
- stm32_dmaisr_t func,
- void *param);
+ bool dmaStreamAllocate(const stm32_dma_stream_t *dmastp,
+ uint32_t priority,
+ stm32_dmaisr_t func,
+ void *param);
void dmaStreamRelease(const stm32_dma_stream_t *dmastp);
#ifdef __cplusplus
}
diff --git a/os/hal/ports/STM32F4xx/stm32_dma.h b/os/hal/ports/STM32F4xx/stm32_dma.h
index 62b0fbd43..cb0d01688 100644
--- a/os/hal/ports/STM32F4xx/stm32_dma.h
+++ b/os/hal/ports/STM32F4xx/stm32_dma.h
@@ -447,10 +447,10 @@ extern const stm32_dma_stream_t _stm32_dma_streams[STM32_DMA_STREAMS];
extern "C" {
#endif
void dmaInit(void);
- bool_t dmaStreamAllocate(const stm32_dma_stream_t *dmastp,
- uint32_t priority,
- stm32_dmaisr_t func,
- void *param);
+ bool dmaStreamAllocate(const stm32_dma_stream_t *dmastp,
+ uint32_t priority,
+ stm32_dmaisr_t func,
+ void *param);
void dmaStreamRelease(const stm32_dma_stream_t *dmastp);
#ifdef __cplusplus
}
diff --git a/os/rt/include/ch.h b/os/rt/include/ch.h
index c2c486c0f..21c172ec9 100644
--- a/os/rt/include/ch.h
+++ b/os/rt/include/ch.h
@@ -62,44 +62,6 @@
#define CH_KERNEL_PATCH 0
/** @} */
-/**
- * @name Common constants
- */
-/**
- * @brief Generic 'false' boolean constant.
- */
-#if !defined(FALSE) || defined(__DOXYGEN__)
-#define FALSE 0
-#endif
-
-/**
- * @brief Generic 'true' boolean constant.
- */
-#if !defined(TRUE) || defined(__DOXYGEN__)
-#define TRUE (!FALSE)
-#endif
-
-/**
- * @brief Generic success constant.
- * @details This constant is functionally equivalent to @p false but more
- * readable, it can be used as return value of all those functions
- * returning a @p bool as a status indicator.
- */
-#if !defined(CH_SUCCESS) || defined(__DOXYGEN__)
-#define CH_SUCCESS false
-#endif
-
-/**
- * @brief Generic failure constant.
- * @details This constant is functionally equivalent to @p true but more
- * readable, it can be used as return value of all those functions
- * returning a @p bool as a status indicator.
- */
-#if !defined(CH_FAILED) || defined(__DOXYGEN__)
-#define CH_FAILED true
-#endif
-/** @} */
-
/* Forward declarations.*/
typedef struct thread thread_t;
typedef struct virtual_timer virtual_timer_t;
@@ -114,10 +76,10 @@ extern "C" {
#endif
/* Inclusion of all the kernel sub-headers.*/
-#include "chconf.h"
#include "chtypes.h"
-#include "chdebug.h"
+#include "chconf.h"
#include "chcore.h"
+#include "chdebug.h"
#include "chtm.h"
#include "chstats.h"
#include "chsys.h"
diff --git a/os/rt/ports/ARMCMx/chcore_timer.h b/os/rt/ports/ARMCMx/chcore_timer.h
index da3bd82de..1a0f98ac0 100644
--- a/os/rt/ports/ARMCMx/chcore_timer.h
+++ b/os/rt/ports/ARMCMx/chcore_timer.h
@@ -60,26 +60,6 @@
/* Module macros. */
/*===========================================================================*/
-/*===========================================================================*/
-/* External declarations. */
-/*===========================================================================*/
-
-/*===========================================================================*/
-/* Module inline functions. */
-/*===========================================================================*/
-
-/**
- * @brief Returns the system time.
- *
- * @return The system time.
- *
- * @notapi
- */
-static inline systime_t port_timer_get_time(void) {
-
- return stGetCounter();
-}
-
/**
* @brief Starts the alarm.
* @note Makes sure that no spurious alarms are triggered after
@@ -89,11 +69,9 @@ static inline systime_t port_timer_get_time(void) {
*
* @notapi
*/
-static inline void port_timer_start_alarm(systime_t time) {
-
- chDbgAssert(stIsAlarmActive() == false, "already active");
-
- stStartAlarm(time);
+#define port_timer_start_alarm(time) { \
+ chDbgAssert(stIsAlarmActive() == false, "already active"); \
+ stStartAlarm(time); \
}
/**
@@ -101,11 +79,9 @@ static inline void port_timer_start_alarm(systime_t time) {
*
* @notapi
*/
-static inline void port_timer_stop_alarm(void) {
-
- chDbgAssert(stIsAlarmActive() != false, "not active");
-
- stStopAlarm();
+#define port_timer_stop_alarm() { \
+ chDbgAssert(stIsAlarmActive() != false, "not active"); \
+ stStopAlarm(); \
}
/**
@@ -115,11 +91,29 @@ static inline void port_timer_stop_alarm(void) {
*
* @notapi
*/
-static inline void port_timer_set_alarm(systime_t time) {
+#define port_timer_set_alarm(time) { \
+ chDbgAssert(stIsAlarmActive() != false, "not active"); \
+ stSetAlarm(time); \
+}
- chDbgAssert(stIsAlarmActive() != false, "not active");
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
- stSetAlarm(time);
+/*===========================================================================*/
+/* Module inline functions. */
+/*===========================================================================*/
+
+/**
+ * @brief Returns the system time.
+ *
+ * @return The system time.
+ *
+ * @notapi
+ */
+static inline systime_t port_timer_get_time(void) {
+
+ return stGetCounter();
}
/**
@@ -131,8 +125,6 @@ static inline void port_timer_set_alarm(systime_t time) {
*/
static inline systime_t port_timer_get_alarm(void) {
- chDbgAssert(stIsAlarmActive() != false, "not active");
-
return stGetAlarm();
}
diff --git a/os/rt/ports/ARMCMx/chcore_v6m.h b/os/rt/ports/ARMCMx/chcore_v6m.h
index f1af44fdc..f72216f95 100644
--- a/os/rt/ports/ARMCMx/chcore_v6m.h
+++ b/os/rt/ports/ARMCMx/chcore_v6m.h
@@ -206,9 +206,9 @@ struct context {
tp->p_ctx.r13 = (struct port_intctx *)((uint8_t *)workspace + \
wsize - \
sizeof(struct port_intctx)); \
- tp->p_ctx.r13->r4 = (void *)(pf); \
- tp->p_ctx.r13->r5 = (void *)(arg); \
- tp->p_ctx.r13->lr = (void *)(_port_thread_start); \
+ tp->p_ctx.r13->r4 = (regarm_t)(pf); \
+ tp->p_ctx.r13->r5 = (regarm_t)(arg); \
+ tp->p_ctx.r13->lr = (regarm_t)(_port_thread_start); \
}
/**
diff --git a/os/rt/ports/ARMCMx/chcore_v7m.h b/os/rt/ports/ARMCMx/chcore_v7m.h
index c2c47024f..d768afaef 100644
--- a/os/rt/ports/ARMCMx/chcore_v7m.h
+++ b/os/rt/ports/ARMCMx/chcore_v7m.h
@@ -305,9 +305,9 @@ struct context {
tp->p_ctx.r13 = (struct port_intctx *)((uint8_t *)workspace + \
wsize - \
sizeof(struct port_intctx)); \
- tp->p_ctx.r13->r4 = (void *)(pf); \
- tp->p_ctx.r13->r5 = (void *)(arg); \
- tp->p_ctx.r13->lr = (void *)(_port_thread_start); \
+ tp->p_ctx.r13->r4 = (regarm_t)(pf); \
+ tp->p_ctx.r13->r5 = (regarm_t)(arg); \
+ tp->p_ctx.r13->lr = (regarm_t)(_port_thread_start); \
}
/**
diff --git a/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h b/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h
index 26a1e5c81..bc33d2e10 100644
--- a/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h
+++ b/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h
@@ -33,7 +33,24 @@
#include <stdint.h>
#include <stdbool.h>
-typedef bool bool_t; /**< Fast boolean type. */
+/**
+ * @name Common constants
+ */
+/**
+ * @brief Generic 'false' boolean constant.
+ */
+#if !defined(FALSE) || defined(__DOXYGEN__)
+#define FALSE 0
+#endif
+
+/**
+ * @brief Generic 'true' boolean constant.
+ */
+#if !defined(TRUE) || defined(__DOXYGEN__)
+#define TRUE (!FALSE)
+#endif
+/** @} */
+
typedef uint32_t systime_t; /**< System time. */
typedef uint32_t rtcnt_t; /**< Realtime counter. */
typedef uint64_t rttime_t; /**< Time accumulator. */