summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSuman Anna <s-anna@ti.com>2010-05-24 20:24:57 -0500
committerHari Kanigeri <h-kanigeri2@ti.com>2010-07-09 17:57:50 -0500
commit87ef5fa1e5d626376a8d0515c9cf9783fd9ea2f4 (patch)
tree4eb31dc595d9527a8075367a581d58e41b3a38c8 /drivers
parent371bac7c849614094ca5f40e18b3d76194740e90 (diff)
SYSLINK: ipc - add ipc_proc_sync_finish synchronization
Added the reverse synchronization so that the slave core waits until the master has completed synchronization. Signed-off-by: Suman Anna <s-anna@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/dsp/syslink/multicore_ipc/ipc.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/drivers/dsp/syslink/multicore_ipc/ipc.c b/drivers/dsp/syslink/multicore_ipc/ipc.c
index 9b021afae54d..80db3e9b7b14 100644
--- a/drivers/dsp/syslink/multicore_ipc/ipc.c
+++ b/drivers/dsp/syslink/multicore_ipc/ipc.c
@@ -281,7 +281,7 @@ int ipc_attach(u16 remote_proc_id)
sharedregion_get_heap(0),
notify_mem_req,
sharedregion_get_cache_line_size(0));
-
+ memset(notify_shared_addr, 0, notify_mem_req);
slave->notify_sr_ptr = sharedregion_get_srptr(
notify_shared_addr, 0);
if (slave->notify_sr_ptr ==
@@ -892,16 +892,21 @@ int ipc_proc_sync_finish(u16 remote_proc_id, void *shared_addr)
bool cache_enabled = sharedregion_is_cache_enabled(0);
#endif
VOLATILE struct ipc_reserved *self;
+ VOLATILE struct ipc_reserved *remote;
/* don't do any synchronization if proc_sync is NONE */
if (ipc_module->proc_sync != IPC_PROCSYNC_NONE) {
/* determine self pointer */
- if (ipc_module->proc_entry[remote_proc_id].slave)
+ if (ipc_module->proc_entry[remote_proc_id].slave) {
self = ipc_get_slave_addr(remote_proc_id, shared_addr);
- else
+ remote = ipc_get_master_addr(remote_proc_id,
+ shared_addr);
+ } else {
self = ipc_get_master_addr(remote_proc_id,
shared_addr);
-
+ remote = ipc_get_slave_addr(remote_proc_id,
+ shared_addr);
+ }
/* set my processor's reserved key to finish */
self->started_key = IPC_PROCSYNCFINISH;
#if 0
@@ -910,6 +915,18 @@ int ipc_proc_sync_finish(u16 remote_proc_id, void *shared_addr)
Cache_wbInv((void *)self, reserved_size,
Cache_Type_ALL, true);
#endif
+ /* if slave processor, wait for remote to finish sync */
+ if (ipc_module->proc_entry[remote_proc_id].slave) {
+ /* wait for remote processor to finish */
+ do {
+#if 0
+ if (cacheEnabled) {
+ Cache_inv((Ptr)remote, reservedSize,
+ Cache_Type_ALL, TRUE);
+ }
+#endif
+ } while (remote->started_key != IPC_PROCSYNCFINISH);
+ }
}
return IPC_S_SUCCESS;