gem5  v22.1.0.0
Classes | Typedefs | Functions | Variables
gem5::guest_abi Namespace Reference

Classes

struct  IsAapcs32Composite
 
struct  IsAapcs32Composite< T, typename std::enable_if_t<(std::is_array_v< T >||std::is_class_v< T >||std::is_union_v< T >) &&!IsVarArgsV< T > > >
 
struct  IsAapcs32HomogeneousAggregate
 
struct  IsAapcs32HomogeneousAggregate< E[N]>
 
struct  Aapcs32ArgumentBase
 
struct  Result< Aapcs32, Integer, typename std::enable_if_t< std::is_integral_v< Integer > &&(sizeof(Integer)< sizeof(uint32_t))> >
 
struct  Result< Aapcs32, Integer, typename std::enable_if_t< std::is_integral_v< Integer > &&(sizeof(Integer)==sizeof(uint32_t))> >
 
struct  Result< Aapcs32, Integer, typename std::enable_if_t< std::is_integral_v< Integer > &&(sizeof(Integer)==sizeof(uint64_t))> >
 
struct  Argument< Aapcs32, Integer, typename std::enable_if_t< std::is_integral_v< Integer > &&(sizeof(Integer)<=sizeof(uint32_t)) > >
 
struct  Argument< Aapcs32, Integer, typename std::enable_if_t< std::is_integral_v< Integer > &&(sizeof(Integer) > sizeof(uint32_t)) > >
 
struct  Result< Aapcs32, Float, typename std::enable_if_t< std::is_floating_point_v< Float > > >
 
struct  Argument< Aapcs32, Float, typename std::enable_if_t< std::is_floating_point_v< Float > > >
 
struct  Result< Aapcs32, Composite, typename std::enable_if_t< IsAapcs32CompositeV< Composite > > >
 
struct  Argument< Aapcs32, Composite, typename std::enable_if_t< IsAapcs32CompositeV< Composite > > >
 
struct  Result< Aapcs32Vfp, Integer, typename std::enable_if_t< std::is_integral_v< Integer > > >
 
struct  Argument< Aapcs32Vfp, Integer, typename std::enable_if_t< std::is_integral_v< Integer > > >
 
struct  Result< Aapcs32Vfp, Float, typename std::enable_if_t< std::is_floating_point_v< Float > > >
 
struct  Argument< Aapcs32Vfp, Float, typename std::enable_if_t< std::is_floating_point_v< Float > > >
 
struct  Result< Aapcs32Vfp, Composite, typename std::enable_if_t< IsAapcs32CompositeV< Composite > &&!IsAapcs32HomogeneousAggregateV< Composite > > >
 
struct  Argument< Aapcs32Vfp, Composite, typename std::enable_if_t< IsAapcs32CompositeV< Composite > &&!IsAapcs32HomogeneousAggregateV< Composite > > >
 
struct  Aapcs32ArrayType
 
struct  Aapcs32ArrayType< E[N]>
 
struct  Argument< Aapcs32Vfp, HA, typename std::enable_if_t< IsAapcs32HomogeneousAggregateV< HA > > >
 
struct  Result< Aapcs32Vfp, HA, typename std::enable_if_t< IsAapcs32HomogeneousAggregateV< HA > > >
 
struct  Argument< Aapcs32Vfp, VarArgs< Types... > >
 
struct  IsAapcs64ShortVector
 
struct  IsAapcs64ShortVector< E[N], typename std::enable_if_t<(std::is_integral_v< E >||std::is_floating_point_v< E >) &&(sizeof(E) *N==8||sizeof(E) *N==16)> >
 
struct  IsAapcs64Composite
 
struct  IsAapcs64Composite< T, typename std::enable_if_t<(std::is_array_v< T >||std::is_class_v< T >||std::is_union_v< T >) &&!IsVarArgsV< T > &&!IsAapcs64ShortVectorV< T > > >
 
struct  IsAapcs64Hfa
 
struct  Argument< Aapcs64, Integer, typename std::enable_if_t< std::is_integral_v< Integer > &&(sizeof(Integer)<=8)> >
 
struct  Argument< Aapcs64, Integer, typename std::enable_if_t< std::is_integral_v< Integer > &&(sizeof(Integer) > 8)> >
 
struct  Result< Aapcs64, Integer, typename std::enable_if_t< std::is_integral_v< Integer > &&(sizeof(Integer)<=8)> >
 
struct  Result< Aapcs64, Integer, typename std::enable_if_t< std::is_integral_v< Integer > &&(sizeof(Integer) > 8)> >
 
struct  Aapcs64ArrayType
 
struct  Aapcs64ArrayType< E[N]>
 
struct  Argument< Aapcs64, HA, typename std::enable_if_t< IsAapcs64HxaV< HA > > >
 
struct  Result< Aapcs64, HA, typename std::enable_if_t< IsAapcs64HxaV< HA > > >
 
struct  Argument< Aapcs64, Composite, typename std::enable_if_t< IsAapcs64CompositeV< Composite > &&!IsAapcs64HxaV< Composite > > >
 
struct  Result< Aapcs64, Composite, typename std::enable_if_t< IsAapcs64CompositeV< Composite > &&!IsAapcs64HxaV< Composite > > >
 
struct  Result< ABI, SyscallReturn, typename std::enable_if_t< std::is_base_of_v< ArmISA::EmuFreebsd::BaseSyscallABI, ABI > > >
 
struct  Result< ABI, SyscallReturn, typename std::enable_if_t< std::is_base_of_v< ArmISA::EmuLinux::BaseSyscallABI, ABI > > >
 
struct  Argument< ABI, Arg, typename std::enable_if_t< std::is_base_of_v< ArmISA::RegABI32, ABI > &&std::is_integral_v< Arg > &&ABI::template IsWideV< Arg > > >
 
struct  Argument< SemiPseudoAbi32, T >
 
struct  Argument< SemiPseudoAbi64, T >
 
struct  Argument< ArmSemihosting::Abi64, Arg, typename std::enable_if_t< std::is_integral_v< Arg > > >
 
struct  Argument< ArmSemihosting::Abi32, Arg, typename std::enable_if_t< std::is_integral_v< Arg > > >
 
struct  Argument< Abi, ArmSemihosting::InPlaceArg, typename std::enable_if_t< std::is_base_of_v< ArmSemihosting::AbiBase, Abi > > >
 
struct  Result< ArmSemihosting::Abi32, ArmSemihosting::RetErrno >
 
struct  Result< ArmSemihosting::Abi64, ArmSemihosting::RetErrno >
 
struct  Result< MipsISA::SEWorkload::SyscallABI, SyscallReturn >
 
struct  Result< PowerISA::SEWorkload::SyscallABI, SyscallReturn >
 
struct  Result< RiscvISA::SEWorkload::SyscallABI, SyscallReturn >
 
struct  Result< SparcPseudoInstABI, T >
 
struct  Argument< SparcPseudoInstABI, uint64_t >
 
struct  Result< ABI, SyscallReturn, typename std::enable_if_t< std::is_base_of_v< SparcISA::SEWorkload::BaseSyscallABI, ABI > > >
 
struct  Argument< SparcISA::SEWorkload::SyscallABI32, Arg, typename std::enable_if_t< std::is_integral_v< Arg > &&SparcISA::SEWorkload::SyscallABI32::IsWideV< Arg > > >
 
struct  Result< ABI, SyscallReturn, typename std::enable_if_t< std::is_base_of_v< X86Linux::SyscallABI, ABI > > >
 
struct  Argument< X86ISA::EmuLinux::SyscallABI32, Arg, typename std::enable_if_t< std::is_integral_v< Arg > &&X86ISA::EmuLinux::SyscallABI32::IsWideV< Arg > > >
 
struct  Result< X86PseudoInstABI, T >
 
struct  Argument< X86PseudoInstABI, uint64_t >
 
struct  Result
 
struct  Result< ABI, void >
 
struct  Argument
 
struct  StateInitializer
 
struct  StateInitializer< ABI, typename std::enable_if_t< std::is_constructible_v< typename ABI::State, const ThreadContext * > > >
 
struct  Preparer
 
struct  Preparer< ABI, Role, Type, decltype((void)&Role< ABI, Type >::prepare)>
 
struct  ResultStorer
 
struct  ResultStorer< ABI, Ret, typename std::enable_if_t< std::is_same_v< void(*)(ThreadContext *, const Ret &, typename ABI::State &), decltype(&Result< ABI, Ret >::store)> > >
 
class  VarArgsBase
 
class  VarArgsBase< First, Types... >
 
class  VarArgsBase<>
 
class  VarArgsImpl
 
class  VarArgsImpl< ABI, Base, First, Types... >
 
class  VarArgsImpl< ABI, Base >
 
class  VarArgs
 
struct  IsVarArgs
 
struct  IsVarArgs< VarArgs< Types... > >
 
struct  Argument< ABI, VarArgs< Types... > >
 
struct  Argument< TestABI_1D, int >
 
struct  Argument< TestABI_1D, Arg, typename std::enable_if_t< std::is_floating_point_v< Arg > > >
 
struct  Result< TestABI_1D, int >
 
struct  Result< TestABI_1D, Ret, typename std::enable_if_t< std::is_floating_point_v< Ret > > >
 
struct  Argument< TestABI_Prepare, int >
 
struct  Result< TestABI_Prepare, Ret >
 
struct  Argument< TestABI_2D, int >
 
struct  Argument< TestABI_2D, Arg, typename std::enable_if_t< std::is_floating_point_v< Arg > > >
 
struct  Result< TestABI_2D, int >
 
struct  Result< TestABI_2D, Ret, typename std::enable_if_t< std::is_floating_point_v< Ret > > >
 
struct  Argument< TestABI_TcInit, int >
 
struct  Argument< ABI, ProxyPtr< T, Proxy > >
 
struct  Argument< ABI, ConstProxyPtr< T, Proxy > >
 
struct  Argument< TestABI, Addr >
 
struct  Argument< ABI, Arg, typename std::enable_if_t< std::is_base_of_v< GenericSyscallABI64, ABI > &&std::is_integral_v< Arg > > >
 
struct  Argument< ABI, Arg, typename std::enable_if_t< std::is_integral_v< Arg > &&!ABI::template IsWideV< Arg > > >
 

Typedefs

template<typename T , std::size_t count, typename Enabled = void>
using Aapcs32HomogeneousAggregate = T[count]
 

Functions

template<typename E , size_t N>
struct IsAapcs64Hfa< E[N], typename std::enable_if_t< std::is_floating_point_v< E > &&N<=4 > > :public std::true_type{};template< typename T >constexpr bool IsAapcs64HfaV=IsAapcs64Hfa< T >::value;template< typename T, typename Enabled=void >struct IsAapcs64Hva :public std::false_type {};template< typename E, size_t N >struct IsAapcs64Hva< E[N], typename std::enable_if_t< IsAapcs64ShortVectorV< E > &&N<=4 > > :public std::true_type{};template< typename T >constexpr bool IsAapcs64HvaV=IsAapcs64Hva< T >::value;template< typename T, typename Enabled=void >struct IsAapcs64Hxa :public std::false_type {};template< typename T >struct IsAapcs64Hxa< T, typename std::enable_if_t< IsAapcs64HfaV< T >||IsAapcs64HvaV< T > > > :public std::true_type{};template< typename T >constexpr bool IsAapcs64HxaV=IsAapcs64Hxa< T >::value;struct Aapcs64ArgumentBase{ template< typename T > static T loadFromStack(ThreadContext *tc, Aapcs64::State &state) { size_t align=std::max< size_t >(8, alignof(T));size_t size=roundUp(sizeof(T), 8);state.nsaa=roundUp(state.nsaa, align);ConstVPtr< T > val(state.nsaa, tc);state.nsaa+=size;return gtoh(*val, ArmISA::byteOrder(tc));}};template< typename Float >struct Argument< Aapcs64, Float, typename std::enable_if_t< std::is_floating_point_v< Float >||IsAapcs64ShortVectorV< Float > > > :public Aapcs64ArgumentBase{ static Float get(ThreadContext *tc, Aapcs64::State &state) { if(state.nsrn<=state.MAX_SRN) { RegId id=ArmISA::vecRegClass[state.nsrn++];ArmISA::VecRegContainer vc;tc->getReg(id, &vc);return vc.as< Float >()[0];} return loadFromStack< Float >(tc, state);}};template< typename Float >struct Result< Aapcs64, Float, typename std::enable_if_t< std::is_floating_point_v< Float >||IsAapcs64ShortVectorV< Float > > >{ static void store(ThreadContext *tc, const Float &f) { RegId id=ArmISA::vecRegClass[0];ArmISA::VecRegContainer reg;tc-> getReg (id, &reg)
 
reg as< Float > ()[0]
 
tc setReg (id, &reg)
 
template<typename ABI , typename Ret , bool store_ret, typename Target , typename State , typename Args , std::size_t... I>
static std::enable_if_t<!store_ret, Ret > callFromHelper (Target &target, ThreadContext *tc, State &state, Args &&args, std::index_sequence< I... >)
 
template<typename ABI , typename Ret , bool store_ret, typename Target , typename State , typename Args , std::size_t... I>
static std::enable_if_t< store_ret, Ret > callFromHelper (Target &target, ThreadContext *tc, State &state, Args &&args, std::index_sequence< I... >)
 
template<typename ABI , typename Ret , bool store_ret, typename ... Args>
static Ret callFrom (ThreadContext *tc, typename ABI::State &state, std::function< Ret(ThreadContext *, Args...)> target)
 
template<typename ABI , typename Ret , typename ... Args>
static void dumpArgsFrom (std::ostream &os, [[maybe_unused]] ThreadContext *tc, typename ABI::State &state)
 
template<typename ABI >
static ABI::State initializeState (const ThreadContext *tc)
 
template<typename ABI , typename Ret , typename Enabled = void>
static void prepareForResult (ThreadContext *tc, typename ABI::State &state)
 
template<typename ABI , typename ... Args>
static void prepareForArguments ([[maybe_unused]] ThreadContext *tc, typename ABI::State &state)
 
template<typename ABI , typename Ret , typename ... Args>
static void prepareForFunction (ThreadContext *tc, typename ABI::State &state)
 
template<typename ABI , typename Ret >
static void storeResult (ThreadContext *tc, const Ret &ret, typename ABI::State &state)
 
template<typename ABI , typename Arg >
static Arg getArgument (ThreadContext *tc, typename ABI::State &state)
 
template<typename ... Types>
std::ostream & operator<< (std::ostream &os, const VarArgs< Types... > &va)
 

Variables

template<typename T >
constexpr bool IsAapcs32CompositeV = IsAapcs32Composite<T>::value
 
template<typename T >
constexpr bool IsAapcs32HomogeneousAggregateV
 
template<typename T >
constexpr bool IsAapcs64ShortVectorV = IsAapcs64ShortVector<T>::value
 
template<typename T >
constexpr bool IsAapcs64CompositeV = IsAapcs64Composite<T>::value
 
template<typename T >
constexpr bool IsVarArgsV = IsVarArgs<T>::value
 

Typedef Documentation

◆ Aapcs32HomogeneousAggregate

template<typename T , std::size_t count, typename Enabled = void>
using gem5::guest_abi::Aapcs32HomogeneousAggregate = typedef T[count]

Definition at line 101 of file aapcs32.hh.

Function Documentation

◆ as< Float >()

reg gem5::guest_abi::as< Float > ( )

◆ callFrom()

template<typename ABI , typename Ret , bool store_ret, typename ... Args>
static Ret gem5::guest_abi::callFrom ( ThreadContext tc,
typename ABI::State &  state,
std::function< Ret(ThreadContext *, Args...)>  target 
)
inlinestatic

Definition at line 82 of file dispatch.hh.

References state.

Referenced by gem5::invokeSimcall().

◆ callFromHelper() [1/2]

template<typename ABI , typename Ret , bool store_ret, typename Target , typename State , typename Args , std::size_t... I>
static std::enable_if_t<!store_ret, Ret> gem5::guest_abi::callFromHelper ( Target &  target,
ThreadContext tc,
State &  state,
Args &&  args,
std::index_sequence< I... >   
)
inlinestatic

Definition at line 63 of file dispatch.hh.

◆ callFromHelper() [2/2]

template<typename ABI , typename Ret , bool store_ret, typename Target , typename State , typename Args , std::size_t... I>
static std::enable_if_t<store_ret, Ret> gem5::guest_abi::callFromHelper ( Target &  target,
ThreadContext tc,
State &  state,
Args &&  args,
std::index_sequence< I... >   
)
inlinestatic

Definition at line 72 of file dispatch.hh.

References state.

◆ dumpArgsFrom()

template<typename ABI , typename Ret , typename ... Args>
static void gem5::guest_abi::dumpArgsFrom ( std::ostream &  os,
[[maybe_unused] ] ThreadContext tc,
typename ABI::State &  state 
)
static

Definition at line 103 of file dispatch.hh.

References gem5::X86ISA::count, gem5::X86ISA::os, and state.

Referenced by gem5::dumpSimcall().

◆ getArgument()

template<typename ABI , typename Arg >
static Arg gem5::guest_abi::getArgument ( ThreadContext tc,
typename ABI::State &  state 
)
static

Definition at line 171 of file layout.hh.

References state.

Referenced by gem5::guest_abi::Argument< Aapcs32Vfp, VarArgs< Types... > >::get().

◆ getReg()

template<typename E , size_t N>
struct IsAapcs64Hfa< E[N], typename std::enable_if_t< std::is_floating_point_v< E > &&N<=4 > > : public std::true_type{};template< typename T >constexpr bool IsAapcs64HfaV=IsAapcs64Hfa< T >::value;template< typename T, typename Enabled=void >struct IsAapcs64Hva :public std::false_type {};template< typename E, size_t N >struct IsAapcs64Hva< E[N], typename std::enable_if_t< IsAapcs64ShortVectorV< E > &&N<=4 > > : public std::true_type{};template< typename T >constexpr bool IsAapcs64HvaV=IsAapcs64Hva< T >::value;template< typename T, typename Enabled=void >struct IsAapcs64Hxa :public std::false_type {};template< typename T >struct IsAapcs64Hxa< T, typename std::enable_if_t< IsAapcs64HfaV< T >||IsAapcs64HvaV< T > > > : public std::true_type{};template< typename T >constexpr bool IsAapcs64HxaV=IsAapcs64Hxa< T >::value;struct Aapcs64ArgumentBase{ template< typename T > static T loadFromStack(ThreadContext *tc, Aapcs64::State &state) { size_t align=std::max< size_t >(8, alignof(T)); size_t size=roundUp(sizeof(T), 8); state.nsaa=roundUp(state.nsaa, align); ConstVPtr< T > val(state.nsaa, tc); state.nsaa+=size; return gtoh(*val, ArmISA::byteOrder(tc)); }};template< typename Float >struct Argument< Aapcs64, Float, typename std::enable_if_t< std::is_floating_point_v< Float >||IsAapcs64ShortVectorV< Float > > > : public Aapcs64ArgumentBase{ static Float get(ThreadContext *tc, Aapcs64::State &state) { if(state.nsrn<=state.MAX_SRN) { RegId id=ArmISA::vecRegClass[state.nsrn++]; ArmISA::VecRegContainer vc; tc->getReg(id, &vc); return vc.as< Float >()[0]; } return loadFromStack< Float >(tc, state); }};template< typename Float >struct Result< Aapcs64, Float, typename std::enable_if_t< std::is_floating_point_v< Float >||IsAapcs64ShortVectorV< Float > > >{ static void store(ThreadContext *tc, const Float &f) { RegId id=ArmISA::vecRegClass[0]; ArmISA::VecRegContainer reg; tc-> gem5::guest_abi::getReg ( id  ,
reg 
)

◆ initializeState()

template<typename ABI >
static ABI::State gem5::guest_abi::initializeState ( const ThreadContext tc)
static

◆ operator<<()

template<typename ... Types>
std::ostream& gem5::guest_abi::operator<< ( std::ostream &  os,
const VarArgs< Types... > &  va 
)

Definition at line 183 of file varargs.hh.

References gem5::X86ISA::os.

◆ prepareForArguments()

template<typename ABI , typename ... Args>
static void gem5::guest_abi::prepareForArguments ( [[maybe_unused] ] ThreadContext tc,
typename ABI::State &  state 
)
inlinestatic

Definition at line 116 of file layout.hh.

References state.

Referenced by gem5::invokeSimcall(), and prepareForFunction().

◆ prepareForFunction()

template<typename ABI , typename Ret , typename ... Args>
static void gem5::guest_abi::prepareForFunction ( ThreadContext tc,
typename ABI::State &  state 
)
inlinestatic

Definition at line 124 of file layout.hh.

References prepareForArguments(), and state.

Referenced by gem5::dumpSimcall(), and gem5::invokeSimcall().

◆ prepareForResult()

template<typename ABI , typename Ret , typename Enabled = void>
static void gem5::guest_abi::prepareForResult ( ThreadContext tc,
typename ABI::State &  state 
)
inlinestatic

◆ setReg()

tc gem5::guest_abi::setReg ( id  ,
reg 
)

◆ storeResult()

template<typename ABI , typename Ret >
static void gem5::guest_abi::storeResult ( ThreadContext tc,
const Ret &  ret,
typename ABI::State &  state 
)
static

Variable Documentation

◆ IsAapcs32CompositeV

template<typename T >
constexpr bool gem5::guest_abi::IsAapcs32CompositeV = IsAapcs32Composite<T>::value
constexpr

Definition at line 93 of file aapcs32.hh.

◆ IsAapcs32HomogeneousAggregateV

template<typename T >
constexpr bool gem5::guest_abi::IsAapcs32HomogeneousAggregateV
constexpr
Initial value:
=
IsAapcs32HomogeneousAggregate<T>::value

Definition at line 110 of file aapcs32.hh.

◆ IsAapcs64CompositeV

template<typename T >
constexpr bool gem5::guest_abi::IsAapcs64CompositeV = IsAapcs64Composite<T>::value
constexpr

Definition at line 114 of file aapcs64.hh.

◆ IsAapcs64ShortVectorV

template<typename T >
constexpr bool gem5::guest_abi::IsAapcs64ShortVectorV = IsAapcs64ShortVector<T>::value
constexpr

Definition at line 94 of file aapcs64.hh.

◆ IsVarArgsV

template<typename T >
constexpr bool gem5::guest_abi::IsVarArgsV = IsVarArgs<T>::value
constexpr

Definition at line 180 of file varargs.hh.

Referenced by TEST().


Generated on Wed Dec 21 2022 10:24:13 for gem5 by doxygen 1.9.1