summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e7a146b)
raw | patch | inline | side by side (parent: e7a146b)
author | G Anthony <a0783926@ti.com> | |
Wed, 24 Jul 2013 23:08:01 +0000 (16:08 -0700) | ||
committer | Ramsey Harris <ramsey@ti.com> | |
Mon, 29 Jul 2013 17:09:56 +0000 (10:09 -0700) |
The VirtQueue modules for Vayu and OMAP5 are not XDC modules.
For non-XDC files, a module name needs to be registered so that Log_print
and Diags will work.
This introduces a private _VirtQueue_init() function, called in
VirtQueue_create(), to register VirtQueue with the Diags/Log system.
Signed-off-by: G Anthony <a0783926@ti.com>
For non-XDC files, a module name needs to be registered so that Log_print
and Diags will work.
This introduces a private _VirtQueue_init() function, called in
VirtQueue_create(), to register VirtQueue with the Diags/Log system.
Signed-off-by: G Anthony <a0783926@ti.com>
packages/ti/ipc/family/omap54xx/VirtQueue.c | patch | blob | history | |
packages/ti/ipc/family/vayu/VirtQueue.c | patch | blob | history |
diff --git a/packages/ti/ipc/family/omap54xx/VirtQueue.c b/packages/ti/ipc/family/omap54xx/VirtQueue.c
index 6c2220427e66e40e3071d8ec476f7218bda28688..7e722d0d44086c464718296fa1bfa6b65488a5e4 100644 (file)
*
*/
+/* this define must precede inclusion of any xdc header file */
+#define Registry_CURDESC ti_ipc_family_vayu__Desc
+#define MODULE_NAME "ti.ipc.family.omap54xx.VirtQueue"
+
#include <xdc/std.h>
#include <xdc/runtime/System.h>
+#include <xdc/runtime/Assert.h>
#include <xdc/runtime/Error.h>
#include <xdc/runtime/Memory.h>
+#include <xdc/runtime/Registry.h>
#include <xdc/runtime/Log.h>
#include <xdc/runtime/Diags.h>
GateHwi_Handle gateH;
} VirtQueue_Object;
+/* module diags mask */
+Registry_Desc Registry_CURDESC;
+
static struct VirtQueue_Object *queueRegistry[NUM_QUEUES] = {NULL};
static UInt16 hostProcId;
extern Int OffloadM3_processSysM3Tasks(UArg msg);
#endif
+/*!
+ * ======== _VirtQueue_init ========
+ *
+ * This function adds the VirtQueue "module" to the Registry so that
+ * DIAGS will work with this non-XDC module.
+ * Since VirtQueue_init is not called by XDC-VirtQueue module clients, this
+ * function is called in the first VirtQueue fxn called: VirtQueue_create.
+ */
+static Void _VirtQueue_init()
+{
+ static int initialized = 0;
+
+ if (!initialized) {
+ Registry_Result result;
+
+ /* register with xdc.runtime to get a diags mask */
+ result = Registry_addModule(&Registry_CURDESC, MODULE_NAME);
+ Assert_isTrue(result == Registry_SUCCESS, (Assert_Id)NULL);
+
+ initialized = 1;
+ }
+}
+
static inline Void * mapPAtoVA(UInt pa)
{
return (Void *)((pa & 0x000fffffU) | IPC_MEM_VRING0);
@@ -489,6 +521,9 @@ VirtQueue_Handle VirtQueue_create(UInt16 remoteProcId, VirtQueue_Params *params,
VirtQueue_Object *vq;
Void *vringAddr;
+ /* Perform initialization we can't do in Instance_init (being non-XDC): */
+ _VirtQueue_init();
+
vq = Memory_alloc(NULL, sizeof(VirtQueue_Object), 0, eb);
if (NULL == vq) {
return (NULL);
index 781179773b06fa92ed94ae37848e34c1f17e527d..80310820508d6b8ba5a0425b6f17a22782686f74 100644 (file)
*
*/
+/* this define must precede inclusion of any xdc header file */
+#define Registry_CURDESC ti_ipc_family_vayu__Desc
+#define MODULE_NAME "ti.ipc.family.vayu.VirtQueue"
+
#include <xdc/std.h>
#include <xdc/runtime/System.h>
+#include <xdc/runtime/Assert.h>
#include <xdc/runtime/Error.h>
#include <xdc/runtime/Memory.h>
+#include <xdc/runtime/Registry.h>
#include <xdc/runtime/Log.h>
#include <xdc/runtime/Diags.h>
GateHwi_Handle gateH;
} VirtQueue_Object;
+/* module diags mask */
+Registry_Desc Registry_CURDESC;
+
static struct VirtQueue_Object *queueRegistry[NUM_QUEUES] = {NULL};
static UInt16 hostProcId;
extern Int OffloadM3_processSysM3Tasks(UArg msg);
#endif
+/*!
+ * ======== _VirtQueue_init ========
+ *
+ * This function adds the VirtQueue "module" to the Registry so that
+ * DIAGS will work with this non-XDC module.
+ * Since VirtQueue_init is not called by XDC-VirtQueue module clients, this
+ * function is called in the first VirtQueue fxn called: VirtQueue_create.
+ */
+static Void _VirtQueue_init()
+{
+ static int initialized = 0;
+
+ if (!initialized) {
+ Registry_Result result;
+
+ /* register with xdc.runtime to get a diags mask */
+ result = Registry_addModule(&Registry_CURDESC, MODULE_NAME);
+ Assert_isTrue(result == Registry_SUCCESS, (Assert_Id)NULL);
+
+ initialized = 1;
+ }
+}
static inline Void * mapPAtoVA(UInt pa)
{
return (Void *)((pa & 0x000fffffU) | IPC_MEM_VRING0);
@@ -498,6 +529,9 @@ VirtQueue_Handle VirtQueue_create(UInt16 remoteProcId, VirtQueue_Params *params,
VirtQueue_Object *vq;
Void *vringAddr;
+ /* Perform initialization we can't do in Instance_init (being non-XDC): */
+ _VirtQueue_init();
+
vq = Memory_alloc(NULL, sizeof(VirtQueue_Object), 0, eb);
if (NULL == vq) {
return (NULL);