summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngela Stegmaier <angelabaker@ti.com>2016-04-15 10:01:51 -0500
committerAngela Stegmaier <angelabaker@ti.com>2016-04-20 13:47:53 -0500
commit04f0bf7c9082a70bc4ff915577755b3cc43297c5 (patch)
tree27b73d0a7989f9d6672c2f308f538c6ee57409db
parent35ad1c497d1be5676f28cd872e1aa238c18505bc (diff)
downloadipc-04f0bf7c9082a70bc4ff915577755b3cc43297c5.tar.gz
Linux: tests: Call MessageQ_unbind in Fault Test
Call MessageQ_unbind in the fault test to unbind the application from remote cores that it doesn't care about. This is useful in the case of remote core recovery, so that recovery of a remote core doesn't trigger errors in MessageQ APIs if the application doesn't care about the state of a particular core. In this way, the MessageQ for the application is only bound to the core(s) with which it is communicating. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
-rw-r--r--linux/src/tests/fault.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/linux/src/tests/fault.c b/linux/src/tests/fault.c
index 196f11a..26db8f4 100644
--- a/linux/src/tests/fault.c
+++ b/linux/src/tests/fault.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2015 Texas Instruments Incorporated - http://www.ti.com
+ * Copyright (c) 2012-2016 Texas Instruments Incorporated - http://www.ti.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -63,6 +63,8 @@ typedef struct SyncMsg {
Int32 faultId;
} SyncMsg ;
+Void MessageQ_unbind(UInt16 procId);
+
Int MessageQApp_execute(UInt32 numLoops, UInt16 procId, UInt32 faultId)
{
Int32 status = 0;
@@ -73,6 +75,7 @@ Int MessageQApp_execute(UInt32 numLoops, UInt16 procId, UInt32 faultId)
MessageQ_Handle msgqHandle;
char remoteQueueName[64];
UInt32 msgId;
+ UInt16 id = 0;
printf("Entered MessageQApp_execute\n");
@@ -87,6 +90,14 @@ Int MessageQApp_execute(UInt32 numLoops, UInt16 procId, UInt32 faultId)
printf("Local MessageQId: 0x%x\n", MessageQ_getQueueId(msgqHandle));
}
+ /* detach from all processors we don't care about */
+ for (id = 1; id < (MultiProc_getBaseIdOfCluster() + MultiProc_getNumProcessors()); id++) {
+ if (id != procId) {
+ printf("Unbinding from ProcId (%d)\n", id);
+ MessageQ_unbind(id);
+ }
+ }
+
sprintf(remoteQueueName, "%s_%s", SLAVE_MESSAGEQNAME,
MultiProc_getName(procId));