diff --git a/apps/matrix_multiply/matrix_multiplyd_remoteproc_master.c b/apps/matrix_multiply/matrix_multiplyd_remoteproc_master.c
index b94848a8b7364a24d7decedbd77a91efaf0e65c7..8f5ce65c15605ed24966f33fb75e0a7c844550e3 100644 (file)
#include <string.h>
#include "openamp/open_amp.h"
-#define BAREMETAL_MASTER 1
-
-#ifdef ZYNQ7_BAREMETAL
-#include "baremetal.h"
-#endif
-
-
#define MAX_SIZE 6
#define NUM_MATRIX 2
/* External functions */
extern void init_system();
+extern void cleanup_system();
+
+/* External variables */
+extern struct hil_proc proc_table[];
static void Matrix_Multiply(const matrix * m, const matrix * n, matrix * r)
{
int i;
int shutdown_msg = SHUTDOWN_MSG;
-#ifdef ZYNQ7_BAREMETAL
- /* Switch to System Mode */
- SWITCH_TO_SYS_MODE();
-#endif
-
/* Initialize HW system components */
init_system();
status =
- remoteproc_init((void *)fw_name, rpmsg_channel_created,
+ remoteproc_init((void *)fw_name, &proc_table[0], rpmsg_channel_created,
rpmsg_channel_deleted, rpmsg_read_cb, &proc);
if (!status) {
/* Send the result of matrix multiplication back to master. */
rpmsg_send(app_rp_chnl, &matrix_result, sizeof(matrix));
-
int_flag = 0;
-
- sleep();
}
- sleep();
+ hil_poll(proc->proc, 0);
}
/* Send shutdown message to remote */
remoteproc_deinit(proc);
+ cleanup_system();
return 0;
}