Eliminate build warnings in QNX build
authorvwan@ti.com <vwan@ti.com>
Thu, 5 Feb 2015 19:32:48 +0000 (11:32 -0800)
committerRobert Tivy <rtivy@ti.com>
Tue, 10 Feb 2015 19:04:06 +0000 (11:04 -0800)
This commit eliminates all build warnings in the QNX IPC build process.
It addresses SDOCM00113501.

Signed-off-by: VW <vwan@ti.com>
18 files changed:
qnx/src/api/MessageQ.c
qnx/src/api/gates/GateMutex.c
qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/syslink_main.c
qnx/src/ipc3x_dev/ti/syslink/family/common/vayu/vayuipu/VAYUIpuHalBoot.c
qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayudsp/VAYUDspEnabler.c
qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayudsp/VAYUDspHalMmu.c
qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayuipu/VAYUIpuEnabler.c
qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayuipu/VAYUIpuHalMmu.c
qnx/src/ipc3x_dev/ti/syslink/inc/_GateMP_daemon.h
qnx/src/ipc3x_dev/ti/syslink/inc/knl/ProcDefs.h
qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/knl/Qnx/MessageQCopyDrv.c
qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/knl/Qnx/gatemp_devctl.c
qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/usr/Qnx/MessageQCopyDrv.c
qnx/src/ipc3x_dev/ti/syslink/procMgr/hlos/knl/ProcMgr.c
qnx/src/ipc3x_dev/ti/syslink/procMgr/hlos/knl/loaders/Elf/Qnx/DLOAD/TMS470_DLOAD_REL/arm_reloc.c
qnx/src/ipc3x_dev/ti/syslink/procMgr/hlos/knl/loaders/Elf/Qnx/ElfLoader.c
qnx/src/ipc3x_dev/ti/syslink/utils/hlos/knl/NameServer_daemon.c
qnx/src/ipc3x_dev/ti/syslink/utils/hlos/knl/osal/Qnx/OsalThread.c

index 66a9219995041afcd99e630fcbc40381a6686e44..bea345111e264ba1cd629759d09da150e8612b07 100644 (file)
@@ -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;
 
index 514afbcf922986e0ecf58c07056e8b6225a05fd5..32608ab367e33f84a50e55f78c1d2544f62c358b 100644 (file)
@@ -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
 }
 
 
index 8025b935448a13fbf12f0b1a0ef8f92d037e63c7..5979e6fc76e6a88ca06572f5acd4185bedddcc19 100644 (file)
@@ -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)) {
index 66fd2a292bdb66734b6468f2c575ec31bfaa93b8..3a4538c2a9678865f6ffc7876b1f050550ccfe15 100644 (file)
@@ -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:
         {
index aab0af5981db734706187455927fe652ec7d687b..d2283618e1c3e9d74e6392fe0a5cb27962d2e0ff 100644 (file)
@@ -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;
index de4ea27650fb65729a795d923175581c07e3f802..560e4886acbc28d18a1f1ab15ddcce80e71b4ae6 100644 (file)
@@ -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(&currentEntry,
                 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;
 }
index bcadd3236fdec3a70f71d934f3b4da61ed56e609..d92c2bcf2f7a46e112cbdde06837ac4f7ad562cb 100644 (file)
@@ -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;
index 5d486ae4ea8c97882dbfe5e40c3b31db4061f985..2ad5fb8a1d2f6eeeb85e49ac4ec1a7dd8a452bcd 100644 (file)
@@ -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(&currentEntry,
@@ -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;
 }
 
index 87c4f11a679c3a9c07077dbfa8dceeff0261bf85..6fe681a0d7d45a2f30425b1db4ee0f6332bf0e29 100644 (file)
@@ -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.
  */
index 3d6b15ccfefddbc143e913965273c44393c0e1c7..3076ee92d5ea2130e9ef45146de671b5f995b331 100644 (file)
@@ -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;
 
index f4a86bf6924ddb62f5bd4c1301d47231ffacd27c..2a8dde3f3c54edacebf6c3efd58f365eb7c6c676 100644 (file)
@@ -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);
index 3bd559fc9dfb6497c890dd1226acadb78f552ecc..f8d4f7c01a150211a521020da26f6348642e51fb 100644 (file)
@@ -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));
 
index 870e729cdda6b9169fa3bcccb1a463f070853038..8c7e2b111418503eabb0b0086958dd3367f5710e 100644 (file)
@@ -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. */
index d15b7a16aeda5cbd636c96133a3d1f9b3c3dc26a..7dc2fef966f8460307bc92a408431dcbba030cf9 100644 (file)
@@ -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];
index 3123c6910745dbb876517decf30d8e739e46c8e5..1d0b7b6b6bd099e4bad095ec7ada4e7a5605a971 100644 (file)
@@ -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
index 7a8cd3bce7420b331473b12d5cd6b9a43108400b..cb4d12596d225725e392dcf4bc001c06d9172050 100644 (file)
@@ -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,
index bd7cc2a0fb3c618a05eaa64bd2529646984b03ba..09f259800f3fc0d91e08d3aa3b9e71c88e748625 100644 (file)
@@ -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;
index 2e818180c1200717c52fd7cbbd80348c0efc9859..e9448efdf27ed22227c519249481228217260e90 100644 (file)
@@ -212,7 +212,7 @@ OsalThread_create (OsalThread_CallbackFxn fxn,
         GT_setFailureReason(curTrace,
                             GT_4CLASS,
                             "OsalThread_create",
-                            OSALTHREAD_E_MEMORY,
+                            status,
                             "Memory Allocation failure ");
     }
     else{