summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngela Stegmaier <angelabaker@ti.com>2016-03-08 16:45:32 -0600
committerAngela Stegmaier <angelabaker@ti.com>2016-03-11 13:14:56 -0600
commitdc6c5082f478225b7fbce4216173e6c5b36100b4 (patch)
tree31051444947b4ed1d5160af36e1f3fc37c9c7306
parenta520969994378fb2629d7dfc25f306c3a711b5bc (diff)
downloadipc-3.42.tar.gz
GateMP: Fix for hostSupport with GateMPSupportNull3.42.01.03ipc-3.42-next3.42
The default configuration for GateMP remoteCustom2 is to use GateMPSupportNull. In this case, the remoteCustom2InUse array will be NULL. Due to this, the virtToPhys translation will fail. If Asserts are enabled for the GateMP module, this will result in a failure. This patch fixes the issue by first checking if the pointer is NULL before attempting the translation, since it is a valid case for the pointer to be NULL. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
-rw-r--r--packages/ti/sdo/ipc/GateMP.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/packages/ti/sdo/ipc/GateMP.c b/packages/ti/sdo/ipc/GateMP.c
index 79b3efe..fd7a91e 100644
--- a/packages/ti/sdo/ipc/GateMP.c
+++ b/packages/ti/sdo/ipc/GateMP.c
@@ -758,12 +758,22 @@ Void ti_sdo_ipc_GateMP_setRegion0Reserved(Ptr sharedAddr)
(UInt32)GateMP_module->remoteSystemInUse, &nsValue[0]);
Assert_isTrue(ret == GateMP_S_SUCCESS, (Assert_Id)NULL);
(void)ret; /* silence unused var warning when asserts disabled */
- ret = _GateMP_virtToPhys(
- (UInt32)GateMP_module->remoteCustom1InUse, &nsValue[1]);
- Assert_isTrue(ret == GateMP_S_SUCCESS, (Assert_Id)NULL);
- ret = _GateMP_virtToPhys(
- (UInt32)GateMP_module->remoteCustom2InUse, &nsValue[2]);
- Assert_isTrue(ret == GateMP_S_SUCCESS, (Assert_Id)NULL);
+ if (GateMP_module->numRemoteCustom1 != 0) {
+ ret = _GateMP_virtToPhys(
+ (UInt32)GateMP_module->remoteCustom1InUse, &nsValue[1]);
+ Assert_isTrue(ret == GateMP_S_SUCCESS, (Assert_Id)NULL);
+ }
+ else {
+ nsValue[1] = 0;
+ }
+ if (GateMP_module->numRemoteCustom2 != 0) {
+ ret = _GateMP_virtToPhys(
+ (UInt32)GateMP_module->remoteCustom2InUse, &nsValue[2]);
+ Assert_isTrue(ret == GateMP_S_SUCCESS, (Assert_Id)NULL);
+ }
+ else {
+ nsValue[2] = 0;
+ }
nsValue[3] = GateMP_module->numRemoteSystem;
nsValue[4] = GateMP_module->numRemoteCustom1;
nsValue[5] = GateMP_module->numRemoteCustom2;