diff options
author | Liam <byteslice@airmail.cc> | 2023-12-12 05:02:01 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-12-12 05:02:01 +0100 |
commit | a05c242429f03251dc8db353714c240da6d6ceaa (patch) | |
tree | 9da7119d20f1eae733531d4057d22c53f59f3ea9 | |
parent | nce: implement instruction emulation for misaligned memory accesses (diff) | |
download | yuzu-a05c242429f03251dc8db353714c240da6d6ceaa.tar yuzu-a05c242429f03251dc8db353714c240da6d6ceaa.tar.gz yuzu-a05c242429f03251dc8db353714c240da6d6ceaa.tar.bz2 yuzu-a05c242429f03251dc8db353714c240da6d6ceaa.tar.lz yuzu-a05c242429f03251dc8db353714c240da6d6ceaa.tar.xz yuzu-a05c242429f03251dc8db353714c240da6d6ceaa.tar.zst yuzu-a05c242429f03251dc8db353714c240da6d6ceaa.zip |
-rw-r--r-- | src/core/arm/nce/arm_nce.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/core/arm/nce/arm_nce.cpp b/src/core/arm/nce/arm_nce.cpp index 858c9f0a7..1311e66a9 100644 --- a/src/core/arm/nce/arm_nce.cpp +++ b/src/core/arm/nce/arm_nce.cpp @@ -251,21 +251,24 @@ void ArmNce::SetSvcArguments(std::span<const uint64_t, 8> args) { ArmNce::ArmNce(System& system, bool uses_wall_clock, std::size_t core_index) : ArmInterface{uses_wall_clock}, m_system{system}, m_core_index{core_index} { m_guest_ctx.system = &m_system; - - // Allocate signal stack. - m_stack = std::make_unique<u8[]>(StackSize); } ArmNce::~ArmNce() = default; void ArmNce::Initialize() { - m_thread_id = gettid(); + if (m_thread_id == -1) { + m_thread_id = gettid(); + } // Configure signal stack. - stack_t ss{}; - ss.ss_sp = m_stack.get(); - ss.ss_size = StackSize; - sigaltstack(&ss, nullptr); + if (!m_stack) { + m_stack = std::make_unique<u8[]>(StackSize); + + stack_t ss{}; + ss.ss_sp = m_stack.get(); + ss.ss_size = StackSize; + sigaltstack(&ss, nullptr); + } // Set up signals. static std::once_flag flag; |