From 84e044f176cee7c6946b24c36c90f63534b5b369 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 19 Jul 2013 12:22:31 +0000 Subject: Renamed Thread to thread_t. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@5995 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chmsg.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'os/kernel/include/chmsg.h') diff --git a/os/kernel/include/chmsg.h b/os/kernel/include/chmsg.h index e613a6aad..be3103db9 100644 --- a/os/kernel/include/chmsg.h +++ b/os/kernel/include/chmsg.h @@ -41,7 +41,7 @@ * @iclass */ #define chMsgIsPendingI(tp) \ - ((tp)->p_msgqueue.p_next != (Thread *)&(tp)->p_msgqueue) + ((tp)->p_msgqueue.p_next != (thread_t *)&(tp)->p_msgqueue) /** * @brief Returns the message carried by the specified thread. @@ -71,9 +71,9 @@ #ifdef __cplusplus extern "C" { #endif - msg_t chMsgSend(Thread *tp, msg_t msg); - Thread * chMsgWait(void); - void chMsgRelease(Thread *tp, msg_t msg); + msg_t chMsgSend(thread_t *tp, msg_t msg); + thread_t * chMsgWait(void); + void chMsgRelease(thread_t *tp, msg_t msg); #ifdef __cplusplus } #endif -- cgit v1.2.3 From 25ddb1c801f06a3be7171e20dcfd46d11a75f112 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 19 Jul 2013 14:51:35 +0000 Subject: 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 --- os/kernel/include/chmsg.h | 69 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 52 insertions(+), 17 deletions(-) (limited to 'os/kernel/include/chmsg.h') 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 */ -- cgit v1.2.3 From 390ed322cb8f40cb9250021cde5f48acb928d291 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 20 Jul 2013 07:24:12 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6001 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chmsg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'os/kernel/include/chmsg.h') diff --git a/os/kernel/include/chmsg.h b/os/kernel/include/chmsg.h index 1e9099c73..4461b30dd 100644 --- a/os/kernel/include/chmsg.h +++ b/os/kernel/include/chmsg.h @@ -70,7 +70,7 @@ extern "C" { /*===========================================================================*/ /** - * @brief Evaluates to TRUE if the thread has pending messages. + * @brief Evaluates to @p true if the thread has pending messages. * * @iclass */ -- cgit v1.2.3 From 49d71a01abeefa000a4cd7a556052d826b096d49 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 20 Jul 2013 10:12:44 +0000 Subject: Renamed or added prefix to all hernel configuration options. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6010 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chmsg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'os/kernel/include/chmsg.h') diff --git a/os/kernel/include/chmsg.h b/os/kernel/include/chmsg.h index 4461b30dd..ff07edfb3 100644 --- a/os/kernel/include/chmsg.h +++ b/os/kernel/include/chmsg.h @@ -29,7 +29,7 @@ #ifndef _CHMSG_H_ #define _CHMSG_H_ -#if CH_USE_MESSAGES || defined(__DOXYGEN__) +#if CH_CFG_USE_MESSAGES || defined(__DOXYGEN__) /*===========================================================================*/ /* Module constants. */ @@ -113,7 +113,7 @@ static inline void chMsgReleaseS(thread_t *tp, msg_t msg) { chSchWakeupS(tp, msg); } -#endif /* CH_USE_MESSAGES */ +#endif /* CH_CFG_USE_MESSAGES */ #endif /* _CHMSG_H_ */ -- cgit v1.2.3 From a1435e018bfc9919cb76b1356509ecc883767fb4 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 10 Aug 2013 14:51:16 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6123 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chmsg.h | 120 ---------------------------------------------- 1 file changed, 120 deletions(-) delete mode 100644 os/kernel/include/chmsg.h (limited to 'os/kernel/include/chmsg.h') diff --git a/os/kernel/include/chmsg.h b/os/kernel/include/chmsg.h deleted file mode 100644 index ff07edfb3..000000000 --- a/os/kernel/include/chmsg.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012,2013 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/** - * @file chmsg.h - * @brief Messages macros and structures. - * - * @addtogroup messages - * @{ - */ - -#ifndef _CHMSG_H_ -#define _CHMSG_H_ - -#if CH_CFG_USE_MESSAGES || defined(__DOXYGEN__) - -/*===========================================================================*/ -/* 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 @p true if the thread has pending messages. - * - * @iclass - */ -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. - * @pre This function must be invoked immediately after exiting a call - * to @p chMsgWait(). - * - * @param[in] tp pointer to the thread - * @return The message carried by the sender. - * - * @api - */ -static inline msg_t chMsgGet(thread_t *tp) { - - return tp->p_msg; -} - -/** - * @brief Releases the thread waiting on top of the messages queue. - * @pre Invoke this function only after a message has been received - * using @p chMsgWait(). - * - * @param[in] tp pointer to the thread - * @param[in] msg message to be returned to the sender - * - * @sclass - */ -static inline void chMsgReleaseS(thread_t *tp, msg_t msg) { - - chDbgCheckClassS(); - - chSchWakeupS(tp, msg); -} - -#endif /* CH_CFG_USE_MESSAGES */ - -#endif /* _CHMSG_H_ */ - -/** @} */ -- cgit v1.2.3