gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::FileFDEntry Class Reference

Holds file descriptors for host-backed files; host-backed files are files which were opened on the physical machine where the simulation is running (probably the thing on/under your desk). More...

#include <fd_entry.hh>

Inheritance diagram for gem5::FileFDEntry:
gem5::HBFDEntry gem5::FDEntry gem5::Serializable

Public Member Functions

 FileFDEntry (int sim_fd, int flags, std::string const &file_name, uint64_t file_offset, bool close_on_exec=false)
 
 FileFDEntry (FileFDEntry const &reg, bool close_on_exec=false)
 
std::shared_ptr< FDEntryclone () const override
 
std::string const & getFileName () const
 
uint64_t getFileOffset () const
 
mode_t getFileMode () const
 
void setFileName (std::string const &file_name)
 
void setFileOffset (uint64_t f_off)
 
void setFileMode (mode_t mode)
 
void serialize (CheckpointOut &cp) const override
 Serialize an object.
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object.
 
- Public Member Functions inherited from gem5::HBFDEntry
 HBFDEntry (int flags, int sim_fd, bool close_on_exec=false)
 
 HBFDEntry (HBFDEntry const &reg, bool close_on_exec=false)
 
std::shared_ptr< FDEntryclone () const override
 
int getFlags () const
 
int getSimFD () const
 
void setFlags (int flags)
 
void setSimFD (int sim_fd)
 
- Public Member Functions inherited from gem5::FDEntry
 FDEntry (bool close_on_exec=false)
 
bool getCOE () const
 
FDClass getClass () const
 
void setCOE (bool close_on_exec)
 
- Public Member Functions inherited from gem5::Serializable
 Serializable ()
 
virtual ~Serializable ()
 
void serializeSection (CheckpointOut &cp, const char *name) const
 Serialize an object into a new section.
 
void serializeSection (CheckpointOut &cp, const std::string &name) const
 
void unserializeSection (CheckpointIn &cp, const char *name)
 Unserialize an a child object.
 
void unserializeSection (CheckpointIn &cp, const std::string &name)
 

Private Attributes

std::string _fileName
 
uint64_t _fileOffset
 
mode_t _mode
 

Additional Inherited Members

- Public Types inherited from gem5::FDEntry
enum  FDClass {
  fd_base , fd_hb , fd_file , fd_pipe ,
  fd_device , fd_socket , fd_null
}
 
- Static Public Member Functions inherited from gem5::Serializable
static const std::string & currentSection ()
 Gets the fully-qualified name of the active section.
 
static void generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream)
 Generate a checkpoint file so that the serialization can be routed to it.
 
- Protected Attributes inherited from gem5::HBFDEntry
int _flags
 
int _simFD
 
- Protected Attributes inherited from gem5::FDEntry
bool _closeOnExec
 
FDClass _class
 

Detailed Description

Holds file descriptors for host-backed files; host-backed files are files which were opened on the physical machine where the simulation is running (probably the thing on/under your desk).

All regular files are redirected to make it appear that the file descriptor assignment starts at file descriptor '3' (not including stdin, stdout, stderr) and then grows upward.

Definition at line 127 of file fd_entry.hh.

Constructor & Destructor Documentation

◆ FileFDEntry() [1/2]

gem5::FileFDEntry::FileFDEntry ( int sim_fd,
int flags,
std::string const & file_name,
uint64_t file_offset,
bool close_on_exec = false )
inline

Definition at line 130 of file fd_entry.hh.

References gem5::FDEntry::_class, and gem5::FDEntry::fd_file.

◆ FileFDEntry() [2/2]

gem5::FileFDEntry::FileFDEntry ( FileFDEntry const & reg,
bool close_on_exec = false )
inline

Definition at line 136 of file fd_entry.hh.

References gem5::FDEntry::_class, and gem5::FDEntry::fd_file.

Member Function Documentation

◆ clone()

std::shared_ptr< FDEntry > gem5::FileFDEntry::clone ( ) const
inlineoverridevirtual

Implements gem5::FDEntry.

Definition at line 142 of file fd_entry.hh.

◆ getFileMode()

mode_t gem5::FileFDEntry::getFileMode ( ) const
inline

Definition at line 149 of file fd_entry.hh.

References _mode.

◆ getFileName()

std::string const & gem5::FileFDEntry::getFileName ( ) const
inline

Definition at line 147 of file fd_entry.hh.

References _fileName.

◆ getFileOffset()

uint64_t gem5::FileFDEntry::getFileOffset ( ) const
inline

Definition at line 148 of file fd_entry.hh.

References _fileOffset.

◆ serialize()

void gem5::FileFDEntry::serialize ( CheckpointOut & cp) const
overridevirtual

Serialize an object.

Output an object's state into the current checkpoint section.

Parameters
cpCheckpoint state

Reimplemented from gem5::FDEntry.

Definition at line 52 of file fd_entry.cc.

References gem5::FDEntry::_closeOnExec, _fileName, _fileOffset, gem5::HBFDEntry::_flags, _mode, and SERIALIZE_SCALAR.

◆ setFileMode()

void gem5::FileFDEntry::setFileMode ( mode_t mode)
inline

Definition at line 153 of file fd_entry.hh.

References _mode, and gem5::ArmISA::mode.

◆ setFileName()

void gem5::FileFDEntry::setFileName ( std::string const & file_name)
inline

Definition at line 151 of file fd_entry.hh.

References _fileName.

◆ setFileOffset()

void gem5::FileFDEntry::setFileOffset ( uint64_t f_off)
inline

Definition at line 152 of file fd_entry.hh.

References _fileOffset.

◆ unserialize()

void gem5::FileFDEntry::unserialize ( CheckpointIn & cp)
overridevirtual

Unserialize an object.

Read an object's state from the current checkpoint section.

Parameters
cpCheckpoint state

Reimplemented from gem5::FDEntry.

Definition at line 62 of file fd_entry.cc.

References gem5::FDEntry::_closeOnExec, _fileName, _fileOffset, gem5::HBFDEntry::_flags, _mode, and UNSERIALIZE_SCALAR.

Member Data Documentation

◆ _fileName

std::string gem5::FileFDEntry::_fileName
private

Definition at line 159 of file fd_entry.hh.

Referenced by getFileName(), serialize(), setFileName(), and unserialize().

◆ _fileOffset

uint64_t gem5::FileFDEntry::_fileOffset
private

Definition at line 160 of file fd_entry.hh.

Referenced by getFileOffset(), serialize(), setFileOffset(), and unserialize().

◆ _mode

mode_t gem5::FileFDEntry::_mode
private

Definition at line 161 of file fd_entry.hh.

Referenced by getFileMode(), serialize(), setFileMode(), and unserialize().


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

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