src/dev/arm/ufs_device.cc
/**
 * Dma transaction function: read device. Notice that the dma action is from
 * a device perspective, while this function is from an initiator perspective
 */
Dma transaction function: read device. Notice that the dma action is from
a device perspective, while this function is from an initiator perspective
Dma transaction function : read device . Notice that the dma action is from a device perspective while this function is from an initiator perspective
void
UFSHostDevice::readDevice(bool lastTransfer, Addr start, uint32_t size,
                          uint8_t* destination, bool no_cache, Event*
                          additional_action)
{
    DPRINTF(UFSHostDevice, "Read start: 0x%8x; Size: %d, data[0]: 0x%8x\n",
            start, size, (reinterpret_cast<uint32_t *>(destination))[0]);
    if (lastTransfer) {
        ++readPendingNum;
        readDoneEvent.push_back(
            EventFunctionWrapper([this]{ readDone(); },
                                 name()));
        assert(!readDoneEvent.back().scheduled());
        dmaPort.dmaAction(MemCmd::WriteReq, start, size,
                          &readDoneEvent.back(), destination, 0);
    } else {
        if (additional_action != NULL)
            assert(!additional_action->scheduled());
        dmaPort.dmaAction(MemCmd::WriteReq, start, size,
                          additional_action, destination, 0);
    }
}
void UFSHostDevice :: readDevice ( bool lastTransfer , Addr start , uint32_t size , uint8_t * destination , bool no_cache , Event * additional_action ) { DPRINTF ( UFSHostDevice , " \n " , start , size , ( reinterpret_cast < uint32_t * > ( destination ) ) [ 0 ] ) ; if ( lastTransfer ) { ++ readPendingNum ; readDoneEvent . push_back ( EventFunctionWrapper ( [ this ] { readDone ( ) ; } , name ( ) ) ) ; assert ( ! readDoneEvent . back ( ) . scheduled ( ) ) ; dmaPort . dmaAction ( MemCmd :: WriteReq , start , size , & readDoneEvent . back ( ) , destination , 0 ) ; } else { if ( additional_action != NULL ) assert ( ! additional_action -> scheduled ( ) ) ; dmaPort . dmaAction ( MemCmd :: WriteReq , start , size , additional_action , destination , 0 ) ; } }
Dma transaction function: read device.
Dma transaction function : read device .
/** check wether interrupt is needed */ //yes, a writereq at a read device function is correct.