aboutsummaryrefslogtreecommitdiffstats
path: root/os/common/oslib/include/chfactory.h
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2017-09-26 08:03:05 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2017-09-26 08:03:05 +0000
commit9f30d457c02f514d4d60112ba4ffeb367ce3bee6 (patch)
treeecd38bae3f9055dd1dcd389f05abfecbbbe7a5bb /os/common/oslib/include/chfactory.h
parent0a24112ccdf69df68f478a8b84998052aba68a8b (diff)
downloadChibiOS-9f30d457c02f514d4d60112ba4ffeb367ce3bee6.tar.gz
ChibiOS-9f30d457c02f514d4d60112ba4ffeb367ce3bee6.tar.bz2
ChibiOS-9f30d457c02f514d4d60112ba4ffeb367ce3bee6.zip
More factory code.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10714 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/common/oslib/include/chfactory.h')
-rw-r--r--os/common/oslib/include/chfactory.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/os/common/oslib/include/chfactory.h b/os/common/oslib/include/chfactory.h
index d8cd20a22..2fe2765dd 100644
--- a/os/common/oslib/include/chfactory.h
+++ b/os/common/oslib/include/chfactory.h
@@ -131,7 +131,7 @@ typedef struct ch_dyn_object {
/**
* @brief List element of the dynamic object.
*/
- dyn_element_t list;
+ dyn_element_t element;
/**
* @brief Physical objects.
* @note This requires C99.
@@ -148,7 +148,7 @@ typedef struct ch_dyn_semaphore {
/**
* @brief List element of the dynamic semaphore.
*/
- dyn_element_t list;
+ dyn_element_t element;
/**
* @brief Physical semaphore.
*/
@@ -213,6 +213,22 @@ extern "C" {
/* Module inline functions. */
/*===========================================================================*/
+/**
+ * @brief Duplicates an object reference.
+ *
+ * @param[in] dep pointer to the element field of the object
+ *
+ * @iclass
+ */
+static inline dyn_element_t *chFactoryDuplicateReferenceI(dyn_element_t *dep) {
+
+ chDbgCheckClassI();
+
+ dep->refs++;
+
+ return dep;
+}
+
#endif /* CH_CFG_USE_FACTORY == TRUE */
#endif /* CHFACTORY_H */