aboutsummaryrefslogtreecommitdiffstats
path: root/os/common/oslib/include
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2017-11-27 16:10:30 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2017-11-27 16:10:30 +0000
commitaebe7d83a55d5db9911b6dccd3a76259982bdcc6 (patch)
tree314a51eea1e1d363ea65d573c174002c842b2279 /os/common/oslib/include
parent71ccd7eb14c4cb3cc4362feda7adc19ec2fd0ff8 (diff)
downloadChibiOS-aebe7d83a55d5db9911b6dccd3a76259982bdcc6.tar.gz
ChibiOS-aebe7d83a55d5db9911b6dccd3a76259982bdcc6.tar.bz2
ChibiOS-aebe7d83a55d5db9911b6dccd3a76259982bdcc6.zip
Various fixes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11080 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/common/oslib/include')
-rw-r--r--os/common/oslib/include/chfactory.h77
-rw-r--r--os/common/oslib/include/chfifo.h4
2 files changed, 77 insertions, 4 deletions
diff --git a/os/common/oslib/include/chfactory.h b/os/common/oslib/include/chfactory.h
index 1804e7260..ca242171d 100644
--- a/os/common/oslib/include/chfactory.h
+++ b/os/common/oslib/include/chfactory.h
@@ -323,7 +323,7 @@ extern "C" {
void _factory_init(void);
#if (CH_CFG_FACTORY_OBJECTS_REGISTRY == TRUE) || defined(__DOXYGEN__)
registered_object_t *chFactoryRegisterObject(const char *name,
- void *objp);
+ void *objp);
registered_object_t *chFactoryFindObject(const char *name);
void chFactoryReleaseObject(registered_object_t *rop);
#endif
@@ -374,6 +374,21 @@ static inline dyn_element_t *chFactoryDuplicateReference(dyn_element_t *dep) {
return dep;
}
+#if (CH_CFG_FACTORY_OBJECTS_REGISTRY == TRUE) || defined(__DOXYGEN__)
+/**
+ * @brief Returns the pointer to the inner registered object.
+ *
+ * @param[in] rop registered object reference
+ * @return The pointer to the registered object.
+ *
+ * @api
+ */
+static inline void *chFactoryGetObject(registered_object_t *rop) {
+
+ return rop->objp;
+}
+#endif /* CH_CFG_FACTORY_OBJECTS_REGISTRY == TRUE */
+
#if (CH_CFG_FACTORY_GENERIC_BUFFERS == TRUE) || defined(__DOXYGEN__)
/**
* @brief Returns the size of a generic dynamic buffer object.
@@ -387,7 +402,65 @@ static inline size_t chFactoryGetBufferSize(dyn_buffer_t *dbp) {
return chHeapGetSize(dbp) - sizeof (dyn_element_t);
}
-#endif
+
+/**
+ * @brief Returns the pointer to the inner buffer.
+ *
+ * @param[in] dbp dynamic buffer object reference
+ * @return The pointer to the dynamic buffer.
+ *
+ * @api
+ */
+static inline uint8_t *chFactoryGetBuffer(dyn_buffer_t *dbp) {
+
+ return dbp->buffer;
+}
+#endif /* CH_CFG_FACTORY_GENERIC_BUFFERS == TRUE */
+
+#if (CH_CFG_FACTORY_SEMAPHORES == TRUE) || defined(__DOXYGEN__)
+/**
+ * @brief Returns the pointer to the inner semaphore.
+ *
+ * @param[in] dsp dynamic semaphore object reference
+ * @return The pointer to the semaphore.
+ *
+ * @api
+ */
+static inline semaphore_t *chFactoryGetSemaphore(dyn_semaphore_t *dsp) {
+
+ return &dsp->sem;
+}
+#endif /* CH_CFG_FACTORY_SEMAPHORES == TRUE */
+
+#if (CH_CFG_FACTORY_MAILBOXES == TRUE) || defined(__DOXYGEN__)
+/**
+ * @brief Returns the pointer to the inner mailbox.
+ *
+ * @param[in] dmp dynamic mailbox object reference
+ * @return The pointer to the mailbox.
+ *
+ * @api
+ */
+static inline mailbox_t *chFactoryGetMailbox(dyn_mailbox_t *dmp) {
+
+ return &dmp->mbx;
+}
+#endif /* CH_CFG_FACTORY_MAILBOXES == TRUE */
+
+#if (CH_CFG_FACTORY_OBJ_FIFOS == TRUE) || defined(__DOXYGEN__)
+/**
+ * @brief Returns the pointer to the inner objects FIFO.
+ *
+ * @param[in] dofp dynamic "objects FIFO" object reference
+ * @return The pointer to the objects FIFO.
+ *
+ * @api
+ */
+static inline objects_fifo_t *chFactoryGetObjectsFIFO(dyn_objects_fifo_t *dofp) {
+
+ return &dofp->fifo;
+}
+#endif /* CH_CFG_FACTORY_OBJ_FIFOS == TRUE */
#endif /* CH_CFG_USE_FACTORY == TRUE */
diff --git a/os/common/oslib/include/chfifo.h b/os/common/oslib/include/chfifo.h
index 78ba16132..31260bc37 100644
--- a/os/common/oslib/include/chfifo.h
+++ b/os/common/oslib/include/chfifo.h
@@ -223,7 +223,7 @@ static inline void chFifoReturnObject(objects_fifo_t *ofp,
* @note By design the object can be always immediately posted.
*
* @param[in] ofp pointer to a @p objects_fifo_t structure
- * @param[in] objp pointer to the object to be released
+ * @param[in] objp pointer to the object to be posted
*
* @iclass
*/
@@ -240,7 +240,7 @@ static inline void chFifoSendObjectI(objects_fifo_t *ofp,
* @note By design the object can be always immediately posted.
*
* @param[in] ofp pointer to a @p objects_fifo_t structure
- * @param[in] objp pointer to the object to be released
+ * @param[in] objp pointer to the object to be posted
*
* @sclass
*/