diff options
| author | 2018-07-20 19:57:45 -0500 | |
|---|---|---|
| committer | 2018-07-20 19:57:45 -0500 | |
| commit | d84eb9dac64f314adcef2c374de245012f658b1d (patch) | |
| tree | 56720a5bce5d1a285dda01c16bfcb1dd57e53054 /src/core/arm/unicorn | |
| parent | Merge pull request #730 from lioncash/string (diff) | |
| download | yuzu-d84eb9dac64f314adcef2c374de245012f658b1d.tar.gz yuzu-d84eb9dac64f314adcef2c374de245012f658b1d.tar.xz yuzu-d84eb9dac64f314adcef2c374de245012f658b1d.zip | |
CPU: Save and restore the TPIDR_EL0 system register on every context switch.
Note that there's currently a dynarmic bug preventing this register from being written.
Diffstat (limited to 'src/core/arm/unicorn')
| -rw-r--r-- | src/core/arm/unicorn/arm_unicorn.cpp | 10 | ||||
| -rw-r--r-- | src/core/arm/unicorn/arm_unicorn.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/core/arm/unicorn/arm_unicorn.cpp b/src/core/arm/unicorn/arm_unicorn.cpp index d2d699e9b..44a46bf04 100644 --- a/src/core/arm/unicorn/arm_unicorn.cpp +++ b/src/core/arm/unicorn/arm_unicorn.cpp | |||
| @@ -169,6 +169,16 @@ void ARM_Unicorn::SetTlsAddress(VAddr base) { | |||
| 169 | CHECKED(uc_reg_write(uc, UC_ARM64_REG_TPIDRRO_EL0, &base)); | 169 | CHECKED(uc_reg_write(uc, UC_ARM64_REG_TPIDRRO_EL0, &base)); |
| 170 | } | 170 | } |
| 171 | 171 | ||
| 172 | u64 ARM_Unicorn::GetTPIDR_EL0() const { | ||
| 173 | u64 value{}; | ||
| 174 | CHECKED(uc_reg_read(uc, UC_ARM64_REG_TPIDR_EL0, &value)); | ||
| 175 | return value; | ||
| 176 | } | ||
| 177 | |||
| 178 | void ARM_Unicorn::SetTPIDR_EL0(u64 value) { | ||
| 179 | CHECKED(uc_reg_write(uc, UC_ARM64_REG_TPIDR_EL0, &value)); | ||
| 180 | } | ||
| 181 | |||
| 172 | void ARM_Unicorn::Run() { | 182 | void ARM_Unicorn::Run() { |
| 173 | if (GDBStub::IsServerEnabled()) { | 183 | if (GDBStub::IsServerEnabled()) { |
| 174 | ExecuteInstructions(std::max(4000000, 0)); | 184 | ExecuteInstructions(std::max(4000000, 0)); |
diff --git a/src/core/arm/unicorn/arm_unicorn.h b/src/core/arm/unicorn/arm_unicorn.h index a78a0acf2..af7943352 100644 --- a/src/core/arm/unicorn/arm_unicorn.h +++ b/src/core/arm/unicorn/arm_unicorn.h | |||
| @@ -28,6 +28,8 @@ public: | |||
| 28 | void SetCPSR(u32 cpsr) override; | 28 | void SetCPSR(u32 cpsr) override; |
| 29 | VAddr GetTlsAddress() const override; | 29 | VAddr GetTlsAddress() const override; |
| 30 | void SetTlsAddress(VAddr address) override; | 30 | void SetTlsAddress(VAddr address) override; |
| 31 | void SetTPIDR_EL0(u64 value) override; | ||
| 32 | u64 GetTPIDR_EL0() const override; | ||
| 31 | void SaveContext(ThreadContext& ctx) override; | 33 | void SaveContext(ThreadContext& ctx) override; |
| 32 | void LoadContext(const ThreadContext& ctx) override; | 34 | void LoadContext(const ThreadContext& ctx) override; |
| 33 | void PrepareReschedule() override; | 35 | void PrepareReschedule() override; |