Supports inter-nuclear communication
This commit is contained in:
@@ -297,7 +297,7 @@ void platform_release_rpmsg_vdev (void * platform, struct rpmsg_device * rpdev)
|
||||
struct rpmsg_virtio_device * rpmsg_vdev;
|
||||
struct remoteproc_priv * prproc = rproc->priv;
|
||||
|
||||
KMutexDelete(ipi.ipi_mutx_id[prproc->notify_id]);
|
||||
// KMutexDelete(ipi.ipi_mutx_id[prproc->notify_id]);
|
||||
ipi.ipi_mutx_id[prproc->notify_id] = -1;
|
||||
|
||||
KTaskDelete(ipi_tsk_id[prproc->notify_id]);
|
||||
@@ -363,11 +363,12 @@ static void* IpiTask (void * exinf)
|
||||
|
||||
while (1)
|
||||
{
|
||||
// extern long ShowTask(void);
|
||||
// ShowTask();
|
||||
|
||||
KMutexObtain(ipi.ipi_mutx_id[prproc->notify_id], WAITING_FOREVER);
|
||||
// KPrintf("IpiTask: after KSemaphoreObtain\n");
|
||||
if (ipi.ipi_mutx_id[prproc->notify_id] != 1)
|
||||
{
|
||||
__WFI();
|
||||
continue;
|
||||
}
|
||||
// KMutexObtain(ipi.ipi_mutx_id[prproc->notify_id], WAITING_FOREVER);
|
||||
|
||||
/* Ignore a incoming interrupt if the virtio layer of a target remoteproc is not yet initialized */
|
||||
if (metal_list_is_empty(&rproc->vdevs))
|
||||
@@ -381,8 +382,8 @@ static void* IpiTask (void * exinf)
|
||||
KPrintf("remoteproc_get_notification() failed with %d", ret);
|
||||
break;
|
||||
}
|
||||
|
||||
DelayKTask(10);
|
||||
ipi.ipi_mutx_id[prproc->notify_id] = 0;
|
||||
// DelayKTask(10);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -391,14 +392,14 @@ static void start_ipi_task (void * platform)
|
||||
struct remoteproc * rproc = platform;
|
||||
struct remoteproc_priv * prproc = rproc->priv;
|
||||
|
||||
int32 mutx_id = KMutexCreate();
|
||||
|
||||
if (mutx_id < 0)
|
||||
{
|
||||
KPrintf("start_ipi_task: create sem fail!\n");
|
||||
return ;
|
||||
}
|
||||
ipi.ipi_mutx_id[prproc->notify_id] = mutx_id;
|
||||
// int32 mutx_id = KMutexCreate();
|
||||
// if (mutx_id < 0)
|
||||
// {
|
||||
// KPrintf("start_ipi_task: create sem fail!\n");
|
||||
// return ;
|
||||
// }
|
||||
// ipi.ipi_mutx_id[prproc->notify_id] = mutx_id;
|
||||
ipi.ipi_mutx_id[prproc->notify_id] = 0;
|
||||
|
||||
// KPrintf("start_ipi_task: prproc->notify_id = %d, ipi.ipi_mutx_id[prproc->notify_id] = %d \n",prproc->notify_id,ipi.ipi_mutx_id[prproc->notify_id]);
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ struct ipi_info
|
||||
int registered;
|
||||
unsigned int mbx_chn[CFG_RPMSG_SVCNO];
|
||||
unsigned int chn_mask; /**< IPI channel mask */
|
||||
int32 ipi_mutx_id[CFG_RPMSG_SVCNO];
|
||||
volatile int32 ipi_mutx_id[CFG_RPMSG_SVCNO];
|
||||
};
|
||||
|
||||
struct shm_info
|
||||
|
||||
@@ -109,9 +109,13 @@ static int rzv2_mhu_callback (mhu_callback_args_t * p_args)
|
||||
return METAL_IRQ_NOT_HANDLED; /* Invalid message arrived */
|
||||
}
|
||||
|
||||
if (ipi.ipi_mutx_id[val] >= 0)
|
||||
// if (ipi.ipi_mutx_id[val] >= 0)
|
||||
// {
|
||||
// KMutexAbandon(ipi.ipi_mutx_id[val]);
|
||||
// }
|
||||
if (ipi.ipi_mutx_id[val] != -1)
|
||||
{
|
||||
KMutexAbandon(ipi.ipi_mutx_id[val]);
|
||||
ipi.ipi_mutx_id[val] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user