diff --git a/rm_osal.h b/rm_osal.h
index dec997e6c37ba9bd4cff6bed4fcc2a29d0a7e685..fbee72006466e9838f67bc0803195bfd94d8746a 100644 (file)
--- a/rm_osal.h
+++ b/rm_osal.h
************************* Extern Declarations ************************
**********************************************************************/
-extern void* Osal_rmMalloc (uint32_t num_bytes);
-extern void Osal_rmFree (void *ptr, uint32_t size);
-extern void Osal_rmLog (char *fmt, ... );
+extern void *Osal_rmMalloc (uint32_t num_bytes);
+extern void Osal_rmFree (void *ptr, uint32_t size);
+extern void *Osal_rmCsEnter (void);
+extern void Osal_rmCsExit (void *CsHandle);
+extern void *Osal_rmMtCsEnter (void *mtSemObj);
+extern void Osal_rmMtCsExit (void *mtSemObj, void *CsHandle);
+extern void Osal_rmBeginMemAccess (void *ptr, uint32_t size);
+extern void Osal_rmEndMemAccess (void *ptr, uint32_t size);
+extern void *Osal_rmTaskBlockCreate (void);
+extern void Osal_rmTaskBlock (void *handle);
+extern void Osal_rmTaskUnblock (void *handle);
+extern void Osal_rmTaskBlockDelete (void *handle);
+extern void Osal_rmLog (char *fmt, ... );
/**
* @brief The macro is used by RM to allocate memory of specified
*/
#define Rm_osalFree Osal_rmFree
+/**
+ * @brief The function is used to enter a critical section.
+ * Function protects against
+ *
+ * access from multiple cores
+ * and
+ * access from multiple threads on single core
+ *
+ * <b> Prototype: </b>
+ * The following is the C prototype for the expected OSAL API.
+ *
+ * @verbatim
+ void *Osal_rmCsEnter (void)
+ @endverbatim
+ *
+ * <b> Parameter </b>
+ * @n Not applicable.
+ *
+ * <b> Return Value </b>
+ * @n Handle used to lock critical section
+ */
+#define Rm_osalCsEnter Osal_rmCsEnter
+
+/**
+ * @brief The function is used to exit a critical section
+ * protected using Osal_rmCsEnter() API.
+ *
+ * <b> Prototype: </b>
+ * The following is the C prototype for the expected OSAL API.
+ *
+ * @verbatim
+ void Osal_rmCsExit (void *CsHandle)
+ @endverbatim
+ *
+ * <b> Parameter </b>
+ * @n Handle for unlocking critical section.
+ *
+ * <b> Return Value </b>
+ * @n Not applicable.
+ */
+#define Rm_osalCsExit Osal_rmCsExit
+
+/**
+ * @brief The function is used to enter a multi-threaded critical
+ * section. Function protects against
+ *
+ * access from multiple threads on single core
+ *
+ * <b> Prototype: </b>
+ * The following is the C prototype for the expected OSAL API.
+ *
+ * @verbatim
+ void *Osal_rmMtCsEnter (void *mtSemObj)
+ @endverbatim
+ *
+ * <b> Parameter </b>
+ * @n Multi-threaded critical section object handle.
+ *
+ * <b> Return Value </b>
+ * @n Handle used to lock the multi-threaded critical section
+ */
+#define Rm_osalMtCsEnter Osal_rmMtCsEnter
+
+/**
+ * @brief The function is used to exit a multi-threaded critical
+ * section protected using Osal_rmMtCsEnter() API.
+ *
+ * <b> Prototype: </b>
+ * The following is the C prototype for the expected OSAL API.
+ *
+ * @verbatim
+ void Osal_rmMtCsExit (void *mtSemObj, void *CsHandle)
+ @endverbatim
+ *
+ * <b> Parameter </b>
+ * @n Multi-threaded critical section object handle.
+ *
+ * <b> Parameter </b>
+ * @n Handle for unlocking multi-threaded critical section.
+ *
+ * <b> Return Value </b>
+ * @n Not applicable.
+ */
+#define Rm_osalMtCsExit Osal_rmMtCsExit
+
+/**
+ * @brief The function is used to indicate that a block of memory is
+ * about to be accessed. If the memory block is cached then this
+ * indicates that the application would need to ensure that the
+ * cache is updated with the data from the actual memory.
+ *
+ * <b> Prototype: </b>
+ * The following is the C prototype for the expected OSAL API.
+ *
+ * @verbatim
+ void Osal_rmBeginMemAccess (void *ptr, uint32_t size)
+ @endverbatim
+ *
+ * <b> Parameter </b>
+ * @n Address of memory block
+ * @n Size of memory block
+ *
+ * <b> Return Value </b>
+ * @n Not applicable.
+ */
+#define Rm_osalBeginMemAccess Osal_rmBeginMemAccess
+
+/**
+ * @brief The function is used to indicate that the block of memory has
+ * finished being accessed. If the memory block is cached then the
+ * application would need to ensure that the contents of the cache
+ * are updated immediately to the actual memory.
+ *
+ * <b> Prototype: </b>
+ * The following is the C prototype for the expected OSAL API.
+ *
+ * @verbatim
+ void Osal_rmEndMemAccess (void *ptr, uint32_t size)
+ @endverbatim
+ *
+ * <b> Parameter </b>
+ * @n Address of memory block
+ * @n Size of memory block
+ *
+ * <b> Return Value </b>
+ * @n Not applicable.
+ */
+#define Rm_osalEndMemAccess Osal_rmEndMemAccess
+
+/**
+ * @brief The macro is used by RM to create a task blocking
+ * mechanism allowing a RM instance to block when it
+ * has not been provided a service callback function
+ * and it must send a packet to remote RM instance
+ * to complete a service.
+ *
+ * <b> Prototype: </b>
+ * The following is the C prototype for the expected OSAL API.
+ *
+ * @verbatim
+ void *Osal_rmTaskBlockCreate (void)
+ @endverbatim
+ *
+ * <b> Parameter </b>
+ * @n Not applicable.
+ *
+ * <b> Return Value </b>
+ * @n Task blocking mechanism handle cast as a void pointer
+ */
+#define Rm_osalTaskBlockCreate Osal_rmTaskBlockCreate
+
+/**
+ * @brief The macro is used by a RM instance to block when it
+ * has not been provided a service callback function
+ * and it must send a packet to remote RM instance
+ * to complete a service. The blocking operation
+ * should block the current RM instance's task/thread
+ * from executing until a task/thread from which the
+ * RM receive code runs unblocks the RM instance
+ *
+ * <b> Prototype: </b>
+ * The following is the C prototype for the expected OSAL API.
+ *
+ * @verbatim
+ void Osal_rmTaskBlock (void *handle)
+ @endverbatim
+ *
+ * <b> Parameter </b>
+ * @n Task blocking mechanism handle cast as a void pointer
+ *
+ * <b> Return Value </b>
+ * @n Not applicable.
+ */
+#define Rm_osalTaskBlock Osal_rmTaskBlock
+
+/**
+ * @brief The macro is used by a RM instance to unblock from
+ * a previous block operation.
+ *
+ * <b> Prototype: </b>
+ * The following is the C prototype for the expected OSAL API.
+ *
+ * @verbatim
+ void Osal_rmTaskUnblock (void *handle)
+ @endverbatim
+ *
+ * <b> Parameter </b>
+ * @n Task blocking mechanism handle cast as a void pointer
+ *
+ * <b> Return Value </b>
+ * @n Not applicable.
+ */
+#define Rm_osalTaskUnblock Osal_rmTaskUnblock
+
+/**
+ * @brief The macro is used by a RM instance to delete its
+ * task blocking mechanism.
+ *
+ * <b> Prototype: </b>
+ * The following is the C prototype for the expected OSAL API.
+ *
+ * @verbatim
+ void Osal_rmTaskBlockDelete (void *handle)
+ @endverbatim
+ *
+ * <b> Parameter </b>
+ * @n Task blocking mechanism handle cast as a void pointer
+ *
+ * <b> Return Value </b>
+ * @n Not applicable.
+ */
+#define Rm_osalTaskBlockDelete Osal_rmTaskBlockDelete
+
/**
* @brief The macro is used by RM to log various
* messages.