gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::DmaCallback Class Referenceabstract

DMA callback class. More...

#include <dma_device.hh>

Inheritance diagram for gem5::DmaCallback:
gem5::Drainable gem5::DmaVirtDevice::DmaVirtCallback< T >

Public Member Functions

virtual const std::string name () const
 
DrainState drain () override
 DmaPort ensures that all oustanding DMA accesses have completed before it finishes draining.
 
EventgetChunkEvent ()
 Request a chunk event.
 
- Public Member Functions inherited from gem5::Drainable
DrainState drainState () const
 Return the current drain state of an object.
 
virtual void notifyFork ()
 Notify a child process of a fork.
 

Protected Member Functions

virtual ~DmaCallback ()=default
 
virtual void process ()=0
 Callback function invoked on completion of all chunks.
 
- Protected Member Functions inherited from gem5::Drainable
 Drainable ()
 
virtual ~Drainable ()
 
virtual void drainResume ()
 Resume execution after a successful drain.
 
void signalDrainDone () const
 Signal that an object is drained.
 

Protected Attributes

int count = 0
 

Private Member Functions

void chunkComplete ()
 Called by DMA engine completion event on each chunk completion.
 

Detailed Description

DMA callback class.

Allows one to register for a callback event after a sequence of (potentially non-contiguous) DMA transfers on a DmaPort completes. Derived classes must implement the process() method and use getChunkEvent() to allocate a callback event for each participating DMA.

Definition at line 275 of file dma_device.hh.

Constructor & Destructor Documentation

◆ ~DmaCallback()

virtual gem5::DmaCallback::~DmaCallback ( )
protectedvirtualdefault

Member Function Documentation

◆ chunkComplete()

void gem5::DmaCallback::chunkComplete ( )
inlineprivate

Called by DMA engine completion event on each chunk completion.

Since the object may delete itself here, callers should not use the object pointer after calling this function.

Definition at line 310 of file dma_device.hh.

References count, process(), and gem5::Drainable::signalDrainDone().

Referenced by getChunkEvent().

◆ drain()

DrainState gem5::DmaCallback::drain ( )
inlineoverridevirtual

DmaPort ensures that all oustanding DMA accesses have completed before it finishes draining.

However, DmaChunkEvents scheduled with a delay might still be sitting on the event queue. Therefore, draining is not complete until count is 0, which ensures that all outstanding DmaChunkEvents associated with this DmaCallback have fired.

Implements gem5::Drainable.

Definition at line 288 of file dma_device.hh.

References count, gem5::Drained, and gem5::Draining.

◆ getChunkEvent()

Event * gem5::DmaCallback::getChunkEvent ( )
inline

Request a chunk event.

Chunks events should be provided to each DMA request that wishes to participate in this DmaCallback.

Definition at line 328 of file dma_device.hh.

References chunkComplete(), count, and name().

Referenced by gem5::DmaVirtDevice::dmaVirt().

◆ name()

virtual const std::string gem5::DmaCallback::name ( ) const
inlinevirtual

Definition at line 278 of file dma_device.hh.

Referenced by getChunkEvent().

◆ process()

virtual void gem5::DmaCallback::process ( )
protectedpure virtual

Callback function invoked on completion of all chunks.

Implemented in gem5::DmaVirtDevice::DmaVirtCallback< T >.

Referenced by chunkComplete().

Member Data Documentation

◆ count

int gem5::DmaCallback::count = 0
protected

Definition at line 294 of file dma_device.hh.

Referenced by chunkComplete(), drain(), and getChunkEvent().


The documentation for this class was generated from the following file:

Generated on Tue Jun 18 2024 16:24:10 for gem5 by doxygen 1.11.0