gem5 [DEVELOP-FOR-25.0]
Loading...
Searching...
No Matches
gem5::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 reset ()
 Reset any state in the ring buffer.
 
void setAddress (Addr addr)
 Set the base address of the VirtIO ring buffer.
 
void readHeader ()
 Update the ring buffer header with data from the guest.
 
void writeHeader ()
 
void read ()
 
void write ()
 

Public Attributes

Header header
 Ring buffer header in host byte order.
 
std::vector< T > ring
 Elements in ring in host byte order.
 

Private Member Functions

 VirtRing ()
 

Private Attributes

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

Detailed Description

template<typename T>
class gem5::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 468 of file base.hh.

Member Typedef Documentation

◆ Flags

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

Definition at line 471 of file base.hh.

◆ Index

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

Definition at line 472 of file base.hh.

Constructor & Destructor Documentation

◆ VirtRing() [1/2]

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

Definition at line 480 of file base.hh.

References _base, _proxy, gem5::PowerISA::bo, byteOrder, header, and ring.

◆ VirtRing() [2/2]

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

Member Function Documentation

◆ read()

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

Definition at line 520 of file base.hh.

References _base, _proxy, byteOrder, gem5::gtoh(), header, gem5::ArmISA::i, readHeader(), and ring.

◆ readHeader()

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

Update the ring buffer header with data from the guest.

Definition at line 501 of file base.hh.

References _base, _proxy, byteOrder, gem5::gtoh(), and header.

Referenced by read().

◆ reset()

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

Reset any state in the ring buffer.

Definition at line 486 of file base.hh.

References _base, and header.

◆ setAddress()

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

Set the base address of the VirtIO ring buffer.

Parameters
addrNew host physical address

Definition at line 497 of file base.hh.

References _base, and gem5::X86ISA::addr.

◆ write()

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

Definition at line 533 of file base.hh.

References _base, _proxy, byteOrder, header, gem5::htog(), gem5::ArmISA::i, ring, and writeHeader().

◆ writeHeader()

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

Member Data Documentation

◆ _base

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

Guest physical base address of the ring buffer.

Definition at line 558 of file base.hh.

Referenced by read(), readHeader(), reset(), setAddress(), VirtRing(), write(), and writeHeader().

◆ _proxy

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

Guest physical memory proxy.

Definition at line 556 of file base.hh.

Referenced by read(), readHeader(), VirtRing(), write(), and writeHeader().

◆ byteOrder

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

Byte order in the ring.

Definition at line 560 of file base.hh.

Referenced by read(), readHeader(), VirtRing(), write(), and writeHeader().

◆ header

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

Ring buffer header in host byte order.

Definition at line 547 of file base.hh.

Referenced by read(), readHeader(), reset(), VirtRing(), write(), and writeHeader().

◆ ring

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

Elements in ring in host byte order.

Definition at line 549 of file base.hh.

Referenced by read(), VirtRing(), and write().


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

Generated on Mon May 26 2025 09:19:27 for gem5 by doxygen 1.13.2