trace: Update to remove direct dependence on SysMin 3.50.03.04
authorSam Nelson <sam.nelson@ti.com>
Thu, 29 Nov 2018 19:40:03 +0000 (14:40 -0500)
committerSam Nelson <sam.nelson@ti.com>
Sat, 1 Dec 2018 03:25:20 +0000 (22:25 -0500)
The size of trace buffer here instead obtaining from the Sysmin
parameter from headerfile, is now obtained directly from the resource
table
Also fixes backward compatibility issues with applications using
xdc/runtime/SysMin.

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
packages/ti/ipc/family/tci6638/VirtQueue.c
packages/ti/ipc/remoteproc/Resource.c
packages/ti/ipc/remoteproc/Resource.xdc

index 5026ab1fd4bab447579d03493f5082a465197781..d4c9cdf86581e8d1d8c48d1dc52a739e0367641f 100644 (file)
@@ -55,7 +55,6 @@
 #include <xdc/runtime/Memory.h>
 #include <xdc/runtime/Log.h>
 #include <xdc/runtime/Diags.h>
-#include <ti/trace/SysMin.h>
 #include <ti/sysbios/gates/GateAll.h>
 
 #include <ti/sysbios/knl/Clock.h>
@@ -431,6 +430,6 @@ Void VirtQueue_cacheWb()
 
     /* Flush the cache of the SysMin buffer only: */
     Assert_isTrue((VirtQueue_module->traceBufPtr != NULL), NULL);
-    Cache_wb(VirtQueue_module->traceBufPtr, SysMin_bufSize, Cache_Type_ALL,
+    Cache_wb(VirtQueue_module->traceBufPtr, Resource_getTraceBufSize(), Cache_Type_ALL,
              FALSE);
 }
index 69accb6e1b62d2cbbe344db7e5d2517a9ab068ea..cbf8d49b9505f22f1ff745e3b99617c2ef87a81e 100644 (file)
@@ -67,6 +67,30 @@ Ptr Resource_getTraceBufPtr()
     return (NULL);
 }
 
+/*
+ *  ======== Resource_getTraceBufPtr ========
+ */
+SizeT Resource_getTraceBufSize()
+{
+    UInt32 i;
+    UInt32 offset;
+    UInt32 type;
+    struct fw_rsc_trace *entry = NULL;
+    Resource_RscTable *table = (Resource_RscTable *)
+                                            (Resource_module->pTable);
+
+    for (i = 0; i < module->pTable->num; i++) {
+        offset = (UInt32)((Char *)table + table->offset[i]);
+        type = *(UInt32 *)offset;
+        if (type == TYPE_TRACE) {
+            entry = (struct fw_rsc_trace *)offset;
+            return ((SizeT)entry->len);
+        }
+    }
+
+    return (NULL);
+}
+
 /*
  *  ======== getVdevStatus ========
  */
index 33124aaf6f39cf709da02ace5bee4b7dcb116d72..2905a8c4b40ca60a27bdd69134ddcb68b084895b 100644 (file)
@@ -147,6 +147,14 @@ module Resource {
     @DirectCall
     Ptr getTraceBufPtr();
 
+    /*!
+     *  @brief      Get the Trace Buffer Size from resource table.
+     *
+     *  @return     Size of trace buffer, or NULL if not found.
+     */
+    @DirectCall
+    SizeT getTraceBufSize();
+
     /*!
      *  @brief      Get the status field of the VDEV, given the fw_rsc_vdev id.
      *