summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9bc6fc0)
raw | patch | inline | side by side (parent: 9bc6fc0)
author | Robert Tivy <rtivy@ti.com> | |
Thu, 7 May 2015 23:53:51 +0000 (16:53 -0700) | ||
committer | Robert Tivy <rtivy@ti.com> | |
Fri, 8 May 2015 00:14:08 +0000 (17:14 -0700) |
Add -n <nprocs> support for overriding the total number of processors
in the system (not to be confused with number of processors in cluster).
Add -r <nreserve> support for overriding the number of reserved
MessageQ queues.
Add -s <synctype> support for overriding the Ipc_ProcSync_* type (can
be -s ALL|PAIR|NONE).
in the system (not to be confused with number of processors in cluster).
Add -r <nreserve> support for overriding the number of reserved
MessageQ queues.
Add -s <synctype> support for overriding the Ipc_ProcSync_* type (can
be -s ALL|PAIR|NONE).
index d9721079c6102471a7794a5418af3944ca6134f3..836d74f8a28861e1e4ec6db2823b983a8dbc2b69 100644 (file)
Void MessageQ_msgInit(MessageQ_Msg msg);
+Void _MessageQ_setNumReservedEntries(UInt n);
+
#if defined (__cplusplus)
}
#endif /* defined (__cplusplus) */
diff --git a/linux/include/_Ipc.h b/linux/include/_Ipc.h
index 0a9ef424018f4bd00ccf5a1e6ee7a109c5e21bec..f9df0e3428fc3840f94b2f43a3b574959e2ffb4f 100644 (file)
--- a/linux/include/_Ipc.h
+++ b/linux/include/_Ipc.h
Void Ipc_getConfig(Ipc_Config *cfg);
+Void Ipc_setConfig(Ipc_Config *cfg);
+
#if defined (__cplusplus)
}
#endif
index c3539da260a127318429a5a3318ec37f799537ab..2a12666d9b49a170d3a544e3980422cb4b3796a2 100644 (file)
assert(cfg != NULL);
memcpy(cfg, &ti_ipc_Ipc_config, sizeof(Ipc_Config));
}
+
+/*
+ * ======== Ipc_setConfig ========
+ */
+Void Ipc_setConfig(Ipc_Config *cfg)
+{
+ assert(cfg != NULL);
+ memcpy(&ti_ipc_Ipc_config, cfg, sizeof(Ipc_Config));
+}
index dc301c2652a6ef7ca1d213fee7b3789b9be4306c..15d6e7640ca8b215fb50d55383d31ed175717e5f 100644 (file)
/*!< Handle of gate to be used for local thread safety */
MessageQ_Config *cfg;
/*!< Current config values */
- MessageQ_Config defaultCfg;
- /*!< Default config values */
MessageQ_Params defaultInstParams;
/*!< Default instance creation parameters */
MessageQ_Handle * queues;
.gate = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
#endif
.cfg = &ti_ipc_MessageQ_cfg,
- .defaultCfg.traceFlag = FALSE,
- .defaultCfg.maxRuntimeEntries = 32u,
- .defaultCfg.maxNameLen = 32u,
- .defaultCfg.numReservedEntries = 0
};
/*!
{
assert(cfg != NULL);
- /* If setup has not yet been called... */
- if (MessageQ_module->refCount < 1) {
- memcpy(cfg, &MessageQ_module->defaultCfg, sizeof(MessageQ_Config));
- }
- else {
- memcpy(cfg, MessageQ_module->cfg, sizeof(MessageQ_Config));
- }
+ memcpy(cfg, MessageQ_module->cfg, sizeof(MessageQ_Config));
}
/* Function to setup the MessageQ module. */
}
}
}
+
+Void _MessageQ_setNumReservedEntries(UInt n)
+{
+ MessageQ_module->cfg->numReservedEntries = n;
+}
diff --git a/linux/src/daemon/lad.c b/linux/src/daemon/lad.c
index 87b326061a1dc2c1ba22efa53d88dcc09411dc97..170c3ec6c783ae402b8cff9a869a8b8052375e1c 100644 (file)
--- a/linux/src/daemon/lad.c
+++ b/linux/src/daemon/lad.c
h : print this help message\n\
g : enable GateMP support \n\
l <logfile> : name of logfile for LAD\n\
+ n <nprocs> : total number of processors in the system\n\
p <oct value>: set LAD's directory permissions\n\
+ r <nreserve> : number of reserved queues\n\
+ s <synctype> : type of Ipc_ProcSync (ALL|PAIR|NONE)\n\
b <value> : Processor's base cluster id \n\
\n\
Examples:\n\
int main(int argc, char * argv[])
{
MessageQ_Handle handle;
+ Ipc_Config ipcCfg;
UInt16 *procIdPtr;
Int statusIO;
Int clientId;
/* process command line args */
while (1) {
- c = getopt(argc, argv, "b:ghl:p:");
+ c = getopt(argc, argv, "b:ghl:n:p:r:s:");
if (c == -1) {
break;
}
#endif
break;
case 'b':
- if (_MultiProc_cfg.id == 0xFFFF &&
- _MultiProc_cfg.baseIdOfCluster == 0xFFFF) {
- printf("\nSetting base cluster id to %s\n", optarg);
- _MultiProc_cfg.id = atoi(optarg);
- _MultiProc_cfg.baseIdOfCluster = atoi(optarg);
- }
- else {
- printf("\nBase cluster id in the MultiProcCfg file must be\n"
- "set to MultiProc_INVALIDID(0xFFFF) when using -b option\n");
- exit(EXIT_FAILURE);
- }
+ printf("\nSet LAD's base cluster id to %s\n", optarg);
+ _MultiProc_cfg.id = atoi(optarg);
+ _MultiProc_cfg.baseIdOfCluster = atoi(optarg);
break;
case 'h':
printf("%s", LAD_USAGE);
}
}
break;
+ case 'n':
+ printf("\nSet LAD's number of processors to %s\n", optarg);
+ _MultiProc_cfg.numProcessors = atoi(optarg);
+ break;
case 'p':
printf("\nSet LAD's directory permissions to '%s'\n", optarg);
chmod(LAD_ROOTDIR, strtol(optarg, NULL, 8));
chmod(LAD_WORKINGDIR, strtol(optarg, NULL, 8));
break;
+ case 'r':
+ printf("\nSet LAD's number of reserved queues to %s\n", optarg);
+ _MessageQ_setNumReservedEntries(atoi(optarg));
+ break;
+ case 's':
+ printf("\nSet LAD's synchronization scheme to ProcSync_%s\n",
+ optarg);
+
+ Ipc_getConfig(&ipcCfg);
+
+ if (!strcmp(optarg, "ALL")) {
+ ipcCfg.procSync = Ipc_ProcSync_ALL;
+ }
+ else if (!strcmp(optarg, "PAIR")) {
+ ipcCfg.procSync = Ipc_ProcSync_PAIR;
+ }
+ else if (!strcmp(optarg, "NONE")) {
+ ipcCfg.procSync = Ipc_ProcSync_NONE;
+ }
+ else {
+ printf("Error: bad synchronization specified, must be "
+ "ALL|PAIR|NONE\n");
+ exit(EXIT_FAILURE);
+ }
+
+ Ipc_setConfig(&ipcCfg);
+ break;
default:
fprintf (stderr, "\nUnrecognized argument\n");
exit(EXIT_FAILURE);
}
/* Check to ensure id and baseId are not invalid */
- printf ("id = %d baseId= %d\n", _MultiProc_cfg.id, _MultiProc_cfg.baseIdOfCluster);
- if (_MultiProc_cfg.id == 0xFFFF || _MultiProc_cfg.baseIdOfCluster == 0xFFFF){
+ printf ("\nnumProcessors = %d id = %d baseId = %d\n",
+ _MultiProc_cfg.numProcessors, _MultiProc_cfg.id,
+ _MultiProc_cfg.baseIdOfCluster);
+
+ if (_MultiProc_cfg.id == 0xFFFF ||
+ _MultiProc_cfg.baseIdOfCluster == 0xFFFF) {
printf("\nBase cluster id is set to an INVALID value\n");
printf("Use -b option to set value or modify the MultiProcCfg file\n");
exit(EXIT_FAILURE);
}
+ if ((_MultiProc_cfg.baseIdOfCluster + _MultiProc_cfg.numProcsInCluster) >
+ _MultiProc_cfg.numProcessors) {
+ printf("\nNumber of processors (%d) must be >= base cluster id + "
+ "number of processors in cluster (%d + %d)\n",
+ _MultiProc_cfg.numProcessors, _MultiProc_cfg.baseIdOfCluster,
+ _MultiProc_cfg.numProcsInCluster);
+ exit(EXIT_FAILURE);
+ }
#if DAEMON