/*! * ======== NotifySetup_attach ======== */ Int NotifySetup_attach(UInt16 remoteProcId, Ptr sharedAddr) { NotifyDriverShm_Params notifyShmParams; NotifyDriverShm_Handle shmDrvHandle; ti_sdo_ipc_Notify_Handle notifyHandle; Error_Block eb; /* Initialize the error block */ Error_init(&eb); /* init params and set default values */ NotifyDriverShm_Params_init(¬ifyShmParams); notifyShmParams.intVectorId = NotifySetup_dspIntVectId; notifyShmParams.sharedAddr = sharedAddr; notifyShmParams.remoteProcId = remoteProcId; shmDrvHandle = NotifyDriverShm_create(¬ifyShmParams, &eb); if (shmDrvHandle == NULL) { return (Notify_E_FAIL); } notifyHandle = ti_sdo_ipc_Notify_create( NotifyDriverShm_Handle_upCast(shmDrvHandle), remoteProcId, 0, NULL, &eb); if (notifyHandle == NULL) { NotifyDriverShm_delete(&shmDrvHandle); return (Notify_E_FAIL); } return (Notify_S_SUCCESS); }
/*! * ======== NotifySetup_attach ======== * Initialize interrupt */ Int NotifySetup_attach(UInt16 remoteProcId, Ptr sharedAddr) { NotifyDriverShm_Params notifyShmParams; NotifyDriverShm_Handle shmDrvHandle; ti_sdo_ipc_Notify_Handle notifyHandle; UInt16 myId = MultiProc_self(); Int status = Notify_S_SUCCESS; Error_Block eb; /* Initialize the error block */ Error_init(&eb); NotifyDriverShm_Params_init(¬ifyShmParams); notifyShmParams.sharedAddr = sharedAddr; notifyShmParams.remoteProcId = remoteProcId; if (myId == NotifySetup_core1ProcId && remoteProcId != NotifySetup_core0ProcId || myId != NotifySetup_core0ProcId && remoteProcId == NotifySetup_core1ProcId) { Error_raise(&eb, NotifySetup_E_noInterruptLine, MultiProc_getName(remoteProcId), NULL); System_exit(1); } /* Disable cache for inter-ducati NotifyDriverShm instances */ if ((myId == NotifySetup_core1ProcId && remoteProcId == NotifySetup_core0ProcId) || (myId == NotifySetup_core0ProcId && remoteProcId == NotifySetup_core1ProcId)) { notifyShmParams.cacheLineSize = 0; notifyShmParams.cacheEnabled = FALSE; } /* Only used by the DSP */ notifyShmParams.intVectorId = NotifySetup_dspIntVectId; shmDrvHandle = NotifyDriverShm_create(¬ifyShmParams, &eb); if (shmDrvHandle == NULL) { return (Notify_E_FAIL); } notifyHandle = ti_sdo_ipc_Notify_create(NotifyDriverShm_Handle_upCast(shmDrvHandle), remoteProcId, 0, NULL, &eb); if (notifyHandle == NULL) { NotifyDriverShm_delete(&shmDrvHandle); status = Notify_E_FAIL; } return (status); }
/*! * ======== NotifySetup_attach ======== * Initialize interrupt */ Int NotifySetup_attach(UInt16 remoteProcId, Ptr sharedAddr) { NotifyDriverShm_Params notifyShmParams; NotifyDriverShm_Handle shmDrvHandle; ti_sdo_ipc_Notify_Handle notifyHandle; Int status = Notify_S_SUCCESS; Error_Block eb; Error_init(&eb); NotifyDriverShm_Params_init(¬ifyShmParams); notifyShmParams.sharedAddr = sharedAddr; notifyShmParams.remoteProcId = remoteProcId; /* Set the intVectorId if on the DSP */ if ((MultiProc_self() == NotifySetup_dsp0ProcId) || (MultiProc_self() == NotifySetup_dsp1ProcId)) { notifyShmParams.intVectorId = NotifySetup_dspIntVectId; } /* Set the intVectorId if on the EVE */ if ((MultiProc_self() == NotifySetup_eve0ProcId) || (MultiProc_self() == NotifySetup_eve1ProcId) || (MultiProc_self() == NotifySetup_eve2ProcId) || (MultiProc_self() == NotifySetup_eve3ProcId)) { if (PROCID(remoteProcId) < 4) { notifyShmParams.intVectorId = NotifySetup_eveIntVectId_INTC1; } else { notifyShmParams.intVectorId = NotifySetup_eveIntVectId_INTC0; } } shmDrvHandle = NotifyDriverShm_create(¬ifyShmParams, &eb); if (shmDrvHandle == NULL) { return (Notify_E_FAIL); } notifyHandle = ti_sdo_ipc_Notify_create( NotifyDriverShm_Handle_upCast(shmDrvHandle), remoteProcId, 0, NULL, &eb); if (notifyHandle == NULL) { NotifyDriverShm_delete(&shmDrvHandle); status = Notify_E_FAIL; } return (status); }
/*! * ======== NotifySetup_attach ======== * Initialize interrupt */ Int NotifySetup_attach(UInt16 remoteProcId, Ptr sharedAddr) { NotifyDriverShm_Params notifyShmParams; NotifyDriverShm_Handle shmDrvHandle; ti_sdo_ipc_Notify_Handle notifyHandle; Int status = Notify_S_SUCCESS; Error_Block eb; Error_init(&eb); NotifyDriverShm_Params_init(¬ifyShmParams); notifyShmParams.sharedAddr = sharedAddr; notifyShmParams.remoteProcId = remoteProcId; /* Set the intVectorId */ if (MultiProc_self() == NotifySetup_dspProcId) { notifyShmParams.intVectorId = NotifySetup_dspIntVectId; } else { notifyShmParams.intVectorId = NotifySetup_arp32IntVectId; } shmDrvHandle = NotifyDriverShm_create(¬ifyShmParams, &eb); if (shmDrvHandle == NULL) { return (Notify_E_FAIL); } notifyHandle = ti_sdo_ipc_Notify_create( NotifyDriverShm_Handle_upCast(shmDrvHandle), remoteProcId, 0, NULL, &eb); if (notifyHandle == NULL) { NotifyDriverShm_delete(&shmDrvHandle); status = Notify_E_FAIL; } return (status); }
/*! * @brief Function to perform device specific destroy for Notify module. * This function deletes the Notify drivers. * * @sa NotifySetupOmapl1xx_attach */ Int NotifySetupOmapl1xx_detach (UInt16 procId) { Int status = Notify_S_SUCCESS; Int tmpStatus = Notify_S_SUCCESS; GT_0trace (curTrace, GT_ENTER, "NotifySetupOmapl1xx_detach"); /* * Delete the notify driver to the DSP (Line 0) */ status = Notify_delete (&NotifySetup_notifyHandle0); #if !defined(SYSLINK_BUILD_OPTIMIZE) if (status < 0) { GT_setFailureReason (curTrace, GT_4CLASS, "NotifySetupOmapl1xx_detach", status, "Notify_delete failed for line 0"); } #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */ tmpStatus = NotifyDriverShm_delete (&NotifySetup_dspDriverHandle0); #if !defined(SYSLINK_BUILD_OPTIMIZE) if ((tmpStatus < 0) && (status >= 0)) { status = tmpStatus; GT_setFailureReason (curTrace, GT_4CLASS, "NotifySetupOmapl1xx_attach", status, "NotifyDriverShm_delete failed for line 0"); } #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */ if (NotifySetup_useSecondLine) { /* * Delete the notify driver to the DSP (Line 1) */ tmpStatus = Notify_delete (&NotifySetup_notifyHandle1); #if !defined(SYSLINK_BUILD_OPTIMIZE) if ((tmpStatus < 0) && (status >= 0)) { status = tmpStatus; GT_setFailureReason (curTrace, GT_4CLASS, "NotifySetupOmapl1xx_detach", status, "Notify_delete failed for line 1"); } #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */ tmpStatus = NotifyDriverShm_delete (&NotifySetup_dspDriverHandle1); #if !defined(SYSLINK_BUILD_OPTIMIZE) if ((tmpStatus < 0) && (status >= 0)) { status = tmpStatus; GT_setFailureReason (curTrace, GT_4CLASS, "NotifySetupOmapl1xx_detach", status, "NotifyDriverShm_delete failed for line 1"); } #endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */ } GT_1trace (curTrace, GT_LEAVE, "NotifySetupOmapl1xx_detach", status); /*! @retval Notify_S_SUCCESS Operation successful */ return (status); }