From a4412c8e22cb0e914fd876c03894929c0ee4812b Mon Sep 17 00:00:00 2001 From: David Marcec Date: Wed, 10 Oct 2018 12:23:50 +1100 Subject: Fixed incorrect types for svcBreak svcBreak reason should be a u32, not a u64. --- src/core/hle/kernel/svc.cpp | 6 +++--- src/core/hle/kernel/svc_wrap.h | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index b488b508d..f05b743ef 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -303,13 +303,13 @@ static ResultCode ArbitrateUnlock(VAddr mutex_addr) { struct BreakReason { union { - u64 raw; - BitField<31, 1, u64> dont_kill_application; + u32 raw; + BitField<31, 1, u32> dont_kill_application; }; }; /// Break program execution -static void Break(u64 reason, u64 info1, u64 info2) { +static void Break(u32 reason, u64 info1, u64 info2) { BreakReason break_reason{reason}; if (break_reason.dont_kill_application) { LOG_ERROR( diff --git a/src/core/hle/kernel/svc_wrap.h b/src/core/hle/kernel/svc_wrap.h index 22712e64f..5f53fb421 100644 --- a/src/core/hle/kernel/svc_wrap.h +++ b/src/core/hle/kernel/svc_wrap.h @@ -239,4 +239,9 @@ void SvcWrap() { func(Param(0), Param(1), Param(2)); } +template +void SvcWrap() { + func((u32)(Param(0) & 0xFFFFFFFF), Param(1), Param(2)); +} + } // namespace Kernel -- cgit v1.2.3 From 09b6dda8f03c06a09b6ad2f731826e93e5920503 Mon Sep 17 00:00:00 2001 From: David Marcec Date: Wed, 10 Oct 2018 12:27:44 +1100 Subject: Use a better name than "dont_kill_application" signal_debugger seems like a more fitting name --- src/core/hle/kernel/svc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index f05b743ef..e5dd43275 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -304,14 +304,14 @@ static ResultCode ArbitrateUnlock(VAddr mutex_addr) { struct BreakReason { union { u32 raw; - BitField<31, 1, u32> dont_kill_application; + BitField<31, 1, u32> signal_debugger; }; }; /// Break program execution static void Break(u32 reason, u64 info1, u64 info2) { BreakReason break_reason{reason}; - if (break_reason.dont_kill_application) { + if (break_reason.signal_debugger) { LOG_ERROR( Debug_Emulated, "Emulated program broke execution! reason=0x{:016X}, info1=0x{:016X}, info2=0x{:016X}", -- cgit v1.2.3 From 2db37ddea92ac3b3e4063eebcdb69e808cafa469 Mon Sep 17 00:00:00 2001 From: David Marcec Date: Wed, 10 Oct 2018 12:49:08 +1100 Subject: Changed all casts in svc_wrap.h to be static_cast instead --- src/core/hle/kernel/svc_wrap.h | 53 ++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/core/hle/kernel/svc_wrap.h b/src/core/hle/kernel/svc_wrap.h index 5f53fb421..cbb80c3c4 100644 --- a/src/core/hle/kernel/svc_wrap.h +++ b/src/core/hle/kernel/svc_wrap.h @@ -35,18 +35,18 @@ void SvcWrap() { template void SvcWrap() { - FuncReturn(func((u32)Param(0)).raw); + FuncReturn(func(static_cast(Param(0))).raw); } template void SvcWrap() { - FuncReturn(func((u32)Param(0), (u32)Param(1)).raw); + FuncReturn(func(static_cast(Param(0)), static_cast(Param(1))).raw); } template void SvcWrap() { u32 param_1 = 0; - u32 retval = func(¶m_1, (u32)Param(1)).raw; + u32 retval = func(¶m_1, static_cast(Param(1))).raw; Core::CurrentArmInterface().SetReg(1, param_1); FuncReturn(retval); } @@ -61,7 +61,7 @@ void SvcWrap() { template void SvcWrap() { - FuncReturn(func(Param(0), (s32)Param(1)).raw); + FuncReturn(func(Param(0), static_cast(Param(1))).raw); } template @@ -79,19 +79,19 @@ void SvcWrap() { template void SvcWrap() { - FuncReturn(func((u32)(Param(0) & 0xFFFFFFFF), Param(1)).raw); + FuncReturn(func(static_cast(Param(0)), Param(1)).raw); } template void SvcWrap() { - FuncReturn(func((u32)(Param(0) & 0xFFFFFFFF), (u32)(Param(1) & 0xFFFFFFFF), Param(2)).raw); + FuncReturn(func(static_cast(Param(0)), static_cast(Param(1)), Param(2)).raw); } template void SvcWrap() { u32 param_1 = 0; u64 param_2 = 0; - ResultCode retval = func((u32)(Param(2) & 0xFFFFFFFF), ¶m_1, ¶m_2); + ResultCode retval = func(static_cast(Param(2)), ¶m_1, ¶m_2); Core::CurrentArmInterface().SetReg(1, param_1); Core::CurrentArmInterface().SetReg(2, param_2); FuncReturn(retval.raw); @@ -100,12 +100,12 @@ void SvcWrap() { template void SvcWrap() { FuncReturn( - func(Param(0), Param(1), (u32)(Param(3) & 0xFFFFFFFF), (u32)(Param(3) & 0xFFFFFFFF)).raw); + func(Param(0), Param(1), static_cast(Param(3)), static_cast(Param(3))).raw); } template void SvcWrap() { - FuncReturn(func((u32)Param(0), Param(1), (u32)Param(2)).raw); + FuncReturn(func(static_cast(Param(0)), Param(1), static_cast(Param(2))).raw); } template @@ -115,25 +115,28 @@ void SvcWrap() { template void SvcWrap() { - FuncReturn(func((u32)Param(0), Param(1), Param(2), (u32)Param(3)).raw); + FuncReturn( + func(static_cast(Param(0)), Param(1), Param(2), static_cast(Param(3))).raw); } template void SvcWrap() { - FuncReturn(func((u32)Param(0), Param(1), Param(2)).raw); + FuncReturn(func(static_cast(Param(0)), Param(1), Param(2)).raw); } template void SvcWrap() { u32 param_1 = 0; - ResultCode retval = func(¶m_1, Param(1), (u32)(Param(2) & 0xFFFFFFFF), (s64)Param(3)); + ResultCode retval = + func(¶m_1, Param(1), static_cast(Param(2)), static_cast(Param(3))); Core::CurrentArmInterface().SetReg(1, param_1); FuncReturn(retval.raw); } template void SvcWrap() { - FuncReturn(func(Param(0), Param(1), (u32)Param(2), (s64)Param(3)).raw); + FuncReturn( + func(Param(0), Param(1), static_cast(Param(2)), static_cast(Param(3))).raw); } template @@ -147,9 +150,9 @@ void SvcWrap() { template void SvcWrap() { u32 param_1 = 0; - u32 retval = - func(¶m_1, Param(1), Param(2), Param(3), (u32)Param(4), (s32)(Param(5) & 0xFFFFFFFF)) - .raw; + u32 retval = func(¶m_1, Param(1), Param(2), Param(3), static_cast(Param(4)), + static_cast(Param(5))) + .raw; Core::CurrentArmInterface().SetReg(1, param_1); FuncReturn(retval); } @@ -172,7 +175,7 @@ void SvcWrap() { template void SvcWrap() { u32 param_1 = 0; - u32 retval = func(¶m_1, Param(1), Param(2), (u32)(Param(3) & 0xFFFFFFFF)).raw; + u32 retval = func(¶m_1, Param(1), Param(2), static_cast(Param(3))).raw; Core::CurrentArmInterface().SetReg(1, param_1); FuncReturn(retval); } @@ -181,22 +184,22 @@ template void SvcWrap() { u32 param_1 = 0; u32 retval = - func(¶m_1, Param(1), (u32)(Param(2) & 0xFFFFFFFF), (u32)(Param(3) & 0xFFFFFFFF)).raw; + func(¶m_1, Param(1), static_cast(Param(2)), static_cast(Param(3))).raw; Core::CurrentArmInterface().SetReg(1, param_1); FuncReturn(retval); } template void SvcWrap() { - FuncReturn( - func(Param(0), (u32)(Param(1) & 0xFFFFFFFF), (s32)(Param(2) & 0xFFFFFFFF), (s64)Param(3)) - .raw); + FuncReturn(func(Param(0), static_cast(Param(1)), static_cast(Param(2)), + static_cast(Param(3))) + .raw); } template void SvcWrap() { - FuncReturn(func(Param(0), (u32)(Param(1) & 0xFFFFFFFF), (s32)(Param(2) & 0xFFFFFFFF), - (s32)(Param(3) & 0xFFFFFFFF)) + FuncReturn(func(Param(0), static_cast(Param(1)), static_cast(Param(2)), + static_cast(Param(3))) .raw); } @@ -226,7 +229,7 @@ void SvcWrap() { template void SvcWrap() { - func((s64)Param(0)); + func(static_cast(Param(0))); } template @@ -241,7 +244,7 @@ void SvcWrap() { template void SvcWrap() { - func((u32)(Param(0) & 0xFFFFFFFF), Param(1), Param(2)); + func(static_cast(Param(0)), Param(1), Param(2)); } } // namespace Kernel -- cgit v1.2.3