src/dev/arm/ufs_device.cc
/**
 * Read callback, on the way from the disk to the DMA. Called by the UFSSCSI
 * layer.
 */
Read callback, on the way from the disk to the DMA. Called by the UFSSCSI
layer.
Read callback on the way from the disk to the DMA . Called by the UFSSCSI layer .
void
UFSHostDevice::readCallback()
{
    DPRINTF(UFSHostDevice, "Read Callback\n");
    uint8_t this_lun = 0;
    while ((this_lun < lunAvail) && !UFSDevice[this_lun]->finishedRead())
        ++this_lun;
    DPRINTF(UFSHostDevice, "Found LUN %d messages pending for clean: %d\n",
            this_lun, SSDReadPending.size());
    if (this_lun < lunAvail) {
        UFSDevice[this_lun]->clearReadSignal();
        SSDReadPending.push_back(UFSDevice[this_lun]->SSDReadInfo.front());
        UFSDevice[this_lun]->SSDReadInfo.pop_front();
        readGarbageEventQueue.push_back(
            EventFunctionWrapper([this]{ readGarbage(); }, name()));
        readDevice(false, SSDReadPending.front().offset,
                   SSDReadPending.front().size,
                   &SSDReadPending.front().buffer[0], false,
                   &readGarbageEventQueue.back());
        ++stats.totalReadDiskTransactions;
    }
    else
        panic("no read finished in tick %d\n", curTick());
}
void UFSHostDevice :: readCallback ( ) { DPRINTF ( UFSHostDevice , " \n " ) ; uint8_t this_lun = 0 ; while ( ( this_lun < lunAvail ) && ! UFSDevice [ this_lun ] -> finishedRead ( ) ) ++ this_lun ; DPRINTF ( UFSHostDevice , " \n " , this_lun , SSDReadPending . size ( ) ) ; if ( this_lun < lunAvail ) { UFSDevice [ this_lun ] -> clearReadSignal ( ) ; SSDReadPending . push_back ( UFSDevice [ this_lun ] -> SSDReadInfo . front ( ) ) ; UFSDevice [ this_lun ] -> SSDReadInfo . pop_front ( ) ; readGarbageEventQueue . push_back ( EventFunctionWrapper ( [ this ] { readGarbage ( ) ; } , name ( ) ) ) ; readDevice ( false , SSDReadPending . front ( ) . offset , SSDReadPending . front ( ) . size , & SSDReadPending . front ( ) . buffer [ 0 ] , false , & readGarbageEventQueue . back ( ) ) ; ++ stats . totalReadDiskTransactions ; } else panic ( " \n " , curTick ( ) ) ; }
Read callback, on the way from the disk to the DMA.
Read callback on the way from the disk to the DMA .
//while we haven't found the right lun, keep searching //Clear signal. //make sure the queue is popped a the end of the dma transaction /**stats*/