aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/include
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-03-06 15:33:35 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-03-06 15:33:35 +0000
commit0678da6352ac484d560086a7f08b533c171b3ef1 (patch)
tree6f72aef789299612d3de1f8412e73fab21e58220 /os/rt/include
parent94db6c6fab0c7b453430190eef4a0d2ddc10b446 (diff)
downloadChibiOS-0678da6352ac484d560086a7f08b533c171b3ef1.tar.gz
ChibiOS-0678da6352ac484d560086a7f08b533c171b3ef1.tar.bz2
ChibiOS-0678da6352ac484d560086a7f08b533c171b3ef1.zip
More MISRA.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7718 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt/include')
-rw-r--r--os/rt/include/chmtx.h4
-rw-r--r--os/rt/include/chschd.h27
-rw-r--r--os/rt/include/chsem.h2
-rw-r--r--os/rt/include/chsystypes.h5
-rw-r--r--os/rt/include/chthreads.h5
5 files changed, 34 insertions, 9 deletions
diff --git a/os/rt/include/chmtx.h b/os/rt/include/chmtx.h
index 4a4b643ff..caa0c8266 100644
--- a/os/rt/include/chmtx.h
+++ b/os/rt/include/chmtx.h
@@ -49,12 +49,12 @@
/**
* @brief Type of a mutex structure.
*/
-typedef struct mutex mutex_t;
+typedef struct ch_mutex mutex_t;
/**
* @brief Mutex structure.
*/
-struct mutex {
+struct ch_mutex {
threads_queue_t m_queue; /**< @brief Queue of the threads sleeping
on this mutex. */
thread_t *m_owner; /**< @brief Owner @p thread_t pointer or
diff --git a/os/rt/include/chschd.h b/os/rt/include/chschd.h
index c166bc034..f57972a88 100644
--- a/os/rt/include/chschd.h
+++ b/os/rt/include/chschd.h
@@ -265,6 +265,31 @@ struct ch_thread {
* states.
*/
void *wtobjp;
+ /**
+ * @brief Pointer to a generic thread reference object.
+ * @note This field is used to get a pointer to a synchronization
+ * object and is valid when the thread is in @p CH_STATE_SUSPENDED
+ * state.
+ */
+ thread_reference_t *wttrp;
+#if (CH_CFG_USE_SEMAPHORES == TRUE) || defined(__DOXYGEN__)
+ /**
+ * @brief Pointer to a generic semaphore object.
+ * @note This field is used to get a pointer to a synchronization
+ * object and is valid when the thread is in @p CH_STATE_WTSEM
+ * state.
+ */
+ struct ch_semaphore *wtsemp;
+#endif
+#if (CH_CFG_USE_MUTEXES == TRUE) || defined(__DOXYGEN__)
+ /**
+ * @brief Pointer to a generic mutex object.
+ * @note This field is used to get a pointer to a synchronization
+ * object and is valid when the thread is in @p CH_STATE_WTMTX
+ * state.
+ */
+ struct ch_mutex *wtmtxp;
+#endif
#if (CH_CFG_USE_EVENTS == TRUE) || defined(__DOXYGEN__)
/**
* @brief Enabled events mask.
@@ -301,7 +326,7 @@ struct ch_thread {
* @brief List of the mutexes owned by this thread.
* @note The list is terminated by a @p NULL in this field.
*/
- struct mutex *p_mtxlist;
+ struct ch_mutex *p_mtxlist;
/**
* @brief Thread's own, non-inherited, priority.
*/
diff --git a/os/rt/include/chsem.h b/os/rt/include/chsem.h
index 51a29e0f2..efc1cea0b 100644
--- a/os/rt/include/chsem.h
+++ b/os/rt/include/chsem.h
@@ -49,7 +49,7 @@
/**
* @brief Semaphore structure.
*/
-typedef struct semaphore {
+typedef struct ch_semaphore {
threads_queue_t s_queue; /**< @brief Queue of the threads sleeping
on this semaphore. */
cnt_t s_cnt; /**< @brief The semaphore counter. */
diff --git a/os/rt/include/chsystypes.h b/os/rt/include/chsystypes.h
index cf101e0db..9a01a93c4 100644
--- a/os/rt/include/chsystypes.h
+++ b/os/rt/include/chsystypes.h
@@ -63,6 +63,11 @@ typedef uint16_t systime_t;
typedef struct ch_thread thread_t;
/**
+ * @brief Type of a thread reference.
+ */
+typedef thread_t * thread_reference_t;
+
+/**
* @brief Type of a generic threads single link list, it works like a stack.
*/
typedef struct ch_threads_list threads_list_t;
diff --git a/os/rt/include/chthreads.h b/os/rt/include/chthreads.h
index 44b9e2032..6632d8d62 100644
--- a/os/rt/include/chthreads.h
+++ b/os/rt/include/chthreads.h
@@ -45,11 +45,6 @@
/*===========================================================================*/
/**
- * @brief Type of a thread reference.
- */
-typedef thread_t * thread_reference_t;
-
-/**
* @brief Thread function.
*/
typedef msg_t (*tfunc_t)(void *p);