aboutsummaryrefslogtreecommitdiffstats
path: root/src/chsem.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-01-20 16:26:48 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-01-20 16:26:48 +0000
commit22e22db0161126d1c58a07e2323662efc18d6c86 (patch)
treee59efd65935cdb9d1358a598925a0a3fa5ace5fd /src/chsem.c
parentb1d77bf4bc7fb6e89b5280d99f401caa50c8a0d8 (diff)
downloadChibiOS-22e22db0161126d1c58a07e2323662efc18d6c86.tar.gz
ChibiOS-22e22db0161126d1c58a07e2323662efc18d6c86.tar.bz2
ChibiOS-22e22db0161126d1c58a07e2323662efc18d6c86.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@649 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src/chsem.c')
-rw-r--r--src/chsem.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/src/chsem.c b/src/chsem.c
index 094a30d4e..3af4854f5 100644
--- a/src/chsem.c
+++ b/src/chsem.c
@@ -26,10 +26,13 @@
#ifdef CH_USE_SEMAPHORES
/**
- * Initializes a semaphore with the specified counter value.
+ * @brief Initializes a semaphore with the specified counter value.
+ *
* @param sp pointer to a @p Semaphore structure
* @param n initial value of the semaphore counter. Must be non-negative.
- * @note Can be called with interrupts disabled or enabled.
+ * @note This function can be invoked from within an interrupt handler even if
+ * it is not an I-Class API because it does not touch any critical kernel
+ * data structure.
*/
void chSemInit(Semaphore *sp, cnt_t n) {
@@ -39,7 +42,8 @@ void chSemInit(Semaphore *sp, cnt_t n) {
}
/**
- * Performs a reset operation on the semaphore.
+ * @brief Performs a reset operation on the semaphore.
+ *
* @param sp pointer to a @p Semaphore structure
* @param n the new value of the semaphore counter. The value must be non-negative.
* @note The released threads can recognize they were waked up by a reset
@@ -57,7 +61,8 @@ void chSemReset(Semaphore *sp, cnt_t n) {
}
/**
- * Performs a reset operation on the semaphore.
+ * @brief Performs a reset operation on the semaphore.
+ *
* @param sp pointer to a @p Semaphore structure
* @param n the new value of the semaphore counter. The value must be non-negative.
* @note The released threads can recognize they were waked up by a reset
@@ -76,7 +81,8 @@ void chSemResetI(Semaphore *sp, cnt_t n) {
}
/**
- * Performs a wait operation on a semaphore.
+ * @brief Performs a wait operation on a semaphore.
+ *
* @param sp pointer to a @p Semaphore structure
* @retval RDY_OK if the semaphore was signaled or not taken.
* @retval RDY_RESET if the semaphore was reset using @p chSemReset().
@@ -93,7 +99,8 @@ msg_t chSemWait(Semaphore *sp) {
}
/**
- * Performs a wait operation on a semaphore.
+ * @brief Performs a wait operation on a semaphore.
+ *
* @param sp pointer to a @p Semaphore structure
* @retval RDY_OK if the semaphore was signaled or not taken.
* @retval RDY_RESET if the semaphore was reset using @p chSemReset().
@@ -113,7 +120,8 @@ msg_t chSemWaitS(Semaphore *sp) {
#ifdef CH_USE_SEMAPHORES_TIMEOUT
/**
- * Performs a wait operation on a semaphore with timeout specification.
+ * @brief Performs a wait operation on a semaphore with timeout specification.
+ *
* @param sp pointer to a @p Semaphore structure
* @param time the number of ticks before the operation fails
* @retval RDY_OK if the semaphore was signaled or not taken.
@@ -135,7 +143,8 @@ msg_t chSemWaitTimeout(Semaphore *sp, systime_t time) {
}
/**
- * Performs a wait operation on a semaphore with timeout specification.
+ * @brief Performs a wait operation on a semaphore with timeout specification.
+ *
* @param sp pointer to a @p Semaphore structure
* @param time the number of ticks before the operation fails
* @retval RDY_OK if the semaphore was signaled or not taken.
@@ -157,7 +166,8 @@ msg_t chSemWaitTimeoutS(Semaphore *sp, systime_t time) {
#endif /* CH_USE_SEMAPHORES_TIMEOUT */
/**
- * Performs a signal operation on a semaphore.
+ * @brief Performs a signal operation on a semaphore.
+ *
* @param sp pointer to a @p Semaphore structure
* @note The function is available only if the @p CH_USE_SEMAPHORES
* option is enabled in @p chconf.h.
@@ -173,7 +183,8 @@ void chSemSignal(Semaphore *sp) {
}
/**
- * Performs a signal operation on a semaphore.
+ * @brief Performs a signal operation on a semaphore.
+ *
* @param sp pointer to a @p Semaphore structure
* @note The function is available only if the @p CH_USE_SEMAPHORES
* option is enabled in @p chconf.h.
@@ -192,7 +203,8 @@ void chSemSignalI(Semaphore *sp) {
#ifdef CH_USE_SEMSW
/**
- * Performs atomic signal and wait operations on two semaphores.
+ * @brief Performs atomic signal and wait operations on two semaphores.
+ *
* @param sps pointer to a @p Semaphore structure to be signaled
* @param spw pointer to a @p Semaphore structure to be wait on
* @retval RDY_OK if the semaphore was signaled or not taken.