gem5  v21.1.0.2
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
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. More...
 
EventgetChunkEvent ()
 Request a chunk event. More...
 
- Public Member Functions inherited from gem5::Drainable
DrainState drainState () const
 Return the current drain state of an object. More...
 
virtual void notifyFork ()
 Notify a child process of a fork. More...
 

Public Attributes

dmaBuffer
 

Private Member Functions

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

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. More...
 
void signalDrainDone () const
 Signal that an object is drained. More...
 
- 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 55 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,
dma_buffer_value = 0 
)
inline

Definition at line 68 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 60 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

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

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

Generated on Tue Sep 21 2021 12:27:30 for gem5 by doxygen 1.8.17