diff options
| author | 2014-05-17 13:47:44 -0400 | |
|---|---|---|
| committer | 2014-05-17 13:47:44 -0400 | |
| commit | cfea5fdd5878968e8a1de99b86966c57d0fc5697 (patch) | |
| tree | e05080cd53be04b42e97f5230f56169eaf6027f2 /src | |
| parent | Merge branch 'master' into threading (diff) | |
| download | yuzu-cfea5fdd5878968e8a1de99b86966c57d0fc5697.tar.gz yuzu-cfea5fdd5878968e8a1de99b86966c57d0fc5697.tar.xz yuzu-cfea5fdd5878968e8a1de99b86966c57d0fc5697.zip | |
cleanups to SVC CreateThread
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/syscall.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/core/hle/syscall.cpp b/src/core/hle/syscall.cpp index 0765bce7a..0c78b19fb 100644 --- a/src/core/hle/syscall.cpp +++ b/src/core/hle/syscall.cpp | |||
| @@ -6,6 +6,9 @@ | |||
| 6 | 6 | ||
| 7 | #include "core/mem_map.h" | 7 | #include "core/mem_map.h" |
| 8 | 8 | ||
| 9 | #include "core/hle/kernel/kernel.h" | ||
| 10 | #include "core/hle/kernel/thread.h" | ||
| 11 | |||
| 9 | #include "core/hle/function_wrappers.h" | 12 | #include "core/hle/function_wrappers.h" |
| 10 | #include "core/hle/syscall.h" | 13 | #include "core/hle/syscall.h" |
| 11 | #include "core/hle/service/service.h" | 14 | #include "core/hle/service/service.h" |
| @@ -140,19 +143,23 @@ Result GetResourceLimitCurrentValues(void* _values, Handle resource_limit, void* | |||
| 140 | return 0; | 143 | return 0; |
| 141 | } | 144 | } |
| 142 | 145 | ||
| 143 | Result CreateThread(void* thread, u32 thread_priority, u32 entry_point, u32 arg, u32 stack_top, u32 processor_id) { | 146 | Result CreateThread(void* thread, u32 priority, u32 entry_point, u32 arg, u32 stack_top, |
| 144 | std::string thread_name; | 147 | u32 processor_id) { |
| 148 | std::string name; | ||
| 145 | if (Symbols::HasSymbol(entry_point)) { | 149 | if (Symbols::HasSymbol(entry_point)) { |
| 146 | TSymbol symbol = Symbols::GetSymbol(entry_point); | 150 | TSymbol symbol = Symbols::GetSymbol(entry_point); |
| 147 | thread_name = symbol.name; | 151 | name = symbol.name; |
| 148 | } else { | 152 | } else { |
| 149 | char buff[100]; | 153 | char buff[100]; |
| 150 | sprintf(buff, "%s", "unk-%08X", entry_point); | 154 | sprintf(buff, "%s", "unknown-%08X", entry_point); |
| 151 | thread_name = buff; | 155 | name = buff; |
| 152 | } | 156 | } |
| 153 | DEBUG_LOG(SVC, "(UNIMPLEMENTED) CreateThread called entrypoint=0x%08X (%s), arg=0x%08X, " | 157 | DEBUG_LOG(SVC, "CreateThread called entrypoint=0x%08X (%s), arg=0x%08X, stacktop=0x%08X, " |
| 154 | "stacktop=0x%08X, threadpriority=0x%08X, processorid=0x%08X", entry_point, | 158 | "threadpriority=0x%08X, processorid=0x%08X", entry_point, name.c_str(), arg, stack_top, |
| 155 | thread_name.c_str(), arg, stack_top, thread_priority, processor_id); | 159 | priority, processor_id); |
| 160 | |||
| 161 | Handle handle = __KernelCreateThread(name.c_str(), entry_point, priority, processor_id, | ||
| 162 | stack_top); | ||
| 156 | 163 | ||
| 157 | return 0; | 164 | return 0; |
| 158 | } | 165 | } |