]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/blobdiff - qnx/src/ipc3x_dev/ti/syslink/resources/RscTable.c
Fix check of return value from DLOAD_get_section_offset() in QNX
[ipc/ipcdev.git] / qnx / src / ipc3x_dev / ti / syslink / resources / RscTable.c
index f6a6fd471c0468a9f1e22893ef2549b83bc47dfb..875946a6108d7ab5fb1b660ea8e4719a2390326c 100644 (file)
@@ -5,7 +5,7 @@
  *
  *  ============================================================================
  *
- *  Copyright (c) 2012-2014, Texas Instruments Incorporated
+ *  Copyright (c) 2012-2015, Texas Instruments Incorporated
  *
  *  Redistribution and use in source and binary forms, with or without
  *  modification, are permitted provided that the following conditions
@@ -130,7 +130,7 @@ struct RscTable_Object_tag {
     /*!< Resource table length. */
     UInt32                 rscTableDA;
     /*!< Resource table device address. */
-    SysLink_MemEntry       memEntries[SYSLINK_MAX_MEMENTRIES];
+    Ipc_MemEntry           memEntries[IPC_MAX_MEMENTRIES];
     /*!< Memory Entries for the remote processor. */
     UInt32                 numMemEntries;
     /*!< Number of Memory Entries in the memEntries array. */
@@ -160,9 +160,9 @@ typedef struct RscTable_Object_tag RscTable_Object;
  *
  *  @brief  RscTable state object variable
  */
-#if !defined(SYSLINK_BUILD_DEBUG)
+#if !defined(IPC_BUILD_DEBUG)
 static
-#endif /* if !defined(SYSLINK_BUILD_DEBUG) */
+#endif /* if !defined(IPC_BUILD_DEBUG) */
 RscTable_ModuleObject RscTable_state;
 
 
@@ -206,7 +206,7 @@ RscTable_alloc (Char * fileName, UInt16 procId)
     status = DLOAD_get_section_offset((LOADER_FILE_DESC *)fileDesc,
                                       RSC_TABLE_STRING, &res_offs, &res_size,
                                       &res_addr);
-    if (status >= 0) {
+    if (status == TRUE) {
         obj = Memory_calloc(NULL, sizeof (RscTable_Object), 0, NULL);
         if (obj != NULL) {
             // Allocate memory to hold the table
@@ -449,7 +449,7 @@ RscTable_process (UInt16 procId, Bool tryAlloc, UInt32 * numBlocks,
                 }
 
                 if (ret == 0) {
-                    if (obj->numMemEntries == SYSLINK_MAX_MEMENTRIES) {
+                    if (obj->numMemEntries == IPC_MAX_MEMENTRIES) {
                         ret = -1;
                     }
                     else {
@@ -475,7 +475,7 @@ RscTable_process (UInt16 procId, Bool tryAlloc, UInt32 * numBlocks,
             {
                 struct fw_rsc_intmem * cout = (struct fw_rsc_intmem *)entry;
 
-                if (obj->numMemEntries == SYSLINK_MAX_MEMENTRIES) {
+                if (obj->numMemEntries == IPC_MAX_MEMENTRIES) {
                     ret = -1;
                 }
                 else {
@@ -556,7 +556,8 @@ RscTable_process (UInt16 procId, Bool tryAlloc, UInt32 * numBlocks,
                         if (ret == 0) {
 #if !ZEROINIT_CHUNKS
                             /* Map the phys mem to local */
-                            vringVA = (UInt32)mmap_device_io(vringSize, pa);
+                            vringVA = (UInt32)mmap_device_io(vringSize,
+                                obj->vringPa);
                             if (vringVA != MAP_DEVICE_FAILED) {
                                 /* Zero-init the vring */
                                 Memory_set((Ptr)vringVA, 0, vringSize);
@@ -593,7 +594,7 @@ RscTable_process (UInt16 procId, Bool tryAlloc, UInt32 * numBlocks,
                     }
                 }
                 if (!ret) {
-                    if (obj->numMemEntries == SYSLINK_MAX_MEMENTRIES) {
+                    if (obj->numMemEntries == IPC_MAX_MEMENTRIES) {
                         ret = -1;
                     }
                     else {
@@ -706,7 +707,7 @@ RscTable_process (UInt16 procId, Bool tryAlloc, UInt32 * numBlocks,
 }
 
 Int
-RscTable_getMemEntries (UInt16 procId, SysLink_MemEntry *memEntries,
+RscTable_getMemEntries (UInt16 procId, Ipc_MemEntry *memEntries,
                         UInt32 * numMemEntries)
 {
     Int status = 0;