48#include "debug/Semihosting.hh"
53#include "params/ArmSemihosting.hh"
108 tc,
"Gem5 semihosting op (0x%x) disabled from here.",
op);
113 if (it ==
calls.end()) {
115 tc,
"Unknown aarch64 semihosting call: op = 0x%x",
op);
120 DPRINTF(Semihosting,
"Semihosting call64: %s\n", call.dump64(tc));
121 auto err = call.call64(
this, tc);
123 DPRINTF(Semihosting,
"\t ->: 0x%x, %i\n",
err.first,
err.second);
134 tc,
"Gem5 semihosting op (0x%x) disabled from here.",
op);
139 if (it ==
calls.end()) {
141 tc,
"Unknown aarch32 semihosting call: op = 0x%x",
op);
146 DPRINTF(Semihosting,
"Semihosting call32: %s\n", call.dump32(tc));
147 auto err = call.call32(
this, tc);
149 DPRINTF(Semihosting,
"\t ->: 0x%x, %i\n",
err.first,
err.second);
157 static std::unique_ptr<PortProxy> port_proxy_s;
158 static std::unique_ptr<PortProxy> port_proxy_ns;
159 static System *secure_sys =
nullptr;
163 if (sys != secure_sys) {
175 return *port_proxy_s;
177 if (!port_proxy_ns) {
185 return *port_proxy_ns;
222 public Argument<ArmSemihosting::Abi32, T>
226 public Argument<ArmSemihosting::Abi64, T>
Semihosting for AArch32 and AArch64.
static const std::map< uint32_t, SemiCall > calls
bool call32(ThreadContext *tc, bool gem5_ops)
Perform an Arm Semihosting call from aarch32 code.
static PortProxy & portProxyImpl(ThreadContext *tc)
bool call64(ThreadContext *tc, bool gem5_ops)
Perform an Arm Semihosting call from aarch64 code.
SemiCallBase< ArmSemihosting, Abi32, Abi64 > SemiCall
RetErrno callGem5PseudoOp32(ThreadContext *tc, uint32_t encoded_func)
ArmSemihosting(const ArmSemihostingParams &p)
RetErrno callGem5PseudoOp64(ThreadContext *tc, uint64_t encoded_func)
Semihosting for AArch32, AArch64, RISCV-32 and RISCV-64: https://github.com/ARM-software/abi-aa/blob/...
RetErrno callReadC(ThreadContext *tc)
RetErrno callElapsed32(ThreadContext *tc, InPlaceArg low, InPlaceArg high)
RetErrno callExit64(ThreadContext *tc, uint64_t code, uint64_t subcode)
RetErrno callFLen(ThreadContext *tc, Handle handle)
void unrecognizedCall(ThreadContext *tc, const char *format, uint64_t op)
RetErrno callTickFreq(ThreadContext *tc)
RetErrno callRename(ThreadContext *tc, Addr from_addr, size_t from_size, Addr to_addr, size_t to_size)
RetErrno callExitExtended(ThreadContext *tc, uint64_t code, uint64_t subcode)
RetErrno callTmpNam(ThreadContext *tc, Addr buffer, uint64_t id, size_t size)
RetErrno callSeek(ThreadContext *tc, Handle handle, uint64_t pos)
RetErrno callSystem(ThreadContext *tc, Addr cmd_addr, size_t cmd_size)
RetErrno callWrite(ThreadContext *tc, Handle handle, Addr buffer, size_t size)
RetErrno callOpen(ThreadContext *tc, const Addr name_base, int fmode, size_t name_size)
static RetErrno retError(SemiErrno e)
RetErrno callIsError(ThreadContext *tc, int64_t status)
RetErrno callElapsed64(ThreadContext *tc, InPlaceArg ticks)
RetErrno callRead(ThreadContext *tc, Handle handle, Addr buffer, size_t size)
RetErrno callExit32(ThreadContext *tc, InPlaceArg code)
static RetErrno retOK(uint64_t r)
RetErrno callGetCmdLine(ThreadContext *tc, Addr addr, InPlaceArg size_arg)
RetErrno callHeapInfo32(ThreadContext *tc, Addr block_addr)
RetErrno callClock(ThreadContext *tc)
RetErrno callRemove(ThreadContext *tc, Addr name_base, size_t name_size)
RetErrno callHeapInfo64(ThreadContext *tc, Addr block_addr)
RetErrno callIsTTY(ThreadContext *tc, Handle handle)
RetErrno callWriteC(ThreadContext *tc, InPlaceArg c)
RetErrno callErrno(ThreadContext *tc)
RetErrno callTime(ThreadContext *tc)
RetErrno callWrite0(ThreadContext *tc, InPlaceArg str)
RetErrno callClose(ThreadContext *tc, Handle handle)
This object is a proxy for a port or other object which implements the functional response protocol,...
@ SECURE
The request targets the secure memory space.
State(const ThreadContext *tc)
State(const ThreadContext *tc)
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual RegVal getReg(const RegId ®) const
virtual System * getSystemPtr()=0
This proxy attempts to translate virtual addresses using the TLBs.
bool isSecure(ThreadContext *tc)
static void decodeAddrOffset(Addr offset, uint8_t &func)
bool pseudoInst(ThreadContext *tc, uint8_t func, uint64_t &result)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.