summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2014-06-01 21:40:10 -0400
committerGravatar bunnei2014-06-01 21:40:10 -0400
commite8a17ee6fdf7ab653be32f52afb10f0dafdf61c1 (patch)
treec8396f428819e31dbf2ae568538140e44d2bc27c /src
parentsvc: cleaned up function_wrappers, updated various SVCs to make use of pointe... (diff)
downloadyuzu-e8a17ee6fdf7ab653be32f52afb10f0dafdf61c1.tar.gz
yuzu-e8a17ee6fdf7ab653be32f52afb10f0dafdf61c1.tar.xz
yuzu-e8a17ee6fdf7ab653be32f52afb10f0dafdf61c1.zip
arm: added option to prepare CPU core (while mid-instruction) for thread reschedule
Diffstat (limited to 'src')
-rw-r--r--src/core/arm/arm_interface.h3
-rw-r--r--src/core/arm/interpreter/arm_interpreter.cpp5
-rw-r--r--src/core/arm/interpreter/arm_interpreter.h3
3 files changed, 11 insertions, 0 deletions
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h
index b73786ccd..316b50fbb 100644
--- a/src/core/arm/arm_interface.h
+++ b/src/core/arm/arm_interface.h
@@ -89,6 +89,9 @@ public:
89 */ 89 */
90 virtual void LoadContext(const ThreadContext& ctx) = 0; 90 virtual void LoadContext(const ThreadContext& ctx) = 0;
91 91
92 /// Prepare core for thread reschedule (if needed to correctly handle state)
93 virtual void PrepareReschedule() = 0;
94
92 /// Getter for num_instructions 95 /// Getter for num_instructions
93 u64 GetNumInstructions() { 96 u64 GetNumInstructions() {
94 return num_instructions; 97 return num_instructions;
diff --git a/src/core/arm/interpreter/arm_interpreter.cpp b/src/core/arm/interpreter/arm_interpreter.cpp
index 17f787b86..2aa100e86 100644
--- a/src/core/arm/interpreter/arm_interpreter.cpp
+++ b/src/core/arm/interpreter/arm_interpreter.cpp
@@ -140,3 +140,8 @@ void ARM_Interpreter::LoadContext(const ThreadContext& ctx) {
140 state->Reg[15] = ctx.pc; 140 state->Reg[15] = ctx.pc;
141 state->NextInstr = RESUME; 141 state->NextInstr = RESUME;
142} 142}
143
144/// Prepare core for thread reschedule (if needed to correctly handle state)
145void ARM_Interpreter::PrepareReschedule() {
146 state->NumInstrsToExecute = 0;
147}
diff --git a/src/core/arm/interpreter/arm_interpreter.h b/src/core/arm/interpreter/arm_interpreter.h
index 6a531e497..1e82883a2 100644
--- a/src/core/arm/interpreter/arm_interpreter.h
+++ b/src/core/arm/interpreter/arm_interpreter.h
@@ -72,6 +72,9 @@ public:
72 */ 72 */
73 void LoadContext(const ThreadContext& ctx); 73 void LoadContext(const ThreadContext& ctx);
74 74
75 /// Prepare core for thread reschedule (if needed to correctly handle state)
76 void PrepareReschedule();
77
75protected: 78protected:
76 79
77 /** 80 /**