struct Aapcs64
{
+ using UintPtr = uint64_t;
+
struct State
{
int ngrn=0; // Next general purpose register number.
struct Abi64 : public AbiBase
{
+ using UintPtr = uint64_t;
+
class State : public StateBase<uint64_t>
{
public:
struct Abi32 : public AbiBase
{
+ using UintPtr = uint32_t;
+
class State : public StateBase<uint64_t>
{
public:
static ProxyPtr<T, Proxy>
get(ThreadContext *tc, typename ABI::State &state)
{
- return ProxyPtr<T, Proxy>(Argument<ABI, Addr>::get(tc, state), tc);
+ return ProxyPtr<T, Proxy>(
+ Argument<ABI, typename ABI::UintPtr>::get(tc, state), tc);
}
};
get(ThreadContext *tc, typename ABI::State &state)
{
return ConstProxyPtr<T, Proxy>(
- Argument<ABI, Addr>::get(tc, state), tc);
+ Argument<ABI, typename ABI::UintPtr>::get(tc, state), tc);
}
};
struct TestABI
{
+ using UintPtr = uint64_t;
using State = int;
};
};
struct GenericSyscallABI64 : public GenericSyscallABI
-{};
+{
+ using UintPtr = uint64_t;
+};
struct GenericSyscallABI32 : public GenericSyscallABI
{
+ using UintPtr = uint32_t;
+
// Is this argument too big for a single register?
template <typename T, typename Enabled=void>
struct IsWide;
template <typename T>
struct IsWide<T, typename std::enable_if_t<
std::is_integral<T>::value &&
- (sizeof(T) < sizeof(uint64_t) ||
+ (sizeof(T) <= sizeof(UintPtr) ||
GuestABI::IsConforming<T>::value)>>
{
static const bool value = false;
template <typename T>
struct IsWide<T, typename std::enable_if_t<
std::is_integral<T>::value &&
- sizeof(T) == sizeof(uint64_t) &&
+ (sizeof(T) > sizeof(UintPtr)) &&
!GuestABI::IsConforming<T>::value>>
{
static const bool value = true;