summaryrefslogtreecommitdiff
path: root/src/core/arm/arm_interface.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/arm/arm_interface.h')
-rw-r--r--src/core/arm/arm_interface.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h
new file mode 100644
index 000000000..eee2f6240
--- /dev/null
+++ b/src/core/arm/arm_interface.h
@@ -0,0 +1,68 @@
1// Copyright 2014 Citra Emulator Project
2// Licensed under GPLv2
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "common.h"
8#include "common_types.h"
9
10/// Generic ARM11 CPU interface
11class ARM_Interface {
12public:
13 ARM_Interface() {
14 num_instructions_ = 0;
15 }
16
17 ~ARM_Interface() {
18 }
19
20 /// Step CPU by one instruction
21 void Step() {
22 ExecuteInstruction();
23 num_instructions_++;
24 }
25
26 /**
27 * Set the Program Counter to an address
28 * @param addr Address to set PC to
29 */
30 virtual void SetPC(u32 addr) = 0;
31
32 /*
33 * Get the current Program Counter
34 * @return Returns current PC
35 */
36 virtual u32 PC() = 0;
37
38 /**
39 * Get an ARM register
40 * @param index Register index (0-15)
41 * @return Returns the value in the register
42 */
43 virtual u32 Reg(int index) = 0;
44
45 /**
46 * Get the current CPSR register
47 * @return Returns the value of the CPSR register
48 */
49 virtual u32 CPSR() = 0;
50
51 /**
52 * Returns the number of clock ticks since the last rese
53 * @return Returns number of clock ticks
54 */
55 virtual u64 GetTicks() = 0;
56
57 /// Getter for num_instructions_
58 u64 num_instructions() { return num_instructions_; }
59
60private:
61
62 /// Execture next instruction
63 virtual void ExecuteInstruction() = 0;
64
65 u64 num_instructions_; ///< Number of instructions executed
66
67 DISALLOW_COPY_AND_ASSIGN(ARM_Interface);
68};