gem5  v20.0.0.2
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
VirtQueue::VirtRing< T > Class Template Reference

VirtIO ring buffer wrapper. More...

Classes

struct  Header
 

Public Types

typedef uint16_t Flags
 
typedef uint16_t Index
 

Public Member Functions

 VirtRing (PortProxy &proxy, ByteOrder bo, uint16_t size)
 
void setAddress (Addr addr)
 Set the base address of the VirtIO ring buffer. More...
 
void readHeader ()
 Update the ring buffer header with data from the guest. More...
 
void writeHeader ()
 
void read ()
 
void write ()
 

Public Attributes

struct VirtQueue::VirtRing::Header M5_ATTR_PACKED
 
Header header
 Ring buffer header in host byte order. More...
 
std::vector< T > ring
 Elements in ring in host byte order. More...
 

Private Member Functions

 VirtRing ()
 

Private Attributes

PortProxy_proxy
 Guest physical memory proxy. More...
 
Addr _base
 Guest physical base address of the ring buffer. More...
 
ByteOrder byteOrder
 Byte order in the ring. More...
 

Detailed Description

template<typename T>
class VirtQueue::VirtRing< T >

VirtIO ring buffer wrapper.

This class wraps a VirtIO ring buffer. The template parameter T is used to select the data type for the items in the ring (used or available descriptors).

Definition at line 448 of file base.hh.

Member Typedef Documentation

◆ Flags

template<typename T>
typedef uint16_t VirtQueue::VirtRing< T >::Flags

Definition at line 451 of file base.hh.

◆ Index

template<typename T>
typedef uint16_t VirtQueue::VirtRing< T >::Index

Definition at line 452 of file base.hh.

Constructor & Destructor Documentation

◆ VirtRing() [1/2]

template<typename T>
VirtQueue::VirtRing< T >::VirtRing ( PortProxy proxy,
ByteOrder  bo,
uint16_t  size 
)
inline

Definition at line 459 of file base.hh.

◆ VirtRing() [2/2]

template<typename T>
VirtQueue::VirtRing< T >::VirtRing ( )
private

Member Function Documentation

◆ read()

template<typename T>
void VirtQueue::VirtRing< T >::read ( )
inline

Definition at line 491 of file base.hh.

Referenced by VirtQueue::consumeDescriptor().

◆ readHeader()

template<typename T>
void VirtQueue::VirtRing< T >::readHeader ( )
inline

Update the ring buffer header with data from the guest.

Definition at line 472 of file base.hh.

Referenced by VirtQueue::produceDescriptor().

◆ setAddress()

template<typename T>
void VirtQueue::VirtRing< T >::setAddress ( Addr  addr)
inline

Set the base address of the VirtIO ring buffer.

Parameters
addrNew host physical address

Definition at line 468 of file base.hh.

Referenced by VirtQueue::setAddress().

◆ write()

template<typename T>
void VirtQueue::VirtRing< T >::write ( )
inline

Definition at line 504 of file base.hh.

Referenced by VirtQueue::produceDescriptor().

◆ writeHeader()

template<typename T>
void VirtQueue::VirtRing< T >::writeHeader ( )
inline

Definition at line 481 of file base.hh.

Member Data Documentation

◆ _base

template<typename T>
Addr VirtQueue::VirtRing< T >::_base
private

Guest physical base address of the ring buffer.

Definition at line 529 of file base.hh.

◆ _proxy

template<typename T>
PortProxy& VirtQueue::VirtRing< T >::_proxy
private

Guest physical memory proxy.

Definition at line 527 of file base.hh.

◆ byteOrder

template<typename T>
ByteOrder VirtQueue::VirtRing< T >::byteOrder
private

Byte order in the ring.

Definition at line 531 of file base.hh.

◆ header

template<typename T>
Header VirtQueue::VirtRing< T >::header

Ring buffer header in host byte order.

Definition at line 518 of file base.hh.

Referenced by VirtQueue::consumeDescriptor(), and VirtQueue::produceDescriptor().

◆ M5_ATTR_PACKED

template<typename T>
struct VirtQueue::VirtRing::Header VirtQueue::VirtRing< T >::M5_ATTR_PACKED

◆ ring

template<typename T>
std::vector<T> VirtQueue::VirtRing< T >::ring

Elements in ring in host byte order.

Definition at line 520 of file base.hh.

Referenced by VirtQueue::consumeDescriptor(), and VirtQueue::produceDescriptor().


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

Generated on Mon Jun 8 2020 15:45:31 for gem5 by doxygen 1.8.13