gem5  v21.1.0.2
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
gem5::ArmSemihosting Class Reference

Semihosting for AArch32 and AArch64. More...

#include <semihosting.hh>

Inheritance diagram for gem5::ArmSemihosting:
gem5::SimObject gem5::EventManager gem5::Serializable gem5::Drainable gem5::statistics::Group gem5::Named

Classes

struct  Abi32
 
struct  Abi64
 
struct  AbiBase
 
class  File
 
class  FileBase
 Internal state for open files. More...
 
class  FileFeatures
 Implementation of the ':semihosting-features' magic file. More...
 
struct  InPlaceArg
 
struct  SemiCall
 Semihosting call information structure. More...
 

Public Types

enum  { T32Imm = 0xAB, A32Imm = 0x123456, A64Imm = 0xF000, Gem5Imm = 0x5D57 }
 
enum  Operation {
  SYS_OPEN = 0x01, SYS_CLOSE = 0x02, SYS_WRITEC = 0x03, SYS_WRITE0 = 0x04,
  SYS_WRITE = 0x05, SYS_READ = 0x06, SYS_READC = 0x07, SYS_ISERROR = 0x08,
  SYS_ISTTY = 0x09, SYS_SEEK = 0x0A, SYS_FLEN = 0x0C, SYS_TMPNAM = 0x0D,
  SYS_REMOVE = 0x0E, SYS_RENAME = 0x0F, SYS_CLOCK = 0x10, SYS_TIME = 0x11,
  SYS_SYSTEM = 0x12, SYS_ERRNO = 0x13, SYS_GET_CMDLINE = 0x15, SYS_HEAPINFO = 0x16,
  SYS_EXIT = 0x18, SYS_EXIT_EXTENDED = 0x20, SYS_ELAPSED = 0x30, SYS_TICKFREQ = 0x31,
  MaxStandardOp = 0xFF, SYS_GEM5_PSEUDO_OP = 0x100
}
 
typedef std::pair< uint64_t, SemiErrnoRetErrno
 
- Public Types inherited from gem5::SimObject
typedef SimObjectParams Params
 

Public Member Functions

 ArmSemihosting (const ArmSemihostingParams &p)
 
bool call64 (ThreadContext *tc, bool gem5_ops)
 Perform an Arm Semihosting call from aarch64 code. More...
 
bool call32 (ThreadContext *tc, bool gem5_ops)
 Perform an Arm Semihosting call from aarch32 code. More...
 
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::SimObject
const Paramsparams () const
 
 SimObject (const Params &p)
 
virtual ~SimObject ()
 
virtual void init ()
 init() is called after all C++ SimObjects have been created and all ports are connected. More...
 
virtual void loadState (CheckpointIn &cp)
 loadState() is called on each SimObject when restoring from a checkpoint. More...
 
virtual void initState ()
 initState() is called on each SimObject when not restoring from a checkpoint. More...
 
virtual void regProbePoints ()
 Register probe points for this object. More...
 
virtual void regProbeListeners ()
 Register probe listeners for this object. More...
 
ProbeManagergetProbeManager ()
 Get the probe manager for this object. More...
 
virtual PortgetPort (const std::string &if_name, PortID idx=InvalidPortID)
 Get a port with a given name and index. More...
 
virtual void startup ()
 startup() is the final initialization call before simulation. More...
 
DrainState drain () override
 Provide a default implementation of the drain interface for objects that don't need draining. More...
 
virtual void memWriteback ()
 Write back dirty buffers to memory using functional writes. More...
 
virtual void memInvalidate ()
 Invalidate the contents of memory buffers. More...
 
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::EventManager
EventQueueeventQueue () const
 
void schedule (Event &event, Tick when)
 
void deschedule (Event &event)
 
void reschedule (Event &event, Tick when, bool always=false)
 
void schedule (Event *event, Tick when)
 
void deschedule (Event *event)
 
void reschedule (Event *event, Tick when, bool always=false)
 
void wakeupEventQueue (Tick when=(Tick) -1)
 This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers. More...
 
void setCurTick (Tick newVal)
 
 EventManager (EventManager &em)
 Event manger manages events in the event queue. More...
 
 EventManager (EventManager *em)
 
 EventManager (EventQueue *eq)
 
- 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)
 
- Public Member Functions inherited from gem5::Drainable
DrainState drainState () const
 Return the current drain state of an object. More...
 
virtual void notifyFork ()
 Notify a child process of a fork. More...
 
- Public Member Functions inherited from gem5::statistics::Group
 Group (Group *parent, const char *name=nullptr)
 Construct a new statistics group. More...
 
virtual ~Group ()
 
virtual void regStats ()
 Callback to set stat parameters. More...
 
virtual void resetStats ()
 Callback to reset stats. More...
 
virtual void preDumpStats ()
 Callback before stats are dumped. More...
 
void addStat (statistics::Info *info)
 Register a stat with this group. More...
 
const std::map< std::string, Group * > & getStatGroups () const
 Get all child groups associated with this object. More...
 
const std::vector< Info * > & getStats () const
 Get all stats associated with this object. More...
 
void addStatGroup (const char *name, Group *block)
 Add a stat block as a child of this block. More...
 
const InforesolveStat (std::string name) const
 Resolve a stat by its name within this group. More...
 
void mergeStatGroup (Group *block)
 Merge the contents (stats & children) of a block to this block. More...
 
 Group ()=delete
 
 Group (const Group &)=delete
 
Groupoperator= (const Group &)=delete
 
- Public Member Functions inherited from gem5::Named
 Named (const std::string &name_)
 
virtual ~Named ()=default
 
virtual std::string name () const
 

Static Public Member Functions

static PortProxyportProxy (ThreadContext *tc)
 
- Static Public Member Functions inherited from gem5::SimObject
static void serializeAll (const std::string &cpt_dir)
 Create a checkpoint by serializing all SimObjects in the system. More...
 
static SimObjectfind (const char *name)
 Find the SimObject with the given name and return a pointer to it. More...
 
static void setSimObjectResolver (SimObjectResolver *resolver)
 There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. More...
 
static SimObjectResolvergetSimObjectResolver ()
 There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. More...
 
- 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 Types

typedef uint64_t SemiErrno
 
using Handle = size_t
 

Protected Member Functions

unsigned calcTickShift () const
 
uint64_t semiTick (Tick tick) const
 
void semiExit (uint64_t code, uint64_t subcode)
 
std::string readString (ThreadContext *tc, Addr ptr, size_t len)
 
- Protected Member Functions inherited from gem5::Drainable
 Drainable ()
 
virtual ~Drainable ()
 
virtual void drainResume ()
 Resume execution after a successful drain. More...
 
void signalDrainDone () const
 Signal that an object is drained. More...
 

Protected Attributes

const std::string cmdLine
 
const Addr memReserve
 
const Addr stackSize
 
const time_t timeBase
 Base time when the simulation started. More...
 
const unsigned tickShift
 Number of bits to right shift gem5 ticks to fit in a uint32_t. More...
 
SemiErrno semiErrno
 
std::string filesRootDir
 
std::vector< std::unique_ptr< FileBase > > files
 
FILE * stdin
 
FILE * stdout
 
FILE * stderr
 
- Protected Attributes inherited from gem5::SimObject
const SimObjectParams & _params
 Cached copy of the object parameters. More...
 
- Protected Attributes inherited from gem5::EventManager
EventQueueeventq
 A pointer to this object's event queue. More...
 

Private Member Functions

RetErrno callOpen (ThreadContext *tc, const Addr name_base, int fmode, size_t name_size)
 
RetErrno callClose (ThreadContext *tc, Handle handle)
 
RetErrno callWriteC (ThreadContext *tc, InPlaceArg c)
 
RetErrno callWrite0 (ThreadContext *tc, InPlaceArg str)
 
RetErrno callWrite (ThreadContext *tc, Handle handle, Addr buffer, size_t size)
 
RetErrno callRead (ThreadContext *tc, Handle handle, Addr buffer, size_t size)
 
RetErrno callReadC (ThreadContext *tc)
 
RetErrno callIsError (ThreadContext *tc, int64_t status)
 
RetErrno callIsTTY (ThreadContext *tc, Handle handle)
 
RetErrno callSeek (ThreadContext *tc, Handle handle, uint64_t pos)
 
RetErrno callFLen (ThreadContext *tc, Handle handle)
 
RetErrno callTmpNam (ThreadContext *tc, Addr buffer, uint64_t id, size_t size)
 
RetErrno callRemove (ThreadContext *tc, Addr name_base, size_t name_size)
 
RetErrno callRename (ThreadContext *tc, Addr from_addr, size_t from_size, Addr to_addr, size_t to_size)
 
RetErrno callClock (ThreadContext *tc)
 
RetErrno callTime (ThreadContext *tc)
 
RetErrno callSystem (ThreadContext *tc, Addr cmd_addr, size_t cmd_size)
 
RetErrno callErrno (ThreadContext *tc)
 
RetErrno callGetCmdLine (ThreadContext *tc, Addr addr, InPlaceArg size_arg)
 
void gatherHeapInfo (ThreadContext *tc, bool aarch64, Addr &heap_base, Addr &heap_limit, Addr &stack_base, Addr &stack_limit)
 
RetErrno callHeapInfo32 (ThreadContext *tc, Addr block_addr)
 
RetErrno callHeapInfo64 (ThreadContext *tc, Addr block_addr)
 
RetErrno callExit32 (ThreadContext *tc, InPlaceArg code)
 
RetErrno callExit64 (ThreadContext *tc, uint64_t code, uint64_t subcode)
 
RetErrno callExitExtended (ThreadContext *tc, uint64_t code, uint64_t subcode)
 
RetErrno callElapsed32 (ThreadContext *tc, InPlaceArg low, InPlaceArg high)
 
RetErrno callElapsed64 (ThreadContext *tc, InPlaceArg ticks)
 
RetErrno callTickFreq (ThreadContext *tc)
 
RetErrno callGem5PseudoOp32 (ThreadContext *tc, uint32_t encoded_func)
 
RetErrno callGem5PseudoOp64 (ThreadContext *tc, uint64_t encoded_func)
 
template<typename Abi >
void unrecognizedCall (ThreadContext *tc, const char *format, uint64_t op)
 

Static Private Member Functions

static RetErrno retError (SemiErrno e)
 
static RetErrno retOK (uint64_t r)
 
static FILE * getSTDIO (const char *stream_name, const std::string &name, const char *mode)
 

Private Attributes

uint16_t tmpNameIndex = 0
 

Static Private Attributes

static const std::map< uint32_t, SemiCallcalls
 
static const std::vector< const char * > fmodes
 
static const std::map< uint64_t, const char * > exitCodes
 
static const std::vector< uint8_t > features
 
static const std::map< const std::string, FILE * > stdioMap
 

Detailed Description

Semihosting for AArch32 and AArch64.

This class implements the Arm semihosting interface. This interface allows baremetal code access service, such as IO, from the simulator. It is conceptually a simplified version of gem5's more general syscall emulation mode.

Exits calls (SYS_EXIT, SYS_EXIT_EXTENDED) from the guest get translated into simualtion exits. Well-known exit codes are translated to messages on the form 'semi:ADP_.*' while unknown codes are returned in hex ('semi:0x..'). The subcode is reported in the gem5 exit event.

Definition at line 76 of file semihosting.hh.

Member Typedef Documentation

◆ Handle

using gem5::ArmSemihosting::Handle = size_t
protected

Definition at line 412 of file semihosting.hh.

◆ RetErrno

Definition at line 433 of file semihosting.hh.

◆ SemiErrno

typedef uint64_t gem5::ArmSemihosting::SemiErrno
protected

Definition at line 262 of file semihosting.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
T32Imm 
A32Imm 
A64Imm 
Gem5Imm 

Definition at line 79 of file semihosting.hh.

◆ Operation

Enumerator
SYS_OPEN 
SYS_CLOSE 
SYS_WRITEC 
SYS_WRITE0 
SYS_WRITE 
SYS_READ 
SYS_READC 
SYS_ISERROR 
SYS_ISTTY 
SYS_SEEK 
SYS_FLEN 
SYS_TMPNAM 
SYS_REMOVE 
SYS_RENAME 
SYS_CLOCK 
SYS_TIME 
SYS_SYSTEM 
SYS_ERRNO 
SYS_GET_CMDLINE 
SYS_HEAPINFO 
SYS_EXIT 
SYS_EXIT_EXTENDED 
SYS_ELAPSED 
SYS_TICKFREQ 
MaxStandardOp 
SYS_GEM5_PSEUDO_OP 

Definition at line 204 of file semihosting.hh.

Constructor & Destructor Documentation

◆ ArmSemihosting()

gem5::ArmSemihosting::ArmSemihosting ( const ArmSemihostingParams &  p)

Member Function Documentation

◆ calcTickShift()

unsigned gem5::ArmSemihosting::calcTickShift ( ) const
inlineprotected

Definition at line 419 of file semihosting.hh.

References gem5::findMsbSet(), and gem5::sim_clock::Frequency.

◆ call32()

bool gem5::ArmSemihosting::call32 ( ThreadContext tc,
bool  gem5_ops 
)

◆ call64()

bool gem5::ArmSemihosting::call64 ( ThreadContext tc,
bool  gem5_ops 
)

◆ callClock()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callClock ( ThreadContext tc)
private

Definition at line 504 of file semihosting.cc.

References gem5::curTick(), retOK(), and gem5::sim_clock::as_int::s.

◆ callClose()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callClose ( ThreadContext tc,
Handle  handle 
)
private

Definition at line 315 of file semihosting.cc.

References DPRINTF, error, files, retError(), and retOK().

◆ callElapsed32()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callElapsed32 ( ThreadContext tc,
InPlaceArg  low,
InPlaceArg  high 
)
private

◆ callElapsed64()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callElapsed64 ( ThreadContext tc,
InPlaceArg  ticks 
)
private

◆ callErrno()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callErrno ( ThreadContext tc)
private

Definition at line 526 of file semihosting.cc.

References semiErrno.

◆ callExit32()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callExit32 ( ThreadContext tc,
InPlaceArg  code 
)
private

Definition at line 620 of file semihosting.cc.

References gem5::ArmSemihosting::InPlaceArg::addr, retOK(), and semiExit().

◆ callExit64()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callExit64 ( ThreadContext tc,
uint64_t  code,
uint64_t  subcode 
)
private

Definition at line 627 of file semihosting.cc.

References retOK(), and semiExit().

◆ callExitExtended()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callExitExtended ( ThreadContext tc,
uint64_t  code,
uint64_t  subcode 
)
private

Definition at line 634 of file semihosting.cc.

References retOK(), and semiExit().

◆ callFLen()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callFLen ( ThreadContext tc,
Handle  handle 
)
private

Definition at line 442 of file semihosting.cc.

References files, retError(), and retOK().

◆ callGem5PseudoOp32()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callGem5PseudoOp32 ( ThreadContext tc,
uint32_t  encoded_func 
)
private

Definition at line 726 of file semihosting.cc.

References gem5::pseudo_inst::decodeAddrOffset(), retError(), and retOK().

◆ callGem5PseudoOp64()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callGem5PseudoOp64 ( ThreadContext tc,
uint64_t  encoded_func 
)
private

Definition at line 739 of file semihosting.cc.

References gem5::pseudo_inst::decodeAddrOffset(), retError(), and retOK().

◆ callGetCmdLine()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callGetCmdLine ( ThreadContext tc,
Addr  addr,
InPlaceArg  size_arg 
)
private

◆ callHeapInfo32()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callHeapInfo32 ( ThreadContext tc,
Addr  block_addr 
)
private

◆ callHeapInfo64()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callHeapInfo64 ( ThreadContext tc,
Addr  block_addr 
)
private

◆ callIsError()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callIsError ( ThreadContext tc,
int64_t  status 
)
private

Definition at line 408 of file semihosting.cc.

References retOK(), and gem5::ArmISA::status.

◆ callIsTTY()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callIsTTY ( ThreadContext tc,
Handle  handle 
)
private

Definition at line 414 of file semihosting.cc.

References files, retError(), and retOK().

◆ callOpen()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callOpen ( ThreadContext tc,
const Addr  name_base,
int  fmode,
size_t  name_size 
)
private

◆ callRead()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callRead ( ThreadContext tc,
Handle  handle,
Addr  buffer,
size_t  size 
)
private

◆ callReadC()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callReadC ( ThreadContext tc)
private

Definition at line 402 of file semihosting.cc.

References retOK().

◆ callRemove()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callRemove ( ThreadContext tc,
Addr  name_base,
size_t  name_size 
)
private

Definition at line 478 of file semihosting.cc.

References readString(), retError(), and retOK().

◆ callRename()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callRename ( ThreadContext tc,
Addr  from_addr,
size_t  from_size,
Addr  to_addr,
size_t  to_size 
)
private

Definition at line 490 of file semihosting.cc.

References readString(), retError(), retOK(), and gem5::PowerISA::to.

◆ callSeek()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callSeek ( ThreadContext tc,
Handle  handle,
uint64_t  pos 
)
private

Definition at line 428 of file semihosting.cc.

References files, retError(), and retOK().

◆ callSystem()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callSystem ( ThreadContext tc,
Addr  cmd_addr,
size_t  cmd_size 
)
private

Definition at line 516 of file semihosting.cc.

References readString(), retError(), and warn.

◆ callTickFreq()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callTickFreq ( ThreadContext tc)
private

Definition at line 676 of file semihosting.cc.

References gem5::sim_clock::Frequency, retOK(), and semiTick().

◆ callTime()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callTime ( ThreadContext tc)
private

Definition at line 510 of file semihosting.cc.

References gem5::curTick(), retOK(), gem5::sim_clock::as_float::s, and timeBase.

◆ callTmpNam()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callTmpNam ( ThreadContext tc,
Addr  buffer,
uint64_t  id,
size_t  size 
)
private

◆ callWrite()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callWrite ( ThreadContext tc,
Handle  handle,
Addr  buffer,
size_t  size 
)
private

Definition at line 360 of file semihosting.cc.

References gem5::X86ISA::addr, files, portProxy(), and gem5::PortProxy::readBlob().

◆ callWrite0()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callWrite0 ( ThreadContext tc,
InPlaceArg  str 
)
private

◆ callWriteC()

ArmSemihosting::RetErrno gem5::ArmSemihosting::callWriteC ( ThreadContext tc,
InPlaceArg  c 
)
private

◆ gatherHeapInfo()

void gem5::ArmSemihosting::gatherHeapInfo ( ThreadContext tc,
bool  aarch64,
Addr heap_base,
Addr heap_limit,
Addr stack_base,
Addr stack_limit 
)
private

◆ getSTDIO()

FILE * gem5::ArmSemihosting::getSTDIO ( const char *  stream_name,
const std::string &  name,
const char *  mode 
)
staticprivate

Definition at line 752 of file semihosting.cc.

References gem5::ArmISA::f, fatal, gem5::ArmISA::mode, gem5::Named::name(), and stdioMap.

◆ portProxy()

PortProxy & gem5::ArmSemihosting::portProxy ( ThreadContext tc)
static

◆ readString()

std::string gem5::ArmSemihosting::readString ( ThreadContext tc,
Addr  ptr,
size_t  len 
)
protected

◆ retError()

static RetErrno gem5::ArmSemihosting::retError ( SemiErrno  e)
inlinestaticprivate

◆ retOK()

static RetErrno gem5::ArmSemihosting::retOK ( uint64_t  r)
inlinestaticprivate

◆ semiExit()

void gem5::ArmSemihosting::semiExit ( uint64_t  code,
uint64_t  subcode 
)
protected

Definition at line 642 of file semihosting.cc.

References gem5::csprintf(), exitCodes, and gem5::exitSimLoop().

Referenced by callExit32(), callExit64(), and callExitExtended().

◆ semiTick()

uint64_t gem5::ArmSemihosting::semiTick ( Tick  tick) const
inlineprotected

Definition at line 425 of file semihosting.hh.

References tickShift.

Referenced by callElapsed32(), callElapsed64(), and callTickFreq().

◆ serialize()

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

Serialize an object.

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

Parameters
cpCheckpoint state

Implements gem5::Serializable.

Definition at line 222 of file semihosting.cc.

References gem5::csprintf(), files, gem5::ArmISA::i, gem5::paramOut(), semiErrno, and SERIALIZE_SCALAR.

◆ unrecognizedCall()

template<typename Abi >
void gem5::ArmSemihosting::unrecognizedCall ( ThreadContext tc,
const char *  format,
uint64_t  op 
)
inlineprivate

Definition at line 577 of file semihosting.hh.

References gem5::ArmISA::format, gem5::X86ISA::op, retError(), and warn.

◆ unserialize()

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

Unserialize an object.

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

Parameters
cpCheckpoint state

Implements gem5::Serializable.

Definition at line 237 of file semihosting.cc.

References gem5::ArmSemihosting::FileBase::create(), gem5::csprintf(), files, gem5::ArmISA::i, gem5::paramIn(), semiErrno, and UNSERIALIZE_SCALAR.

Member Data Documentation

◆ calls

const std::map< uint32_t, ArmSemihosting::SemiCall > gem5::ArmSemihosting::calls
staticprivate

Definition at line 588 of file semihosting.hh.

Referenced by call32(), and call64().

◆ cmdLine

const std::string gem5::ArmSemihosting::cmdLine
protected

Definition at line 248 of file semihosting.hh.

Referenced by callGetCmdLine().

◆ exitCodes

const std::map< uint64_t, const char * > gem5::ArmSemihosting::exitCodes
staticprivate
Initial value:
{
{ 0x20000, "semi:ADP_Stopped_BranchThroughZero" },
{ 0x20001, "semi:ADP_Stopped_UndefinedInstr" },
{ 0x20002, "semi:ADP_Stopped_SoftwareInterrupt" },
{ 0x20003, "semi:ADP_Stopped_PrefetchAbort" },
{ 0x20004, "semi:ADP_Stopped_DataAbort" },
{ 0x20005, "semi:ADP_Stopped_AddressException" },
{ 0x20006, "semi:ADP_Stopped_IRQ" },
{ 0x20007, "semi:ADP_Stopped_FIQ" },
{ 0x20020, "semi:ADP_Stopped_BreakPoint" },
{ 0x20021, "semi:ADP_Stopped_WatchPoint" },
{ 0x20022, "semi:ADP_Stopped_StepComplete" },
{ 0x20023, "semi:ADP_Stopped_RunTimeErrorUnknown" },
{ 0x20024, "semi:ADP_Stopped_InternalError" },
{ 0x20025, "semi:ADP_Stopped_UserInterruption" },
{ 0x20026, "semi:ADP_Stopped_ApplicationExit" },
{ 0x20027, "semi:ADP_Stopped_StackOverflow" },
{ 0x20028, "semi:ADP_Stopped_DivisionByZero" },
{ 0x20029, "semi:ADP_Stopped_DivisionByZero" },
}

Definition at line 590 of file semihosting.hh.

Referenced by semiExit().

◆ features

const std::vector< uint8_t > gem5::ArmSemihosting::features
staticprivate
Initial value:
{
0x53, 0x48, 0x46, 0x42,
0x3,
}

Definition at line 591 of file semihosting.hh.

Referenced by gem5::ArmSemihosting::FileFeatures::read(), and gem5::ArmSemihosting::FileFeatures::seek().

◆ files

std::vector<std::unique_ptr<FileBase> > gem5::ArmSemihosting::files
protected

◆ filesRootDir

std::string gem5::ArmSemihosting::filesRootDir
protected

Definition at line 410 of file semihosting.hh.

Referenced by callOpen().

◆ fmodes

const std::vector< const char * > gem5::ArmSemihosting::fmodes
staticprivate
Initial value:
{
"r", "rb", "r+", "r+b",
"w", "wb", "w+", "w+b",
"a", "ab", "a+", "a+b",
}

Definition at line 589 of file semihosting.hh.

Referenced by callOpen().

◆ memReserve

const Addr gem5::ArmSemihosting::memReserve
protected

Definition at line 249 of file semihosting.hh.

Referenced by gatherHeapInfo().

◆ semiErrno

SemiErrno gem5::ArmSemihosting::semiErrno
protected

Definition at line 263 of file semihosting.hh.

Referenced by call32(), call64(), callErrno(), serialize(), and unserialize().

◆ stackSize

const Addr gem5::ArmSemihosting::stackSize
protected

Definition at line 250 of file semihosting.hh.

Referenced by gatherHeapInfo().

◆ stderr

FILE* gem5::ArmSemihosting::stderr
protected

Definition at line 415 of file semihosting.hh.

◆ stdin

FILE* gem5::ArmSemihosting::stdin
protected

Definition at line 413 of file semihosting.hh.

◆ stdioMap

const std::map< const std::string, FILE * > gem5::ArmSemihosting::stdioMap
staticprivate
Initial value:
{
{"cin", ::stdin},
{"stdin", ::stdin},
{"cout", ::stdout},
{"stdout", ::stdout},
{"cerr", ::stderr},
{"stderr", ::stderr},
}

Definition at line 592 of file semihosting.hh.

Referenced by getSTDIO().

◆ stdout

FILE* gem5::ArmSemihosting::stdout
protected

Definition at line 414 of file semihosting.hh.

◆ tickShift

const unsigned gem5::ArmSemihosting::tickShift
protected

Number of bits to right shift gem5 ticks to fit in a uint32_t.

Definition at line 259 of file semihosting.hh.

Referenced by semiTick().

◆ timeBase

const time_t gem5::ArmSemihosting::timeBase
protected

Base time when the simulation started.

This is used to calculate the time of date when the guest call SYS_TIME.

Definition at line 256 of file semihosting.hh.

Referenced by callTime().

◆ tmpNameIndex

uint16_t gem5::ArmSemihosting::tmpNameIndex = 0
private

Definition at line 595 of file semihosting.hh.

Referenced by callTmpNam().


The documentation for this class was generated from the following files:
gem5::ArmSemihosting::stderr
FILE * stderr
Definition: semihosting.hh:415
gem5::ArmSemihosting::stdout
FILE * stdout
Definition: semihosting.hh:414
gem5::ArmSemihosting::stdin
FILE * stdin
Definition: semihosting.hh:413

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