gem5  v20.1.0.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
ArmSemihosting Class Reference

Semihosting for AArch32 and AArch64. More...

#include <semihosting.hh>

Inheritance diagram for ArmSemihosting:
SimObject EventManager Serializable Drainable Stats::Group

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 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 SimObject
const Paramsparams () const
 
 SimObject (const Params *_params)
 
virtual ~SimObject ()
 
virtual const std::string name () const
 
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 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 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 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 Stats::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 (Stats::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...
 
 Group ()=delete
 
 Group (const Group &)=delete
 
Groupoperator= (const Group &)=delete
 

Static Public Member Functions

static PortProxyportProxy (ThreadContext *tc)
 
- Static Public Member Functions inherited from SimObject
static void serializeAll (CheckpointOut &cp)
 Serialize 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 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)
 

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 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 SimObject
const SimObjectParams * _params
 Cached copy of the object parameters. More...
 
- Protected Attributes inherited from 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)
 

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 72 of file semihosting.hh.

Member Typedef Documentation

◆ Handle

using ArmSemihosting::Handle = size_t
protected

Definition at line 403 of file semihosting.hh.

◆ RetErrno

Definition at line 424 of file semihosting.hh.

◆ SemiErrno

typedef uint64_t ArmSemihosting::SemiErrno
protected

Definition at line 253 of file semihosting.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
T32Imm 
A32Imm 
A64Imm 
Gem5Imm 

Definition at line 76 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 196 of file semihosting.hh.

Constructor & Destructor Documentation

◆ ArmSemihosting()

ArmSemihosting::ArmSemihosting ( const ArmSemihostingParams *  p)

Definition at line 137 of file semihosting.cc.

References mkutctime(), MipsISA::p, and ArmISA::t.

Member Function Documentation

◆ calcTickShift()

unsigned ArmSemihosting::calcTickShift ( ) const
inlineprotected

Definition at line 410 of file semihosting.hh.

References findMsbSet(), and SimClock::Frequency.

◆ call32()

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

◆ call64()

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

◆ callClock()

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

Definition at line 492 of file semihosting.cc.

References curTick(), retOK(), and SimClock::Int::s.

◆ callClose()

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

Definition at line 308 of file semihosting.cc.

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

◆ callElapsed32()

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

◆ callElapsed64()

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

◆ callErrno()

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

Definition at line 514 of file semihosting.cc.

References semiErrno.

◆ callExit32()

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

Definition at line 608 of file semihosting.cc.

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

◆ callExit64()

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

Definition at line 615 of file semihosting.cc.

References retOK(), and semiExit().

◆ callExitExtended()

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

Definition at line 622 of file semihosting.cc.

References retOK(), and semiExit().

◆ callFLen()

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

Definition at line 435 of file semihosting.cc.

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

◆ callGem5PseudoOp32()

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

Definition at line 713 of file semihosting.cc.

References PseudoInst::decodeAddrOffset(), retError(), and retOK().

◆ callGem5PseudoOp64()

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

Definition at line 726 of file semihosting.cc.

References PseudoInst::decodeAddrOffset(), retError(), and retOK().

◆ callGetCmdLine()

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

◆ callHeapInfo32()

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

◆ callHeapInfo64()

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

◆ callIsError()

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

Definition at line 401 of file semihosting.cc.

References retOK(), and ArmISA::status.

◆ callIsTTY()

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

Definition at line 407 of file semihosting.cc.

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

◆ callOpen()

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

◆ callRead()

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

Definition at line 374 of file semihosting.cc.

References addr, files, panic_if, portProxy(), retOK(), and PortProxy::writeBlob().

◆ callReadC()

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

Definition at line 395 of file semihosting.cc.

References retOK().

◆ callRemove()

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

Definition at line 466 of file semihosting.cc.

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

◆ callRename()

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

Definition at line 478 of file semihosting.cc.

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

◆ callSeek()

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

Definition at line 421 of file semihosting.cc.

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

◆ callSystem()

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

Definition at line 504 of file semihosting.cc.

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

◆ callTickFreq()

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

Definition at line 664 of file semihosting.cc.

References SimClock::Frequency, retOK(), and semiTick().

◆ callTime()

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

Definition at line 498 of file semihosting.cc.

References curTick(), retOK(), SimClock::Float::s, and timeBase.

◆ callTmpNam()

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

◆ callWrite()

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

Definition at line 353 of file semihosting.cc.

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

◆ callWrite0()

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

◆ callWriteC()

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

◆ gatherHeapInfo()

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

◆ getSTDIO()

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

Definition at line 739 of file semihosting.cc.

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

◆ portProxy()

PortProxy & ArmSemihosting::portProxy ( ThreadContext tc)
static

◆ readString()

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

Definition at line 269 of file semihosting.cc.

References ArmISA::len, portProxy(), and PortProxy::readBlob().

Referenced by callOpen(), callRemove(), callRename(), and callSystem().

◆ retError()

static RetErrno ArmSemihosting::retError ( SemiErrno  e)
inlinestaticprivate

◆ retOK()

static RetErrno ArmSemihosting::retOK ( uint64_t  r)
inlinestaticprivate

◆ semiExit()

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

Definition at line 630 of file semihosting.cc.

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

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

◆ semiTick()

uint64_t ArmSemihosting::semiTick ( Tick  tick) const
inlineprotected

Definition at line 416 of file semihosting.hh.

References tickShift.

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

◆ serialize()

void ArmSemihosting::serialize ( CheckpointOut cp) const
overridevirtual

Serialize an object.

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

Parameters
cpCheckpoint state

Implements Serializable.

Definition at line 215 of file semihosting.cc.

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

◆ unrecognizedCall()

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

Definition at line 568 of file semihosting.hh.

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

◆ unserialize()

void ArmSemihosting::unserialize ( CheckpointIn cp)
overridevirtual

Unserialize an object.

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

Parameters
cpCheckpoint state

Implements Serializable.

Definition at line 230 of file semihosting.cc.

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

Member Data Documentation

◆ calls

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

Definition at line 579 of file semihosting.hh.

Referenced by call32(), and call64().

◆ cmdLine

const std::string ArmSemihosting::cmdLine
protected

Definition at line 239 of file semihosting.hh.

Referenced by callGetCmdLine().

◆ exitCodes

const std::map< uint64_t, const char * > 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 581 of file semihosting.hh.

Referenced by semiExit().

◆ features

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

Definition at line 582 of file semihosting.hh.

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

◆ files

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

◆ filesRootDir

std::string ArmSemihosting::filesRootDir
protected

Definition at line 401 of file semihosting.hh.

Referenced by callOpen().

◆ fmodes

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

Definition at line 580 of file semihosting.hh.

Referenced by callOpen().

◆ memReserve

const Addr ArmSemihosting::memReserve
protected

Definition at line 240 of file semihosting.hh.

Referenced by gatherHeapInfo().

◆ semiErrno

SemiErrno ArmSemihosting::semiErrno
protected

Definition at line 254 of file semihosting.hh.

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

◆ stackSize

const Addr ArmSemihosting::stackSize
protected

Definition at line 241 of file semihosting.hh.

Referenced by gatherHeapInfo().

◆ stderr

FILE* ArmSemihosting::stderr
protected

Definition at line 406 of file semihosting.hh.

◆ stdin

FILE* ArmSemihosting::stdin
protected

Definition at line 404 of file semihosting.hh.

◆ stdioMap

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

Definition at line 583 of file semihosting.hh.

Referenced by getSTDIO().

◆ stdout

FILE* ArmSemihosting::stdout
protected

Definition at line 405 of file semihosting.hh.

◆ tickShift

const unsigned ArmSemihosting::tickShift
protected

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

Definition at line 250 of file semihosting.hh.

Referenced by semiTick().

◆ timeBase

const time_t 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 247 of file semihosting.hh.

Referenced by callTime().


The documentation for this class was generated from the following files:
ArmSemihosting::stderr
FILE * stderr
Definition: semihosting.hh:406
ArmSemihosting::stdout
FILE * stdout
Definition: semihosting.hh:405
ArmSemihosting::stdin
FILE * stdin
Definition: semihosting.hh:404

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