diff options
Diffstat (limited to 'src/core/arm/arm_interface.h')
| -rw-r--r-- | src/core/arm/arm_interface.h | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index 5ae60214e..9f2224b78 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h | |||
| @@ -25,19 +25,11 @@ public: | |||
| 25 | VAddr tls_address; | 25 | VAddr tls_address; |
| 26 | }; | 26 | }; |
| 27 | 27 | ||
| 28 | /** | 28 | /// Runs the CPU until an event happens |
| 29 | * Runs the CPU for the given number of instructions | 29 | virtual void Run() = 0; |
| 30 | * @param num_instructions Number of instructions to run | ||
| 31 | */ | ||
| 32 | void Run(int num_instructions) { | ||
| 33 | ExecuteInstructions(num_instructions); | ||
| 34 | this->num_instructions += num_instructions; | ||
| 35 | } | ||
| 36 | 30 | ||
| 37 | /// Step CPU by one instruction | 31 | /// Step CPU by one instruction |
| 38 | void Step() { | 32 | virtual void Step() = 0; |
| 39 | Run(1); | ||
| 40 | } | ||
| 41 | 33 | ||
| 42 | virtual void MapBackingMemory(VAddr address, size_t size, u8* memory, | 34 | virtual void MapBackingMemory(VAddr address, size_t size, u8* memory, |
| 43 | Kernel::VMAPermission perms) {} | 35 | Kernel::VMAPermission perms) {} |
| @@ -122,19 +114,4 @@ public: | |||
| 122 | 114 | ||
| 123 | /// Prepare core for thread reschedule (if needed to correctly handle state) | 115 | /// Prepare core for thread reschedule (if needed to correctly handle state) |
| 124 | virtual void PrepareReschedule() = 0; | 116 | virtual void PrepareReschedule() = 0; |
| 125 | |||
| 126 | /// Getter for num_instructions | ||
| 127 | u64 GetNumInstructions() const { | ||
| 128 | return num_instructions; | ||
| 129 | } | ||
| 130 | |||
| 131 | protected: | ||
| 132 | /** | ||
| 133 | * Executes the given number of instructions | ||
| 134 | * @param num_instructions Number of instructions to executes | ||
| 135 | */ | ||
| 136 | virtual void ExecuteInstructions(int num_instructions) = 0; | ||
| 137 | |||
| 138 | private: | ||
| 139 | u64 num_instructions = 0; ///< Number of instructions executed | ||
| 140 | }; | 117 | }; |