diff options
Diffstat (limited to 'os/rt/include')
-rw-r--r-- | os/rt/include/ch.h | 4 | ||||
-rw-r--r-- | os/rt/include/chschd.h | 50 | ||||
-rw-r--r-- | os/rt/include/chvt.h | 25 |
3 files changed, 40 insertions, 39 deletions
diff --git a/os/rt/include/ch.h b/os/rt/include/ch.h index 11c75c407..a8cc7ac81 100644 --- a/os/rt/include/ch.h +++ b/os/rt/include/ch.h @@ -62,10 +62,6 @@ #define CH_KERNEL_PATCH 0
/** @} */
-/* Forward declarations.*/
-typedef struct thread thread_t;
-typedef struct virtual_timer virtual_timer_t;
-
/* Core headers.*/
#include "chtypes.h"
#include "chconf.h"
diff --git a/os/rt/include/chschd.h b/os/rt/include/chschd.h index bcca26d85..fe85f76cb 100644 --- a/os/rt/include/chschd.h +++ b/os/rt/include/chschd.h @@ -69,16 +69,16 @@ /*===========================================================================*/
/**
- * @brief Generic threads single link list, it works like a stack.
+ * @extends threads_queue_t
+ *
+ * @brief Type of a thread structure.
*/
-typedef struct {
- thread_t *p_next; /**< @brief Next in the list/queue. */
-} threads_list_t;
+typedef struct thread thread_t;
/**
* @extends threads_list_t
*
- * @brief Generic threads bidirectional linked list header and element.
+ * @brief Type of a generic threads bidirectional linked list header and element.
*/
typedef struct {
thread_t *p_next; /**< @brief Next in the list/queue. */
@@ -86,6 +86,13 @@ typedef struct { } threads_queue_t;
/**
+ * @brief Type of a generic threads single link list, it works like a stack.
+ */
+typedef struct {
+ thread_t *p_next; /**< @brief Next in the list/queue. */
+} threads_list_t;
+
+/**
* @extends threads_queue_t
*
* @brief Ready list header.
@@ -106,14 +113,12 @@ typedef struct { } ready_list_t;
/**
- * @extends threads_queue_t
- *
* @brief Structure representing a thread.
* @note Not all the listed fields are always needed, by switching off some
* not needed ChibiOS/RT subsystems it is possible to save RAM space
- * by shrinking the @p thread_t structure.
+ * by shrinking this structure.
*/
-typedef struct thread {
+struct thread {
thread_t *p_next; /**< @brief Next in the list/queue. */
/* End of the fields shared with the threads_list_t structure.*/
thread_t *p_prev; /**< @brief Previous in the queue. */
@@ -246,7 +251,32 @@ typedef struct thread { /* Extra fields defined in chconf.h.*/
CH_CFG_THREAD_EXTRA_FIELDS
#endif
-} thread_t;
+};
+
+/**
+ * @brief Type of a Virtual Timer callback function.
+ */
+typedef void (*vtfunc_t)(void *);
+
+/**
+ * @brief Type of a Virtual Timer structure.
+ */
+typedef struct virtual_timer virtual_timer_t;
+
+/**
+ * @extends virtual_timers_list_t
+ *
+ * @brief Virtual Timer descriptor structure.
+ */
+struct virtual_timer {
+ virtual_timer_t *vt_next; /**< @brief Next timer in the list. */
+ virtual_timer_t *vt_prev; /**< @brief Previous timer in the list. */
+ systime_t vt_delta; /**< @brief Time delta before timeout. */
+ vtfunc_t vt_func; /**< @brief Timer callback function
+ pointer. */
+ void *vt_par; /**< @brief Timer callback function
+ parameter. */
+};
/**
* @brief Virtual timers list header.
diff --git a/os/rt/include/chvt.h b/os/rt/include/chvt.h index 5c2d49d31..471ba22ee 100644 --- a/os/rt/include/chvt.h +++ b/os/rt/include/chvt.h @@ -87,31 +87,6 @@ /* Module data structures and types. */
/*===========================================================================*/
-/**
- * @brief Type of a Virtual Timer callback function.
- */
-typedef void (*vtfunc_t)(void *);
-
-/**
- * @brief Type of a Virtual Timer structure.
- */
-typedef struct virtual_timer virtual_timer_t;
-
-/**
- * @extends virtual_timers_list_t
- *
- * @brief Virtual Timer descriptor structure.
- */
-struct virtual_timer {
- virtual_timer_t *vt_next; /**< @brief Next timer in the list. */
- virtual_timer_t *vt_prev; /**< @brief Previous timer in the list. */
- systime_t vt_delta; /**< @brief Time delta before timeout. */
- vtfunc_t vt_func; /**< @brief Timer callback function
- pointer. */
- void *vt_par; /**< @brief Timer callback function
- parameter. */
-};
-
/*===========================================================================*/
/* Module macros. */
/*===========================================================================*/
|