diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-02-06 12:31:09 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-02-06 12:31:09 +0000 |
commit | 8e428dbd1a48615c36c8c086dd51079050c9fb1c (patch) | |
tree | d1c7168826614acb1925e997915a010f3c4d999b /os/kernel/include/semaphores.h | |
parent | f17db1931e95f5ebb42f557b6eead2bf1320db5a (diff) | |
download | ChibiOS-8e428dbd1a48615c36c8c086dd51079050c9fb1c.tar.gz ChibiOS-8e428dbd1a48615c36c8c086dd51079050c9fb1c.tar.bz2 ChibiOS-8e428dbd1a48615c36c8c086dd51079050c9fb1c.zip |
Kernel headers cleanup.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1568 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/include/semaphores.h')
-rw-r--r-- | os/kernel/include/semaphores.h | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/os/kernel/include/semaphores.h b/os/kernel/include/semaphores.h index 65dd64a9c..b2fbba65c 100644 --- a/os/kernel/include/semaphores.h +++ b/os/kernel/include/semaphores.h @@ -18,8 +18,9 @@ */
/**
- * @file semaphores.h
- * @brief Semaphores macros and structures.
+ * @file semaphores.h
+ * @brief Semaphores macros and structures.
+ *
* @addtogroup semaphores
* @{
*/
@@ -30,12 +31,12 @@ #if CH_USE_SEMAPHORES
/**
- * @brief Semaphore structure.
+ * @brief Semaphore structure.
*/
typedef struct Semaphore {
- ThreadsQueue s_queue; /**< Queue of the threads sleeping on
- this semaphore.*/
- cnt_t s_cnt; /**< The semaphore counter.*/
+ ThreadsQueue s_queue; /**< @brief Queue of the threads sleeping
+ on this semaphore. */
+ cnt_t s_cnt; /**< @brief The semaphore counter. */
} Semaphore;
#ifdef __cplusplus
@@ -58,37 +59,41 @@ extern "C" { #endif
/**
- * @brief Data part of a static semaphore initializer.
+ * @brief Data part of a static semaphore initializer.
* @details This macro should be used when statically initializing a semaphore
- * that is part of a bigger structure. - * @param name the name of the semaphore variable
- * @param n the counter initial value, this value must be non-negative
+ * that is part of a bigger structure.
+ * + * @param[in] name the name of the semaphore variable
+ * @param[in] n the counter initial value, this value must be
+ * non-negative
*/
#define _SEMAPHORE_DATA(name, n) {_THREADSQUEUE_DATA(name.s_queue), n}
/**
- * @brief Static semaphore initializer.
- * @details Statically initialized semaphores require no explicit initialization
- * using @p chSemInit().
- * @param name the name of the semaphore variable
- * @param n the counter initial value, this value must be non-negative + * @brief Static semaphore initializer.
+ * @details Statically initialized semaphores require no explicit
+ * initialization using @p chSemInit().
+ *
+ * @param[in] name the name of the semaphore variable
+ * @param[in] n the counter initial value, this value must be
+ * non-negative */
#define SEMAPHORE_DECL(name, n) Semaphore name = _SEMAPHORE_DATA(name, n)
/**
- * Decreases the semaphore counter, this macro can be used when it is ensured
- * that the counter would not become negative.
+ * @brief Decreases the semaphore counter.
+ * @details This macro can be used when the counter is known to be positive.
*/
#define chSemFastWaitI(sp) ((sp)->s_cnt--)
/**
- * Increases the semaphore counter, this macro can be used when the counter is
- * not negative.
+ * @brief Increases the semaphore counter.
+ * @details This macro can be used when the counter is known to be not negative.
*/
#define chSemFastSignalI(sp) ((sp)->s_cnt++)
/**
- * Returns the semaphore counter current value.
+ * @brief Returns the semaphore counter current value.
*/
#define chSemGetCounterI(sp) ((sp)->s_cnt)
|