|
gem5
v19.0.0.0
|
#include <semihosting.hh>
Public Member Functions | |
| File (ArmSemihosting &_parent, const char *name, const char *mode) | |
| ~File () | |
| void | serialize (CheckpointOut &cp) const override |
| Serialize an object. More... | |
| void | unserialize (CheckpointIn &cp) override |
| Unserialize an object. More... | |
| int64_t | open () override |
| Open the the file. More... | |
| int64_t | close () override |
| Close the file. More... | |
| bool | isTTY () const override |
| Check if a file corresponds to a TTY device. More... | |
| int64_t | read (uint8_t *buffer, uint64_t size) override |
| Read data from file. More... | |
| int64_t | write (const uint8_t *buffer, uint64_t size) override |
| Write data to file. More... | |
| int64_t | seek (uint64_t pos) override |
| Seek to an absolute position in the file. More... | |
| int64_t | flen () override |
| Get the length of a file in bytes. 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 () |
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 Member Functions | |
| int64_t | openImpl (bool unserialize) |
| bool | needClose () const |
Protected Attributes | |
| FILE * | file |
Protected Attributes inherited from ArmSemihosting::FileBase | |
| ArmSemihosting & | parent |
| std::string | _name |
| std::string | mode |
Additional Inherited Members | |
Static Public Member Functions inherited from ArmSemihosting::FileBase | |
| static std::unique_ptr< FileBase > | create (ArmSemihosting &parent, const std::string &fname, const char *mode) |
| static std::unique_ptr< FileBase > | create (ArmSemihosting &parent, CheckpointIn &cp, const std::string &sec) |
Static Public Member Functions inherited from Serializable | |
| static const std::string & | currentSection () |
| Get the fully-qualified name of the active section. More... | |
| static void | serializeAll (const std::string &cpt_dir) |
| static void | unserializeGlobals (CheckpointIn &cp) |
Static Public Attributes inherited from Serializable | |
| static int | ckptCount = 0 |
| static int | ckptMaxCount = 0 |
| static int | ckptPrevCount = -1 |
Definition at line 222 of file semihosting.hh.
| ArmSemihosting::File::File | ( | ArmSemihosting & | _parent, |
| const char * | name, | ||
| const char * | mode | ||
| ) |
Definition at line 834 of file semihosting.cc.
| ArmSemihosting::File::~File | ( | ) |
Definition at line 841 of file semihosting.cc.
|
overridevirtual |
Close the file.
Reimplemented from ArmSemihosting::FileBase.
Definition at line 877 of file semihosting.cc.
References file, needClose(), and panic_if.
Referenced by ~File().
|
overridevirtual |
Get the length of a file in bytes.
Reimplemented from ArmSemihosting::FileBase.
Definition at line 941 of file semihosting.cc.
References file, and ArmISA::len.
|
overridevirtual |
Check if a file corresponds to a TTY device.
Reimplemented from ArmSemihosting::FileBase.
Definition at line 890 of file semihosting.cc.
References file, ArmSemihosting::FileBase::parent, ArmSemihosting::stderr, ArmSemihosting::stdin, and ArmSemihosting::stdout.
Referenced by serialize(), and unserialize().
|
inlineprotected |
Definition at line 241 of file semihosting.hh.
References ArmSemihosting::FileBase::isTTY().
Referenced by close().
|
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 ArmSemihosting::FileBase.
Definition at line 231 of file semihosting.hh.
References ArmSemihosting::FileBase::close(), ArmSemihosting::FileBase::flen(), ArmSemihosting::FileBase::isTTY(), ArmSemihosting::FileBase::read(), ArmSemihosting::FileBase::seek(), and ArmSemihosting::FileBase::write().
|
protected |
Definition at line 848 of file semihosting.cc.
References ArmSemihosting::FileBase::_name, file, ArmSemihosting::FileBase::mode, panic_if, ArmSemihosting::FileBase::parent, ArmSemihosting::stderr, ArmSemihosting::stdin, ArmSemihosting::stdout, and warn.
Referenced by unserialize().
|
overridevirtual |
Read data from file.
Reimplemented from ArmSemihosting::FileBase.
Definition at line 898 of file semihosting.cc.
|
overridevirtual |
Seek to an absolute position in the file.
| pos | Byte offset from start of file. |
Reimplemented from ArmSemihosting::FileBase.
Definition at line 929 of file semihosting.cc.
|
overridevirtual |
Serialize an object.
Output an object's state into the current checkpoint section.
| cp | Checkpoint state |
Reimplemented from ArmSemihosting::FileBase.
Definition at line 963 of file semihosting.cc.
References file, isTTY(), panic_if, ArmSemihosting::FileBase::serialize(), and SERIALIZE_SCALAR.
|
overridevirtual |
Unserialize an object.
Read an object's state from the current checkpoint section.
| cp | Checkpoint state |
Reimplemented from ArmSemihosting::FileBase.
Definition at line 975 of file semihosting.cc.
References ArmSemihosting::FileBase::_name, ArmSemihosting::ArmSemihosting(), fatal, file, isTTY(), openImpl(), ArmSemihosting::FileBase::unserialize(), and UNSERIALIZE_SCALAR.
|
overridevirtual |
Write data to file.
Reimplemented from ArmSemihosting::FileBase.
Definition at line 913 of file semihosting.cc.
|
protected |
Definition at line 243 of file semihosting.hh.
Referenced by close(), flen(), isTTY(), openImpl(), read(), seek(), serialize(), unserialize(), write(), and ~File().