gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::DmaVirtDevice::DmaVirtCallback< T > Class Template Reference

Wraps a std::function object in a DmaCallback. More...

#include <dma_virt_device.hh>

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

Public Member Functions

 DmaVirtCallback (const std::function< void(const T &)> &function, T dma_buffer_value=0)
 
- Public Member Functions inherited from gem5::DmaCallback
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.
 

Public Attributes

dmaBuffer
 

Private Member Functions

virtual void process () override
 Callback function invoked on completion of all chunks.
 

Private Attributes

std::function< void(const T &)> _function
 

Additional Inherited Members

- Protected Member Functions inherited from gem5::DmaCallback
virtual ~DmaCallback ()=default
 
- 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 inherited from gem5::DmaCallback
int count = 0
 

Detailed Description

template<class T>
class gem5::DmaVirtDevice::DmaVirtCallback< T >

Wraps a std::function object in a DmaCallback.

Much cleaner than defining a bunch of callback objects for each desired behavior when a DMA completes. Contains a built in templated buffer that can be used for DMA temporary storage.

Definition at line 51 of file dma_virt_device.hh.

Constructor & Destructor Documentation

◆ DmaVirtCallback()

template<class T >
gem5::DmaVirtDevice::DmaVirtCallback< T >::DmaVirtCallback ( const std::function< void(const T &)> & function,
T dma_buffer_value = 0 )
inline

Definition at line 64 of file dma_virt_device.hh.

Member Function Documentation

◆ process()

template<class T >
virtual void gem5::DmaVirtDevice::DmaVirtCallback< T >::process ( )
inlineoverrideprivatevirtual

Callback function invoked on completion of all chunks.

Implements gem5::DmaCallback.

Definition at line 56 of file dma_virt_device.hh.

References gem5::DmaVirtDevice::DmaVirtCallback< T >::_function, and gem5::DmaVirtDevice::DmaVirtCallback< T >::dmaBuffer.

Member Data Documentation

◆ _function

template<class T >
std::function<void(const T &)> gem5::DmaVirtDevice::DmaVirtCallback< T >::_function
private

◆ dmaBuffer


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