- added ThreadContext struct

- cleaned up CreateThread svc
This commit is contained in:
bunnei 2014-05-15 18:25:56 -04:00
parent cf2eb8e3d3
commit 367d63691f
2 changed files with 26 additions and 8 deletions

View File

@ -9,6 +9,7 @@
#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"
#include "core/hle/kernel/thread.h"
#include "common/symbols.h" #include "common/symbols.h"
@ -139,16 +140,19 @@ Result GetResourceLimitCurrentValues(void* _values, Handle resource_limit, void*
return 0; return 0;
} }
Result CreateThread(void* thread, u32 threadpriority, u32 entrypoint, u32 arg, u32 stacktop, u32 processorid) { Result CreateThread(void* thread, u32 thread_priority, u32 entry_point, u32 arg, u32 stack_top, u32 processor_id) {
std::string symbol_name = "unknown"; std::string thread_name;
if (Symbols::HasSymbol(entrypoint)) { if (Symbols::HasSymbol(entry_point)) {
TSymbol symbol = Symbols::GetSymbol(entrypoint); TSymbol symbol = Symbols::GetSymbol(entry_point);
symbol_name = symbol.name; thread_name = symbol.name;
} else {
char buff[100];
sprintf(buff, "%s", "unk-%08X", entry_point);
thread_name = buff;
} }
// stack top: 0x0056A4A0
DEBUG_LOG(SVC, "(UNIMPLEMENTED) CreateThread called entrypoint=0x%08X (%s), arg=0x%08X, " DEBUG_LOG(SVC, "(UNIMPLEMENTED) CreateThread called entrypoint=0x%08X (%s), arg=0x%08X, "
"stacktop=0x%08X, threadpriority=0x%08X, processorid=0x%08X", entrypoint, "stacktop=0x%08X, threadpriority=0x%08X, processorid=0x%08X", entry_point,
symbol_name.c_str(), arg, stacktop, threadpriority, processorid); thread_name.c_str(), arg, stack_top, thread_priority, processor_id);
return 0; return 0;
} }

View File

@ -6,6 +6,20 @@
#include "common/common_types.h" #include "common/common_types.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
// SVC structures
struct ThreadContext {
u32 cpu_registers[13];
u32 sp;
u32 lr;
u32 pc;
u32 cpsr;
u32 fpu_registers[32];
u32 fpscr;
u32 fpexc;
};
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace Syscall // Namespace Syscall