mirror of
https://github.com/yuzu-emu/yuzu-mainline
synced 2024-11-24 05:48:16 +00:00
cleanups to SVC CreateThread
This commit is contained in:
parent
3fac6dc39e
commit
cfea5fdd58
1 changed files with 15 additions and 8 deletions
|
@ -6,6 +6,9 @@
|
||||||
|
|
||||||
#include "core/mem_map.h"
|
#include "core/mem_map.h"
|
||||||
|
|
||||||
|
#include "core/hle/kernel/kernel.h"
|
||||||
|
#include "core/hle/kernel/thread.h"
|
||||||
|
|
||||||
#include "core/hle/function_wrappers.h"
|
#include "core/hle/function_wrappers.h"
|
||||||
#include "core/hle/syscall.h"
|
#include "core/hle/syscall.h"
|
||||||
#include "core/hle/service/service.h"
|
#include "core/hle/service/service.h"
|
||||||
|
@ -140,19 +143,23 @@ Result GetResourceLimitCurrentValues(void* _values, Handle resource_limit, void*
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result CreateThread(void* thread, u32 thread_priority, u32 entry_point, u32 arg, u32 stack_top, u32 processor_id) {
|
Result CreateThread(void* thread, u32 priority, u32 entry_point, u32 arg, u32 stack_top,
|
||||||
std::string thread_name;
|
u32 processor_id) {
|
||||||
|
std::string name;
|
||||||
if (Symbols::HasSymbol(entry_point)) {
|
if (Symbols::HasSymbol(entry_point)) {
|
||||||
TSymbol symbol = Symbols::GetSymbol(entry_point);
|
TSymbol symbol = Symbols::GetSymbol(entry_point);
|
||||||
thread_name = symbol.name;
|
name = symbol.name;
|
||||||
} else {
|
} else {
|
||||||
char buff[100];
|
char buff[100];
|
||||||
sprintf(buff, "%s", "unk-%08X", entry_point);
|
sprintf(buff, "%s", "unknown-%08X", entry_point);
|
||||||
thread_name = buff;
|
name = buff;
|
||||||
}
|
}
|
||||||
DEBUG_LOG(SVC, "(UNIMPLEMENTED) CreateThread called entrypoint=0x%08X (%s), arg=0x%08X, "
|
DEBUG_LOG(SVC, "CreateThread called entrypoint=0x%08X (%s), arg=0x%08X, stacktop=0x%08X, "
|
||||||
"stacktop=0x%08X, threadpriority=0x%08X, processorid=0x%08X", entry_point,
|
"threadpriority=0x%08X, processorid=0x%08X", entry_point, name.c_str(), arg, stack_top,
|
||||||
thread_name.c_str(), arg, stack_top, thread_priority, processor_id);
|
priority, processor_id);
|
||||||
|
|
||||||
|
Handle handle = __KernelCreateThread(name.c_str(), entry_point, priority, processor_id,
|
||||||
|
stack_top);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue