summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2014-05-13 21:58:26 -0400
committerGravatar bunnei2014-05-13 21:58:26 -0400
commitb5ef630c9c3133c1452462420788076e9890bcc3 (patch)
treee92f096682f3fd55623925e58636663f4053d24b
parent- added __KernelLoadExec function (diff)
downloadyuzu-b5ef630c9c3133c1452462420788076e9890bcc3.tar.gz
yuzu-b5ef630c9c3133c1452462420788076e9890bcc3.tar.xz
yuzu-b5ef630c9c3133c1452462420788076e9890bcc3.zip
added CreateThread, CreateMutex, and ReleaseMutex SVC stubs (just parameter decoding for now)
-rw-r--r--src/core/hle/function_wrappers.h2
-rw-r--r--src/core/hle/syscall.cpp43
2 files changed, 38 insertions, 7 deletions
diff --git a/src/core/hle/function_wrappers.h b/src/core/hle/function_wrappers.h
index 18b01b14b..83be7648b 100644
--- a/src/core/hle/function_wrappers.h
+++ b/src/core/hle/function_wrappers.h
@@ -740,7 +740,7 @@ template<int func(void*, u32, void*, int)> void WrapI_VUVI(){
740} 740}
741 741
742template<int func(void*, u32, u32, u32, u32, u32)> void WrapI_VUUUUU(){ 742template<int func(void*, u32, u32, u32, u32, u32)> void WrapI_VUUUUU(){
743 u32 retval = func(Memory::GetPointer(PARAM(0)), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5)); 743 u32 retval = func(NULL, PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
744 RETURN(retval); 744 RETURN(retval);
745} 745}
746 746
diff --git a/src/core/hle/syscall.cpp b/src/core/hle/syscall.cpp
index d47df6038..c697bc277 100644
--- a/src/core/hle/syscall.cpp
+++ b/src/core/hle/syscall.cpp
@@ -10,6 +10,8 @@
10#include "core/hle/syscall.h" 10#include "core/hle/syscall.h"
11#include "core/hle/service/service.h" 11#include "core/hle/service/service.h"
12 12
13#include "common/symbols.h"
14
13//////////////////////////////////////////////////////////////////////////////////////////////////// 15////////////////////////////////////////////////////////////////////////////////////////////////////
14// Namespace Syscall 16// Namespace Syscall
15 17
@@ -26,7 +28,8 @@ enum MapMemoryPermission {
26}; 28};
27 29
28/// Map application or GSP heap memory 30/// Map application or GSP heap memory
29Result ControlMemory(u32 operation, u32 addr0, u32 addr1, u32 size, u32 permissions) { 31Result ControlMemory(void* _outaddr, u32 operation, u32 addr0, u32 addr1, u32 size, u32 permissions) {
32 u32* outaddr = (u32*)_outaddr;
30 u32 virtual_address = 0x00000000; 33 u32 virtual_address = 0x00000000;
31 34
32 DEBUG_LOG(SVC, "ControlMemory called operation=0x%08X, addr0=0x%08X, addr1=0x%08X, size=%08X, permissions=0x%08X", 35 DEBUG_LOG(SVC, "ControlMemory called operation=0x%08X, addr0=0x%08X, addr1=0x%08X, size=%08X, permissions=0x%08X",
@@ -48,7 +51,9 @@ Result ControlMemory(u32 operation, u32 addr0, u32 addr1, u32 size, u32 permissi
48 default: 51 default:
49 ERROR_LOG(SVC, "ControlMemory unknown operation=0x%08X", operation); 52 ERROR_LOG(SVC, "ControlMemory unknown operation=0x%08X", operation);
50 } 53 }
51 54 if (NULL != outaddr) {
55 *outaddr = virtual_address;
56 }
52 Core::g_app_core->SetReg(1, virtual_address); 57 Core::g_app_core->SetReg(1, virtual_address);
53 58
54 return 0; 59 return 0;
@@ -134,16 +139,42 @@ Result GetResourceLimitCurrentValues(void* _values, Handle resource_limit, void*
134 return 0; 139 return 0;
135} 140}
136 141
142Result CreateThread(void* thread, u32 threadpriority, u32 entrypoint, u32 arg, u32 stacktop, u32 processorid) {
143 std::string symbol_name = "unknown";
144 if (Symbols::HasSymbol(entrypoint)) {
145 TSymbol symbol = Symbols::GetSymbol(entrypoint);
146 symbol_name = symbol.name;
147 }
148 // stack top: 0x0056A4A0
149 DEBUG_LOG(SVC, "(UNIMPLEMENTED) CreateThread called entrypoint=0x%08X (%s), arg=0x%08X, "
150 "stacktop=0x%08X, threadpriority=0x%08X, processorid=0x%08X", entrypoint,
151 symbol_name.c_str(), arg, stacktop, threadpriority, processorid);
152
153 return 0;
154}
155
156Result CreateMutex(void* _mutex, u32 initial_locked) {
157 Handle* mutex = (Handle*)_mutex;
158 DEBUG_LOG(SVC, "(UNIMPLEMENTED) CreateMutex called initial_locked=%s",
159 initial_locked ? "true" : "false");
160 return 0;
161}
162
163Result ReleaseMutex(Handle handle) {
164 DEBUG_LOG(SVC, "(UNIMPLEMENTED) ReleaseMutex called handle=0x%08X", handle);
165 return 0;
166}
167
137const HLE::FunctionDef Syscall_Table[] = { 168const HLE::FunctionDef Syscall_Table[] = {
138 {0x00, NULL, "Unknown"}, 169 {0x00, NULL, "Unknown"},
139 {0x01, WrapI_UUUUU<ControlMemory>, "ControlMemory"}, 170 {0x01, WrapI_VUUUUU<ControlMemory>, "ControlMemory"},
140 {0x02, NULL, "QueryMemory"}, 171 {0x02, NULL, "QueryMemory"},
141 {0x03, NULL, "ExitProcess"}, 172 {0x03, NULL, "ExitProcess"},
142 {0x04, NULL, "GetProcessAffinityMask"}, 173 {0x04, NULL, "GetProcessAffinityMask"},
143 {0x05, NULL, "SetProcessAffinityMask"}, 174 {0x05, NULL, "SetProcessAffinityMask"},
144 {0x06, NULL, "GetProcessIdealProcessor"}, 175 {0x06, NULL, "GetProcessIdealProcessor"},
145 {0x07, NULL, "SetProcessIdealProcessor"}, 176 {0x07, NULL, "SetProcessIdealProcessor"},
146 {0x08, NULL, "CreateThread"}, 177 {0x08, WrapI_VUUUUU<CreateThread>, "CreateThread"},
147 {0x09, NULL, "ExitThread"}, 178 {0x09, NULL, "ExitThread"},
148 {0x0A, NULL, "SleepThread"}, 179 {0x0A, NULL, "SleepThread"},
149 {0x0B, NULL, "GetThreadPriority"}, 180 {0x0B, NULL, "GetThreadPriority"},
@@ -154,8 +185,8 @@ const HLE::FunctionDef Syscall_Table[] = {
154 {0x10, NULL, "SetThreadIdealProcessor"}, 185 {0x10, NULL, "SetThreadIdealProcessor"},
155 {0x11, NULL, "GetCurrentProcessorNumber"}, 186 {0x11, NULL, "GetCurrentProcessorNumber"},
156 {0x12, NULL, "Run"}, 187 {0x12, NULL, "Run"},
157 {0x13, NULL, "CreateMutex"}, 188 {0x13, WrapI_VU<CreateMutex>, "CreateMutex"},
158 {0x14, NULL, "ReleaseMutex"}, 189 {0x14, WrapI_U<ReleaseMutex>, "ReleaseMutex"},
159 {0x15, NULL, "CreateSemaphore"}, 190 {0x15, NULL, "CreateSemaphore"},
160 {0x16, NULL, "ReleaseSemaphore"}, 191 {0x16, NULL, "ReleaseSemaphore"},
161 {0x17, NULL, "CreateEvent"}, 192 {0x17, NULL, "CreateEvent"},