mirror of https://git.suyu.dev/suyu/suyu
core/arm: Remove usage of global GetCurrentThread()
Now both CPU backends go through their referenced system instance to obtain the current thread.
This commit is contained in:
parent
985d0f35e5
commit
472319e573
|
@ -15,6 +15,7 @@
|
||||||
#include "core/core_timing_util.h"
|
#include "core/core_timing_util.h"
|
||||||
#include "core/gdbstub/gdbstub.h"
|
#include "core/gdbstub/gdbstub.h"
|
||||||
#include "core/hle/kernel/process.h"
|
#include "core/hle/kernel/process.h"
|
||||||
|
#include "core/hle/kernel/scheduler.h"
|
||||||
#include "core/hle/kernel/svc.h"
|
#include "core/hle/kernel/svc.h"
|
||||||
#include "core/hle/kernel/vm_manager.h"
|
#include "core/hle/kernel/vm_manager.h"
|
||||||
#include "core/memory.h"
|
#include "core/memory.h"
|
||||||
|
@ -87,7 +88,7 @@ public:
|
||||||
if (GDBStub::IsServerEnabled()) {
|
if (GDBStub::IsServerEnabled()) {
|
||||||
parent.jit->HaltExecution();
|
parent.jit->HaltExecution();
|
||||||
parent.SetPC(pc);
|
parent.SetPC(pc);
|
||||||
Kernel::Thread* thread = Kernel::GetCurrentThread();
|
Kernel::Thread* const thread = parent.system.CurrentScheduler().GetCurrentThread();
|
||||||
parent.SaveContext(thread->GetContext());
|
parent.SaveContext(thread->GetContext());
|
||||||
GDBStub::Break();
|
GDBStub::Break();
|
||||||
GDBStub::SendTrap(thread, 5);
|
GDBStub::SendTrap(thread, 5);
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "core/arm/unicorn/arm_unicorn.h"
|
#include "core/arm/unicorn/arm_unicorn.h"
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
#include "core/core_timing.h"
|
#include "core/core_timing.h"
|
||||||
|
#include "core/hle/kernel/scheduler.h"
|
||||||
#include "core/hle/kernel/svc.h"
|
#include "core/hle/kernel/svc.h"
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
@ -177,7 +178,7 @@ void ARM_Unicorn::ExecuteInstructions(std::size_t num_instructions) {
|
||||||
uc_reg_write(uc, UC_ARM64_REG_PC, &last_bkpt.address);
|
uc_reg_write(uc, UC_ARM64_REG_PC, &last_bkpt.address);
|
||||||
}
|
}
|
||||||
|
|
||||||
Kernel::Thread* thread = Kernel::GetCurrentThread();
|
Kernel::Thread* const thread = system.CurrentScheduler().GetCurrentThread();
|
||||||
SaveContext(thread->GetContext());
|
SaveContext(thread->GetContext());
|
||||||
if (last_bkpt_hit || GDBStub::IsMemoryBreak() || GDBStub::GetCpuStepFlag()) {
|
if (last_bkpt_hit || GDBStub::IsMemoryBreak() || GDBStub::GetCpuStepFlag()) {
|
||||||
last_bkpt_hit = false;
|
last_bkpt_hit = false;
|
||||||
|
|
Loading…
Reference in New Issue