gem5  v20.1.0.0
Public Member Functions | Protected Attributes | List of all members
ArmSemihosting::FileFeatures Class Reference

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

#include <semihosting.hh>

Inheritance diagram for ArmSemihosting::FileFeatures:
ArmSemihosting::FileBase Serializable

Public Member Functions

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

Protected Attributes

size_t pos
 
- Protected Attributes inherited from ArmSemihosting::FileBase
ArmSemihostingparent
 
std::string _name
 
std::string mode
 

Additional Inherited Members

- Static Public Member Functions inherited from ArmSemihosting::FileBase
static std::unique_ptr< FileBasecreate (ArmSemihosting &parent, const std::string &fname, const char *mode)
 
static std::unique_ptr< FileBasecreate (ArmSemihosting &parent, CheckpointIn &cp, const std::string &sec)
 
- Static Public Member Functions inherited from Serializable
static const std::string & currentSection ()
 Gets the fully-qualified name of the active section. More...
 
static void serializeAll (const std::string &cpt_dir)
 Serializes all the SimObjects. More...
 
static void unserializeGlobals (CheckpointIn &cp)
 

Detailed Description

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

Definition at line 361 of file semihosting.hh.

Constructor & Destructor Documentation

◆ FileFeatures()

ArmSemihosting::FileFeatures::FileFeatures ( ArmSemihosting _parent,
const char *  name,
const char *  mode 
)

Definition at line 829 of file semihosting.cc.

Member Function Documentation

◆ read()

int64_t ArmSemihosting::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 ArmSemihosting::FileBase.

Definition at line 836 of file semihosting.cc.

References ArmSemihosting::features, and ArmISA::len.

◆ seek()

int64_t ArmSemihosting::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 ArmSemihosting::FileBase.

Definition at line 847 of file semihosting.cc.

References ArmSemihosting::features.

◆ serialize()

void ArmSemihosting::FileFeatures::serialize ( CheckpointOut cp) const
overridevirtual

Serialize an object.

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

Parameters
cpCheckpoint state

Reimplemented from ArmSemihosting::FileBase.

Definition at line 858 of file semihosting.cc.

References ArmSemihosting::FileBase::serialize(), and SERIALIZE_SCALAR.

◆ unserialize()

void ArmSemihosting::FileFeatures::unserialize ( CheckpointIn cp)
overridevirtual

Unserialize an object.

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

Parameters
cpCheckpoint state

Reimplemented from ArmSemihosting::FileBase.

Definition at line 865 of file semihosting.cc.

References ArmSemihosting::FileBase::unserialize(), and UNSERIALIZE_SCALAR.

Member Data Documentation

◆ pos

size_t ArmSemihosting::FileFeatures::pos
protected

Definition at line 374 of file semihosting.hh.


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

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