summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5685b04)
raw | patch | inline | side by side (parent: 5685b04)
author | Ramsey Harris <ramsey@ti.com> | |
Wed, 4 Feb 2015 03:20:17 +0000 (19:20 -0800) | ||
committer | Robert Tivy <rtivy@ti.com> | |
Wed, 4 Feb 2015 19:10:25 +0000 (11:10 -0800) |
New method to encapsulate the run-time configuration of IPC
cluster baseId: Ipc_clusterConfig. Call this method from a
startup first function after setting the cluster baseId. Set
Ipc.entry array with valid procId when cluster baseId is known,
otherwise set to INVALIDID. Set MultiProc.clusterProcList array
as above.
cluster baseId: Ipc_clusterConfig. Call this method from a
startup first function after setting the cluster baseId. Set
Ipc.entry array with valid procId when cluster baseId is known,
otherwise set to INVALIDID. Set MultiProc.clusterProcList array
as above.
diff --git a/packages/ti/ipc/Ipc.h b/packages/ti/ipc/Ipc.h
index d2a7dc192a334d5880170b15358bd9a14177eca2..9141ee5c14af8348b2a58fe6d766f602230a3d17 100644 (file)
--- a/packages/ti/ipc/Ipc.h
+++ b/packages/ti/ipc/Ipc.h
*/
Int Ipc_attach(UInt16 remoteProcId);
*/
Int Ipc_attach(UInt16 remoteProcId);
+/*!
+ * @brief Internal IPC cluster configuration
+ *
+ * Perform run-time configuration of internal data structures
+ * related to cluster baseId. This function should be called
+ * from a "startup first" hook but after having called
+ * MultiProc_setBaseIdOfCluster().
+ *
+ * @remarks This function is only available on SYS/BIOS.
+ */
+Int Ipc_clusterConfig(Void);
+
/*!
* @brief Detach from the remote processor
*
/*!
* @brief Detach from the remote processor
*
index 3f24580df495c3dbc2dca618e50cc9d034c0ac9f..e5e97dd35bc9155c8e671565c1f42e707351f918 100644 (file)
/*
/*
- * Copyright (c) 2012-2014, 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
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#ifdef __ti__
#pragma FUNC_EXT_CALLED(Ipc_attach);
#ifdef __ti__
#pragma FUNC_EXT_CALLED(Ipc_attach);
+ #pragma FUNC_EXT_CALLED(Ipc_clusterConfig);
#pragma FUNC_EXT_CALLED(Ipc_detach);
#pragma FUNC_EXT_CALLED(Ipc_isAttached);
#pragma FUNC_EXT_CALLED(Ipc_readConfig);
#pragma FUNC_EXT_CALLED(Ipc_detach);
#pragma FUNC_EXT_CALLED(Ipc_isAttached);
#pragma FUNC_EXT_CALLED(Ipc_readConfig);
return (status);
}
return (status);
}
+/*
+ * ======== Ipc_clusterConfig ========
+ */
+Int Ipc_clusterConfig(Void)
+{
+ UInt16 *procIdPtr;
+ UInt16 numProcs;
+ UInt16 baseId;
+ UInt16 i;
+
+
+ /* sanity check the cluster baseId */
+ baseId = MultiProc_getBaseIdOfCluster();
+
+ if (baseId == MultiProc_INVALIDID) {
+ return (Ipc_E_INVALIDSTATE);
+ }
+
+ /* initialize the MultiProc.clusterProcList array */
+ numProcs = MultiProc_getNumProcsInCluster();
+ procIdPtr = MultiProc_getClusterProcList();
+
+ for (i = 0; i < numProcs; i++) {
+ *procIdPtr++ = baseId + i;
+ }
+
+ /* update the Ipc.procEntry[] array with valid procIds */
+ for (i = 0; i < numProcs; i++) {
+ Ipc_module->procEntry[i].entry.remoteProcId = baseId + i;
+ }
+
+ return (Ipc_S_SUCCESS);
+}
+
/*
* ======== Ipc_isAttached ========
*/
/*
* ======== Ipc_isAttached ========
*/
index 900bf583af869f941e793c44033b8938dc3387c9..ccaaa005ab740e2e177d8cf8a5b938eebb84f8da 100644 (file)
/*
/*
- * 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
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* ======== module$static$init ========
* Initialize module values.
*/
* ======== module$static$init ========
* Initialize module values.
*/
-function module$static$init(mod, params)
+function module$static$init(state, mod)
{
{
- /* this array will be setup below with internal array */
- mod.procEntry.length = MultiProc.numProcsInCluster;
var fxn = new Ipc.UserFxn;
var userFxnSet = false;
var fxn = new Ipc.UserFxn;
var userFxnSet = false;
/* init Ipc.entry */
initEntryArray();
/* init Ipc.entry */
initEntryArray();
- /* init the module state */
- for (var i=0; i < MultiProc.numProcsInCluster; i++) {
- mod.procEntry[i].entry = Ipc.entry[i];
- mod.procEntry[i].localConfigList = null;
- mod.procEntry[i].remoteConfigList = null;
- mod.procEntry[i].attached = 0;
+ /* initialize the procEntry[] array */
+ state.procEntry.length = MultiProc.numProcsInCluster;
+
+ for (var i = 0; i < state.procEntry.length; i++) {
+ state.procEntry[i].entry = Ipc.entry[i];
+ state.procEntry[i].localConfigList = null;
+ state.procEntry[i].remoteConfigList = null;
+ state.procEntry[i].attached = 0;
}
}
- mod.ipcSharedAddr = null;
- mod.gateMPSharedAddr = null;
+ state.ipcSharedAddr = null;
+ state.gateMPSharedAddr = null;
Ipc.numUserFxns = Ipc.userFxns.length;
}
Ipc.numUserFxns = Ipc.userFxns.length;
}
/* init Ipc.entry */
initEntryArray();
/* init Ipc.entry */
initEntryArray();
+ if (MultiProc.baseIdOfCluster == MultiProc.INVALIDID) {
+ Ipc.$logError("Cannot use Ipc.setEntryMeta when "
+ + "MultiProc.baseIdOfCluster is INVALIDID.", Ipc);
+ }
+
+ var clusterId = entry.remoteProcId - MultiProc.baseIdOfCluster;
+
if (entry.setupNotify != undefined) {
if (entry.setupNotify != undefined) {
- Ipc.entry[entry.remoteProcId].setupNotify = entry.setupNotify;
+ Ipc.entry[clusterId].setupNotify = entry.setupNotify;
}
if (entry.setupMessageQ != undefined) {
}
if (entry.setupMessageQ != undefined) {
- Ipc.entry[entry.remoteProcId].setupMessageQ = entry.setupMessageQ;
+ Ipc.entry[clusterId].setupMessageQ = entry.setupMessageQ;
}
}
}
}
if (!(initEntryDone)) {
Ipc.entry.length = MultiProc.numProcsInCluster;
if (!(initEntryDone)) {
Ipc.entry.length = MultiProc.numProcsInCluster;
- for (var i=0; i < MultiProc.numProcsInCluster; i++) {
- Ipc.entry[i].remoteProcId = MultiProc.baseIdOfCluster + i;
+ for (var i = 0; i < MultiProc.numProcsInCluster; i++) {
+ Ipc.entry[i].remoteProcId =
+ (MultiProc.baseIdOfCluster == MultiProc.INVALIDID) ?
+ MultiProc.INVALIDID : MultiProc.baseIdOfCluster + i;
Ipc.entry[i].setupNotify = true;
Ipc.entry[i].setupMessageQ = true;
}
Ipc.entry[i].setupNotify = true;
Ipc.entry[i].setupMessageQ = true;
}
index 9b7afeddc79e64121e0603238297e0f4697c536e..eb863cd9bd627a608a4b3ce37474391f47eb963c 100644 (file)
/*
/*
- * Copyright (c) 2012-2014 Texas Instruments Incorporated - http://www.ti.com
+ * 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
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
state.clusterProcList.length = mod.numProcsInCluster;
/* initialize the array if we know the actual procIds */
state.clusterProcList.length = mod.numProcsInCluster;
/* initialize the array if we know the actual procIds */
- if (mod.baseIdOfCluster != MultiProc.INVALIDID) {
- for (var i = 0; i < state.clusterProcList.length; i++) {
- state.clusterProcList[i] = mod.baseIdOfCluster + i;
- }
+ for (var i = 0; i < state.clusterProcList.length; i++) {
+ state.clusterProcList[i] =
+ (mod.baseIdOfCluster != MultiProc.INVALIDID) ?
+ mod.baseIdOfCluster + i : MultiProc.INVALIDID;
}
}
}
}