diff options
| author | 2015-03-26 12:54:16 -0400 | |
|---|---|---|
| committer | 2015-04-02 00:19:11 -0400 | |
| commit | 5e5954c63b1a22ba2d333d23ae4c194798fe5412 (patch) | |
| tree | b002936fff0450760eff4469a06e48e745200a36 /src/core/arm/dyncom | |
| parent | dyncom: Migrate InAPrivilegedMode to armsupp (diff) | |
| download | yuzu-5e5954c63b1a22ba2d333d23ae4c194798fe5412.tar.gz yuzu-5e5954c63b1a22ba2d333d23ae4c194798fe5412.tar.xz yuzu-5e5954c63b1a22ba2d333d23ae4c194798fe5412.zip | |
dyncom: Move CP15 register reading into its own function.
Keeps everything contained. Added all supported readable registers in an ARM11 MPCore.
Diffstat (limited to 'src/core/arm/dyncom')
| -rw-r--r-- | src/core/arm/dyncom/arm_dyncom_interpreter.cpp | 47 |
1 files changed, 3 insertions, 44 deletions
diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp index 1fc342d02..88eb49e34 100644 --- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp +++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp | |||
| @@ -3697,6 +3697,7 @@ unsigned InterpreterMainLoop(ARMul_State* state) { | |||
| 3697 | #undef RS | 3697 | #undef RS |
| 3698 | 3698 | ||
| 3699 | #define CRn inst_cream->crn | 3699 | #define CRn inst_cream->crn |
| 3700 | #define OPCODE_1 inst_cream->opcode_1 | ||
| 3700 | #define OPCODE_2 inst_cream->opcode_2 | 3701 | #define OPCODE_2 inst_cream->opcode_2 |
| 3701 | #define CRm inst_cream->crm | 3702 | #define CRm inst_cream->crm |
| 3702 | #define CP15_REG(n) cpu->CP15[CP15(n)] | 3703 | #define CP15_REG(n) cpu->CP15[CP15(n)] |
| @@ -4922,50 +4923,8 @@ unsigned InterpreterMainLoop(ARMul_State* state) { | |||
| 4922 | CITRA_IGNORE_EXIT(-1); | 4923 | CITRA_IGNORE_EXIT(-1); |
| 4923 | goto END; | 4924 | goto END; |
| 4924 | } else { | 4925 | } else { |
| 4925 | if (inst_cream->cp_num == 15) { | 4926 | if (inst_cream->cp_num == 15) |
| 4926 | if(CRn == 0 && OPCODE_2 == 0 && CRm == 0) { | 4927 | RD = ReadCP15Register(cpu, CRn, OPCODE_1, CRm, OPCODE_2); |
| 4927 | RD = cpu->CP15[CP15(CP15_MAIN_ID)]; | ||
| 4928 | } else if (CRn == 0 && CRm == 0 && OPCODE_2 == 1) { | ||
| 4929 | RD = cpu->CP15[CP15(CP15_CACHE_TYPE)]; | ||
| 4930 | } else if (CRn == 1 && CRm == 0 && OPCODE_2 == 0) { | ||
| 4931 | RD = cpu->CP15[CP15(CP15_CONTROL)]; | ||
| 4932 | } else if (CRn == 1 && CRm == 0 && OPCODE_2 == 1) { | ||
| 4933 | RD = cpu->CP15[CP15(CP15_AUXILIARY_CONTROL)]; | ||
| 4934 | } else if (CRn == 1 && CRm == 0 && OPCODE_2 == 2) { | ||
| 4935 | RD = cpu->CP15[CP15(CP15_COPROCESSOR_ACCESS_CONTROL)]; | ||
| 4936 | } else if (CRn == 2 && CRm == 0 && OPCODE_2 == 0) { | ||
| 4937 | RD = cpu->CP15[CP15(CP15_TRANSLATION_BASE_TABLE_0)]; | ||
| 4938 | } else if (CRn == 2 && CRm == 0 && OPCODE_2 == 1) { | ||
| 4939 | RD = cpu->CP15[CP15(CP15_TRANSLATION_BASE_TABLE_1)]; | ||
| 4940 | } else if (CRn == 2 && CRm == 0 && OPCODE_2 == 2) { | ||
| 4941 | RD = cpu->CP15[CP15(CP15_TRANSLATION_BASE_CONTROL)]; | ||
| 4942 | } else if (CRn == 3 && CRm == 0 && OPCODE_2 == 0) { | ||
| 4943 | RD = cpu->CP15[CP15(CP15_DOMAIN_ACCESS_CONTROL)]; | ||
| 4944 | } else if (CRn == 5 && CRm == 0 && OPCODE_2 == 0) { | ||
| 4945 | RD = cpu->CP15[CP15(CP15_FAULT_STATUS)]; | ||
| 4946 | } else if (CRn == 5 && CRm == 0 && OPCODE_2 == 1) { | ||
| 4947 | RD = cpu->CP15[CP15(CP15_INSTR_FAULT_STATUS)]; | ||
| 4948 | } else if (CRn == 6 && CRm == 0 && OPCODE_2 == 0) { | ||
| 4949 | RD = cpu->CP15[CP15(CP15_FAULT_ADDRESS)]; | ||
| 4950 | } else if (CRn == 13) { | ||
| 4951 | if(OPCODE_2 == 0) { | ||
| 4952 | RD = CP15_REG(CP15_PID); | ||
| 4953 | } else if(OPCODE_2 == 1) { | ||
| 4954 | RD = CP15_REG(CP15_CONTEXT_ID); | ||
| 4955 | } else if (OPCODE_2 == 2) { | ||
| 4956 | RD = CP15_REG(CP15_THREAD_UPRW); | ||
| 4957 | } else if(OPCODE_2 == 3) { | ||
| 4958 | RD = Memory::KERNEL_MEMORY_VADDR; | ||
| 4959 | } else if (OPCODE_2 == 4) { | ||
| 4960 | if (InAPrivilegedMode(cpu)) | ||
| 4961 | RD = CP15_REG(CP15_THREAD_PRW); | ||
| 4962 | } else { | ||
| 4963 | LOG_ERROR(Core_ARM11, "mmu_mrr wrote UNKNOWN - reg %d", CRn); | ||
| 4964 | } | ||
| 4965 | } else { | ||
| 4966 | LOG_ERROR(Core_ARM11, "mrc CRn=%d, CRm=%d, OP2=%d is not implemented", CRn, CRm, OPCODE_2); | ||
| 4967 | } | ||
| 4968 | } | ||
| 4969 | } | 4928 | } |
| 4970 | } | 4929 | } |
| 4971 | cpu->Reg[15] += GET_INST_SIZE(cpu); | 4930 | cpu->Reg[15] += GET_INST_SIZE(cpu); |