summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/arm/interpreter/arminit.cpp9
-rw-r--r--src/core/arm/interpreter/armsupp.cpp5
2 files changed, 10 insertions, 4 deletions
diff --git a/src/core/arm/interpreter/arminit.cpp b/src/core/arm/interpreter/arminit.cpp
index 710115375..c6b8197f6 100644
--- a/src/core/arm/interpreter/arminit.cpp
+++ b/src/core/arm/interpreter/arminit.cpp
@@ -16,6 +16,7 @@
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
17 17
18#include <cstring> 18#include <cstring>
19#include "core/mem_map.h"
19#include "core/arm/skyeye_common/armdefs.h" 20#include "core/arm/skyeye_common/armdefs.h"
20#include "core/arm/skyeye_common/armemu.h" 21#include "core/arm/skyeye_common/armemu.h"
21 22
@@ -138,8 +139,16 @@ void ARMul_Reset(ARMul_State* state)
138 state->Bank = SVCBANK; 139 state->Bank = SVCBANK;
139 FLUSHPIPE; 140 FLUSHPIPE;
140 141
142 // Reset CP15
141 ResetMPCoreCP15Registers(state); 143 ResetMPCoreCP15Registers(state);
142 144
145 // This is separate from the CP15 register reset function, as
146 // this isn't an ARM-defined reset value; it's set by the 3DS.
147 //
148 // TODO: Whenever TLS is implemented, this should contain
149 // the address of the 0x200-byte TLS
150 state->CP15[CP15(CP15_THREAD_URO)] = Memory::KERNEL_MEMORY_VADDR;
151
143 state->EndCondition = 0; 152 state->EndCondition = 0;
144 state->ErrorCode = 0; 153 state->ErrorCode = 0;
145 154
diff --git a/src/core/arm/interpreter/armsupp.cpp b/src/core/arm/interpreter/armsupp.cpp
index 6a11a5804..f28fd8c9d 100644
--- a/src/core/arm/interpreter/armsupp.cpp
+++ b/src/core/arm/interpreter/armsupp.cpp
@@ -227,11 +227,8 @@ u32 ReadCP15Register(ARMul_State* cpu, u32 crn, u32 opcode_1, u32 crm, u32 opcod
227 if (opcode_2 == 2) 227 if (opcode_2 == 2)
228 return cpu->CP15[CP15(CP15_THREAD_UPRW)]; 228 return cpu->CP15[CP15(CP15_THREAD_UPRW)];
229 229
230 // TODO: Whenever TLS is implemented, this should return
231 // "cpu->CP15[CP15(CP15_THREAD_URO)];"
232 // which contains the address of the 0x200-byte TLS
233 if (opcode_2 == 3) 230 if (opcode_2 == 3)
234 return Memory::KERNEL_MEMORY_VADDR; 231 return cpu->CP15[CP15(CP15_THREAD_URO)];
235 } 232 }
236 233
237 if (InAPrivilegedMode(cpu)) 234 if (InAPrivilegedMode(cpu))