diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-07-19 14:51:35 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-07-19 14:51:35 +0000 |
commit | 25ddb1c801f06a3be7171e20dcfd46d11a75f112 (patch) | |
tree | 8a9cc02a0a62649b44821817b96a6c148ddfc9f8 /os/kernel/include/chmsg.h | |
parent | d58064a533743df77e52f9d76385a9e0ea1d0227 (diff) | |
download | ChibiOS-25ddb1c801f06a3be7171e20dcfd46d11a75f112.tar.gz ChibiOS-25ddb1c801f06a3be7171e20dcfd46d11a75f112.tar.bz2 ChibiOS-25ddb1c801f06a3be7171e20dcfd46d11a75f112.zip |
First cleanup pass finished, queues and streams not yet removed.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@5999 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/include/chmsg.h')
-rw-r--r-- | os/kernel/include/chmsg.h | 69 |
1 files changed, 52 insertions, 17 deletions
diff --git a/os/kernel/include/chmsg.h b/os/kernel/include/chmsg.h index be3103db9..1e9099c73 100644 --- a/os/kernel/include/chmsg.h +++ b/os/kernel/include/chmsg.h @@ -31,17 +31,55 @@ #if CH_USE_MESSAGES || defined(__DOXYGEN__)
-/**
- * @name Macro Functions
- * @{
- */
+/*===========================================================================*/
+/* Module constants. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Module pre-compile time settings. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Module data structures and types. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Module macros. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ msg_t chMsgSend(thread_t *tp, msg_t msg);
+ thread_t * chMsgWait(void);
+ void chMsgRelease(thread_t *tp, msg_t msg);
+#ifdef __cplusplus
+}
+#endif
+
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
/**
* @brief Evaluates to TRUE if the thread has pending messages.
*
* @iclass
*/
-#define chMsgIsPendingI(tp) \
- ((tp)->p_msgqueue.p_next != (thread_t *)&(tp)->p_msgqueue)
+static inline bool chMsgIsPendingI(thread_t *tp) {
+
+ chDbgCheckClassI();
+
+ return (bool)(tp->p_msgqueue.p_next != (thread_t *)&tp->p_msgqueue);
+}
/**
* @brief Returns the message carried by the specified thread.
@@ -53,7 +91,10 @@ *
* @api
*/
-#define chMsgGet(tp) ((tp)->p_msg)
+static inline msg_t chMsgGet(thread_t *tp) {
+
+ return tp->p_msg;
+}
/**
* @brief Releases the thread waiting on top of the messages queue.
@@ -65,18 +106,12 @@ *
* @sclass
*/
-#define chMsgReleaseS(tp, msg) chSchWakeupS(tp, msg)
-/** @} */
+static inline void chMsgReleaseS(thread_t *tp, msg_t msg) {
-#ifdef __cplusplus
-extern "C" {
-#endif
- msg_t chMsgSend(thread_t *tp, msg_t msg);
- thread_t * chMsgWait(void);
- void chMsgRelease(thread_t *tp, msg_t msg);
-#ifdef __cplusplus
+ chDbgCheckClassS();
+
+ chSchWakeupS(tp, msg);
}
-#endif
#endif /* CH_USE_MESSAGES */
|