Browse Source

arm: added option to prepare CPU core (while mid-instruction) for thread reschedule

pull/15/merge
bunnei 12 years ago
parent
commit
e8a17ee6fd
  1. 3
      src/core/arm/arm_interface.h
  2. 5
      src/core/arm/interpreter/arm_interpreter.cpp
  3. 3
      src/core/arm/interpreter/arm_interpreter.h

3
src/core/arm/arm_interface.h

@ -89,6 +89,9 @@ public:
*/
virtual void LoadContext(const ThreadContext& ctx) = 0;
/// Prepare core for thread reschedule (if needed to correctly handle state)
virtual void PrepareReschedule() = 0;
/// Getter for num_instructions
u64 GetNumInstructions() {
return num_instructions;

5
src/core/arm/interpreter/arm_interpreter.cpp

@ -140,3 +140,8 @@ void ARM_Interpreter::LoadContext(const ThreadContext& ctx) {
state->Reg[15] = ctx.pc;
state->NextInstr = RESUME;
}
/// Prepare core for thread reschedule (if needed to correctly handle state)
void ARM_Interpreter::PrepareReschedule() {
state->NumInstrsToExecute = 0;
}

3
src/core/arm/interpreter/arm_interpreter.h

@ -72,6 +72,9 @@ public:
*/
void LoadContext(const ThreadContext& ctx);
/// Prepare core for thread reschedule (if needed to correctly handle state)
void PrepareReschedule();
protected:
/**

Loading…
Cancel
Save