From dc8479928c5aee4c6ad6fe4f59006fb604cee701 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 18 Sep 2016 09:38:01 +0900 Subject: Sources: Run clang-format on everything. --- src/core/hle/function_wrappers.h | 103 ++++++++++++++++++++++++++------------- 1 file changed, 68 insertions(+), 35 deletions(-) (limited to 'src/core/hle/function_wrappers.h') diff --git a/src/core/hle/function_wrappers.h b/src/core/hle/function_wrappers.h index 8839ce482..d5d989c29 100644 --- a/src/core/hle/function_wrappers.h +++ b/src/core/hle/function_wrappers.h @@ -7,14 +7,14 @@ #include "common/common_types.h" #include "core/arm/arm_interface.h" -#include "core/memory.h" #include "core/hle/hle.h" #include "core/hle/result.h" #include "core/hle/svc.h" +#include "core/memory.h" namespace HLE { -#define PARAM(n) Core::g_app_core->GetReg(n) +#define PARAM(n) Core::g_app_core->GetReg(n) /// An invalid result code that is meant to be overwritten when a thread resumes from waiting static const ResultCode RESULT_INVALID(0xDEADC0DE); @@ -40,28 +40,33 @@ static inline void FuncReturn64(u64 res) { //////////////////////////////////////////////////////////////////////////////////////////////////// // Function wrappers that return type ResultCode -template void Wrap() { +template +void Wrap() { FuncReturn(func(PARAM(0), PARAM(1), PARAM(2), PARAM(3)).raw); } -template void Wrap(){ +template +void Wrap() { u32 param_1 = 0; u32 retval = func(¶m_1, PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4)).raw; Core::g_app_core->SetReg(1, param_1); FuncReturn(retval); } -template void Wrap() { +template +void Wrap() { u32 param_1 = 0; u32 retval = func(¶m_1, PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4)).raw; Core::g_app_core->SetReg(1, param_1); FuncReturn(retval); } -template void Wrap() { +template +void Wrap() { s32 param_1 = 0; s32 retval = func(¶m_1, (Handle*)Memory::GetPointer(PARAM(1)), (s32)PARAM(2), - (PARAM(3) != 0), (((s64)PARAM(4) << 32) | PARAM(0))).raw; + (PARAM(3) != 0), (((s64)PARAM(4) << 32) | PARAM(0))) + .raw; if (retval != RESULT_INVALID.raw) { Core::g_app_core->SetReg(1, (u32)param_1); @@ -69,18 +74,22 @@ template void Wrap() { } } -template void Wrap() { - FuncReturn(func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), (((s64)PARAM(5) << 32) | PARAM(4))).raw); +template +void Wrap() { + FuncReturn( + func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), (((s64)PARAM(5) << 32) | PARAM(4))).raw); } -template void Wrap(){ +template +void Wrap() { u32 param_1 = 0; u32 retval = func(¶m_1).raw; Core::g_app_core->SetReg(1, param_1); FuncReturn(retval); } -template void Wrap() { +template +void Wrap() { s32 retval = func(PARAM(0), (((s64)PARAM(3) << 32) | PARAM(2))).raw; if (retval != RESULT_INVALID.raw) { @@ -88,7 +97,8 @@ template void Wrap() { } } -template void Wrap() { +template +void Wrap() { MemoryInfo memory_info = {}; PageInfo page_info = {}; u32 retval = func(&memory_info, &page_info, PARAM(2)).raw; @@ -100,7 +110,8 @@ template void Wrap() { FuncReturn(retval); } -template void Wrap() { +template +void Wrap() { MemoryInfo memory_info = {}; PageInfo page_info = {}; u32 retval = func(&memory_info, &page_info, PARAM(2), PARAM(3)).raw; @@ -112,55 +123,65 @@ template void Wrap() { FuncReturn(retval); } -template void Wrap(){ +template +void Wrap() { s32 param_1 = 0; u32 retval = func(¶m_1, PARAM(1)).raw; Core::g_app_core->SetReg(1, param_1); FuncReturn(retval); } -template void Wrap() { +template +void Wrap() { FuncReturn(func(PARAM(0), (s32)PARAM(1)).raw); } -template void Wrap(){ +template +void Wrap() { u32 param_1 = 0; u32 retval = func(¶m_1, PARAM(1)).raw; Core::g_app_core->SetReg(1, param_1); FuncReturn(retval); } -template void Wrap() { +template +void Wrap() { FuncReturn(func(PARAM(0)).raw); } -template void Wrap(){ - FuncReturn(func((s64*)Memory::GetPointer(PARAM(0)), PARAM(1), (u32*)Memory::GetPointer(PARAM(2)), - (s32)PARAM(3)).raw); +template +void Wrap() { + FuncReturn(func((s64*)Memory::GetPointer(PARAM(0)), PARAM(1), + (u32*)Memory::GetPointer(PARAM(2)), (s32)PARAM(3)) + .raw); } -template void Wrap() { +template +void Wrap() { u32 param_1 = 0; u32 retval = func(¶m_1, (char*)Memory::GetPointer(PARAM(1))).raw; Core::g_app_core->SetReg(1, param_1); FuncReturn(retval); } -template void Wrap() { +template +void Wrap() { u32 param_1 = 0; u32 retval = func(¶m_1, PARAM(1), PARAM(2)).raw; Core::g_app_core->SetReg(1, param_1); FuncReturn(retval); } -template void Wrap() { +template +void Wrap() { s32 param_1 = 0; u32 retval = func(¶m_1, PARAM(1), PARAM(2)).raw; Core::g_app_core->SetReg(1, param_1); FuncReturn(retval); } -template void Wrap() { +template +void Wrap() { s64 param_1 = 0; u32 retval = func(¶m_1, PARAM(1), PARAM(2)).raw; Core::g_app_core->SetReg(1, (u32)param_1); @@ -168,7 +189,8 @@ template void Wrap() { FuncReturn(retval); } -template void Wrap() { +template +void Wrap() { u32 param_1 = 0; // The last parameter is passed in R0 instead of R4 u32 retval = func(¶m_1, PARAM(1), PARAM(2), PARAM(3), PARAM(0)).raw; @@ -176,13 +198,15 @@ template void Wrap() { FuncReturn(retval); } -template void Wrap() { +template +void Wrap() { s64 param1 = ((u64)PARAM(3) << 32) | PARAM(2); s64 param2 = ((u64)PARAM(4) << 32) | PARAM(1); FuncReturn(func(PARAM(0), param1, param2).raw); } -template void Wrap() { +template +void Wrap() { s64 param_1 = 0; u32 retval = func(¶m_1, PARAM(1), PARAM(2)).raw; Core::g_app_core->SetReg(1, (u32)param_1); @@ -190,14 +214,18 @@ template void Wrap() { FuncReturn(retval); } -template void Wrap() { +template +void Wrap() { FuncReturn(func(PARAM(0), PARAM(1)).raw); } -template void Wrap() { +template +void Wrap() { Handle param_1 = 0; Handle param_2 = 0; - u32 retval = func(¶m_1, ¶m_2, reinterpret_cast(Memory::GetPointer(PARAM(2))), PARAM(3)).raw; + u32 retval = func(¶m_1, ¶m_2, + reinterpret_cast(Memory::GetPointer(PARAM(2))), PARAM(3)) + .raw; // The first out parameter is moved into R2 and the second is moved into R1. Core::g_app_core->SetReg(1, param_2); Core::g_app_core->SetReg(2, param_1); @@ -207,29 +235,34 @@ template void Wrap() { //////////////////////////////////////////////////////////////////////////////////////////////////// // Function wrappers that return type u32 -template void Wrap() { +template +void Wrap() { FuncReturn(func()); } //////////////////////////////////////////////////////////////////////////////////////////////////// // Function wrappers that return type s64 -template void Wrap() { +template +void Wrap() { FuncReturn64(func()); } //////////////////////////////////////////////////////////////////////////////////////////////////// /// Function wrappers that return type void -template void Wrap() { +template +void Wrap() { func(((s64)PARAM(1) << 32) | PARAM(0)); } -template void Wrap() { +template +void Wrap() { func((char*)Memory::GetPointer(PARAM(0))); } -template void Wrap() { +template +void Wrap() { func((u8)PARAM(0)); } -- cgit v1.2.3