Apps: remoteproc slave: use hil_poll()
authorWendy Liang <jliang@xilinx.com>
Thu, 4 Aug 2016 18:51:28 +0000 (11:51 -0700)
committerWendy Liang <jliang@xilinx.com>
Thu, 13 Oct 2016 05:01:47 +0000 (22:01 -0700)
Use hil_poll() to wait for remoteproc to be signaled.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
apps/echo_test/echo_testd.c
apps/func_test_suite/func_test_suite.c
apps/matrix_multiply/matrix_multiplyd.c
apps/rpc_demo/rpc_demo.c

index 29371a3152b40fa9d6e3e670bdef8610e01ca2f3..53dd802ce7c6cd3b7525428ba853a718542fa9e9 100644 (file)
@@ -58,10 +58,13 @@ int main()
                return -1;
        }
 
-       while (1) {
-               __asm__("\
-                       wfi\n\t");
-       };
+       do {
+               hil_poll(proc->proc, 0);
+       } while (!app_rp_chnl);
+
+       while(app_rp_chnl) {
+               hil_poll(proc->proc, 0);
+       }
 
        return 0;
 }
@@ -75,6 +78,8 @@ static void rpmsg_channel_created(struct rpmsg_channel *rp_chnl)
 
 static void rpmsg_channel_deleted(struct rpmsg_channel *rp_chnl)
 {
+       app_rp_chnl = NULL;
+       rp_ept = NULL;
 }
 
 static void rpmsg_read_cb(struct rpmsg_channel *rp_chnl, void *data, int len,
index 73f22ba947c9baf017ca1a347c53649c38866513..f30af91c9910d339c6ac9d9ca78333e57eda3b9e 100644 (file)
@@ -121,7 +121,7 @@ int main()
                                break;
                }
 
-               sleep();
+               hil_poll(proc, 0);
        }
 
        cleanup_system();
index e253d66d283ba45162c6a690886dfc3cf41339fd..2d94b2a22635585dbda18e2845ae9335ccb2fd99 100644 (file)
@@ -72,8 +72,12 @@ int main()
                return -1;
        }
 
-       while (1) {
-               __asm__("wfi\n\t");
+       do {
+               hil_poll(proc->proc, 0);
+       } while (!app_rp_chnl);
+
+       while(app_rp_chnl) {
+               hil_poll(proc->proc, 0);
        }
 
        return 0;
@@ -89,6 +93,8 @@ static void rpmsg_channel_created(struct rpmsg_channel *rp_chnl)
 static void rpmsg_channel_deleted(struct rpmsg_channel *rp_chnl)
 {
        rpmsg_destroy_ept(rp_ept);
+       rp_ept = NULL;
+       app_rp_chnl = NULL;
 }
 
 static void rpmsg_read_cb(struct rpmsg_channel *rp_chnl, void *data, int len,
index 611067d2fc1d809a4d026a49fca38c795202fc0a..289982e173e0e54f1c12aea48dd84fae7ecc11b8 100755 (executable)
@@ -78,8 +78,7 @@ int main()
        }
 
        while (!chnl_cb_flag) {
-               __asm__("\
-                       wfi\n\t");
+               hil_poll(proc->proc, 0);
        }
 
        chnl_cb_flag = 0;
@@ -171,9 +170,8 @@ int main()
        printf
            ("\r\nRemote> Firmware's rpmsg-openamp-demo-channel going down! \r\n");
 
-       while (1) {
-               __asm__("\
-                       wfi\n\t");
+       while (app_rp_chnl) {
+               hil_poll(proc->proc, 0);
        }
 
        return 0;
@@ -187,6 +185,7 @@ static void rpmsg_channel_created(struct rpmsg_channel *rp_chnl)
 
 static void rpmsg_channel_deleted(struct rpmsg_channel *rp_chnl)
 {
+       app_rp_chnl = NULL;
 }
 
 static void rpmsg_read_cb(struct rpmsg_channel *rp_chnl, void *data, int len,