diff options
author | bunnei <bunneidev@gmail.com> | 2020-03-02 05:46:10 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2020-03-03 03:51:57 +0100 |
commit | c083ea7d7846ee40cfc889ed1d415f73ec78364c (patch) | |
tree | c58a597921953ad17f5b233c7e23996f78c2521b /src/core/arm/unicorn | |
parent | core: loader: Remove check for 32-bit. (diff) | |
download | yuzu-c083ea7d7846ee40cfc889ed1d415f73ec78364c.tar yuzu-c083ea7d7846ee40cfc889ed1d415f73ec78364c.tar.gz yuzu-c083ea7d7846ee40cfc889ed1d415f73ec78364c.tar.bz2 yuzu-c083ea7d7846ee40cfc889ed1d415f73ec78364c.tar.lz yuzu-c083ea7d7846ee40cfc889ed1d415f73ec78364c.tar.xz yuzu-c083ea7d7846ee40cfc889ed1d415f73ec78364c.tar.zst yuzu-c083ea7d7846ee40cfc889ed1d415f73ec78364c.zip |
Diffstat (limited to 'src/core/arm/unicorn')
-rw-r--r-- | src/core/arm/unicorn/arm_unicorn.cpp | 8 | ||||
-rw-r--r-- | src/core/arm/unicorn/arm_unicorn.h | 7 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/core/arm/unicorn/arm_unicorn.cpp b/src/core/arm/unicorn/arm_unicorn.cpp index f99ad5802..8a9800a96 100644 --- a/src/core/arm/unicorn/arm_unicorn.cpp +++ b/src/core/arm/unicorn/arm_unicorn.cpp @@ -53,7 +53,7 @@ static bool UnmappedMemoryHook(uc_engine* uc, uc_mem_type type, u64 addr, int si void* user_data) { auto* const system = static_cast<System*>(user_data); - ARM_Interface::ThreadContext ctx{}; + ARM_Interface::ThreadContext64 ctx{}; system->CurrentArmInterface().SaveContext(ctx); ASSERT_MSG(false, "Attempted to read from unmapped memory: 0x{:X}, pc=0x{:X}, lr=0x{:X}", addr, ctx.pc, ctx.cpu_registers[30]); @@ -179,7 +179,7 @@ void ARM_Unicorn::ExecuteInstructions(std::size_t num_instructions) { } Kernel::Thread* const thread = system.CurrentScheduler().GetCurrentThread(); - SaveContext(thread->GetContext()); + SaveContext(thread->GetContext64()); if (last_bkpt_hit || GDBStub::IsMemoryBreak() || GDBStub::GetCpuStepFlag()) { last_bkpt_hit = false; GDBStub::Break(); @@ -188,7 +188,7 @@ void ARM_Unicorn::ExecuteInstructions(std::size_t num_instructions) { } } -void ARM_Unicorn::SaveContext(ThreadContext& ctx) { +void ARM_Unicorn::SaveContext(ThreadContext64& ctx) { int uregs[32]; void* tregs[32]; @@ -215,7 +215,7 @@ void ARM_Unicorn::SaveContext(ThreadContext& ctx) { CHECKED(uc_reg_read_batch(uc, uregs, tregs, 32)); } -void ARM_Unicorn::LoadContext(const ThreadContext& ctx) { +void ARM_Unicorn::LoadContext(const ThreadContext64& ctx) { int uregs[32]; void* tregs[32]; diff --git a/src/core/arm/unicorn/arm_unicorn.h b/src/core/arm/unicorn/arm_unicorn.h index 3c5b155f9..f30d13cb6 100644 --- a/src/core/arm/unicorn/arm_unicorn.h +++ b/src/core/arm/unicorn/arm_unicorn.h @@ -30,8 +30,6 @@ public: void SetTlsAddress(VAddr address) override; void SetTPIDR_EL0(u64 value) override; u64 GetTPIDR_EL0() const override; - void SaveContext(ThreadContext& ctx) override; - void LoadContext(const ThreadContext& ctx) override; void PrepareReschedule() override; void ClearExclusiveState() override; void ExecuteInstructions(std::size_t num_instructions); @@ -41,6 +39,11 @@ public: void PageTableChanged(Common::PageTable&, std::size_t) override {} void RecordBreak(GDBStub::BreakpointAddress bkpt); + void SaveContext(ThreadContext32& ctx) override {} + void SaveContext(ThreadContext64& ctx) override; + void LoadContext(const ThreadContext32& ctx) override {} + void LoadContext(const ThreadContext64& ctx) override; + private: static void InterruptHook(uc_engine* uc, u32 int_no, void* user_data); |