]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/open-amp.git/commitdiff
Introduce RPMSG_ASSERT
authorWendy Liang <jliang@xilinx.com>
Thu, 2 Jun 2016 00:48:32 +0000 (17:48 -0700)
committerWendy Liang <jliang@xilinx.com>
Thu, 13 Oct 2016 05:01:43 +0000 (22:01 -0700)
Remove OpenAMP env assert.

Similar to virtqueue assert, introduce RPMSG_ASSERT

Signed-off-by: Wendy Liang <jliang@xilinx.com>
lib/include/openamp/rpmsg_core.h
lib/rpmsg/rpmsg.c

index 7ee62ba73cdca10c5012134c11069dcd09b1424a..26ff14f03ec5b4debaa0a5f3f643904ce0b65c32 100644 (file)
 #define RPMSG_ERR_DEV_ID                        (RPMSG_ERROR_BASE - 7)
 #define RPMSG_ERR_DEV_ADDR                      (RPMSG_ERROR_BASE - 8)
 
+#if (RPMSG_DEBUG == true)
+#define RPMSG_ASSERT(_exp, _msg) do{ \
+    if (!(_exp)){ printf("%s - "_msg, __func__); while(1);} \
+    } while(0)
+#else
+#define RPMSG_ASSERT(_exp, _msg) if (!(_exp)) while(1)
+#endif
+
 struct rpmsg_channel;
 typedef void (*rpmsg_rx_cb_t) (struct rpmsg_channel *, void *, int, void *,
                               unsigned long);
index 501868f0c5efade5ce358ffc1a0126f2f52c74e7..9a3549643e8026425803ec7687ffe4e749469783 100644 (file)
@@ -206,7 +206,7 @@ int rpmsg_send_offchannel_raw(struct rpmsg_channel *rp_chnl, uint32_t src,
 
        /* Enqueue buffer on virtqueue. */
        ret = rpmsg_enqueue_buffer(rdev, buffer, buff_len, idx);
-       env_assert(ret == VQUEUE_SUCCESS, "FATAL: RPMSG failed to enqueue buffer.\n");
+       RPMSG_ASSERT(ret == VQUEUE_SUCCESS, "FATAL: RPMSG failed to enqueue buffer.\n");
        /* Let the other side know that there is a job to process. */
        virtqueue_kick(rdev->tvq);