From af37dd0d52b011236d176b924efbd369afa5746c Mon Sep 17 00:00:00 2001 From: Jannik Vogel Date: Sat, 14 May 2016 15:45:04 +0200 Subject: Set fpscr for new threads --- src/core/arm/arm_interface.h | 1 + src/core/hle/kernel/thread.cpp | 2 ++ src/core/hle/svc.cpp | 3 +++ 3 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index 533067d4f..d8abe5aeb 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h @@ -6,6 +6,7 @@ #include "common/common_types.h" #include "core/arm/skyeye_common/arm_regformat.h" +#include "core/arm/skyeye_common/vfp/asm_vfp.h" namespace Core { struct ThreadContext; diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 68f026918..43def6146 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -526,6 +526,8 @@ SharedPtr SetupMainThread(u32 entry_point, s32 priority) { SharedPtr thread = thread_res.MoveFrom(); + thread->context.fpscr = FPSCR_DEFAULT_NAN | FPSCR_FLUSH_TO_ZERO | FPSCR_ROUND_TOZERO | FPSCR_IXC; // 0x03C00010 + // Run new "main" thread SwitchContext(thread.get()); diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index 3a53126c1..2bf122a6d 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp @@ -502,6 +502,9 @@ static ResultCode CreateThread(Handle* out_handle, s32 priority, u32 entry_point CASCADE_RESULT(SharedPtr thread, Kernel::Thread::Create( name, entry_point, priority, arg, processor_id, stack_top)); + + thread->context.fpscr = FPSCR_DEFAULT_NAN | FPSCR_FLUSH_TO_ZERO | FPSCR_ROUND_TOZERO; // 0x03C00000 + CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(thread))); LOG_TRACE(Kernel_SVC, "called entrypoint=0x%08X (%s), arg=0x%08X, stacktop=0x%08X, " -- cgit v1.2.3