aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/arm/arm_interface.h
diff options
context:
space:
mode:
authorGravatar bunnei <bunneidev@gmail.com>2014-05-26 20:52:00 -0400
committerGravatar bunnei <bunneidev@gmail.com>2014-05-26 20:52:00 -0400
commit6448c2f30062c085330ff26a4812c9a91c7b492c (patch)
tree386e32cf3ec053491fb8dfd8459a1c92553241d9 /src/core/arm/arm_interface.h
parent74f972651566bdd1266115fc9dd9a1b652f8dbec (diff)
parent0aa582bf89c3e3e479540b706511590636870912 (diff)
Merge pull request #9 from bunnei/master
Add initial kernel HLE, includes thread creation and context switching
Diffstat (limited to 'src/core/arm/arm_interface.h')
-rw-r--r--src/core/arm/arm_interface.h30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h
index 9fdc7ba3..b73786cc 100644
--- a/src/core/arm/arm_interface.h
+++ b/src/core/arm/arm_interface.h
@@ -7,11 +7,13 @@
#include "common/common.h"
#include "common/common_types.h"
+#include "core/hle/svc.h"
+
/// Generic ARM11 CPU interface
class ARM_Interface : NonCopyable {
public:
ARM_Interface() {
- m_num_instructions = 0;
+ num_instructions = 0;
}
~ARM_Interface() {
@@ -23,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
@@ -64,14 +66,32 @@ 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
*/
virtual u64 GetTicks() const = 0;
- /// Getter for m_num_instructions
+ /**
+ * 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 num_instructions
u64 GetNumInstructions() {
- return m_num_instructions;
+ return num_instructions;
}
protected:
@@ -84,6 +104,6 @@ protected:
private:
- u64 m_num_instructions; ///< Number of instructions executed
+ u64 num_instructions; ///< Number of instructions executed
};