gem5  v20.1.0.0
Public Member Functions | Private Attributes | List of all members
VMA::MappedFileBuffer Class Reference

MappedFileBuffer is a wrapper around a region of host memory backed by a file. More...

Public Member Functions

 MappedFileBuffer (int fd, size_t length, off_t offset)
 
 ~MappedFileBuffer ()
 
void * getBuffer () const
 
uint64_t getLength () const
 

Private Attributes

void * _buffer
 
size_t _length
 

Detailed Description

MappedFileBuffer is a wrapper around a region of host memory backed by a file.

The constructor attempts to map a file from host memory, and the destructor attempts to unmap it. If there is a problem with the host mapping/unmapping, then we panic.

Definition at line 183 of file vma.hh.

Constructor & Destructor Documentation

◆ MappedFileBuffer()

VMA::MappedFileBuffer::MappedFileBuffer ( int  fd,
size_t  length,
off_t  offset 
)

Definition at line 119 of file vma.cc.

References _buffer, _length, ArmISA::fd, ArmISA::offset, panic, and panic_if.

◆ ~MappedFileBuffer()

VMA::MappedFileBuffer::~MappedFileBuffer ( )

Definition at line 148 of file vma.cc.

References panic_if.

Member Function Documentation

◆ getBuffer()

void* VMA::MappedFileBuffer::getBuffer ( ) const
inline

Definition at line 189 of file vma.hh.

References _buffer.

◆ getLength()

uint64_t VMA::MappedFileBuffer::getLength ( ) const
inline

Definition at line 190 of file vma.hh.

References _length.

Member Data Documentation

◆ _buffer

void* VMA::MappedFileBuffer::_buffer
private

Definition at line 193 of file vma.hh.

Referenced by getBuffer(), and MappedFileBuffer().

◆ _length

size_t VMA::MappedFileBuffer::_length
private

Definition at line 194 of file vma.hh.

Referenced by getLength(), and MappedFileBuffer().


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

Generated on Wed Sep 30 2020 14:02:34 for gem5 by doxygen 1.8.17