aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
Diffstat (limited to 'os')
-rw-r--r--os/rt/include/chregistry.h38
1 files changed, 20 insertions, 18 deletions
diff --git a/os/rt/include/chregistry.h b/os/rt/include/chregistry.h
index e4cbb0d68..84c6c1a52 100644
--- a/os/rt/include/chregistry.h
+++ b/os/rt/include/chregistry.h
@@ -78,6 +78,26 @@ typedef struct {
/*===========================================================================*/
/**
+ * @name Macro Functions
+ * @{
+ */
+/**
+ * @brief Sets the current thread name.
+ * @pre This function only stores the pointer to the name if the option
+ * @p CH_CFG_USE_REGISTRY is enabled else no action is performed.
+ *
+ * @param[in] p thread name as a zero terminated string
+ *
+ * @api
+ */
+#define chRegSetThreadName(p) (ch.rlist.r_current->p_name = (p))
+/** @} */
+#else /* !CH_CFG_USE_REGISTRY */
+#define chRegSetThreadName(p)
+#endif /* !CH_CFG_USE_REGISTRY */
+
+#if CH_CFG_USE_REGISTRY || defined(__DOXYGEN__)
+/**
* @brief Removes a thread from the registry list.
* @note This macro is not meant for use in application code.
*
@@ -119,24 +139,6 @@ extern "C" {
/*===========================================================================*/
/**
- * @brief Sets the current thread name.
- * @pre This function only stores the pointer to the name if the option
- * @p CH_CFG_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_CFG_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_CFG_USE_REGISTRY is enabled else @p NULL is returned.