gem5  v21.1.0.2
Public Member Functions | Private Attributes | List of all members
gem5::DeviceFDEntry Class Reference

Holds file descriptors needed to simulate devices opened with pseudo files (commonly with calls to ioctls). More...

#include <fd_entry.hh>

Inheritance diagram for gem5::DeviceFDEntry:
gem5::FDEntry gem5::Serializable

Public Member Functions

 DeviceFDEntry (EmulatedDriver *driver, std::string const &file_name, bool close_on_exec=false)
 
 DeviceFDEntry (DeviceFDEntry const &dev, bool close_on_exec=false)
 
std::shared_ptr< FDEntryclone () const override
 
EmulatedDrivergetDriver () const
 
std::string const & getFileName () const
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
- 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. More...
 
void serializeSection (CheckpointOut &cp, const std::string &name) const
 
void unserializeSection (CheckpointIn &cp, const char *name)
 Unserialize an a child object. More...
 
void unserializeSection (CheckpointIn &cp, const std::string &name)
 

Private Attributes

EmulatedDriver_driver
 
std::string _fileName
 

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. More...
 
static void generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream)
 Generate a checkpoint file so that the serialization can be routed to it. More...
 
- Protected Attributes inherited from gem5::FDEntry
bool _closeOnExec
 
FDClass _class
 

Detailed Description

Holds file descriptors needed to simulate devices opened with pseudo files (commonly with calls to ioctls).

Definition at line 215 of file fd_entry.hh.

Constructor & Destructor Documentation

◆ DeviceFDEntry() [1/2]

gem5::DeviceFDEntry::DeviceFDEntry ( EmulatedDriver driver,
std::string const &  file_name,
bool  close_on_exec = false 
)
inline

Definition at line 218 of file fd_entry.hh.

References gem5::FDEntry::_class.

◆ DeviceFDEntry() [2/2]

gem5::DeviceFDEntry::DeviceFDEntry ( DeviceFDEntry const &  dev,
bool  close_on_exec = false 
)
inline

Definition at line 223 of file fd_entry.hh.

References gem5::FDEntry::_class.

Member Function Documentation

◆ clone()

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

Implements gem5::FDEntry.

Definition at line 229 of file fd_entry.hh.

◆ getDriver()

EmulatedDriver* gem5::DeviceFDEntry::getDriver ( ) const
inline

Definition at line 234 of file fd_entry.hh.

References _driver.

◆ getFileName()

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

Definition at line 235 of file fd_entry.hh.

References _fileName.

◆ serialize()

void gem5::DeviceFDEntry::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 90 of file fd_entry.cc.

References gem5::FDEntry::_closeOnExec, _fileName, and SERIALIZE_SCALAR.

◆ unserialize()

void gem5::DeviceFDEntry::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 98 of file fd_entry.cc.

References gem5::FDEntry::_closeOnExec, _fileName, and UNSERIALIZE_SCALAR.

Member Data Documentation

◆ _driver

EmulatedDriver* gem5::DeviceFDEntry::_driver
private

Definition at line 241 of file fd_entry.hh.

Referenced by getDriver().

◆ _fileName

std::string gem5::DeviceFDEntry::_fileName
private

Definition at line 242 of file fd_entry.hh.

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


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

Generated on Tue Sep 21 2021 12:27:29 for gem5 by doxygen 1.8.17