diff --git a/src/arch/arm/aapcs64.hh b/src/arch/arm/aapcs64.hh index 8a5e4374c5..fb7b8f8dfc 100644 --- a/src/arch/arm/aapcs64.hh +++ b/src/arch/arm/aapcs64.hh @@ -44,6 +44,8 @@ class ThreadContext; struct Aapcs64 { + using UintPtr = uint64_t; + struct State { int ngrn=0; // Next general purpose register number. diff --git a/src/arch/arm/semihosting.hh b/src/arch/arm/semihosting.hh index 74697f408a..7566887fc6 100644 --- a/src/arch/arm/semihosting.hh +++ b/src/arch/arm/semihosting.hh @@ -133,6 +133,8 @@ class ArmSemihosting : public SimObject struct Abi64 : public AbiBase { + using UintPtr = uint64_t; + class State : public StateBase { public: @@ -145,6 +147,8 @@ class ArmSemihosting : public SimObject struct Abi32 : public AbiBase { + using UintPtr = uint32_t; + class State : public StateBase { public: diff --git a/src/sim/proxy_ptr.hh b/src/sim/proxy_ptr.hh index 02263bae45..968c1560cb 100644 --- a/src/sim/proxy_ptr.hh +++ b/src/sim/proxy_ptr.hh @@ -338,7 +338,8 @@ struct Argument> static ProxyPtr get(ThreadContext *tc, typename ABI::State &state) { - return ProxyPtr(Argument::get(tc, state), tc); + return ProxyPtr( + Argument::get(tc, state), tc); } }; @@ -349,7 +350,7 @@ struct Argument> get(ThreadContext *tc, typename ABI::State &state) { return ConstProxyPtr( - Argument::get(tc, state), tc); + Argument::get(tc, state), tc); } }; diff --git a/src/sim/proxy_ptr.test.cc b/src/sim/proxy_ptr.test.cc index b9f46e6234..de0194d1b3 100644 --- a/src/sim/proxy_ptr.test.cc +++ b/src/sim/proxy_ptr.test.cc @@ -465,6 +465,7 @@ TEST(ProxyPtr, NonConstOperators) struct TestABI { + using UintPtr = uint64_t; using State = int; }; diff --git a/src/sim/syscall_abi.hh b/src/sim/syscall_abi.hh index 984f0e0252..9d552028f8 100644 --- a/src/sim/syscall_abi.hh +++ b/src/sim/syscall_abi.hh @@ -54,10 +54,14 @@ struct GenericSyscallABI }; 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 struct IsWide; @@ -65,7 +69,7 @@ struct GenericSyscallABI32 : public GenericSyscallABI template struct IsWide::value && - (sizeof(T) < sizeof(uint64_t) || + (sizeof(T) <= sizeof(UintPtr) || GuestABI::IsConforming::value)>> { static const bool value = false; @@ -74,7 +78,7 @@ struct GenericSyscallABI32 : public GenericSyscallABI template struct IsWide::value && - sizeof(T) == sizeof(uint64_t) && + (sizeof(T) > sizeof(UintPtr)) && !GuestABI::IsConforming::value>> { static const bool value = true;