]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/blobdiff - packages/ti/ipc/ipcmgr/IpcMgr.c
SDOCM00114354 IPC Manager needs a public header file
[ipc/ipcdev.git] / packages / ti / ipc / ipcmgr / IpcMgr.c
index 4f9c6d4949c5fcdd785e40649045d58b13e65ed5..bfa9253de0cc3e731912030d77a0320a70fffd80 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2012-2015 Texas Instruments Incorporated - http://www.ti.com
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 #include <ti/ipc/transports/TransportRpmsgSetup.h>
 #include <ti/ipc/rpmsg/_RPMessage.h>
 
+#ifdef IpcMgr_USEDEH
+#include <ti/deh/Watchdog.h>
+#ifdef DSP
+#include <ti/sysbios/family/c64p/Exception.h>
+#elif IPU
+#include <ti/sysbios/family/arm/m3/Hwi.h>
+#endif
+#endif
+
+#include "IpcMgr.h"
+
+
 /*
  *  ======== IpcMgr_rpmsgStartup ========
- *  Initialize the RPMSG module.  This calls VirtQueue_startup().
+ *  Initialize the RPMSG module. This calls VirtQueue_startup().
  *
  *  Use for stacks built on RPMessage only.
  */
-Void IpcMgr_rpmsgStartup()
+Void IpcMgr_rpmsgStartup(Void)
 {
     Assert_isTrue(MultiProc_self() != MultiProc_getId("HOST"), NULL);
     RPMessage_init(MultiProc_getId("HOST"));
+
+#ifdef IpcMgr_USEDEH
+    /*
+     * When using DEH, initialize the Watchdog timers if not already done
+     * (i.e. late-attach)
+     */
+#ifdef DSP
+    Watchdog_init((Void (*)(Void))ti_sysbios_family_c64p_Exception_handler);
+#elif IPU
+    Watchdog_init(ti_sysbios_family_arm_m3_Hwi_excHandlerAsm__I);
+#endif
+#endif
 }
 
 /*
@@ -62,7 +86,7 @@ Void IpcMgr_rpmsgStartup()
  *
  *  Use for stacks built on MessageQ/TransportRpmsg only.
  */
-Void IpcMgr_ipcStartup()
+Void IpcMgr_ipcStartup(Void)
 {
     UInt procId = MultiProc_getId("HOST");
     Int status;
@@ -74,6 +98,18 @@ Void IpcMgr_ipcStartup()
     /* Sets up to communicate with host's NameServer: */
     status = NameServerRemoteRpmsg_attach(procId, 0);
     Assert_isTrue(status >= 0, NULL);
+
+#ifdef IpcMgr_USEDEH
+    /*
+     * When using DEH, initialize the Watchdog timers if not already done
+     * (i.e. late-attach)
+     */
+#ifdef DSP
+    Watchdog_init((Void (*)(Void))ti_sysbios_family_c64p_Exception_handler);
+#elif IPU
+    Watchdog_init(ti_sysbios_family_arm_m3_Hwi_excHandlerAsm__I);
+#endif
+#endif
 }
 
 /*