38#ifndef __ARCH_ARM_SEMIHOSTING_HH__
39#define __ARCH_ARM_SEMIHOSTING_HH__
61struct ArmSemihostingParams;
101 tc->getReg(ArmISA::int_reg::X1), &ArmISA::
byteOrder)
117 tc->getReg(ArmISA::int_reg::R1), &ArmISA::
byteOrder)
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
Semihosting for AArch32, AArch64, RISCV-32 and RISCV-64: https://github.com/ARM-software/abi-aa/blob/...
This object is a proxy for a port or other object which implements the functional response protocol,...
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 - Pranith Kumar Copyright (c) 2020 Inria 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)