Hi,
I am puzzled with an Ipc example notify_multicore.c (I remember there are similar things in other examples). The semphore created in .cfg is like this:
It seems to me semHandle is the name of the object. While in the .c code, see below, semHandle is still used as a handle from the function definiton of:
Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);
Could you explain it to me?
Thanks.
...............................
* ======== tsk0_func ========
* Sends an event to the next processor then pends on a semaphore.
* The semaphore is posted by the callback function.
*/
Void tsk0_func(
UArg arg0, UArg arg1)
{
Int i = 1;
Int status;
if (MultiProc_self() == 0) {
while (i <= NUMLOOPS) {
/* Send an event to the next processor */
status =Notify_sendEvent(dstProc, INTERRUPT_LINE, EVENTID, i,
TRUE);
/* Continue until remote side is up */
if (status < 0) {continue;
}
System_printf("tsk1_func: Sent request #%d to %s\n", seq,
MultiProc_getName(dstProc));
/* Wait to be released by the cbFxn posting the semaphore */
Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);
System_printf("tsk1_func: Received request #%d from %s\n", seq,
MultiProc_getName(recvProcId));
/* increment for next iteration */
i++;
}
}
else {.................
.....................