From 55a540eb0209b58a03c6a095b3b475892af150a9 Mon Sep 17 00:00:00 2001 From: bunnei Date: Thu, 29 May 2014 23:03:47 -0400 Subject: arm: removed unnecessary code when calling SVC from skyeye --- src/core/arm/interpreter/armemu.cpp | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'src/core/arm') diff --git a/src/core/arm/interpreter/armemu.cpp b/src/core/arm/interpreter/armemu.cpp index e5dc7bd4..1e22cda9 100644 --- a/src/core/arm/interpreter/armemu.cpp +++ b/src/core/arm/interpreter/armemu.cpp @@ -4533,23 +4533,7 @@ ARMul_Emulate26 (ARMul_State * state) case 0xfd: case 0xfe: case 0xff: - if (instr == ARMul_ABORTWORD - && state->AbortAddr == pc) { - /* A prefetch abort. */ - XScale_set_fsr_far (state, - ARMul_CP15_R5_MMU_EXCPT, - pc); - ARMul_Abort (state, - ARMul_PrefetchAbortV); - break; - } - //sky_pref_t* pref = get_skyeye_pref(); - //if(pref->user_mode_sim){ - // ARMul_OSHandleSWI (state, BITS (0, 23)); - // break; - //} HLE::CallSVC(instr); - ARMul_Abort (state, ARMul_SWIV); break; } } -- cgit v1.2.3 From e8a17ee6fdf7ab653be32f52afb10f0dafdf61c1 Mon Sep 17 00:00:00 2001 From: bunnei Date: Sun, 1 Jun 2014 21:40:10 -0400 Subject: arm: added option to prepare CPU core (while mid-instruction) for thread reschedule --- src/core/arm/arm_interface.h | 3 +++ src/core/arm/interpreter/arm_interpreter.cpp | 5 +++++ src/core/arm/interpreter/arm_interpreter.h | 3 +++ 3 files changed, 11 insertions(+) (limited to 'src/core/arm') diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index b73786cc..316b50fb 100644 --- a/src/core/arm/arm_interface.h +++ b/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; diff --git a/src/core/arm/interpreter/arm_interpreter.cpp b/src/core/arm/interpreter/arm_interpreter.cpp index 17f787b8..2aa100e8 100644 --- a/src/core/arm/interpreter/arm_interpreter.cpp +++ b/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; +} diff --git a/src/core/arm/interpreter/arm_interpreter.h b/src/core/arm/interpreter/arm_interpreter.h index 6a531e49..1e82883a 100644 --- a/src/core/arm/interpreter/arm_interpreter.h +++ b/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: /** -- cgit v1.2.3 From c330a0a1d66f916fc19cf92160522530baf1aad1 Mon Sep 17 00:00:00 2001 From: bunnei Date: Wed, 4 Jun 2014 18:41:44 -0400 Subject: arm: reverting a change made with cb0663de - this has to have been a typo! --- src/core/arm/interpreter/armemu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/arm') diff --git a/src/core/arm/interpreter/armemu.cpp b/src/core/arm/interpreter/armemu.cpp index 1e22cda9..f3c14e60 100644 --- a/src/core/arm/interpreter/armemu.cpp +++ b/src/core/arm/interpreter/armemu.cpp @@ -4456,6 +4456,7 @@ ARMul_Emulate26 (ARMul_State * state) } /* Drop through. */ + case 0xe0: case 0xe4: case 0xe6: case 0xe8: @@ -4489,7 +4490,6 @@ ARMul_Emulate26 (ARMul_State * state) /* Co-Processor Register Transfers (MRC) and Data Ops. */ - case 0xe0: case 0xe1: case 0xe3: case 0xe5: -- cgit v1.2.3 From 9ece9da50d7c7827b9eb3bb9cfb007fb4af07061 Mon Sep 17 00:00:00 2001 From: bunnei Date: Thu, 5 Jun 2014 00:20:11 -0400 Subject: arm: fixed bug in how thread context switch occurs with SkyEye --- src/core/arm/interpreter/arm_interpreter.cpp | 7 +++++-- src/core/hle/svc.h | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/core/arm') diff --git a/src/core/arm/interpreter/arm_interpreter.cpp b/src/core/arm/interpreter/arm_interpreter.cpp index 2aa100e8..8030ec56 100644 --- a/src/core/arm/interpreter/arm_interpreter.cpp +++ b/src/core/arm/interpreter/arm_interpreter.cpp @@ -118,6 +118,9 @@ void ARM_Interpreter::SaveContext(ThreadContext& ctx) { ctx.fpscr = state->VFP[1]; ctx.fpexc = state->VFP[2]; + + ctx.reg_15 = state->Reg[15]; + ctx.mode = state->NextInstr; } /** @@ -137,8 +140,8 @@ void ARM_Interpreter::LoadContext(const ThreadContext& ctx) { state->VFP[1] = ctx.fpscr; state->VFP[2] = ctx.fpexc; - state->Reg[15] = ctx.pc; - state->NextInstr = RESUME; + state->Reg[15] = ctx.reg_15; + state->NextInstr = ctx.mode; } /// Prepare core for thread reschedule (if needed to correctly handle state) diff --git a/src/core/hle/svc.h b/src/core/hle/svc.h index c5170aab..1d125faf 100644 --- a/src/core/hle/svc.h +++ b/src/core/hle/svc.h @@ -29,6 +29,10 @@ struct ThreadContext { u32 fpu_registers[32]; u32 fpscr; u32 fpexc; + + // These are not part of native ThreadContext, but needed by emu + u32 reg_15; + u32 mode; }; enum ResetType { -- cgit v1.2.3 From 6cdad8390c20aed5c526916816388831d71213a2 Mon Sep 17 00:00:00 2001 From: bunnei Date: Thu, 5 Jun 2014 00:25:32 -0400 Subject: arm: fixed a bug where ARM_Interpreter::ExecuteInstructions was actually executing one more instruction than expected --- src/core/arm/interpreter/arm_interpreter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/arm') diff --git a/src/core/arm/interpreter/arm_interpreter.cpp b/src/core/arm/interpreter/arm_interpreter.cpp index 8030ec56..0e893f18 100644 --- a/src/core/arm/interpreter/arm_interpreter.cpp +++ b/src/core/arm/interpreter/arm_interpreter.cpp @@ -98,7 +98,7 @@ u64 ARM_Interpreter::GetTicks() const { * @param num_instructions Number of instructions to executes */ void ARM_Interpreter::ExecuteInstructions(int num_instructions) { - state->NumInstrsToExecute = num_instructions; + state->NumInstrsToExecute = num_instructions - 1; ARMul_Emulate32(state); } -- cgit v1.2.3