gem5 v24.0.0.0
|
#include <semihosting.hh>
Public Member Functions | |
File (BaseSemihosting &_parent, const char *name, const char *mode) | |
~File () | |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. | |
int64_t | open () override |
Open the the file. | |
int64_t | close () override |
Close the file. | |
bool | isTTY () const override |
Check if a file corresponds to a TTY device. | |
int64_t | read (uint8_t *buffer, uint64_t size) override |
Read data from file. | |
int64_t | write (const uint8_t *buffer, uint64_t size) override |
Write data to 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 | |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. | |
const std::string & | fileName () |
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 Member Functions | |
int64_t | openImpl (bool unserialize) |
bool | needClose () const |
Protected Attributes | |
FILE * | file |
Protected Attributes inherited from gem5::BaseSemihosting::FileBase | |
BaseSemihosting & | parent |
std::string | _name |
std::string | mode |
Additional Inherited Members | |
Static Public Member Functions inherited from gem5::BaseSemihosting::FileBase | |
static std::unique_ptr< FileBase > | create (BaseSemihosting &parent, const std::string &fname, const char *mode) |
static std::unique_ptr< FileBase > | create (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. | |
Definition at line 333 of file semihosting.hh.
gem5::BaseSemihosting::File::File | ( | BaseSemihosting & | _parent, |
const char * | name, | ||
const char * | mode ) |
Definition at line 719 of file semihosting.cc.
gem5::BaseSemihosting::File::~File | ( | ) |
Definition at line 724 of file semihosting.cc.
|
overridevirtual |
Close the file.
Reimplemented from gem5::BaseSemihosting::FileBase.
Definition at line 761 of file semihosting.cc.
References panic_if.
|
overridevirtual |
Get the length of a file in bytes.
Reimplemented from gem5::BaseSemihosting::FileBase.
Definition at line 823 of file semihosting.cc.
References gem5::ArmISA::len.
|
overridevirtual |
Check if a file corresponds to a TTY device.
Reimplemented from gem5::BaseSemihosting::FileBase.
Definition at line 774 of file semihosting.cc.
Referenced by needClose().
|
inlineprotected |
Definition at line 357 of file semihosting.hh.
References isTTY().
|
inlineoverridevirtual |
Open the the file.
Semihosting file IO interfaces
These interfaces implement common IO functionality in the Semihosting interface.
All functions return a negative value that corresponds to a UNIX errno value when they fail and >=0 on success.
Reimplemented from gem5::BaseSemihosting::FileBase.
Definition at line 343 of file semihosting.hh.
References openImpl().
|
protected |
Definition at line 732 of file semihosting.cc.
References gem5::Named::_name, gem5::ArmISA::mode, panic_if, and warn.
Referenced by open().
|
overridevirtual |
Read data from file.
Reimplemented from gem5::BaseSemihosting::FileBase.
Definition at line 781 of file semihosting.cc.
References panic_if.
|
overridevirtual |
Seek to an absolute position in the file.
pos | Byte offset from start of file. |
Reimplemented from gem5::BaseSemihosting::FileBase.
Definition at line 811 of file semihosting.cc.
References panic_if.
|
overridevirtual |
Serialize an object.
Output an object's state into the current checkpoint section.
cp | Checkpoint state |
Implements gem5::Serializable.
Definition at line 844 of file semihosting.cc.
References panic_if, gem5::BaseSemihosting::FileBase::serialize(), and SERIALIZE_SCALAR.
|
overridevirtual |
Unserialize an object.
Read an object's state from the current checkpoint section.
cp | Checkpoint state |
Implements gem5::Serializable.
Definition at line 856 of file semihosting.cc.
References gem5::Named::_name, fatal, gem5::BaseSemihosting::FileBase::unserialize(), and UNSERIALIZE_SCALAR.
|
overridevirtual |
Write data to file.
Reimplemented from gem5::BaseSemihosting::FileBase.
Definition at line 796 of file semihosting.cc.
References panic_if.
|
protected |
Definition at line 362 of file semihosting.hh.