aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/include/chregistry.h
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-07-13 21:09:39 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-07-13 21:09:39 +0000
commit5fee9bc344b38d79ff1baf26e6365eeae7d407b5 (patch)
treecd03f7ccbdf0a44026bc0f80b6fc87b9a6d361d0 /os/kernel/include/chregistry.h
parent2bdd9885e282b8cf26642f4a4b73fc4e61da872c (diff)
parent2e5abeebad5e94989f62e05582028f02c5e71dda (diff)
downloadChibiOS-5fee9bc344b38d79ff1baf26e6365eeae7d407b5.tar.gz
ChibiOS-5fee9bc344b38d79ff1baf26e6365eeae7d407b5.tar.bz2
ChibiOS-5fee9bc344b38d79ff1baf26e6365eeae7d407b5.zip
I2C. Merged changes from trunk.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@3160 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/include/chregistry.h')
-rw-r--r--os/kernel/include/chregistry.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/os/kernel/include/chregistry.h b/os/kernel/include/chregistry.h
index 3e9cc5508..0967f699e 100644
--- a/os/kernel/include/chregistry.h
+++ b/os/kernel/include/chregistry.h
@@ -30,6 +30,34 @@
#define _CHREGISTRY_H_
#if CH_USE_REGISTRY || defined(__DOXYGEN__)
+/**
+ * @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 */
+
+#if CH_USE_REGISTRY || defined(__DOXYGEN__)
/**
* @brief Removes a thread from the registry list.