Exemple #1
0
/*!
 *  ======== 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(&notifyShmParams);
    notifyShmParams.intVectorId     = NotifySetup_dspIntVectId;
    notifyShmParams.sharedAddr      = sharedAddr;
    notifyShmParams.remoteProcId  = remoteProcId;
        
    shmDrvHandle = NotifyDriverShm_create(&notifyShmParams, &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);
}
Exemple #2
0
/*!
 *  ======== 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(&notifyShmParams);
    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(&notifyShmParams, &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);
}
Exemple #3
0
/*!
 *  ======== 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(&notifyShmParams);
    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(&notifyShmParams, &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);
}
Exemple #4
0
/*!
 *  ======== 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(&notifyShmParams);
    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(&notifyShmParams, &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);
}