From: vwan@ti.com Date: Thu, 5 Feb 2015 19:32:48 +0000 (-0800) Subject: Eliminate build warnings in QNX build X-Git-Tag: 3.35.00.04_eng~7 X-Git-Url: https://git.ti.com/gitweb?p=ipc%2Fipcdev.git;a=commitdiff_plain;h=d10b2b452982fd5090ae7666aafd6103744b38b0 Eliminate build warnings in QNX build This commit eliminates all build warnings in the QNX IPC build process. It addresses SDOCM00113501. Signed-off-by: VW --- diff --git a/qnx/src/api/MessageQ.c b/qnx/src/api/MessageQ.c index 66a9219..bea3451 100644 --- a/qnx/src/api/MessageQ.c +++ b/qnx/src/api/MessageQ.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014, Texas Instruments Incorporated + * Copyright (c) 2012-2015, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -375,7 +375,6 @@ MessageQ_Handle MessageQ_create (String name, const MessageQ_Params * pp) Int status = MessageQ_S_SUCCESS; MessageQ_Object * obj = NULL; UInt16 queueIndex = 0u; - UInt16 procId; MessageQDrv_CmdArgs cmdArgs; int fildes[2]; MessageQ_Params ps; @@ -442,7 +441,6 @@ MessageQ_Handle MessageQ_create (String name, const MessageQ_Params * pp) /* Populate the params member */ memcpy(&obj->params, &ps, sizeof(ps)); - procId = MultiProc_self(); obj->queue = cmdArgs.args.create.queueId; obj->serverHandle = cmdArgs.args.create.handle; @@ -752,10 +750,9 @@ Void MessageQ_unblock (MessageQ_Handle handle) { MessageQ_Object * obj = (MessageQ_Object *) handle; char buf = 'n'; - int numBytes; /* Write to pipe to awaken any threads blocked on this messageQ: */ - numBytes = write(obj->unblockFdW, &buf, 1); + write(obj->unblockFdW, &buf, 1); } /* Embeds a source message queue into a message. */ @@ -1026,9 +1023,15 @@ static Int transportGet(int fd, MessageQ_Msg * retMsg) PRINTVERBOSE1("transportGet: read from fd: %d\n", fd) ret = ioctl(fd, TIIPC_IOCGETREMOTE, &remote); + if (ret == -1) { + printf("ioctl failed: %s (%d)\n", strerror(errno), errno); + status = MessageQ_E_FAIL; + goto exit; + } PRINTVERBOSE3("\tReceived a msg: byteCount: %d, rpmsg addr: %d, rpmsg \ proc: %d\n", byteCount, remote.remote_addr, remote.remote_proc) - PRINTVERBOSE2("\tMessage Id: %d, Message size: %d\n", msg->msgId, msg->msgSize) + PRINTVERBOSE2("\tMessage Id: %d, Message size: %d\n", msg->msgId, + msg->msgSize) *retMsg = msg; diff --git a/qnx/src/api/gates/GateMutex.c b/qnx/src/api/gates/GateMutex.c index 514afbc..32608ab 100644 --- a/qnx/src/api/gates/GateMutex.c +++ b/qnx/src/api/gates/GateMutex.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Texas Instruments Incorporated + * Copyright (c) 2013-2015, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -128,10 +128,14 @@ IArg GateMutex_enter (GateMutex_Handle gmHandle) Void GateMutex_leave (GateMutex_Handle gmHandle, IArg key) { GateMutex_Object * obj = (GateMutex_Object *)gmHandle; +#if defined(IPC_BUILD_DEBUG) int ret; ret = pthread_mutex_unlock(&(obj->mutex)); assert(ret == 0); +#else + pthread_mutex_unlock(&(obj->mutex)); +#endif } diff --git a/qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/syslink_main.c b/qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/syslink_main.c index 8025b93..5979e6f 100644 --- a/qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/syslink_main.c +++ b/qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/syslink_main.c @@ -1582,7 +1582,6 @@ int main(int argc, char *argv[]) int c; int hib_enable = 1; uint32_t hib_timeout = PM_HIB_DEFAULT_TIME; - char *user_parm = NULL; struct stat sbuf; int i = 0; char * abs_path = NULL; @@ -1596,7 +1595,7 @@ int main(int argc, char *argv[]) /* Parse the input args */ while (1) { - c = getopt (argc, argv, "H:T:U:gc:dv:a:"); + c = getopt (argc, argv, "H:T:gc:dv:a:"); if (c == -1) break; @@ -1613,9 +1612,6 @@ int main(int argc, char *argv[]) hib_timeout = atoi(optarg); break; #endif - case 'U': - user_parm = optarg; - break; case 'd': disableRecovery = true; break; @@ -1758,41 +1754,6 @@ int main(int argc, char *argv[]) return(-1); } -#if (_NTO_VERSION >= 800) - /* Relinquish privileges */ - status = procmgr_ability( 0, - DENY_ALL | PROCMGR_AID_SPAWN, - DENY_ALL | PROCMGR_AID_FORK, - PROCMGR_ADN_NONROOT | PROCMGR_AOP_ALLOW | PROCMGR_AID_MEM_PEER, - PROCMGR_ADN_NONROOT | PROCMGR_AOP_ALLOW | PROCMGR_AID_MEM_PHYS, - PROCMGR_ADN_NONROOT | PROCMGR_AOP_ALLOW | PROCMGR_AID_INTERRUPT, - PROCMGR_ADN_NONROOT | PROCMGR_AOP_ALLOW | PROCMGR_AID_PATHSPACE, - PROCMGR_ADN_NONROOT | PROCMGR_AOP_ALLOW | PROCMGR_AID_RSRCDBMGR, - PROCMGR_ADN_ROOT | PROCMGR_AOP_ALLOW | PROCMGR_AOP_LOCK | PROCMGR_AOP_SUBRANGE | PROCMGR_AID_SETUID, - (uint64_t)1, (uint64_t)~0, - PROCMGR_ADN_ROOT | PROCMGR_AOP_ALLOW | PROCMGR_AOP_LOCK | PROCMGR_AOP_SUBRANGE | PROCMGR_AID_SETGID, - (uint64_t)1, (uint64_t)~0, - PROCMGR_ADN_ROOT | PROCMGR_AOP_DENY | PROCMGR_AOP_LOCK | PROCMGR_AID_EOL); - - if (status != EOK) { - Osal_printf("procmgr_ability failed! errno=%d", status); - return EXIT_FAILURE; - } - - /* Reduce priority to either what defined from command line or at least nobody */ - if (user_parm != NULL) { - if (set_ids_from_arg(user_parm) < 0) { - Osal_printf("unable to set uid/gid - %s", strerror(errno)); - return EXIT_FAILURE; - } - } else { - if (setuid(99) != 0) { - Osal_printf("unable to set uid - %s", strerror(errno)); - return EXIT_FAILURE; - } - } -#endif - /* make this a daemon process */ if (-1 == procmgr_daemon(EXIT_SUCCESS, PROCMGR_DAEMON_NOCLOSE | PROCMGR_DAEMON_NODEVNULL)) { diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/vayu/vayuipu/VAYUIpuHalBoot.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/vayu/vayuipu/VAYUIpuHalBoot.c index 66fd2a2..3a4538c 100644 --- a/qnx/src/ipc3x_dev/ti/syslink/family/common/vayu/vayuipu/VAYUIpuHalBoot.c +++ b/qnx/src/ipc3x_dev/ti/syslink/family/common/vayu/vayuipu/VAYUIpuHalBoot.c @@ -96,15 +96,12 @@ Int VAYUIPU_halBootCtrl (Ptr halObj, Processor_BootCtrlCmd cmd, Ptr args) { Int status = PROCESSOR_SUCCESS; - VAYUIPU_HalObject * halObject = NULL; GT_3trace (curTrace, GT_ENTER, "VAYUIPU_halBootCtrl", halObj, cmd, args); GT_assert (curTrace, (halObj != NULL)); GT_assert (curTrace, (cmd < Processor_BootCtrlCmd_EndValue)); - halObject = (VAYUIPU_HalObject *) halObj; - switch (cmd) { case Processor_BootCtrlCmd_SetEntryPoint: { diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayudsp/VAYUDspEnabler.c b/qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayudsp/VAYUDspEnabler.c index aab0af5..d228361 100644 --- a/qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayudsp/VAYUDspEnabler.c +++ b/qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayudsp/VAYUDspEnabler.c @@ -6,7 +6,7 @@ * * ============================================================================ * - * Copyright (c) 2013, Texas Instruments Incorporated + * Copyright (c) 2013-2015, Texas Instruments Incorporated * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -1146,7 +1146,6 @@ static Int pte_set (UInt32 pa, UInt32 va, UInt32 size, struct pg_table_attrs *pt = pt_Table; struct iotlb_entry *mapAttrs; int status = 0; - VAYUDSP_HalMmuEntryInfo setPteInfo; mapAttrs = Memory_alloc(0, sizeof(struct iotlb_entry), 0, NULL); l1_base_va = pt->l1_base_va; @@ -1216,12 +1215,6 @@ static Int pte_set (UInt32 pa, UInt32 va, UInt32 size, mapAttrs->da = va; mapAttrs->pa = pa; mapAttrs->pgsz = MMU_CAM_PGSZ_16M; - setPteInfo.elementSize = attrs->element_size; - setPteInfo.endianism = attrs->endianism; - setPteInfo.masterPhyAddr = pa; - setPteInfo.mixedSize = attrs->mixedSize; - setPteInfo.size = size; - setPteInfo.slaveVirtAddr = va; status = hw_mmu_pte_set(pg_tbl_va, pa, va, size, attrs); if (status == RET_OK) @@ -1404,9 +1397,6 @@ static Int rproc_mem_unmap (UInt32 mmuBase, struct pg_table_attrs * p_pt_attrs, UInt32 rem_bytes_l2; UInt32 vaCurr; Int status = 0; - UInt32 temp; - UInt32 pAddr; - UInt32 numof4Kpages = 0; if (mmuBase == 0) { status = -ENOMEM; @@ -1475,14 +1465,6 @@ static Int rproc_mem_unmap (UInt32 mmuBase, struct pg_table_attrs * p_pt_attrs, if ((pte_size != 0) && (rem_bytes_l2 >= pte_size) && !(vaCurr & (pte_size - 1))) { - /* Collect Physical addresses from VA */ - pAddr = (pte_val & ~(pte_size - 1)); - if (pte_size == HW_PAGE_SIZE_64KB) - numof4Kpages = 16; - else - numof4Kpages = 1; - temp = 0; - if (hw_mmu_pte_clear(pte_addr_l2, vaCurr, pte_size) == RET_OK) { rem_bytes_l2 -= pte_size; @@ -1520,13 +1502,6 @@ static Int rproc_mem_unmap (UInt32 mmuBase, struct pg_table_attrs * p_pt_attrs, /* pte_size = 1 MB or 16 MB */ if ((pte_size != 0) && (rem_bytes >= pte_size) && !(vaCurr & (pte_size - 1))) { - if (pte_size == HW_PAGE_SIZE_1MB) - numof4Kpages = 256; - else - numof4Kpages = 4096; - temp = 0; - /* Collect Physical addresses from VA */ - pAddr = (pte_val & ~(pte_size - 1)); if (hw_mmu_pte_clear(L1_base_va, vaCurr, pte_size) == RET_OK) { rem_bytes -= pte_size; diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayudsp/VAYUDspHalMmu.c b/qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayudsp/VAYUDspHalMmu.c index de4ea27..560e488 100644 --- a/qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayudsp/VAYUDspHalMmu.c +++ b/qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayudsp/VAYUDspHalMmu.c @@ -258,47 +258,11 @@ VAYUDSP_halMmuCtrl (Ptr halObj, Processor_MmuCtrlCmd cmd, Ptr args) case Processor_MmuCtrlCmd_AddEntry: { - VAYUDSP_HalMmuCtrlArgs_AddEntry * addEntry; - addEntry = (VAYUDSP_HalMmuCtrlArgs_AddEntry *) args; - - halObject = (VAYUDSP_HalObject *) halObj; - /* Add the entry in TLB for new request */ - //status = _VAYUDSP_halMmuAddEntry (halObject,addEntry) ; -#if !defined(IPC_BUILD_OPTIMIZE) - if (status < 0) { - /*! @retval PROCESSOR_E_FAIL Failed to dynamically add DSP MMU - * entry. */ - status = PROCESSOR_E_FAIL; - GT_setFailureReason (curTrace, - GT_4CLASS, - "VAYUDSP_halMmuCtrl", - status, - "Failed to dynamically add DSP MMU entry"); - } -#endif /* if !defined(IPC_BUILD_OPTIMIZE) */ } break; case Processor_MmuCtrlCmd_DeleteEntry: { - VAYUDSP_HalMmuCtrlArgs_DeleteEntry * deleteEntry; - deleteEntry = (VAYUDSP_HalMmuCtrlArgs_DeleteEntry *) args; - - halObject = (VAYUDSP_HalObject *) halObj; - /* Add the entry in TLB for new request */ - //status = _VAYUDSP_halMmuDeleteEntry (halObject,deleteEntry); -#if !defined(IPC_BUILD_OPTIMIZE) - if (status < 0) { - /*! @retval PROCESSOR_E_FAIL Failed to dynamically delete DSP - * MMU entry */ - status = PROCESSOR_E_FAIL; - GT_setFailureReason (curTrace, - GT_4CLASS, - "VAYUDSP_halMmuCtrl", - status, - "Failed to dynamically add DSP MMU entry"); - } -#endif /* if !defined(IPC_BUILD_OPTIMIZE) */ } break; @@ -840,7 +804,6 @@ _VAYUDSP_halMmuDeleteEntry (VAYUDSP_HalObject * halObject, UInt32 * iopgd = NULL; UInt32 currentEntrySize; VAYUDSP_HalMmuEntryInfo currentEntry; - VAYUDSP_HalMmuObject * mmu0Obj, *mmu1Obj; //UInt32 clearBytes = 0; GT_2trace (curTrace, GT_ENTER, "_VAYUDSP_halMmuDeleteEntry", @@ -850,9 +813,6 @@ _VAYUDSP_halMmuDeleteEntry (VAYUDSP_HalObject * halObject, GT_assert (curTrace, (entry != NULL)); GT_assert (curTrace, (entry->size != 0)); - mmu0Obj = &(halObject->mmu0Obj); - mmu1Obj = &(halObject->mmu1Obj); - /* Add the entry (or entries) */ Memory_copy(¤tEntry, entry, @@ -929,6 +889,7 @@ _VAYUDSP_halMmuDeleteEntry (VAYUDSP_HalObject * halObject, } +#ifdef MMUTEST static ULONG HAL_MMU_PteAddrL1(const ULONG L1_base, const ULONG va) { ULONG TTB_13_to_7, VA_31_to_20, desc_13_to_0; @@ -944,6 +905,7 @@ static ULONG HAL_MMU_PteAddrL2(const ULONG L2_base, const ULONG va) { return ( (L2_base & 0xFFFFFC00) | ( (va >> 10) & 0x3FC ) ); } +#endif #define OUTREG32(x, y) WRITE_REGISTER_ULONG(x, (ULONG)(y)) @@ -951,6 +913,7 @@ int VAYUDSP_InternalMMU_PteSet (const ULONG pgTblVa, struct iotlb_entry *mapAttrs) { Int status = 0; +#ifdef MMUTEST ULONG pteAddr, pteVal; Int numEntries = 1; ULONG physicalAddr = mapAttrs->pa; @@ -1004,10 +967,9 @@ int VAYUDSP_InternalMMU_PteSet (const ULONG pgTblVa, while (--numEntries >= 0) { -#ifdef MMUTEST ((ULONG*)pteAddr)[numEntries] = pteVal; -#endif } +#endif return status; } diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayuipu/VAYUIpuEnabler.c b/qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayuipu/VAYUIpuEnabler.c index bcadd32..d92c2bc 100644 --- a/qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayuipu/VAYUIpuEnabler.c +++ b/qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayuipu/VAYUIpuEnabler.c @@ -6,7 +6,7 @@ * * ============================================================================ * - * Copyright (c) 2013-2014, Texas Instruments Incorporated + * Copyright (c) 2013-2015, Texas Instruments Incorporated * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -1169,7 +1169,6 @@ static Int pte_set (UInt32 pa, UInt32 va, UInt32 size, UInt32 l2_page_num = 0; struct pg_table_attrs *pt = pt_Table; int status = 0; - VAYUIPU_HalMmuEntryInfo setPteInfo; l1_base_va = pt->l1_base_va; pg_tbl_va = l1_base_va; @@ -1228,12 +1227,6 @@ static Int pte_set (UInt32 pa, UInt32 va, UInt32 size, } } if (status == 0) { - setPteInfo.elementSize = attrs->element_size; - setPteInfo.endianism = attrs->endianism; - setPteInfo.masterPhyAddr = pa; - setPteInfo.mixedSize = attrs->mixedSize; - setPteInfo.size = size; - setPteInfo.slaveVirtAddr = va; status = hw_mmu_pte_set(pg_tbl_va, pa, va, size, attrs); if (status == RET_OK) status = 0; @@ -1561,9 +1554,6 @@ static Int rproc_mem_unmap (VAYUIPU_HalObject * halObject, UInt32 rem_bytes_l2; UInt32 vaCurr; Int status = 0; - UInt32 temp; - UInt32 pAddr; - UInt32 numof4Kpages = 0; struct pg_table_attrs * p_pt_attrs = NULL; if (halObject == NULL) { @@ -1643,13 +1633,6 @@ static Int rproc_mem_unmap (VAYUIPU_HalObject * halObject, >= pte_size) && !(vaCurr & (pte_size - 1))) { /* Collect Physical addresses from VA */ - pAddr = (pte_val & ~(pte_size - 1)); - if (pte_size == HW_PAGE_SIZE_64KB) - numof4Kpages = 16; - else - numof4Kpages = 1; - temp = 0; - if (hw_mmu_pte_clear(pte_addr_l2, vaCurr, pte_size) == RET_OK) { rem_bytes_l2 -= pte_size; @@ -1687,13 +1670,7 @@ static Int rproc_mem_unmap (VAYUIPU_HalObject * halObject, /* pte_size = 1 MB or 16 MB */ if ((pte_size != 0) && (rem_bytes >= pte_size) && !(vaCurr & (pte_size - 1))) { - if (pte_size == HW_PAGE_SIZE_1MB) - numof4Kpages = 256; - else - numof4Kpages = 4096; - temp = 0; /* Collect Physical addresses from VA */ - pAddr = (pte_val & ~(pte_size - 1)); if (hw_mmu_pte_clear(L1_base_va, vaCurr, pte_size) == RET_OK) { rem_bytes -= pte_size; diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayuipu/VAYUIpuHalMmu.c b/qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayuipu/VAYUIpuHalMmu.c index 5d486ae..2ad5fb8 100644 --- a/qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayuipu/VAYUIpuHalMmu.c +++ b/qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayuipu/VAYUIpuHalMmu.c @@ -267,47 +267,11 @@ VAYUIPU_halMmuCtrl (Ptr halObj, Processor_MmuCtrlCmd cmd, Ptr args) case Processor_MmuCtrlCmd_AddEntry: { - VAYUIPU_HalMmuCtrlArgs_AddEntry * addEntry; - addEntry = (VAYUIPU_HalMmuCtrlArgs_AddEntry *) args; - - halObject = (VAYUIPU_HalObject *) halObj; - /* Add the entry in TLB for new request */ - //status = _VAYUIPU_halMmuAddEntry (halObject,addEntry) ; -#if !defined(IPC_BUILD_OPTIMIZE) - if (status < 0) { - /*! @retval PROCESSOR_E_FAIL Failed to dynamically add IPU MMU - * entry. */ - status = PROCESSOR_E_FAIL; - GT_setFailureReason (curTrace, - GT_4CLASS, - "VAYUIPU_halMmuCtrl", - status, - "Failed to dynamically add IPU MMU entry"); - } -#endif /* if !defined(IPC_BUILD_OPTIMIZE) */ } break; case Processor_MmuCtrlCmd_DeleteEntry: { - VAYUIPU_HalMmuCtrlArgs_DeleteEntry * deleteEntry; - deleteEntry = (VAYUIPU_HalMmuCtrlArgs_DeleteEntry *) args; - - halObject = (VAYUIPU_HalObject *) halObj; - /* Add the entry in TLB for new request */ - //status = _VAYUIPU_halMmuDeleteEntry (halObject,deleteEntry); -#if !defined(IPC_BUILD_OPTIMIZE) - if (status < 0) { - /*! @retval PROCESSOR_E_FAIL Failed to dynamically delete IPU - * MMU entry */ - status = PROCESSOR_E_FAIL; - GT_setFailureReason (curTrace, - GT_4CLASS, - "VAYUIPU_halMmuCtrl", - status, - "Failed to dynamically add IPU MMU entry"); - } -#endif /* if !defined(IPC_BUILD_OPTIMIZE) */ } break; @@ -807,7 +771,7 @@ _VAYUIPU_halMmuDeleteEntry (VAYUIPU_HalObject * halObject, UInt32 * iopgd = NULL; UInt32 currentEntrySize; VAYUIPU_HalMmuEntryInfo currentEntry; - VAYUIPU_HalMmuObject * mmuObj; + /* VAYUIPU_HalMmuObject * mmuObj; */ //UInt32 clearBytes = 0; GT_2trace (curTrace, GT_ENTER, "_VAYUIPU_halMmuDeleteEntry", @@ -817,7 +781,7 @@ _VAYUIPU_halMmuDeleteEntry (VAYUIPU_HalObject * halObject, GT_assert (curTrace, (entry != NULL)); GT_assert (curTrace, (entry->size != 0)); - mmuObj = &(halObject->mmuObj); + /* mmuObj = &(halObject->mmuObj); */ /* copy the entry (or entries) */ Memory_copy(¤tEntry, @@ -894,7 +858,7 @@ _VAYUIPU_halMmuDeleteEntry (VAYUIPU_HalObject * halObject, return status; } - +#ifdef MMUTEST static ULONG HAL_MMU_PteAddrL1(const ULONG L1_base, const ULONG va) { ULONG TTB_13_to_7, VA_31_to_20, desc_13_to_0; @@ -910,6 +874,7 @@ static ULONG HAL_MMU_PteAddrL2(const ULONG L2_base, const ULONG va) { return ( (L2_base & 0xFFFFFC00) | ( (va >> 10) & 0x3FC ) ); } +#endif #define OUTREG32(x, y) WRITE_REGISTER_ULONG(x, (ULONG)(y)) @@ -917,6 +882,7 @@ int VAYUIPU_InternalMMU_PteSet (const ULONG pgTblVa, struct iotlb_entry * mapAttrs) { Int status = 0; +#ifdef MMUTEST ULONG pteAddr, pteVal; Int numEntries = 1; ULONG physicalAddr = mapAttrs->pa; @@ -970,11 +936,9 @@ int VAYUIPU_InternalMMU_PteSet (const ULONG pgTblVa, while (--numEntries >= 0) { -#ifdef MMUTEST ((ULONG*)pteAddr)[numEntries] = pteVal; -#endif } - +#endif return status; } diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/_GateMP_daemon.h b/qnx/src/ipc3x_dev/ti/syslink/inc/_GateMP_daemon.h index 87c4f11..6fe681a 100644 --- a/qnx/src/ipc3x_dev/ti/syslink/inc/_GateMP_daemon.h +++ b/qnx/src/ipc3x_dev/ti/syslink/inc/_GateMP_daemon.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, Texas Instruments Incorporated + * Copyright (c) 2013-2015, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -59,6 +59,16 @@ Int GateMP_setup(Int32 * sr0ProcId); */ Int GateMP_destroy(Bool forced); +/*! + * Start the GateMP module. + */ +Int GateMP_start(Void); + +/*! + * Stop the GateMP module. + */ +Int GateMP_stop(Void); + /*! * Find a free resource id for a particular protection type. */ diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/ProcDefs.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/ProcDefs.h index 3d6b15c..3076ee9 100644 --- a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/ProcDefs.h +++ b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/ProcDefs.h @@ -153,7 +153,7 @@ typedef struct Processor_Register_tag { /*!< Client callback function. */ Ptr arg; /*!< Client arg to pass to the callback function. */ - ProcMgr_EventType state[]; + ProcMgr_State state[]; /*!< States registered for notification. */ } Processor_Register; diff --git a/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/knl/Qnx/MessageQCopyDrv.c b/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/knl/Qnx/MessageQCopyDrv.c index f4a86bf..2a8dde3 100644 --- a/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/knl/Qnx/MessageQCopyDrv.c +++ b/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/knl/Qnx/MessageQCopyDrv.c @@ -175,7 +175,6 @@ MessageQCopyDrv_devctl (resmgr_context_t * ctp, io_devctl_t * msg, */ void mqcopy_server_test_cb(MessageQCopy_Handle handle, void * data, int len, void * priv, UInt32 src, UInt16 srcProc) { - int status = 0; char message[MessageQCopy_BUFSIZE]; memcpy(message, data, len); @@ -184,13 +183,13 @@ void mqcopy_server_test_cb(MessageQCopy_Handle handle, void * data, int len, voi mqcopy_test_num_msgs++, handle, src, message); if (mqcopy_test_num_msgs < MQCOPY_TEST_NUM_MSG) { - status = MessageQCopy_send (srcProc, - local_procid, - src, - local_endpoint, - MQCOPY_TSET_MSG, - String_len(MQCOPY_TSET_MSG), - TRUE); + MessageQCopy_send (srcProc, + local_procid, + src, + local_endpoint, + MQCOPY_TSET_MSG, + String_len(MQCOPY_TSET_MSG), + TRUE); } else { OsalSemaphore_post(mqcopy_test_sem); @@ -267,7 +266,7 @@ static int run_mqcopy_server_test(void) void mqcopy_client_test_cb(MessageQCopy_Handle handle, void * data, int len, void * priv, UInt32 src, UInt16 srcProc) { - int status = 0, i = 0; + int i = 0; char message[MessageQCopy_BUFSIZE]; memcpy(message, data, len); @@ -282,13 +281,13 @@ void mqcopy_client_test_cb(MessageQCopy_Handle handle, void * data, int len, voi } if (i != 10) { if (mqcopy_test_num_msgs < MQCOPY_TEST_NUM_MSG) { - status = MessageQCopy_send (mqcopy_test_handles[i].procId, - local_procid, - mqcopy_test_handles[i].endpoint, - local_endpoint, - MQCOPY_TSET_MSG, - String_len(MQCOPY_TSET_MSG), - TRUE); + MessageQCopy_send(mqcopy_test_handles[i].procId, + local_procid, + mqcopy_test_handles[i].endpoint, + local_endpoint, + MQCOPY_TSET_MSG, + String_len(MQCOPY_TSET_MSG), + TRUE); } else { OsalSemaphore_post(mqcopy_test_sem); diff --git a/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/knl/Qnx/gatemp_devctl.c b/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/knl/Qnx/gatemp_devctl.c index 3bd559f..f8d4f7c 100644 --- a/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/knl/Qnx/gatemp_devctl.c +++ b/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/knl/Qnx/gatemp_devctl.c @@ -56,6 +56,8 @@ int ipc_gatemp_getNumResources(resmgr_context_t *ctp, io_devctl_t *msg, ipc_ocb_t *ocb); int ipc_gatemp_start(resmgr_context_t *ctp, io_devctl_t *msg, ipc_ocb_t *ocb); +int ipc_gatemp_stop(resmgr_context_t *ctp, io_devctl_t *msg, + ipc_ocb_t *ocb); int ipc_gatemp_isSetup(resmgr_context_t *ctp, io_devctl_t *msg, ipc_ocb_t *ocb); @@ -249,8 +251,6 @@ int ipc_gatemp_start(resmgr_context_t *ctp, io_devctl_t *msg, int ipc_gatemp_stop(resmgr_context_t *ctp, io_devctl_t *msg, ipc_ocb_t *ocb) { - GateMPDrv_CmdArgs * cargs = (GateMPDrv_CmdArgs *) - (_DEVCTL_DATA (msg->i)); GateMPDrv_CmdArgs * out = (GateMPDrv_CmdArgs *) (_DEVCTL_DATA (msg->o)); diff --git a/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/usr/Qnx/MessageQCopyDrv.c b/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/usr/Qnx/MessageQCopyDrv.c index 870e729..8c7e2b1 100644 --- a/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/usr/Qnx/MessageQCopyDrv.c +++ b/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/usr/Qnx/MessageQCopyDrv.c @@ -8,7 +8,7 @@ * * ============================================================================ * - * Copyright (c) 2011-2012, Texas Instruments Incorporated + * Copyright (c) 2011-2015, Texas Instruments Incorporated * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -121,7 +121,6 @@ MessageQCopyDrv_open (Void) { Int status = MessageQCopy_S_SUCCESS; int osStatus = 0; - Bool isForked = FALSE; GT_0trace (curTrace, GT_ENTER, "MessageQCopyDrv_open"); @@ -159,7 +158,6 @@ MessageQCopyDrv_open (Void) if (MessageQCopyDrv_setup != getpid ()) { /* Indicates that this is a forked process - Ang - need to check this? */ MessageQCopyDrv_setup = getpid (); - isForked = TRUE; } else { /* TBD: Protection for refCount. */ diff --git a/qnx/src/ipc3x_dev/ti/syslink/procMgr/hlos/knl/ProcMgr.c b/qnx/src/ipc3x_dev/ti/syslink/procMgr/hlos/knl/ProcMgr.c index d15b7a1..7dc2fef 100644 --- a/qnx/src/ipc3x_dev/ti/syslink/procMgr/hlos/knl/ProcMgr.c +++ b/qnx/src/ipc3x_dev/ti/syslink/procMgr/hlos/knl/ProcMgr.c @@ -886,7 +886,6 @@ ProcMgr_attach (ProcMgr_Handle handle, ProcMgr_AttachParams * params) Int status = ProcMgr_S_SUCCESS; ProcMgr_Object * procMgrHandle = (ProcMgr_Object *) handle ; IArg key; - UInt32 index = 0; ProcMgr_AttachParams tmpParams; Processor_AttachParams procAttachParams; Loader_AttachParams loaderAttachParams; @@ -997,7 +996,6 @@ ProcMgr_attach (ProcMgr_Handle handle, ProcMgr_AttachParams * params) for (i = 0; (i < procAttachParams.numMemEntries) && (status >= 0); i++) { - index = i; me = &procAttachParams.memEntries [i]; srcAddr = me->addr [ProcMgr_AddrType_SlaveVirt]; dstAddr = me->addr [ProcMgr_AddrType_MasterPhys]; diff --git a/qnx/src/ipc3x_dev/ti/syslink/procMgr/hlos/knl/loaders/Elf/Qnx/DLOAD/TMS470_DLOAD_REL/arm_reloc.c b/qnx/src/ipc3x_dev/ti/syslink/procMgr/hlos/knl/loaders/Elf/Qnx/DLOAD/TMS470_DLOAD_REL/arm_reloc.c index 3123c69..1d0b7b6 100644 --- a/qnx/src/ipc3x_dev/ti/syslink/procMgr/hlos/knl/loaders/Elf/Qnx/DLOAD/TMS470_DLOAD_REL/arm_reloc.c +++ b/qnx/src/ipc3x_dev/ti/syslink/procMgr/hlos/knl/loaders/Elf/Qnx/DLOAD/TMS470_DLOAD_REL/arm_reloc.c @@ -1228,6 +1228,8 @@ static void rel_unpack_addend(ARM_RELOC_TYPE r_type, uint8_t* address, uint32_t* addend) { + uint32_t temp; + switch (r_type) { case R_ARM_ABS32: @@ -1242,14 +1244,16 @@ static void rel_unpack_addend(ARM_RELOC_TYPE r_type, case R_ARM_ABS16: { *addend = *((uint16_t*)address); - *addend = SIGN_EXTEND(*addend, 16); + temp = SIGN_EXTEND(*addend, 16); + *addend = temp; } break; case R_ARM_ABS8: { *addend = *address; - *addend = SIGN_EXTEND(*addend, 8); + temp = SIGN_EXTEND(*addend, 8); + *addend = temp; } break; @@ -1590,8 +1594,6 @@ static BOOL process_rel_table(DLOAD_HANDLE handle, for ( ; rid < relnum; rid++) { - int32_t r_symid = ELF32_R_SYM(rel_table[rid].r_info); - /*---------------------------------------------------------------*/ /* If the relocation offset falls within the segment, process it */ /*---------------------------------------------------------------*/ @@ -2076,4 +2078,4 @@ void unit_arm_rel_mask_for_group(ARM_RELOC_TYPE r_type, int32_t* reloc_val) { rel_mask_for_group(r_type, reloc_val); } -#endif \ No newline at end of file +#endif diff --git a/qnx/src/ipc3x_dev/ti/syslink/procMgr/hlos/knl/loaders/Elf/Qnx/ElfLoader.c b/qnx/src/ipc3x_dev/ti/syslink/procMgr/hlos/knl/loaders/Elf/Qnx/ElfLoader.c index 7a8cd3b..cb4d125 100644 --- a/qnx/src/ipc3x_dev/ti/syslink/procMgr/hlos/knl/loaders/Elf/Qnx/ElfLoader.c +++ b/qnx/src/ipc3x_dev/ti/syslink/procMgr/hlos/knl/loaders/Elf/Qnx/ElfLoader.c @@ -1511,7 +1511,6 @@ ElfLoader_delete (ElfLoader_Handle * handlePtr) { Int status = LOADER_SUCCESS; DLOAD_HANDLE elfObject = NULL; - ElfLoader_Object * object = NULL; _ElfLoader_Object * elfLoaderObject = NULL; Loader_Object * handle; IArg key; @@ -1551,8 +1550,6 @@ ElfLoader_delete (ElfLoader_Handle * handlePtr) /* Reset handle in Loader handle array. */ ElfLoader_state.loaderHandles [handle->procId] = NULL; - object = (ElfLoader_Object *) handle->object; - /* Free memory used for the ElfLoader object. */ if (handle->object != NULL) { elfObject = (DLOAD_HANDLE)((ElfLoader_Object *) @@ -2120,7 +2117,7 @@ ElfLoader_getEntryPt (Loader_Handle handle, elfObj = elfLoaderObj->elfObject; GT_assert (curTrace, (elfObj != NULL)); - if (!DLOAD_get_entry_point(elfObj, fileId, (TARGET_ADDRESS)entryPt)) { + if (!DLOAD_get_entry_point(elfObj, fileId, (TARGET_ADDRESS *)entryPt)) { status = LOADER_E_FAIL; } @@ -2253,7 +2250,6 @@ Int ElfLoader_getSectionData (Loader_Handle handle, _ElfLoader_Object * _elfLoaderObj; Processor_Handle procHandle; UInt32 procAddr_masterPhys; - UInt32 procAddr_masterVirt; ProcMgr_AddrInfo aInfo; UInt32 numBytes; Int status = LOADER_SUCCESS; @@ -2305,8 +2301,6 @@ Int ElfLoader_getSectionData (Loader_Handle handle, ProcMgr_AddrType_MasterPhys); if (status >= 0) { - procAddr_masterVirt = aInfo.addr [ProcMgr_AddrType_MasterKnlVirt]; - /* Suspect this function has not been validated, so do a Memcopy */ status = ProcMgr_read (_elfLoaderObj->pmHandle, sectionInfo->physicalAddress, diff --git a/qnx/src/ipc3x_dev/ti/syslink/utils/hlos/knl/NameServer_daemon.c b/qnx/src/ipc3x_dev/ti/syslink/utils/hlos/knl/NameServer_daemon.c index bd7cc2a..09f2598 100644 --- a/qnx/src/ipc3x_dev/ti/syslink/utils/hlos/knl/NameServer_daemon.c +++ b/qnx/src/ipc3x_dev/ti/syslink/utils/hlos/knl/NameServer_daemon.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014, Texas Instruments Incorporated + * Copyright (c) 2012-2015, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -239,7 +239,6 @@ static void NameServerRemote_processMessage(NameServerMsg * msg, UInt16 procId) NameServer_Handle handle; Int status = NameServer_E_FAIL; char buf = 'n'; - int numBytes; int waitFd = NameServer_module->waitFdW; if (msg->request == NAMESERVER_REQUEST) { @@ -301,7 +300,7 @@ static void NameServerRemote_processMessage(NameServerMsg * msg, UInt16 procId) memcpy(&NameServer_module->nsMsg, msg, sizeof(NameServerMsg)); /* Post the eventfd upon which NameServer_get() is waiting */ - numBytes = write(waitFd, &buf, sizeof(buf)); + write(waitFd, &buf, sizeof(buf)); } } @@ -339,7 +338,6 @@ static Void _listener_cb(MessageQCopy_Handle handle, void * data, int len, Int NameServer_setup(Void) { Int status = NameServer_S_SUCCESS; - UInt16 numProcs; int fd[2]; pthread_mutex_lock(&NameServer_module->modGate); @@ -354,8 +352,6 @@ Int NameServer_setup(Void) goto exit; } - numProcs = MultiProc_getNumProcessors(); - if (pipe(fd) == -1) { status = NameServer_E_FAIL; LOG0("NameServer_setup: failed to create waitFd.\n") @@ -860,6 +856,11 @@ Int NameServer_getRemote(NameServer_Handle handle, if (FD_ISSET(waitFd, &rfds)) { /* Read, just to balance the write: */ numBytes = read(waitFd, &buf, sizeof(buf)); + if (numBytes == -1) { + LOG0("NameServer_getRemote: read failure\n") + status = NameServer_E_FAIL; + goto exit; + } /* Process response: */ replyMsg = &NameServer_module->nsMsg; diff --git a/qnx/src/ipc3x_dev/ti/syslink/utils/hlos/knl/osal/Qnx/OsalThread.c b/qnx/src/ipc3x_dev/ti/syslink/utils/hlos/knl/osal/Qnx/OsalThread.c index 2e81818..e9448ef 100644 --- a/qnx/src/ipc3x_dev/ti/syslink/utils/hlos/knl/osal/Qnx/OsalThread.c +++ b/qnx/src/ipc3x_dev/ti/syslink/utils/hlos/knl/osal/Qnx/OsalThread.c @@ -212,7 +212,7 @@ OsalThread_create (OsalThread_CallbackFxn fxn, GT_setFailureReason(curTrace, GT_4CLASS, "OsalThread_create", - OSALTHREAD_E_MEMORY, + status, "Memory Allocation failure "); } else{