diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp index b499bd4073..abb34c68ff 100644 --- a/src/core/hle/kernel/k_thread.cpp +++ b/src/core/hle/kernel/k_thread.cpp @@ -21,6 +21,7 @@ #include "common/logging.h" #include "common/settings.h" #include "common/random.h" +#include "core/arm/nce/arm_nce.h" #include "core/core.h" #include "core/cpu_manager.h" #include "core/hardware_properties.h" @@ -110,7 +111,11 @@ namespace Kernel { } // namespace KThread::KThread(KernelCore& kernel) - : KAutoObjectWithSlabHeapAndContainer{kernel}, m_activity_pause_lock{kernel} {} + : KAutoObjectWithSlabHeapAndContainer{kernel}, m_activity_pause_lock{kernel} { +#ifdef HAS_NCE + m_native_execution_parameters = std::make_unique(); +#endif + } KThread::~KThread() = default; Result KThread::Initialize(KernelCore& kernel, KThreadFunction func, uintptr_t arg, KProcessAddress user_stack_top, diff --git a/src/core/hle/kernel/k_thread.h b/src/core/hle/kernel/k_thread.h index 66469813be..1d4288cbfe 100644 --- a/src/core/hle/kernel/k_thread.h +++ b/src/core/hle/kernel/k_thread.h @@ -33,15 +33,12 @@ #include "core/hle/kernel/svc_types.h" #include "core/hle/result.h" -#ifdef HAS_NCE -#include "core/arm/nce/arm_nce.h" -#endif - namespace Common { class Fiber; } namespace Core { +struct NativeExecutionParameters; namespace Memory { class Memory; } @@ -670,8 +667,8 @@ public: } #ifdef HAS_NCE - Core::NativeExecutionParameters& GetNativeExecutionParameters() { - return m_native_execution_parameters; + Core::NativeExecutionParameters& GetNativeExecutionParameters() const { + return *m_native_execution_parameters; } #endif @@ -932,7 +929,7 @@ private: uintptr_t m_argument{}; KProcessAddress m_stack_top{}; #ifdef HAS_NCE - Core::NativeExecutionParameters m_native_execution_parameters{}; + std::unique_ptr m_native_execution_parameters; #endif public: