summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2014-05-15 18:25:56 -0400
committerGravatar bunnei2014-05-15 18:25:56 -0400
commit367d63691fe810c83979fee04b181338f96cfb50 (patch)
treee27fc6a48b37bf94d3a805157d15d80d08f5e238
parentadded ThreadQueueList class to common (taken from PPSSPP) (diff)
downloadyuzu-367d63691fe810c83979fee04b181338f96cfb50.tar.gz
yuzu-367d63691fe810c83979fee04b181338f96cfb50.tar.xz
yuzu-367d63691fe810c83979fee04b181338f96cfb50.zip
- added ThreadContext struct
- cleaned up CreateThread svc
-rw-r--r--src/core/hle/syscall.cpp20
-rw-r--r--src/core/hle/syscall.h14
2 files changed, 26 insertions, 8 deletions
diff --git a/src/core/hle/syscall.cpp b/src/core/hle/syscall.cpp
index c697bc277..0700d9e82 100644
--- a/src/core/hle/syscall.cpp
+++ b/src/core/hle/syscall.cpp
@@ -9,6 +9,7 @@
9#include "core/hle/function_wrappers.h" 9#include "core/hle/function_wrappers.h"
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#include "core/hle/kernel/thread.h"
12 13
13#include "common/symbols.h" 14#include "common/symbols.h"
14 15
@@ -139,16 +140,19 @@ Result GetResourceLimitCurrentValues(void* _values, Handle resource_limit, void*
139 return 0; 140 return 0;
140} 141}
141 142
142Result CreateThread(void* thread, u32 threadpriority, u32 entrypoint, u32 arg, u32 stacktop, u32 processorid) { 143Result CreateThread(void* thread, u32 thread_priority, u32 entry_point, u32 arg, u32 stack_top, u32 processor_id) {
143 std::string symbol_name = "unknown"; 144 std::string thread_name;
144 if (Symbols::HasSymbol(entrypoint)) { 145 if (Symbols::HasSymbol(entry_point)) {
145 TSymbol symbol = Symbols::GetSymbol(entrypoint); 146 TSymbol symbol = Symbols::GetSymbol(entry_point);
146 symbol_name = symbol.name; 147 thread_name = symbol.name;
148 } else {
149 char buff[100];
150 sprintf(buff, "%s", "unk-%08X", entry_point);
151 thread_name = buff;
147 } 152 }
148 // stack top: 0x0056A4A0
149 DEBUG_LOG(SVC, "(UNIMPLEMENTED) CreateThread called entrypoint=0x%08X (%s), arg=0x%08X, " 153 DEBUG_LOG(SVC, "(UNIMPLEMENTED) CreateThread called entrypoint=0x%08X (%s), arg=0x%08X, "
150 "stacktop=0x%08X, threadpriority=0x%08X, processorid=0x%08X", entrypoint, 154 "stacktop=0x%08X, threadpriority=0x%08X, processorid=0x%08X", entry_point,
151 symbol_name.c_str(), arg, stacktop, threadpriority, processorid); 155 thread_name.c_str(), arg, stack_top, thread_priority, processor_id);
152 156
153 return 0; 157 return 0;
154} 158}
diff --git a/src/core/hle/syscall.h b/src/core/hle/syscall.h
index 7a94e0136..15af5e138 100644
--- a/src/core/hle/syscall.h
+++ b/src/core/hle/syscall.h
@@ -7,6 +7,20 @@
7#include "common/common_types.h" 7#include "common/common_types.h"
8 8
9//////////////////////////////////////////////////////////////////////////////////////////////////// 9////////////////////////////////////////////////////////////////////////////////////////////////////
10// SVC structures
11
12struct ThreadContext {
13 u32 cpu_registers[13];
14 u32 sp;
15 u32 lr;
16 u32 pc;
17 u32 cpsr;
18 u32 fpu_registers[32];
19 u32 fpscr;
20 u32 fpexc;
21};
22
23////////////////////////////////////////////////////////////////////////////////////////////////////
10// Namespace Syscall 24// Namespace Syscall
11 25
12namespace Syscall { 26namespace Syscall {