src/dev/arm/ufs_device.cc
/**
 * Manage read transfer. Manages correct transfer flow and makes sure that
 * the queues are filled on time
 */
Manage read transfer. Manages correct transfer flow and makes sure that
the queues are filled on time
Manage read transfer . Manages correct transfer flow and makes sure that the queues are filled on time
void
UFSHostDevice::manageReadTransfer(uint32_t size, uint32_t LUN, uint64_t
                                  offset, uint32_t sg_table_length,
                                  struct UFSHCDSGEntry* sglist)
{
    uint32_t size_accum = 0;
    DPRINTF(UFSHostDevice, "Data READ size: %d\n", size);
    for (uint32_t count = 0; count < sg_table_length; count++) {
        struct transferInfo new_transfer;
        new_transfer.offset = sglist[count].upperAddr;
        new_transfer.offset = (new_transfer.offset << 32) |
            (sglist[count].baseAddr & 0xFFFFFFFF);
        new_transfer.filePointer = offset + size_accum;
        new_transfer.size = (sglist[count].size + 1);
        new_transfer.lunID = LUN;
        DPRINTF(UFSHostDevice, "Data READ start: 0x%8x; size: %d\n",
                new_transfer.offset, new_transfer.size);
        UFSDevice[LUN]->SSDReadInfo.push_back(new_transfer);
        UFSDevice[LUN]->SSDReadInfo.back().buffer.resize(sglist[count].size
                                                         + 1);
        UFSDevice[LUN]->readFlash(&UFSDevice[LUN]->
                                  SSDReadInfo.back().buffer[0],
                                  offset + size_accum,
                                  sglist[count].size + 1);
        size_accum += (sglist[count].size + 1);
        DPRINTF(UFSHostDevice, "Transfer %d; Remaining: 0x%8x, Accumulated:"
                " 0x%8x\n", (count + 1), (size-size_accum), size_accum);
        stats.totalReadSSD += (sglist[count].size + 1);
        stats.currentReadSSDQueue = UFSDevice[LUN]->SSDReadInfo.size();
        stats.averageReadSSDQueue = UFSDevice[LUN]->SSDReadInfo.size();
    }
    UFSDevice[LUN]->SSDReadStart(sg_table_length);
    ++stats.totalReadUFSTransactions;
}
void UFSHostDevice :: manageReadTransfer ( uint32_t size , uint32_t LUN , uint64_t offset , uint32_t sg_table_length , struct UFSHCDSGEntry * sglist ) { uint32_t size_accum = 0 ; DPRINTF ( UFSHostDevice , " \n " , size ) ; for ( uint32_t count = 0 ; count < sg_table_length ; count ++ ) { struct transferInfo new_transfer ; new_transfer . offset = sglist [ count ] . upperAddr ; new_transfer . offset = ( new_transfer . offset << 32 ) | ( sglist [ count ] . baseAddr & 0xFFFFFFFF ) ; new_transfer . filePointer = offset + size_accum ; new_transfer . size = ( sglist [ count ] . size + 1 ) ; new_transfer . lunID = LUN ; DPRINTF ( UFSHostDevice , " \n " , new_transfer . offset , new_transfer . size ) ; UFSDevice [ LUN ] -> SSDReadInfo . push_back ( new_transfer ) ; UFSDevice [ LUN ] -> SSDReadInfo . back ( ) . buffer . resize ( sglist [ count ] . size + 1 ) ; UFSDevice [ LUN ] -> readFlash ( & UFSDevice [ LUN ] -> SSDReadInfo . back ( ) . buffer [ 0 ] , offset + size_accum , sglist [ count ] . size + 1 ) ; size_accum += ( sglist [ count ] . size + 1 ) ; DPRINTF ( UFSHostDevice , " " " \n " , ( count + 1 ) , ( size - size_accum ) , size_accum ) ; stats . totalReadSSD += ( sglist [ count ] . size + 1 ) ; stats . currentReadSSDQueue = UFSDevice [ LUN ] -> SSDReadInfo . size ( ) ; stats . averageReadSSDQueue = UFSDevice [ LUN ] -> SSDReadInfo . size ( ) ; } UFSDevice [ LUN ] -> SSDReadStart ( sg_table_length ) ; ++ stats . totalReadUFSTransactions ; }
Manage read transfer.
Manage read transfer .
/**
     * Break-up the transactions into actions defined by the scatter gather
     * list.
     */ /**
         * The disk image is read here; but the action is simultated later
         * You can see this as the preparation stage, whereas later is the
         * simulation phase.
         */ /** stats **/ /** stats **/