]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/commitdiff
Multiple transport interface support for ti.sdo.ipc.MessageQ
authorRamsey Harris <ramsey@ti.com>
Wed, 26 Nov 2014 23:52:42 +0000 (15:52 -0800)
committerRobert Tivy <rtivy@ti.com>
Wed, 26 Nov 2014 23:56:54 +0000 (15:56 -0800)
Added new ITransport base class interface. New INetworkTransport
interface. MessageQ is now able to register multiple transport
instances. Dummy network transport to work around RTSC bug.

12 files changed:
packages/ti/sdo/ipc/MessageQ.c
packages/ti/sdo/ipc/MessageQ.xdc
packages/ti/sdo/ipc/MessageQ.xs
packages/ti/sdo/ipc/interfaces/IMessageQTransport.xdc
packages/ti/sdo/ipc/interfaces/INetworkTransport.xdc [new file with mode: 0644]
packages/ti/sdo/ipc/interfaces/INetworkTransportDummy.xdc [new file with mode: 0644]
packages/ti/sdo/ipc/interfaces/ITransport.xdc [new file with mode: 0644]
packages/ti/sdo/ipc/interfaces/package.xdc
packages/ti/sdo/ipc/transports/TransportNetworkDummy.c [new file with mode: 0644]
packages/ti/sdo/ipc/transports/TransportNetworkDummy.xdc [new file with mode: 0644]
packages/ti/sdo/ipc/transports/package.bld
packages/ti/sdo/ipc/transports/package.xdc

index 3a4df0de6b8b07207c172260a7b20a609d8cf14e..2e9422e43025730fb771ffd054d8303f0159ff9c 100644 (file)
@@ -52,7 +52,9 @@
 #include <ti/sysbios/hal/Hwi.h>
 #include <ti/sysbios/syncs/SyncSem.h>
 
+#include <ti/sdo/ipc/interfaces/ITransport.h>
 #include <ti/sdo/ipc/interfaces/IMessageQTransport.h>
+#include <ti/sdo/ipc/interfaces/INetworkTransport.h>
 #include <ti/sdo/utils/List.h>
 
 /* must be included after the internal header file for now */
@@ -433,13 +435,58 @@ Int MessageQ_put(MessageQ_QueueId queueId, MessageQ_Msg msg)
     UInt16            srcProc;
 #endif
     ti_sdo_ipc_MessageQ_Object   *obj;
+    Int tid;
+    ITransport_Handle baseTrans;
+    INetworkTransport_Handle netTrans;
 
     Assert_isTrue((msg != NULL), ti_sdo_ipc_MessageQ_A_invalidMsg);
 
     msg->dstId   = (UInt16)(queueId);
     msg->dstProc = (UInt16)(queueId >> 16);
 
-    if (dstProcId != MultiProc_self()) {
+    /* extract the transport ID from the message header */
+    tid = MessageQ_getTransportId(msg);
+
+    /* if recipient is local, use direct message delivery */
+    if (dstProcId == MultiProc_self()) {
+        /* Assert queueId is valid */
+        Assert_isTrue((UInt16)queueId < MessageQ_module->numQueues,
+                      ti_sdo_ipc_MessageQ_A_invalidQueueId);
+
+        /* It is a local MessageQ */
+        obj = MessageQ_module->queues[(UInt16)(queueId)];
+
+        /* Assert object is not NULL */
+        Assert_isTrue(obj != NULL, ti_sdo_ipc_MessageQ_A_invalidObj);
+
+        if ((msg->flags & MessageQ_PRIORITYMASK) == MessageQ_URGENTPRI) {
+            listHandle = ti_sdo_ipc_MessageQ_Instance_State_highList(obj);
+            List_putHead(listHandle, (List_Elem *)msg);
+        }
+        else {
+            if ((msg->flags & MessageQ_PRIORITYMASK) == MessageQ_NORMALPRI) {
+                listHandle = ti_sdo_ipc_MessageQ_Instance_State_normalList(obj);
+            }
+            else {
+                listHandle = ti_sdo_ipc_MessageQ_Instance_State_highList(obj);
+            }
+            /* put on the queue */
+            List_put(listHandle, (List_Elem *)msg);
+        }
+
+        ISync_signal(obj->synchronizer);
+
+        status = MessageQ_S_SUCCESS;
+
+        if ((ti_sdo_ipc_MessageQ_traceFlag) ||
+            (msg->flags & ti_sdo_ipc_MessageQ_TRACEMASK) != 0) {
+            Log_write4(ti_sdo_ipc_MessageQ_LM_putLocal, (UArg)(msg),
+                       (UArg)(msg->seqNum), (UArg)(msg->srcProc), (UArg)(obj));
+        }
+    }
+
+    /* if transport ID is zero, use primary transport array */
+    else if (tid == 0) {
         /* assert that dstProcId is valid */
         Assert_isTrue(dstProcId < ti_sdo_utils_MultiProc_numProcessors,
                       ti_sdo_ipc_MessageQ_A_procIdInvalid);
@@ -490,43 +537,33 @@ Int MessageQ_put(MessageQ_QueueId queueId, MessageQ_Msg msg)
             status = MessageQ_E_FAIL;
         }
     }
-    else {
-        /* Assert queueId is valid */
-        Assert_isTrue((UInt16)queueId < MessageQ_module->numQueues,
-                      ti_sdo_ipc_MessageQ_A_invalidQueueId);
 
-        /* It is a local MessageQ */
-        obj = MessageQ_module->queues[(UInt16)(queueId)];
-
-        /* Assert object is not NULL */
-        Assert_isTrue(obj != NULL, ti_sdo_ipc_MessageQ_A_invalidObj);
+    /* use a registered transport to deliver the message */
+    else {
+        baseTrans = MessageQ_module->regTrans[tid].transport;
 
-        if ((msg->flags & MessageQ_PRIORITYMASK) == MessageQ_URGENTPRI) {
-            listHandle = ti_sdo_ipc_MessageQ_Instance_State_highList(obj);
-            List_putHead(listHandle, (List_Elem *)msg);
-        }
-        else {
-            if ((msg->flags & MessageQ_PRIORITYMASK) == MessageQ_NORMALPRI) {
-                listHandle = ti_sdo_ipc_MessageQ_Instance_State_normalList(obj);
-            }
-            else {
-                listHandle = ti_sdo_ipc_MessageQ_Instance_State_highList(obj);
-            }
-            /* put on the queue */
-            List_put(listHandle, (List_Elem *)msg);
+        if (baseTrans == NULL) {
+            /* raise error */
+            status = MessageQ_E_FAIL;
+            goto leave;
         }
 
-        ISync_signal(obj->synchronizer);
+        switch (MessageQ_module->regTrans[tid].type) {
 
-        status = MessageQ_S_SUCCESS;
+            case ti_sdo_ipc_MessageQ_TransportType_INetworkTransport:
+                netTrans = INetworkTransport_Handle_downCast(baseTrans);
 
-        if ((ti_sdo_ipc_MessageQ_traceFlag) ||
-            (msg->flags & ti_sdo_ipc_MessageQ_TRACEMASK) != 0) {
-            Log_write4(ti_sdo_ipc_MessageQ_LM_putLocal, (UArg)(msg),
-                       (UArg)(msg->seqNum), (UArg)(msg->srcProc), (UArg)(obj));
+                if (INetworkTransport_put(netTrans, msg)) {
+                    status = MessageQ_S_SUCCESS;
+                }
+                else {
+                    status = MessageQ_E_FAIL;
+                }
+            break;
         }
     }
 
+leave:
     return (status);
 }
 
@@ -741,6 +778,54 @@ Void ti_sdo_ipc_MessageQ_unregisterTransport(UInt16 procId, UInt priority)
     Hwi_restore(key);
 }
 
+/*
+ *  ======== ti_sdo_ipc_MessageQ_registerTransportId ========
+ */
+Bool ti_sdo_ipc_MessageQ_registerTransportId(UInt tid, ITransport_Handle inst)
+{
+    ti_sdo_ipc_MessageQ_TransportType type;
+
+    /* validate transport ID */
+    if ((tid < 1) || (tid > 7)) {
+        /* raise error */
+        return (FALSE);
+    }
+
+    /* don't overwrite an existing transport */
+    if (MessageQ_module->regTrans[tid].transport != NULL) {
+        /* raise error */
+        return (FALSE);
+    }
+
+    /* determine the transport type */
+    if (INetworkTransport_Handle_downCast(inst) != NULL) {
+        type = ti_sdo_ipc_MessageQ_TransportType_INetworkTransport;
+    }
+    else {
+        /* raise error */
+        return (FALSE);
+    }
+
+    /* register the transport instance */
+    MessageQ_module->regTrans[tid].transport = inst;
+    MessageQ_module->regTrans[tid].type = type;
+    return (TRUE);
+}
+
+/*
+ *  ======== ti_sdo_ipc_MessageQ_registerTransportId ========
+ */
+Bool ti_sdo_ipc_MessageQ_unregisterTransportId(UInt tid)
+{
+    /* forget the registered transport instance */
+    MessageQ_module->regTrans[tid].transport = NULL;
+    MessageQ_module->regTrans[tid].type =
+            ti_sdo_ipc_MessageQ_TransportType_Invalid;
+
+    return (TRUE);
+}
+
+
 /*
  *************************************************************************
  *                       Instance functions
@@ -761,6 +846,10 @@ Int ti_sdo_ipc_MessageQ_Instance_init(ti_sdo_ipc_MessageQ_Object *obj, String na
     List_Handle      listHandle;
     SyncSem_Handle   syncSemHandle;
     MessageQ_QueueIndex queueIndex;
+    Int tid;
+    Int status;
+    ITransport_Handle baseTrans;
+    INetworkTransport_Handle netTrans;
 
     /* lock */
     key = IGateProvider_enter(MessageQ_module->gate);
@@ -865,6 +954,33 @@ Int ti_sdo_ipc_MessageQ_Instance_init(ti_sdo_ipc_MessageQ_Object *obj, String na
         }
     }
 
+    /* notify all registered transports about the new queue */
+    for (tid = 1; tid <= 7; tid++) {
+        if (MessageQ_module->regTrans[tid].transport == NULL) {
+            continue;
+        }
+        baseTrans = MessageQ_module->regTrans[tid].transport;
+
+        switch (MessageQ_module->regTrans[tid].type) {
+
+            case ti_sdo_ipc_MessageQ_TransportType_INetworkTransport:
+                netTrans = INetworkTransport_Handle_downCast(baseTrans);
+
+                if (INetworkTransport_bind(netTrans, obj->queue)) {
+                    status = MessageQ_S_SUCCESS;
+                }
+                else {
+                    status = MessageQ_E_FAIL;
+                }
+            break;
+        }
+
+        /* check for failure */
+        if (status < 0) {
+            /* TODO add error handling */
+        }
+    }
+
     return (0);
 }
 
@@ -877,12 +993,42 @@ Void ti_sdo_ipc_MessageQ_Instance_finalize(
     UInt key;
     MessageQ_QueueIndex index = (MessageQ_QueueIndex)(obj->queue);
     List_Handle listHandle;
+    Int tid;
+    ITransport_Handle baseTrans;
+    INetworkTransport_Handle netTrans;
 
     /* Requested queueId was not available. Nothing was done in the init */
     if (status == 5) {
         return;
     }
 
+    /* notify all registered transports that given queue is being deleted */
+    for (tid = 1; tid <= 7; tid++) {
+        if (MessageQ_module->regTrans[tid].transport == NULL) {
+            continue;
+        }
+        baseTrans = MessageQ_module->regTrans[tid].transport;
+
+        switch (MessageQ_module->regTrans[tid].type) {
+
+            case ti_sdo_ipc_MessageQ_TransportType_INetworkTransport:
+                netTrans = INetworkTransport_Handle_downCast(baseTrans);
+
+                if (INetworkTransport_unbind(netTrans, obj->queue)) {
+                    status = MessageQ_S_SUCCESS;
+                }
+                else {
+                    status = MessageQ_E_FAIL;
+                }
+            break;
+        }
+
+        /* check for failure */
+        if (status < 0) {
+            /* TODO add error handling */
+        }
+    }
+
     if (obj->syncSemHandle != NULL) {
         SyncSem_delete(&obj->syncSemHandle);
     }
index 882c0b3e8beb5f2b56ea5381869623a2e0ace92b..4b420a2788b6e447ca928bac51dc633190c64320 100644 (file)
@@ -46,6 +46,7 @@ import xdc.runtime.knl.ISync;
 
 import ti.sysbios.syncs.SyncSem;
 
+import ti.sdo.ipc.interfaces.ITransport;
 import ti.sdo.ipc.interfaces.IMessageQTransport;
 import ti.sdo.utils.NameServer;
 import ti.sdo.utils.List;
@@ -597,6 +598,18 @@ module MessageQ
      */
     Void unregisterTransport(UInt16 procId, UInt priority);
 
+    /*!
+     *  ======== registerTransportId ========
+     *  Register the transport instance for the given ID
+     */
+    Bool registerTransportId(UInt tid, ITransport.Handle inst);
+
+    /*!
+     *  ======== unregisterTransportId ========
+     *  Unregister the transport for the given ID
+     */
+    Bool unregisterTransportId(UInt tid);
+
 instance:
 
     /*!
@@ -704,6 +717,17 @@ internal:
         UInt16             procId;
     };
 
+    enum TransportType {
+        TransportType_IMessageQTransport,
+        TransportType_INetworkTransport,
+        TransportType_Invalid
+    };
+
+    struct RegisteredTransport {
+        ITransport.Handle transport;
+        TransportType type;
+    };
+
     /*!
      *  ======== nameSrvPrms ========
      *  This Params object is used for temporary storage of the
@@ -753,5 +777,6 @@ internal:
         FreeHookFxn          freeHookFxn;
         Bool                 canFreeQueues;
         UInt16               seqNum;
+        RegisteredTransport  regTrans[8];
     };
 }
index 8417abf9c12dae820fc0b038948a6ce61f3676fd..b91222e0553ed7e7827e7032f38362c5ab8f2bf8 100644 (file)
@@ -64,8 +64,13 @@ function module$use()
     List       = xdc.useModule("ti.sdo.utils.List");
     MultiProc  = xdc.useModule("ti.sdo.utils.MultiProc");
     NameServer = xdc.useModule('ti.sdo.utils.NameServer');
-    GateThread = xdc.useModule("xdc.runtime.knl.GateThread");
-    SyncSem    = xdc.useModule("ti.sysbios.syncs.SyncSem");
+    GateThread = xdc.useModule('xdc.runtime.knl.GateThread');
+    SyncSem    = xdc.useModule('ti.sysbios.syncs.SyncSem');
+
+    xdc.useModule('ti.sdo.ipc.interfaces.ITransport');
+    xdc.useModule('ti.sdo.ipc.interfaces.IMessageQTransport');
+    xdc.useModule('ti.sdo.ipc.interfaces.INetworkTransport');
+    xdc.useModule('ti.sdo.ipc.transports.TransportNetworkDummy');
 
     /* Plug the SetupTransportProxy for the MessageQ transport */
     if (MessageQ.SetupTransportProxy == null) {
@@ -85,12 +90,12 @@ function module$use()
  *  ======== module$static$init ========
  *  Initialize module values.
  */
-function module$static$init(mod, params)
+function module$static$init(state, mod)
 {
     /* initialize the NameServer param to be used now or later */
-    MessageQ.nameSrvPrms.maxRuntimeEntries = params.maxRuntimeEntries;
-    MessageQ.nameSrvPrms.tableSection      = params.tableSection;
-    MessageQ.nameSrvPrms.maxNameLen        = params.maxNameLen;
+    MessageQ.nameSrvPrms.maxRuntimeEntries = mod.maxRuntimeEntries;
+    MessageQ.nameSrvPrms.tableSection      = mod.tableSection;
+    MessageQ.nameSrvPrms.maxNameLen        = mod.maxNameLen;
 
     /*
      *  Get the current number of created static instances of this module.
@@ -101,11 +106,10 @@ function module$static$init(mod, params)
 
     /* create NameServer here only if no static instances are created */
     if (instCount == 0) {
-        mod.nameServer = NameServer.create("MessageQ",
-                                           MessageQ.nameSrvPrms);
+        state.nameServer = NameServer.create("MessageQ", MessageQ.nameSrvPrms);
     }
     else {
-        mod.nameServer = null;
+        state.nameServer = null;
     }
 
     /*
@@ -113,94 +117,98 @@ function module$static$init(mod, params)
      *  Also pre-allocate if numReservedEntries is not zero.
      *  maxRuntimeEntries < numReservedEntries is caught in validate.
      */
-    mod.numQueues = this.$instances.length;
-    if (params.maxRuntimeEntries != NameServer.ALLOWGROWTH) {
-        mod.numQueues += params.maxRuntimeEntries;
+    state.numQueues = this.$instances.length;
+    if (mod.maxRuntimeEntries != NameServer.ALLOWGROWTH) {
+        state.numQueues += mod.maxRuntimeEntries;
     }
-    else if (params.numReservedEntries != 0){
-        mod.numQueues += params.numReservedEntries;
+    else if (mod.numReservedEntries != 0){
+        state.numQueues += mod.numReservedEntries;
     }
 
-    mod.queues.length = mod.numQueues;
-    mod.canFreeQueues = false;
-    mod.freeHookFxn   = params.freeHookFxn;
+    state.queues.length = state.numQueues;
+    state.canFreeQueues = false;
+    state.freeHookFxn   = mod.freeHookFxn;
 
-    if (params.nameTableGate == null) {
-         mod.gate = null;
+    if (mod.nameTableGate == null) {
+         state.gate = null;
     }
     else {
-        mod.gate = params.nameTableGate;
+        state.gate = mod.nameTableGate;
     }
 
     var messsageQParams = new this.Params;
 
     /* Initial the seqNum used for tracing */
-    mod.seqNum     = 0;
+    state.seqNum = 0;
 
     /* Set the length of the heaps array */
-    mod.numHeaps     = params.numHeaps;
-    mod.heaps.length = mod.numHeaps;
+    state.numHeaps = mod.numHeaps;
+    state.heaps.length = state.numHeaps;
 
     /* Initialize the heaps array to null */
-    for (var i = 0; i < mod.heaps.length; i++) {
-            mod.heaps[i] = null;
+    for (var i = 0; i < state.heaps.length; i++) {
+        state.heaps[i] = null;
     }
 
     /*
      *  Sort the static heaps by heap id into the heaps array
      */
-    for (var i = 0; i < params.staticHeaps.length; i++) {
+    for (var i = 0; i < mod.staticHeaps.length; i++) {
 
         /* Make sure the id is not too big */
-        if (params.staticHeaps[i].heapId >= mod.numHeaps) {
-            MessageQ.$logError("Out of range heapId (" +
-                                params.staticHeaps[i].heapId +
-                                "). Max heapId is " + (params.numHeaps - 1) +
-                                " (MessageQ.numHeaps - 1).", this);
+        if (mod.staticHeaps[i].heapId >= state.numHeaps) {
+            MessageQ.$logError("Out of range heapId ("
+                    + mod.staticHeaps[i].heapId + "). Max heapId is "
+                    + (mod.numHeaps - 1) + " (MessageQ.numHeaps - 1).", this);
         }
 
         /* Make sure the same id is not used twice */
-        if (mod.heaps[params.staticHeaps[i].heapId] != null) {
-            MessageQ.$logError("Cannot register multiple heaps to heapId " +
-                                params.staticHeaps[i].heapId + ".", this);
+        if (state.heaps[mod.staticHeaps[i].heapId] != null) {
+            MessageQ.$logError("Cannot register multiple heaps to heapId "
+                    + mod.staticHeaps[i].heapId + ".", this);
         }
 
-        mod.heaps[params.staticHeaps[i].heapId] = params.staticHeaps[i].heap;
+        state.heaps[mod.staticHeaps[i].heapId] = mod.staticHeaps[i].heap;
     }
 
     /* Set the length of the transport array */
-    mod.transports.length = MultiProc.numProcessors;
+    state.transports.length = MultiProc.numProcessors;
 
     /* Initialize all the transports to null */
-    for (var i = 0; i < mod.transports.length; i++) {
-        mod.transports[i][0] = null;
-        mod.transports[i][1] = null;
+    for (var i = 0; i < state.transports.length; i++) {
+        state.transports[i][0] = null;
+        state.transports[i][1] = null;
     }
 
     /*
      *  Sort the static Transports by processor id into the
      *  transport array
      */
-    for (var i = 0; i < params.staticTransports.length; i++) {
+    for (var i = 0; i < mod.staticTransports.length; i++) {
 
         /* Make sure the procId is not too big */
-        if (params.staticTransports[i].procId >= MultiProc.numProcessors) {
-            MessageQ.$logError("MessageQ Out of range procId (" +
-                                params.staticTransports[i].procId +
-                                "). Max procId is " +
-                                (MultiProc.numProcessors) +
-                                " (MultiProc.numProcessors).", this);
+        if (mod.staticTransports[i].procId >= MultiProc.numProcessors) {
+            MessageQ.$logError("MessageQ Out of range procId ("
+                    + mod.staticTransports[i].procId + "). Max procId is "
+                    + (MultiProc.numProcessors) + " (MultiProc.numProcessors).",
+                    this);
         }
 
         /* Make sure the same id is not used twice */
-        if (mod.transports[params.staticTransports[i].procId] != null) {
-            MessageQ.$logError("Cannot register multiple transports to one" +
-                               " remote processor " +
-                               params.staticTransports[i].procId + ".", this);
+        if (state.transports[mod.staticTransports[i].procId] != null) {
+            MessageQ.$logError("Cannot register multiple transports to one"
+                    + " remote processor " + mod.staticTransports[i].procId
+                    + ".", this);
         }
 
-        mod.transports[params.staticTransports[i].procId] =
-            params.staticTransports[i].transport;
+        state.transports[mod.staticTransports[i].procId] =
+            mod.staticTransports[i].transport;
+    }
+
+    /* initialize the registered transport array */
+    for (var i = 0; i < state.regTrans.length; i++) {
+        state.regTrans[i].transport = null;
+        state.regTrans[i].type = mod.TransportType_Invalid;
     }
 }
 
index 2d2ef14515d969b09e87337d1a48929e1b24dfed..7a4f236cc6b3c2711dbc21e41e25ec0474a940ef 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2012-2014 Texas Instruments Incorporated - http://www.ti.com
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== IMessageQTransport.xdc ========
- *
  */
+package ti.sdo.ipc.interfaces;
 
 /*!
  *  ======== IMessageQTransport ========
@@ -47,8 +48,7 @@
  *  the transport implementation can use.
  */
 
-interface IMessageQTransport
-{
+interface IMessageQTransport inherits ITransport {
     /*!
      *  Transport return values
      *
diff --git a/packages/ti/sdo/ipc/interfaces/INetworkTransport.xdc b/packages/ti/sdo/ipc/interfaces/INetworkTransport.xdc
new file mode 100644 (file)
index 0000000..1e59eff
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2012-2014 Texas Instruments Incorporated - http://www.ti.com
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * *  Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * *  Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * *  Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ *  ======== INetworkTransport.xdc ========
+ */
+package ti.sdo.ipc.interfaces;
+
+/*!
+ *  ======== INetworkTransport ========
+ *  Interface for the network type of transports
+ */
+
+interface INetworkTransport inherits ITransport {
+
+instance:
+
+    /*!
+     *  ======== create ========
+     *  Create a transport instance
+     */
+    create();
+
+    /*!
+     *  ======== bind ========
+     *  Bind a resource for the given queueId
+     */
+    Int bind(UInt32 queueId);
+
+    /*!
+     *  ======== unbind ========
+     *  Unbind a resource for the given queueId
+     */
+    Int unbind(UInt32 queueId);
+
+    /*!
+     *  ======== put ========
+     *  Send the message over the given transport instance
+     */
+    @DirectCall
+    Bool put(Ptr msg);
+}
diff --git a/packages/ti/sdo/ipc/interfaces/INetworkTransportDummy.xdc b/packages/ti/sdo/ipc/interfaces/INetworkTransportDummy.xdc
new file mode 100644 (file)
index 0000000..07c2992
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2012-2014 Texas Instruments Incorporated - http://www.ti.com
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * *  Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * *  Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * *  Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ *  ======== INetworkTransportDummy.xdc ========
+ */
+package ti.sdo.ipc.interfaces;
+
+/*!
+ *  ======== INetworkTransport ========
+ *  Interface for the network type of transports
+ */
+
+interface INetworkTransportDummy inherits INetworkTransport {
+
+}
diff --git a/packages/ti/sdo/ipc/interfaces/ITransport.xdc b/packages/ti/sdo/ipc/interfaces/ITransport.xdc
new file mode 100644 (file)
index 0000000..88e2baf
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2014 Texas Instruments Incorporated - http://www.ti.com
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * *  Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * *  Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * *  Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ *  ======== ITransport.xdc ========
+ */
+package ti.sdo.ipc.interfaces;
+
+/*!
+ *  ======== ITransport ========
+ *  Base interface for all message transports
+ */
+@DirectCall
+interface ITransport {
+
+instance:
+
+}
index aa0238a1dfc1e2b3a3e5c90b1276eb0dab5506b2..fbf6067b013ebbd2a22b3adaead496d5cc834775 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2014 Texas Instruments Incorporated - http://www.ti.com
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  *  Contains interfaces for communication between processors.
  */
 
-package ti.sdo.ipc.interfaces [1,0,0,0] {
+package ti.sdo.ipc.interfaces [1,0,1] {
     interface INotifyDriver;
     interface INotifySetup;
     interface IGateMPSupport;
+    interface ITransport;
     interface IMessageQTransport;
+    interface INetworkTransport;
     interface ITransportSetup;
 }
diff --git a/packages/ti/sdo/ipc/transports/TransportNetworkDummy.c b/packages/ti/sdo/ipc/transports/TransportNetworkDummy.c
new file mode 100644 (file)
index 0000000..ad5b1d8
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2014 Texas Instruments Incorporated - http://www.ti.com
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * *  Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * *  Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * *  Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ *  ======== TransportNetworkDummy.c ========
+ */
+
+#include <xdc/std.h>
+#include <xdc/runtime/Error.h>
+
+#include "package/internal/TransportNetworkDummy.xdc.h"
+
+/*
+ *  ======== TransportNetworkDummy_Instance_init ========
+ */
+Void TransportNetworkDummy_Instance_init(TransportNetworkDummy_Object *obj,
+        const TransportNetworkDummy_Params *params)
+{
+    /* ... */
+}
+
+/*
+ *  ======== TransportNetworkDummy_bind ========
+ */
+Int TransportNetworkDummy_bind(TransportNetworkDummy_Object *obj, UInt32 qid)
+{
+    return (0);
+}
+
+/*
+ *  ======== TransportNetworkDummy_unbind ========
+ */
+Int TransportNetworkDummy_unbind(TransportNetworkDummy_Object *obj, UInt32 qid)
+{
+    return (0);
+}
+
+/*
+ *  ======== TransportNetworkDummy_put ========
+ */
+Bool TransportNetworkDummy_put(TransportNetworkDummy_Object *obj, Ptr msg)
+{
+    return (TRUE);
+}
diff --git a/packages/ti/sdo/ipc/transports/TransportNetworkDummy.xdc b/packages/ti/sdo/ipc/transports/TransportNetworkDummy.xdc
new file mode 100644 (file)
index 0000000..a497b12
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014 Texas Instruments Incorporated - http://www.ti.com
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * *  Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * *  Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * *  Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ *  ======== TransportNetworkDummy.xdc ========
+ */
+
+
+/*!
+ *  ======== TransportNetworkDummy ========
+ *  Dummy implementation to avoid RTSC bug
+ */
+
+module TransportNetworkDummy inherits ti.sdo.ipc.interfaces.INetworkTransport
+{
+
+}
index 882553573caa7ffc14f8fb7f02594dde7411c27e..fe46970cec4e22c7236940c2ecd4ce4083826dab 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2014 Texas Instruments Incorporated - http://www.ti.com
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -44,7 +44,8 @@ var objList = [
     "TransportShmCircSetup.c",
     "TransportShmNotify.c",
     "TransportShmNotifySetup.c",
-    "TransportNullSetup.c"
+    "TransportNullSetup.c",
+    "TransportNetworkDummy.c"
 ];
 
 /* if not building a product release, build package libraries */
index 2ac0b36fdde01bd91b13279ff8c16eea97f7d79c..352ff376f8f6e4a47b6868c22f17561763b422c6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2014 Texas Instruments Incorporated - http://www.ti.com
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -46,4 +46,5 @@ package ti.sdo.ipc.transports [1,0,0,0] {
     module    TransportShmNotify;
     module    TransportShmNotifySetup;
     module    TransportNullSetup;
+    module    TransportNetworkDummy;
 }