Introduce openamp_print
authorWendy Liang <jliang@xilinx.com>
Thu, 1 Sep 2016 18:28:36 +0000 (11:28 -0700)
committerWendy Liang <jliang@xilinx.com>
Thu, 13 Oct 2016 05:01:50 +0000 (22:01 -0700)
Add openamp_print() instead of directly using printf for
printing in OpenAMP repo.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
lib/include/openamp/env.h
lib/include/openamp/open_amp.h
lib/include/openamp/rpmsg_core.h
lib/include/openamp/rpmsg_retarget.h
lib/include/openamp/virtqueue.h
lib/virtio/virtqueue.c

index 56e8f56d4821b196a8675b871d48a245e272647c..4fbdaa9a61856b70f6a535984bf20bd7f67f1156 100644 (file)
 
 #include <stdio.h>
 
+#define openamp_print(format, ...) printf(format, ##__VA_ARGS__)
+
 #ifdef OPENAMP_DEBUG
-#define openamp_dbg(format, ...) printf(format, ##__VA_ARGS__)
+#define openamp_dbg(format, ...) openamp_print(i"DEBUG: " format, ##__VA_ARGS__)
 #else
 #define openamp_dbg(...)
 #endif
index 1ded4fe1ea60f9671f81c9ccfe003f8a0ffeacef..caf078b82d57aca54d2f5313a3de8c81b80a23ef 100644 (file)
@@ -33,4 +33,5 @@
 #include "openamp/rpmsg.h"
 #include "openamp/remoteproc.h"
 
+
 #endif                         /* OPEN_AMP_H_ */
index 0962a9f37ec58a7f2ff4f4f77ac1c866113deef0..3cc68ec562c1fa3299357f593250e861491b72cb 100644 (file)
@@ -81,7 +81,7 @@
 
 #if (RPMSG_DEBUG == true)
 #define RPMSG_ASSERT(_exp, _msg) do{ \
-    if (!(_exp)){ printf("%s - "_msg, __func__); while(1);} \
+    if (!(_exp)){ openamp_print("%s - "_msg, __func__); while(1);} \
     } while(0)
 #else
 #define RPMSG_ASSERT(_exp, _msg) if (!(_exp)) while(1)
index 85839ecab7c169d4fd7de8a02e4cc964d70c2d8b..4e023927458b3070f0bddaf291c160108fd398d9 100644 (file)
@@ -43,8 +43,6 @@ struct _sys_rpc {
        struct _sys_call_args sys_call_args;
 };
 
-void debug_print(char *str, int len);
-
 /* API prototypes */
 int rpmsg_retarget_init(struct rpmsg_channel *rp_chnl, rpc_shutdown_cb cb);
 int rpmsg_retarget_deinit(struct rpmsg_channel *rp_chnl);
index 48b52f3e14c9c0ef517486a80b80e841c09ae19f..1ad4cb34e74dc9b299c5934bbda414b093e3ea55 100644 (file)
@@ -157,7 +157,7 @@ typedef void vq_notify(struct virtqueue *);
 #if (VQUEUE_DEBUG == true)
 
 #define VQASSERT(_vq, _exp, _msg) do{ \
-    if (!(_exp)){ printf("%s: %s - "_msg, __func__, (_vq)->vq_name); while(1);} \
+    if (!(_exp)){ openamp_print("%s: %s - "_msg, __func__, (_vq)->vq_name); while(1);} \
     } while(0)
 
 #define VQ_RING_ASSERT_VALID_IDX(_vq, _idx)            \
index d9f4fa8f0f964468e82f7fda7fab7c46a77dd1e1..ca67a7b977363a33fc6ab5038c97ad3e9004b2c0 100644 (file)
@@ -311,7 +311,7 @@ void virtqueue_free(struct virtqueue *vq)
        if (vq != VQ_NULL) {
 
                if (vq->vq_free_cnt != vq->vq_nentries) {
-                       printf
+                       openamp_print
                            ("\r\nWARNING %s: freeing non-empty virtqueue\r\n",
                             vq->vq_name);
                }
@@ -464,7 +464,7 @@ void virtqueue_dump(struct virtqueue *vq)
        if (vq == VQ_NULL)
                return;
 
-       printf("VQ: %s - size=%d; free=%d; used=%d; queued=%d; "
+       openamp_print("VQ: %s - size=%d; free=%d; used=%d; queued=%d; "
                  "desc_head_idx=%d; avail.idx=%d; used_cons_idx=%d; "
                  "used.idx=%d; avail.flags=0x%x; used.flags=0x%x\r\n",
                  vq->vq_name, vq->vq_nentries, vq->vq_free_cnt,