From: Angela Stegmaier Date: Fri, 15 Apr 2016 15:01:51 +0000 (-0500) Subject: Linux: tests: Call MessageQ_unbind in Fault Test X-Git-Tag: 3.43.00.00_eng~7 X-Git-Url: https://git.ti.com/gitweb?p=ipc%2Fipcdev.git;a=commitdiff_plain;h=04f0bf7c9082a70bc4ff915577755b3cc43297c5 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 --- 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));