Merge pull request #1482 from lioncash/init

thread: Remove unnecessary memset from ResetThreadContext()
This commit is contained in:
bunnei 2018-10-12 12:06:51 -04:00 committed by GitHub
commit f9d03b1d41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -183,13 +183,10 @@ void Thread::ResumeFromWait() {
*/ */
static void ResetThreadContext(Core::ARM_Interface::ThreadContext& context, VAddr stack_top, static void ResetThreadContext(Core::ARM_Interface::ThreadContext& context, VAddr stack_top,
VAddr entry_point, u64 arg) { VAddr entry_point, u64 arg) {
memset(&context, 0, sizeof(Core::ARM_Interface::ThreadContext)); context = {};
context.cpu_registers[0] = arg; context.cpu_registers[0] = arg;
context.pc = entry_point; context.pc = entry_point;
context.sp = stack_top; context.sp = stack_top;
context.pstate = 0;
context.fpcr = 0;
} }
ResultVal<SharedPtr<Thread>> Thread::Create(KernelCore& kernel, std::string name, VAddr entry_point, ResultVal<SharedPtr<Thread>> Thread::Create(KernelCore& kernel, std::string name, VAddr entry_point,