gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::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
 
off_t getOffset () const
 

Private Attributes

void * _buffer
 
size_t _length
 
off_t _offset
 

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 190 of file vma.hh.

Constructor & Destructor Documentation

◆ MappedFileBuffer()

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

Definition at line 121 of file vma.cc.

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

◆ ~MappedFileBuffer()

gem5::VMA::MappedFileBuffer::~MappedFileBuffer ( )

Definition at line 150 of file vma.cc.

References panic_if.

Member Function Documentation

◆ getBuffer()

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

Definition at line 196 of file vma.hh.

References _buffer.

◆ getLength()

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

Definition at line 197 of file vma.hh.

References _length.

◆ getOffset()

off_t gem5::VMA::MappedFileBuffer::getOffset ( ) const
inline

Definition at line 198 of file vma.hh.

References _offset.

Member Data Documentation

◆ _buffer

void* gem5::VMA::MappedFileBuffer::_buffer
private

Definition at line 201 of file vma.hh.

Referenced by getBuffer(), and MappedFileBuffer().

◆ _length

size_t gem5::VMA::MappedFileBuffer::_length
private

Definition at line 202 of file vma.hh.

Referenced by getLength(), and MappedFileBuffer().

◆ _offset

off_t gem5::VMA::MappedFileBuffer::_offset
private

Definition at line 203 of file vma.hh.

Referenced by getOffset().


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

Generated on Tue Jun 18 2024 16:24:15 for gem5 by doxygen 1.11.0