summaryrefslogtreecommitdiff
path: root/src/core/arm
diff options
context:
space:
mode:
authorGravatar bunnei2014-06-14 12:13:16 -0400
committerGravatar bunnei2014-06-14 12:13:16 -0400
commit004df767953a949817da89bddcd5d1379240f769 (patch)
treeb2d54928dcbf3cb4dde0cd5d3277afe7999b7bd9 /src/core/arm
parentGPU debugger: Const correctness and build fix. (diff)
parentKernel: Removed unnecessary "#pragma once". (diff)
downloadyuzu-004df767953a949817da89bddcd5d1379240f769.tar.gz
yuzu-004df767953a949817da89bddcd5d1379240f769.tar.xz
yuzu-004df767953a949817da89bddcd5d1379240f769.zip
Merge branch 'threading' of https://github.com/bunnei/citra
Conflicts: src/core/hle/function_wrappers.h src/core/hle/service/gsp.cpp
Diffstat (limited to 'src/core/arm')
-rw-r--r--src/core/arm/arm_interface.h3
-rw-r--r--src/core/arm/interpreter/arm_interpreter.cpp14
-rw-r--r--src/core/arm/interpreter/arm_interpreter.h3
-rw-r--r--src/core/arm/interpreter/armemu.cpp18
4 files changed, 18 insertions, 20 deletions
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h
index 34a2eba1b..be677ae20 100644
--- a/src/core/arm/arm_interface.h
+++ b/src/core/arm/arm_interface.h
@@ -89,6 +89,9 @@ public:
89 */ 89 */
90 virtual void LoadContext(const ThreadContext& ctx) = 0; 90 virtual void LoadContext(const ThreadContext& ctx) = 0;
91 91
92 /// Prepare core for thread reschedule (if needed to correctly handle state)
93 virtual void PrepareReschedule() = 0;
94
92 /// Getter for num_instructions 95 /// Getter for num_instructions
93 u64 GetNumInstructions() { 96 u64 GetNumInstructions() {
94 return num_instructions; 97 return num_instructions;
diff --git a/src/core/arm/interpreter/arm_interpreter.cpp b/src/core/arm/interpreter/arm_interpreter.cpp
index 17f787b86..0e893f182 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 {
98 * @param num_instructions Number of instructions to executes 98 * @param num_instructions Number of instructions to executes
99 */ 99 */
100void ARM_Interpreter::ExecuteInstructions(int num_instructions) { 100void ARM_Interpreter::ExecuteInstructions(int num_instructions) {
101 state->NumInstrsToExecute = num_instructions; 101 state->NumInstrsToExecute = num_instructions - 1;
102 ARMul_Emulate32(state); 102 ARMul_Emulate32(state);
103} 103}
104 104
@@ -118,6 +118,9 @@ void ARM_Interpreter::SaveContext(ThreadContext& ctx) {
118 118
119 ctx.fpscr = state->VFP[1]; 119 ctx.fpscr = state->VFP[1];
120 ctx.fpexc = state->VFP[2]; 120 ctx.fpexc = state->VFP[2];
121
122 ctx.reg_15 = state->Reg[15];
123 ctx.mode = state->NextInstr;
121} 124}
122 125
123/** 126/**
@@ -137,6 +140,11 @@ void ARM_Interpreter::LoadContext(const ThreadContext& ctx) {
137 state->VFP[1] = ctx.fpscr; 140 state->VFP[1] = ctx.fpscr;
138 state->VFP[2] = ctx.fpexc; 141 state->VFP[2] = ctx.fpexc;
139 142
140 state->Reg[15] = ctx.pc; 143 state->Reg[15] = ctx.reg_15;
141 state->NextInstr = RESUME; 144 state->NextInstr = ctx.mode;
145}
146
147/// Prepare core for thread reschedule (if needed to correctly handle state)
148void ARM_Interpreter::PrepareReschedule() {
149 state->NumInstrsToExecute = 0;
142} 150}
diff --git a/src/core/arm/interpreter/arm_interpreter.h b/src/core/arm/interpreter/arm_interpreter.h
index 6a531e497..1e82883a2 100644
--- a/src/core/arm/interpreter/arm_interpreter.h
+++ b/src/core/arm/interpreter/arm_interpreter.h
@@ -72,6 +72,9 @@ public:
72 */ 72 */
73 void LoadContext(const ThreadContext& ctx); 73 void LoadContext(const ThreadContext& ctx);
74 74
75 /// Prepare core for thread reschedule (if needed to correctly handle state)
76 void PrepareReschedule();
77
75protected: 78protected:
76 79
77 /** 80 /**
diff --git a/src/core/arm/interpreter/armemu.cpp b/src/core/arm/interpreter/armemu.cpp
index e5dc7bd44..f3c14e608 100644
--- a/src/core/arm/interpreter/armemu.cpp
+++ b/src/core/arm/interpreter/armemu.cpp
@@ -4456,6 +4456,7 @@ ARMul_Emulate26 (ARMul_State * state)
4456 } 4456 }
4457 /* Drop through. */ 4457 /* Drop through. */
4458 4458
4459 case 0xe0:
4459 case 0xe4: 4460 case 0xe4:
4460 case 0xe6: 4461 case 0xe6:
4461 case 0xe8: 4462 case 0xe8:
@@ -4489,7 +4490,6 @@ ARMul_Emulate26 (ARMul_State * state)
4489 4490
4490 4491
4491 /* Co-Processor Register Transfers (MRC) and Data Ops. */ 4492 /* Co-Processor Register Transfers (MRC) and Data Ops. */
4492 case 0xe0:
4493 case 0xe1: 4493 case 0xe1:
4494 case 0xe3: 4494 case 0xe3:
4495 case 0xe5: 4495 case 0xe5:
@@ -4533,23 +4533,7 @@ ARMul_Emulate26 (ARMul_State * state)
4533 case 0xfd: 4533 case 0xfd:
4534 case 0xfe: 4534 case 0xfe:
4535 case 0xff: 4535 case 0xff:
4536 if (instr == ARMul_ABORTWORD
4537 && state->AbortAddr == pc) {
4538 /* A prefetch abort. */
4539 XScale_set_fsr_far (state,
4540 ARMul_CP15_R5_MMU_EXCPT,
4541 pc);
4542 ARMul_Abort (state,
4543 ARMul_PrefetchAbortV);
4544 break;
4545 }
4546 //sky_pref_t* pref = get_skyeye_pref();
4547 //if(pref->user_mode_sim){
4548 // ARMul_OSHandleSWI (state, BITS (0, 23));
4549 // break;
4550 //}
4551 HLE::CallSVC(instr); 4536 HLE::CallSVC(instr);
4552 ARMul_Abort (state, ARMul_SWIV);
4553 break; 4537 break;
4554 } 4538 }
4555 } 4539 }