]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/blobdiff - qnx/src/ipc3x_dev/ti/syslink/resources/RscTable.c
Set status field in fw_rsc_vdev after MessageQCopy_attach and before RscTable_update...
[ipc/ipcdev.git] / qnx / src / ipc3x_dev / ti / syslink / resources / RscTable.c
index 93edfa62101b11ecfccea7f3c50c6caf3d189c2f..af4255c322617b240a33419b66f41037b301a823 100644 (file)
@@ -410,6 +410,7 @@ Int Chunk_allocate (RscTable_Object *obj, UInt32 size, UInt32 * pa)
                              "Chunk_allocate",
                              status,
                              "Invalid arg passed");
+        GT_3trace(curTrace, GT_4CLASS, "obj [0x%x] obj->chunks [0x%x] pa [0x%x]", obj, obj ? obj->chunks : NULL, pa);
     }
     else {
         // first try to allocate contiguous mem
@@ -1089,6 +1090,32 @@ RscTable_free (RscTable_Handle * handle)
     return status;
 }
 
+Int RscTable_setStatus(UInt16 procId, UInt32 value)
+{
+    Int i;
+    Int status = 0;
+
+    RscTable_Object * obj = (RscTable_Object *)RscTable_state.handles[procId];
+    RscTable_Header * table = (RscTable_Header *)obj->rscTable;
+
+    /* Look for the vdev entry and update the status */
+    for (i = 0; i < table->num; i++) {
+        RscTable_MemEntry * entry =
+                (RscTable_MemEntry *)((UInt32)table + table->offset[i]);
+        if (entry->type == TYPE_VDEV) {
+            struct fw_rsc_vdev *vdev = (struct fw_rsc_vdev *)entry;
+            vdev->status = value;
+            break;
+        }
+    }
+
+    if (i == table->num) {
+        status = RSCTABLE_E_FAIL;
+    }
+
+    return status;
+}
+
 #if defined (__cplusplus)
 }
 #endif /* defined (__cplusplus) */