From: vwan@ti.com Date: Tue, 22 Jul 2014 22:23:51 +0000 (-0700) Subject: Fix MultiProc_self() in QNX to return the correct value X-Git-Tag: 3.23.00.01~6 X-Git-Url: https://git.ti.com/gitweb?p=ipc%2Fipcdev.git;a=commitdiff_plain;h=49d5b3e89545662aa9761e443a6ef78a40143376;ds=inline Fix MultiProc_self() in QNX to return the correct value This commit fixes MultiProc_getConfig, so that its returned data structure does not get corrupted. This in turn fixes MultiProc_self(), which was returning the corrupted id. This addresses CQ SDOCM00108594. Signed-off-by: VW --- diff --git a/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/knl/Qnx/multiproc_devctl.c b/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/knl/Qnx/multiproc_devctl.c index 7e65e2a..91a02a7 100644 --- a/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/knl/Qnx/multiproc_devctl.c +++ b/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/knl/Qnx/multiproc_devctl.c @@ -6,7 +6,7 @@ * * ============================================================================ * - * Copyright (c) 2013, Texas Instruments Incorporated + * Copyright (c) 2013-2014, Texas Instruments Incorporated * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -101,13 +101,14 @@ int syslink_multiproc_getconfig(resmgr_context_t *ctp, io_devctl_t *msg, { MultiProcDrv_CmdArgs * cargs = (MultiProcDrv_CmdArgs *) (_DEVCTL_DATA (msg->i)); - MultiProc_Config local_config; - MultiProc_getConfig (&local_config); + MultiProc_Config * config = (MultiProc_Config *)(cargs+1); + + MultiProc_getConfig(config); cargs->apiStatus = MultiProc_S_SUCCESS; SETIOV(&ctp->iov[0], &msg->o, sizeof(msg->o) + sizeof(MultiProcDrv_CmdArgs)); - SETIOV(&ctp->iov[1], &local_config, sizeof(MultiProc_Config)); + SETIOV(&ctp->iov[1], config, sizeof(MultiProc_Config)); return _RESMGR_NPARTS(2); } diff --git a/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/usr/Qnx/MultiProcDrv.c b/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/usr/Qnx/MultiProcDrv.c index 8f839c6..c4a7b49 100644 --- a/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/usr/Qnx/MultiProcDrv.c +++ b/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/usr/Qnx/MultiProcDrv.c @@ -6,7 +6,7 @@ * * ============================================================================ * - * Copyright (c) 2013, Texas Instruments Incorporated + * Copyright (c) 2013-2014, Texas Instruments Incorporated * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -88,7 +88,7 @@ MultiProcDrv_ioctl (UInt32 cmd, Ptr args) SETIOV(&mpgetconfig_iov[0], cargs, sizeof(MultiProcDrv_CmdArgs)); SETIOV(&mpgetconfig_iov[1], cargs->args.getConfig.config, sizeof(MultiProc_Config)); - osStatus = devctlv(IpcDrv_handle, DCMD_MULTIPROC_GETCONFIG, 1, 2, + osStatus = devctlv(IpcDrv_handle, DCMD_MULTIPROC_GETCONFIG, 2, 2, mpgetconfig_iov, mpgetconfig_iov, NULL); } break;