38#ifndef __ARCH_ARM_SEMIHOSTING_HH__
39#define __ARCH_ARM_SEMIHOSTING_HH__
61struct ArmSemihostingParams;
167 static const std::map<uint32_t, SemiCall>
calls;
173template <
typename Arg>
175 typename std::enable_if_t<
176 (std::is_integral_v<Arg> ||
177 std::is_same<Arg,pseudo_inst::GuestAddr>::value)>>
182 return (Arg)state.
get(tc);
186template <
typename Arg>
188 typename std::enable_if_t<
189 (std::is_integral_v<Arg> ||
190 std::is_same<Arg,pseudo_inst::GuestAddr>::value)>>
195 if (std::is_signed_v<Arg>) {
199 return (Arg)state.
get(tc);
204template <
typename Abi>
206 std::is_base_of_v<ArmSemihosting::AbiBase, Abi>>>
212 state.getAddr(),
sizeof(
typename Abi::State::ArgType));
State(const ThreadContext *tc)
State(const ThreadContext *tc)
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.
ByteOrder byteOrder(ThreadContext *tc) const override
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)
PortProxy & portProxy(ThreadContext *tc) const override
Arg get(ThreadContext *tc)
StateBase(const ThreadContext *tc, Addr arg_pointer, std::function< ByteOrder(const ThreadContext *tc)> getByteOrder)
std::pair< uint64_t, SemiErrno > RetErrno
BaseSemihosting(const BaseSemihostingParams &p)
This object is a proxy for a port or other object which implements the functional response protocol,...
Base class for serial devices such as terminals.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual void setReg(const RegId ®, RegVal val)
constexpr uint64_t sext(uint64_t val)
Sign-extend an N-bit value to 64 bits.
ByteOrder byteOrder(const ThreadContext *tc)
Copyright (c) 2024 Arm Limited All rights reserved.
PortProxy Object Declaration.
Semihosting call information structure.
static ArmSemihosting::InPlaceArg get(ThreadContext *tc, typename Abi::State &state)
static Arg get(ThreadContext *tc, ArmSemihosting::Abi32::State &state)
static Arg get(ThreadContext *tc, ArmSemihosting::Abi64::State &state)
static void store(ThreadContext *tc, const ArmSemihosting::RetErrno &err)
static void store(ThreadContext *tc, const ArmSemihosting::RetErrno &err)