summaryrefslogtreecommitdiffstats
path: root/src/core/arm
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2015-05-11 01:35:37 +0200
committerSubv <subv2112@gmail.com>2015-05-11 01:35:37 +0200
commit000876858d52d7e4fa8e21bc4407d43d548eff30 (patch)
treef0af4cde78349cfe4ea7875b24d37cf85eb3eb03 /src/core/arm
parentMerge pull request #726 from bunnei/gpu-improvements (diff)
downloadyuzu-000876858d52d7e4fa8e21bc4407d43d548eff30.tar
yuzu-000876858d52d7e4fa8e21bc4407d43d548eff30.tar.gz
yuzu-000876858d52d7e4fa8e21bc4407d43d548eff30.tar.bz2
yuzu-000876858d52d7e4fa8e21bc4407d43d548eff30.tar.lz
yuzu-000876858d52d7e4fa8e21bc4407d43d548eff30.tar.xz
yuzu-000876858d52d7e4fa8e21bc4407d43d548eff30.tar.zst
yuzu-000876858d52d7e4fa8e21bc4407d43d548eff30.zip
Diffstat (limited to 'src/core/arm')
-rw-r--r--src/core/arm/arm_interface.h3
-rw-r--r--src/core/arm/dyncom/arm_dyncom.cpp5
-rw-r--r--src/core/arm/dyncom/arm_dyncom.h2
3 files changed, 7 insertions, 3 deletions
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h
index 85ed2c698..976c339e8 100644
--- a/src/core/arm/arm_interface.h
+++ b/src/core/arm/arm_interface.h
@@ -99,8 +99,9 @@ public:
* @param stack_top Pointer to the top of the stack
* @param entry_point Entry point for execution
* @param arg User argument for thread
+ * @param tls_address Address of the Thread Local Storage for the thread
*/
- virtual void ResetContext(Core::ThreadContext& context, u32 stack_top, u32 entry_point, u32 arg) = 0;
+ virtual void ResetContext(Core::ThreadContext& context, u32 stack_top, u32 entry_point, u32 arg, u32 tls_address) = 0;
/**
* Saves the current CPU context
diff --git a/src/core/arm/dyncom/arm_dyncom.cpp b/src/core/arm/dyncom/arm_dyncom.cpp
index 0072ae533..1de1d2612 100644
--- a/src/core/arm/dyncom/arm_dyncom.cpp
+++ b/src/core/arm/dyncom/arm_dyncom.cpp
@@ -90,13 +90,14 @@ void ARM_DynCom::ExecuteInstructions(int num_instructions) {
AddTicks(ticks_executed);
}
-void ARM_DynCom::ResetContext(Core::ThreadContext& context, u32 stack_top, u32 entry_point, u32 arg) {
+void ARM_DynCom::ResetContext(Core::ThreadContext& context, u32 stack_top, u32 entry_point, u32 arg, u32 tls_address) {
memset(&context, 0, sizeof(Core::ThreadContext));
context.cpu_registers[0] = arg;
context.pc = entry_point;
context.sp = stack_top;
context.cpsr = 0x1F; // Usermode
+ context.tls = tls_address;
}
void ARM_DynCom::SaveContext(Core::ThreadContext& ctx) {
@@ -123,6 +124,8 @@ void ARM_DynCom::LoadContext(const Core::ThreadContext& ctx) {
state->VFP[1] = ctx.fpscr;
state->VFP[2] = ctx.fpexc;
+
+ SetCP15Register(CP15_THREAD_URO, ctx.tls);
}
void ARM_DynCom::PrepareReschedule() {
diff --git a/src/core/arm/dyncom/arm_dyncom.h b/src/core/arm/dyncom/arm_dyncom.h
index 2488c879c..b3fd708f1 100644
--- a/src/core/arm/dyncom/arm_dyncom.h
+++ b/src/core/arm/dyncom/arm_dyncom.h
@@ -27,7 +27,7 @@ public:
void AddTicks(u64 ticks) override;
- void ResetContext(Core::ThreadContext& context, u32 stack_top, u32 entry_point, u32 arg) override;
+ void ResetContext(Core::ThreadContext& context, u32 stack_top, u32 entry_point, u32 arg, u32 tls_address) override;
void SaveContext(Core::ThreadContext& ctx) override;
void LoadContext(const Core::ThreadContext& ctx) override;