summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/arm/arm_interface.h15
-rw-r--r--src/core/arm/dyncom/arm_dyncom.cpp8
-rw-r--r--src/core/arm/dyncom/arm_dyncom.h2
3 files changed, 25 insertions, 0 deletions
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h
index fe1e584ad..310663774 100644
--- a/src/core/arm/arm_interface.h
+++ b/src/core/arm/arm_interface.h
@@ -6,6 +6,7 @@
6 6
7#include "common/common.h" 7#include "common/common.h"
8#include "common/common_types.h" 8#include "common/common_types.h"
9#include "core/arm/skyeye_common/arm_regformat.h"
9 10
10namespace Core { 11namespace Core {
11 struct ThreadContext; 12 struct ThreadContext;
@@ -74,6 +75,20 @@ public:
74 virtual void SetCPSR(u32 cpsr) = 0; 75 virtual void SetCPSR(u32 cpsr) = 0;
75 76
76 /** 77 /**
78 * Gets the value stored in a CP15 register.
79 * @param reg The CP15 register to retrieve the value from.
80 * @return the value stored in the given CP15 register.
81 */
82 virtual u32 GetCP15Register(CP15Register reg) = 0;
83
84 /**
85 * Stores the given value into the indicated CP15 register.
86 * @param reg The CP15 register to store the value into.
87 * @param value The value to store into the CP15 register.
88 */
89 virtual void SetCP15Register(CP15Register reg, u32 value) = 0;
90
91 /**
77 * Advance the CPU core by the specified number of ticks (e.g. to simulate CPU execution time) 92 * Advance the CPU core by the specified number of ticks (e.g. to simulate CPU execution time)
78 * @param ticks Number of ticks to advance the CPU core 93 * @param ticks Number of ticks to advance the CPU core
79 */ 94 */
diff --git a/src/core/arm/dyncom/arm_dyncom.cpp b/src/core/arm/dyncom/arm_dyncom.cpp
index cb1a410a0..1b1d01420 100644
--- a/src/core/arm/dyncom/arm_dyncom.cpp
+++ b/src/core/arm/dyncom/arm_dyncom.cpp
@@ -68,6 +68,14 @@ void ARM_DynCom::SetCPSR(u32 cpsr) {
68 state->Cpsr = cpsr; 68 state->Cpsr = cpsr;
69} 69}
70 70
71u32 ARM_DynCom::GetCP15Register(CP15Register reg) {
72 return state->CP15[reg];
73}
74
75void ARM_DynCom::SetCP15Register(CP15Register reg, u32 value) {
76 state->CP15[reg] = value;
77}
78
71void ARM_DynCom::AddTicks(u64 ticks) { 79void ARM_DynCom::AddTicks(u64 ticks) {
72 down_count -= ticks; 80 down_count -= ticks;
73 if (down_count < 0) 81 if (down_count < 0)
diff --git a/src/core/arm/dyncom/arm_dyncom.h b/src/core/arm/dyncom/arm_dyncom.h
index a7f95d307..822b3bbb9 100644
--- a/src/core/arm/dyncom/arm_dyncom.h
+++ b/src/core/arm/dyncom/arm_dyncom.h
@@ -22,6 +22,8 @@ public:
22 void SetReg(int index, u32 value) override; 22 void SetReg(int index, u32 value) override;
23 u32 GetCPSR() const override; 23 u32 GetCPSR() const override;
24 void SetCPSR(u32 cpsr) override; 24 void SetCPSR(u32 cpsr) override;
25 u32 GetCP15Register(CP15Register reg) override;
26 void SetCP15Register(CP15Register reg, u32 value) override;
25 27
26 void AddTicks(u64 ticks) override; 28 void AddTicks(u64 ticks) override;
27 29