diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-07-19 14:51:35 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-07-19 14:51:35 +0000 |
commit | 25ddb1c801f06a3be7171e20dcfd46d11a75f112 (patch) | |
tree | 8a9cc02a0a62649b44821817b96a6c148ddfc9f8 /os/kernel/include/chregistry.h | |
parent | d58064a533743df77e52f9d76385a9e0ea1d0227 (diff) | |
download | ChibiOS-25ddb1c801f06a3be7171e20dcfd46d11a75f112.tar.gz ChibiOS-25ddb1c801f06a3be7171e20dcfd46d11a75f112.tar.bz2 ChibiOS-25ddb1c801f06a3be7171e20dcfd46d11a75f112.zip |
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
Diffstat (limited to 'os/kernel/include/chregistry.h')
-rw-r--r-- | os/kernel/include/chregistry.h | 101 |
1 files changed, 69 insertions, 32 deletions
diff --git a/os/kernel/include/chregistry.h b/os/kernel/include/chregistry.h index 552e9d598..b176058ce 100644 --- a/os/kernel/include/chregistry.h +++ b/os/kernel/include/chregistry.h @@ -31,6 +31,22 @@ #if CH_USE_REGISTRY || defined(__DOXYGEN__)
+/*===========================================================================*/
+/* Module constants. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Module pre-compile time settings. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Module data structures and types. */
+/*===========================================================================*/
+
/**
* @brief ChibiOS/RT memory signature record.
*/
@@ -57,39 +73,10 @@ typedef struct { uint8_t cf_off_time; /**< @brief Offset of @p p_time field. */
} chdebug_t;
-/**
- * @name Macro Functions
- * @{
- */
-/**
- * @brief Sets the current thread name.
- * @pre This function only stores the pointer to the name if the option
- * @p CH_USE_REGISTRY is enabled else no action is performed.
- *
- * @param[in] p thread name as a zero terminated string
- *
- * @api
- */
-#define chRegSetThreadName(p) (currp->p_name = (p))
-
-/**
- * @brief Returns the name of the specified thread.
- * @pre This function only returns the pointer to the name if the option
- * @p CH_USE_REGISTRY is enabled else @p NULL is returned.
- *
- * @param[in] tp pointer to the thread
- *
- * @return Thread name as a zero terminated string.
- * @retval NULL if the thread name has not been set.
- */
-#define chRegGetThreadName(tp) ((tp)->p_name)
-/** @} */
-#else /* !CH_USE_REGISTRY */
-#define chRegSetThreadName(p)
-#define chRegGetThreadName(tp) NULL
-#endif /* !CH_USE_REGISTRY */
+/*===========================================================================*/
+/* Module macros. */
+/*===========================================================================*/
-#if CH_USE_REGISTRY || defined(__DOXYGEN__)
/**
* @brief Removes a thread from the registry list.
* @note This macro is not meant for use in application code.
@@ -113,6 +100,10 @@ typedef struct { (tp)->p_older->p_newer = rlist.r_older = (tp); \
}
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -123,6 +114,52 @@ extern "C" { }
#endif
+/*===========================================================================*/
+/* Module inline functions. */
+/*===========================================================================*/
+
+/**
+ * @brief Sets the current thread name.
+ * @pre This function only stores the pointer to the name if the option
+ * @p CH_USE_REGISTRY is enabled else no action is performed.
+ *
+ * @param[in] p thread name as a zero terminated string
+ *
+ * @api
+ */
+static inline void chRegSetThreadName(const char *name) {
+
+#if CH_USE_REGISTRY
+ currp->p_name = name;
+#else
+ (void)name;
+#endif
+}
+
+/**
+ * @brief Returns the name of the specified thread.
+ * @pre This function only returns the pointer to the name if the option
+ * @p CH_USE_REGISTRY is enabled else @p NULL is returned.
+ *
+ * @param[in] tp pointer to the thread
+ *
+ * @return Thread name as a zero terminated string.
+ * @retval NULL if the thread name has not been set.
+ *
+ * @iclass
+ */
+static inline const char *chRegGetThreadNameI(thread_t *tp) {
+
+ chDbgCheckClassI();
+
+#if CH_USE_REGISTRY
+ return tp->p_name;
+#else
+ (void)tp;
+ return NULL;
+#endif
+}
+
#endif /* CH_USE_REGISTRY */
#endif /* _CHREGISTRY_H_ */
|