src/dev/arm/ufs_device.cc
/**
 * Find finished transfer. Callback function. One of the LUNs is done with
 * the disk transfer and reports back to the controller. This function finds
 * out who it was, and calls transferDone.
 */
Find finished transfer. Callback function. One of the LUNs is done with
the disk transfer and reports back to the controller. This function finds
out who it was, and calls transferDone.
Find finished transfer . Callback function . One of the LUNs is done with the disk transfer and reports back to the controller . This function finds out who it was and calls transferDone .
void
UFSHostDevice::LUNSignal()
{
    uint8_t this_lun = 0;
    while ((this_lun < lunAvail) && !UFSDevice[this_lun]->finishedCommand())
        ++this_lun;
    if (this_lun < lunAvail) {
        UFSDevice[this_lun]->clearSignal();
        transferDone(UFSDevice[this_lun]->transferInfo.responseStartAddr,
                     UFSDevice[this_lun]->transferInfo.reqPos,
                     UFSDevice[this_lun]->transferInfo.requestOut,
                     UFSDevice[this_lun]->transferInfo.size,
                     UFSDevice[this_lun]->transferInfo.address,
                     UFSDevice[this_lun]->transferInfo.destination,
                     UFSDevice[this_lun]->transferInfo.finished,
                     UFSDevice[this_lun]->transferInfo.lunID);
    }
    else
        panic("no LUN finished in tick %d\n", curTick());
}
void UFSHostDevice :: LUNSignal ( ) { uint8_t this_lun = 0 ; while ( ( this_lun < lunAvail ) && ! UFSDevice [ this_lun ] -> finishedCommand ( ) ) ++ this_lun ; if ( this_lun < lunAvail ) { UFSDevice [ this_lun ] -> clearSignal ( ) ; transferDone ( UFSDevice [ this_lun ] -> transferInfo . responseStartAddr , UFSDevice [ this_lun ] -> transferInfo . reqPos , UFSDevice [ this_lun ] -> transferInfo . requestOut , UFSDevice [ this_lun ] -> transferInfo . size , UFSDevice [ this_lun ] -> transferInfo . address , UFSDevice [ this_lun ] -> transferInfo . destination , UFSDevice [ this_lun ] -> transferInfo . finished , UFSDevice [ this_lun ] -> transferInfo . lunID ) ; } else panic ( " \n " , curTick ( ) ) ; }
Find finished transfer.
Find finished transfer .
//while we haven't found the right lun, keep searching //Clear signal. //found it; call transferDone