From ce4d271a53e79814f66a46bd69a8970ea3849ee9 Mon Sep 17 00:00:00 2001 From: bunnei Date: Sun, 11 May 2014 22:14:13 -0400 Subject: added option to set CPSR register to arm_interface --- src/core/arm/arm_interface.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/core/arm/arm_interface.h') diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index 4dfe0570b..602c91e30 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h @@ -55,6 +55,12 @@ public: */ virtual u32 GetCPSR() const = 0; + /** + * Set the current CPSR register + * @param cpsr Value to set CPSR to + */ + virtual void SetCPSR(u32 cpsr) = 0; + /** * Returns the number of clock ticks since the last rese * @return Returns number of clock ticks -- cgit v1.2.3 From 49dc2ce8ac4fc37a008fa28e0771c8c74c576b05 Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 20 May 2014 18:50:16 -0400 Subject: ARM_Interface: added SaveContext and LoadContext functions for HLE thread switching --- src/core/arm/arm_interface.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/core/arm/arm_interface.h') diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index 5c382ebbd..52bc82115 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h @@ -7,6 +7,8 @@ #include "common/common.h" #include "common/common_types.h" +#include "core/hle/svc.h" + /// Generic ARM11 CPU interface class ARM_Interface : NonCopyable { public: @@ -75,6 +77,18 @@ public: */ virtual u64 GetTicks() const = 0; + /** + * Saves the current CPU context + * @param ctx Thread context to save + */ + virtual void SaveContext(ThreadContext& ctx) = 0; + + /** + * Loads a CPU context + * @param ctx Thread context to load + */ + virtual void LoadContext(const ThreadContext& ctx) = 0; + /// Getter for m_num_instructions u64 GetNumInstructions() { return m_num_instructions; @@ -90,6 +104,6 @@ protected: private: - u64 m_num_instructions; ///< Number of instructions executed + u64 m_num_instructions; ///< Number of instructions executed }; -- cgit v1.2.3 From 001280245685ade50326301409e8aee28602504d Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 20 May 2014 18:52:54 -0400 Subject: ARM_Interpreter/ARM_Interface: Fixed member variable naming to be consistent with style guide --- src/core/arm/arm_interface.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/core/arm/arm_interface.h') diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index 52bc82115..b73786ccd 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h @@ -13,7 +13,7 @@ class ARM_Interface : NonCopyable { public: ARM_Interface() { - m_num_instructions = 0; + num_instructions = 0; } ~ARM_Interface() { @@ -25,7 +25,7 @@ public: */ void Run(int num_instructions) { ExecuteInstructions(num_instructions); - m_num_instructions += num_instructions; + num_instructions += num_instructions; } /// Step CPU by one instruction @@ -89,9 +89,9 @@ public: */ virtual void LoadContext(const ThreadContext& ctx) = 0; - /// Getter for m_num_instructions + /// Getter for num_instructions u64 GetNumInstructions() { - return m_num_instructions; + return num_instructions; } protected: @@ -104,6 +104,6 @@ protected: private: - u64 m_num_instructions; ///< Number of instructions executed + u64 num_instructions; ///< Number of instructions executed }; -- cgit v1.2.3