diff --git a/test/rm_osal.c b/test/rm_osal.c
index 4b8c65f3c9dfe0aaf6f52ae51e97bdd7bf115d25..1216bcf9759ebb48852cf2a549d54a4668a8fca7 100644 (file)
--- a/test/rm_osal.c
+++ b/test/rm_osal.c
*
* \par
*/
+
+/* Standard Includes */
#include <stdarg.h>
+/* XDC Includes */
#include <xdc/std.h>
#include <xdc/runtime/Memory.h>
#include <xdc/runtime/Error.h>
#include <xdc/runtime/System.h>
+/* IPC Includes */
+#include <ti/ipc/GateMP.h>
+
/**********************************************************************
****************************** Defines *******************************
**********************************************************************/
+#define RM_INTERNAL_GATE_NAME "rmInternalLocalGate"
/**********************************************************************
************************** Global Variables **************************
uint32_t rmMallocCounter = 0;
uint32_t rmFreeCounter = 0;
+GateMP_Handle rmInternalGateHandle;
+
/**********************************************************************
*************************** OSAL Functions **************************
**********************************************************************/
void Osal_rmLocalGateInit (void)
{
-
+ GateMP_Params gateParams;
+
+ /* Create a GateMP object to be use as a resource lock */
+ GateMP_Params_init(&gateParams);
+ gateParams.name = RM_INTERNAL_GATE_NAME;
+ /* Local protection for multiple threads, uses a BIOS GateMutexPri */
+ gateParams.localProtect = GateMP_LocalProtect_THREAD;
+ /* No remote protection because we're not going between cores */
+ gateParams.remoteProtect = GateMP_RemoteProtect_NONE;
+ rmInternalGateHandle = GateMP_create(&gateParams);
}
-void *Osal_rmLocalGateEnter (void)
+uint32_t Osal_rmLocalGateEnter (void)
{
-
- return (NULL);
+ return ((uint32_t)GateMP_enter(rmInternalGateHandle));
}
-void Osal_rmLocalGateLeave (void *localGateKey)
+void Osal_rmLocalGateLeave (uint32_t localGateKey)
{
-
+ GateMP_leave(rmInternalGateHandle, (IArg)localGateKey);
}
/* FUNCTION PURPOSE: Prints a variable list