diff options
Diffstat (limited to 'src/core/arm/arm_interface.h')
| -rw-r--r-- | src/core/arm/arm_interface.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index e466b21b2..ccd43f431 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h | |||
| @@ -8,15 +8,22 @@ | |||
| 8 | #include "core/arm/skyeye_common/arm_regformat.h" | 8 | #include "core/arm/skyeye_common/arm_regformat.h" |
| 9 | #include "core/arm/skyeye_common/vfp/asm_vfp.h" | 9 | #include "core/arm/skyeye_common/vfp/asm_vfp.h" |
| 10 | 10 | ||
| 11 | namespace Core { | ||
| 12 | struct ThreadContext; | ||
| 13 | } | ||
| 14 | |||
| 15 | /// Generic ARM11 CPU interface | 11 | /// Generic ARM11 CPU interface |
| 16 | class ARM_Interface : NonCopyable { | 12 | class ARM_Interface : NonCopyable { |
| 17 | public: | 13 | public: |
| 18 | virtual ~ARM_Interface() {} | 14 | virtual ~ARM_Interface() {} |
| 19 | 15 | ||
| 16 | struct ThreadContext { | ||
| 17 | u32 cpu_registers[13]; | ||
| 18 | u32 sp; | ||
| 19 | u32 lr; | ||
| 20 | u32 pc; | ||
| 21 | u32 cpsr; | ||
| 22 | u32 fpu_registers[64]; | ||
| 23 | u32 fpscr; | ||
| 24 | u32 fpexc; | ||
| 25 | }; | ||
| 26 | |||
| 20 | /** | 27 | /** |
| 21 | * Runs the CPU for the given number of instructions | 28 | * Runs the CPU for the given number of instructions |
| 22 | * @param num_instructions Number of instructions to run | 29 | * @param num_instructions Number of instructions to run |
| @@ -124,13 +131,13 @@ public: | |||
| 124 | * Saves the current CPU context | 131 | * Saves the current CPU context |
| 125 | * @param ctx Thread context to save | 132 | * @param ctx Thread context to save |
| 126 | */ | 133 | */ |
| 127 | virtual void SaveContext(Core::ThreadContext& ctx) = 0; | 134 | virtual void SaveContext(ThreadContext& ctx) = 0; |
| 128 | 135 | ||
| 129 | /** | 136 | /** |
| 130 | * Loads a CPU context | 137 | * Loads a CPU context |
| 131 | * @param ctx Thread context to load | 138 | * @param ctx Thread context to load |
| 132 | */ | 139 | */ |
| 133 | virtual void LoadContext(const Core::ThreadContext& ctx) = 0; | 140 | virtual void LoadContext(const ThreadContext& ctx) = 0; |
| 134 | 141 | ||
| 135 | /// Prepare core for thread reschedule (if needed to correctly handle state) | 142 | /// Prepare core for thread reschedule (if needed to correctly handle state) |
| 136 | virtual void PrepareReschedule() = 0; | 143 | virtual void PrepareReschedule() = 0; |