aboutsummaryrefslogtreecommitdiffstats
path: root/os/common/oslib/include/chfactory.h
diff options
context:
space:
mode:
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 */