src/dev/arm/ufs_device.cc
/**
 * Write done handling function. Is only initiated when the flash is directly
 * approached
 */
Write done handling function. Is only initiated when the flash is directly
approached
Write done handling function . Is only initiated when the flash is directly approached
void
UFSHostDevice::writeDone()
{
    assert(dmaWriteInfo.size() > 0);
    dmaWriteInfo.pop_front();
    assert(SSDWriteinfo.size() > 0);
    uint32_t lun = SSDWriteinfo.front().lunID;
    DPRINTF(UFSHostDevice, "Write done entered, queue: %d\n",
            UFSDevice[lun]->SSDWriteDoneInfo.size());
    UFSDevice[lun]->writeFlash(&SSDWriteinfo.front().buffer[0],
                               SSDWriteinfo.front().offset,
                               SSDWriteinfo.front().size);
    UFSDevice[lun]->SSDWriteDoneInfo.push_back(SSDWriteinfo.front());
    SSDWriteinfo.pop_front();
    --writePendingNum;
    UFSDevice[lun]->SSDWriteStart();
    stats.currentWriteSSDQueue = UFSDevice[lun]->SSDWriteDoneInfo.size();
    stats.averageWriteSSDQueue = UFSDevice[lun]->SSDWriteDoneInfo.size();
    ++stats.totalWriteDiskTransactions;
    if (!dmaWriteInfo.empty())
        writeDevice(NULL, true, dmaWriteInfo.front().start,
                    dmaWriteInfo.front().size,  NULL,
                    dmaWriteInfo.front().SCSIDiskOffset,
                    dmaWriteInfo.front().LUN);
    DPRINTF(UFSHostDevice, "Write done end\n");
}
void UFSHostDevice :: writeDone ( ) { assert ( dmaWriteInfo . size ( ) > 0 ) ; dmaWriteInfo . pop_front ( ) ; assert ( SSDWriteinfo . size ( ) > 0 ) ; uint32_t lun = SSDWriteinfo . front ( ) . lunID ; DPRINTF ( UFSHostDevice , " \n " , UFSDevice [ lun ] -> SSDWriteDoneInfo . size ( ) ) ; UFSDevice [ lun ] -> writeFlash ( & SSDWriteinfo . front ( ) . buffer [ 0 ] , SSDWriteinfo . front ( ) . offset , SSDWriteinfo . front ( ) . size ) ; UFSDevice [ lun ] -> SSDWriteDoneInfo . push_back ( SSDWriteinfo . front ( ) ) ; SSDWriteinfo . pop_front ( ) ; -- writePendingNum ; UFSDevice [ lun ] -> SSDWriteStart ( ) ; stats . currentWriteSSDQueue = UFSDevice [ lun ] -> SSDWriteDoneInfo . size ( ) ; stats . averageWriteSSDQueue = UFSDevice [ lun ] -> SSDWriteDoneInfo . size ( ) ; ++ stats . totalWriteDiskTransactions ; if ( ! dmaWriteInfo . empty ( ) ) writeDevice ( NULL , true , dmaWriteInfo . front ( ) . start , dmaWriteInfo . front ( ) . size , NULL , dmaWriteInfo . front ( ) . SCSIDiskOffset , dmaWriteInfo . front ( ) . LUN ) ; DPRINTF ( UFSHostDevice , " \n " ) ; }
Write done handling function.
Write done handling function .
/**DMA is done, information no longer needed*/ /**If there is nothing on the way, we need to start the events*/ /**Write the disk*/ /**
     * Move to the second queue, enter the logic unit
     * This is where the disk is approached and the flash transaction is
     * handled SSDWriteDone will take care of the timing
     */ /**so far, only the DMA part has been handled, lets do the disk delay*/ /** stats **/ /**initiate the next dma action (if any)*/