gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::BaseSemihosting::FileFeatures Class Reference

Implementation of the ':semihosting-features' magic file. More...

#include <semihosting.hh>

Inheritance diagram for gem5::BaseSemihosting::FileFeatures:
gem5::BaseSemihosting::FileBase gem5::Serializable

Public Member Functions

 FileFeatures (BaseSemihosting &_parent, const char *name, const char *mode)
 
void serialize (CheckpointOut &cp) const override
 Serialize an object.
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object.
 
int64_t read (uint8_t *buffer, uint64_t size) override
 Read data from file.
 
int64_t seek (uint64_t pos) override
 Seek to an absolute position in the file.
 
int64_t flen () override
 Get the length of a file in bytes.
 
- Public Member Functions inherited from gem5::BaseSemihosting::FileBase
 FileBase (BaseSemihosting &_parent, const char *name, const char *_mode)
 
virtual ~FileBase ()
 
 FileBase ()=delete
 
 FileBase (FileBase &)=delete
 
const std::string & fileName ()
 
virtual int64_t open ()
 Open the the file.
 
virtual int64_t close ()
 Close the file.
 
virtual bool isTTY () const
 Check if a file corresponds to a TTY device.
 
virtual int64_t write (const uint8_t *buffer, uint64_t size)
 Write data to file.
 
- 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)
 

Protected Attributes

size_t pos = 0
 
- Protected Attributes inherited from gem5::BaseSemihosting::FileBase
BaseSemihostingparent
 
std::string _name
 
std::string mode
 

Additional Inherited Members

- Static Public Member Functions inherited from gem5::BaseSemihosting::FileBase
static std::unique_ptr< FileBasecreate (BaseSemihosting &parent, const std::string &fname, const char *mode)
 
static std::unique_ptr< FileBasecreate (BaseSemihosting &parent, CheckpointIn &cp, const std::string &sec)
 
- 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.
 

Detailed Description

Implementation of the ':semihosting-features' magic file.

Definition at line 316 of file semihosting.hh.

Constructor & Destructor Documentation

◆ FileFeatures()

gem5::BaseSemihosting::FileFeatures::FileFeatures ( BaseSemihosting & _parent,
const char * name,
const char * mode )

Definition at line 672 of file semihosting.cc.

Member Function Documentation

◆ flen()

int64_t gem5::BaseSemihosting::FileFeatures::flen ( )
overridevirtual

Get the length of a file in bytes.

Returns
<0 on error (-errno), length on success

Reimplemented from gem5::BaseSemihosting::FileBase.

Definition at line 678 of file semihosting.cc.

References gem5::BaseSemihosting::features.

◆ read()

int64_t gem5::BaseSemihosting::FileFeatures::read ( uint8_t * buffer,
uint64_t size )
overridevirtual

Read data from file.

Returns
<0 on error (-errno), bytes read on success (0 for EOF).

Reimplemented from gem5::BaseSemihosting::FileBase.

Definition at line 684 of file semihosting.cc.

References gem5::BaseSemihosting::features, and gem5::ArmISA::len.

◆ seek()

int64_t gem5::BaseSemihosting::FileFeatures::seek ( uint64_t pos)
overridevirtual

Seek to an absolute position in the file.

Parameters
posByte offset from start of file.
Returns
<0 on error (-errno), 0 on success.

Reimplemented from gem5::BaseSemihosting::FileBase.

Definition at line 695 of file semihosting.cc.

References gem5::BaseSemihosting::features.

◆ serialize()

void gem5::BaseSemihosting::FileFeatures::serialize ( CheckpointOut & cp) const
overridevirtual

Serialize an object.

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

Parameters
cpCheckpoint state

Reimplemented from gem5::BaseSemihosting::FileBase.

Definition at line 706 of file semihosting.cc.

References gem5::BaseSemihosting::FileBase::serialize(), and SERIALIZE_SCALAR.

◆ unserialize()

void gem5::BaseSemihosting::FileFeatures::unserialize ( CheckpointIn & cp)
overridevirtual

Unserialize an object.

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

Parameters
cpCheckpoint state

Reimplemented from gem5::BaseSemihosting::FileBase.

Definition at line 713 of file semihosting.cc.

References gem5::BaseSemihosting::FileBase::unserialize(), and UNSERIALIZE_SCALAR.

Member Data Documentation

◆ pos

size_t gem5::BaseSemihosting::FileFeatures::pos = 0
protected

Definition at line 330 of file semihosting.hh.


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

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