summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/arm/dyncom/arm_dyncom_interpreter.cpp1
-rw-r--r--src/core/arm/interpreter/arminit.cpp74
-rw-r--r--src/core/arm/interpreter/armsupp.cpp214
-rw-r--r--src/core/arm/skyeye_common/arm_regformat.h40
-rw-r--r--src/core/arm/skyeye_common/armdefs.h2
5 files changed, 163 insertions, 168 deletions
diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
index b0efd7194..b8fbe7f3a 100644
--- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
+++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
@@ -3700,7 +3700,6 @@ unsigned InterpreterMainLoop(ARMul_State* state) {
3700 #define OPCODE_1 inst_cream->opcode_1 3700 #define OPCODE_1 inst_cream->opcode_1
3701 #define OPCODE_2 inst_cream->opcode_2 3701 #define OPCODE_2 inst_cream->opcode_2
3702 #define CRm inst_cream->crm 3702 #define CRm inst_cream->crm
3703 #define CP15_REG(n) cpu->CP15[CP15(n)]
3704 #define RD cpu->Reg[inst_cream->Rd] 3703 #define RD cpu->Reg[inst_cream->Rd]
3705 #define RD2 cpu->Reg[inst_cream->Rd + 1] 3704 #define RD2 cpu->Reg[inst_cream->Rd + 1]
3706 #define RN cpu->Reg[inst_cream->Rn] 3705 #define RN cpu->Reg[inst_cream->Rn]
diff --git a/src/core/arm/interpreter/arminit.cpp b/src/core/arm/interpreter/arminit.cpp
index c6b8197f6..7254a16f3 100644
--- a/src/core/arm/interpreter/arminit.cpp
+++ b/src/core/arm/interpreter/arminit.cpp
@@ -71,58 +71,58 @@ void ARMul_SelectProcessor(ARMul_State* state, unsigned properties)
71static void ResetMPCoreCP15Registers(ARMul_State* cpu) 71static void ResetMPCoreCP15Registers(ARMul_State* cpu)
72{ 72{
73 // c0 73 // c0
74 cpu->CP15[CP15(CP15_MAIN_ID)] = 0x410FB024; 74 cpu->CP15[CP15_MAIN_ID] = 0x410FB024;
75 cpu->CP15[CP15(CP15_TLB_TYPE)] = 0x00000800; 75 cpu->CP15[CP15_TLB_TYPE] = 0x00000800;
76 cpu->CP15[CP15(CP15_PROCESSOR_FEATURE_0)] = 0x00000111; 76 cpu->CP15[CP15_PROCESSOR_FEATURE_0] = 0x00000111;
77 cpu->CP15[CP15(CP15_PROCESSOR_FEATURE_1)] = 0x00000001; 77 cpu->CP15[CP15_PROCESSOR_FEATURE_1] = 0x00000001;
78 cpu->CP15[CP15(CP15_DEBUG_FEATURE_0)] = 0x00000002; 78 cpu->CP15[CP15_DEBUG_FEATURE_0] = 0x00000002;
79 cpu->CP15[CP15(CP15_MEMORY_MODEL_FEATURE_0)] = 0x01100103; 79 cpu->CP15[CP15_MEMORY_MODEL_FEATURE_0] = 0x01100103;
80 cpu->CP15[CP15(CP15_MEMORY_MODEL_FEATURE_1)] = 0x10020302; 80 cpu->CP15[CP15_MEMORY_MODEL_FEATURE_1] = 0x10020302;
81 cpu->CP15[CP15(CP15_MEMORY_MODEL_FEATURE_2)] = 0x01222000; 81 cpu->CP15[CP15_MEMORY_MODEL_FEATURE_2] = 0x01222000;
82 cpu->CP15[CP15(CP15_MEMORY_MODEL_FEATURE_3)] = 0x00000000; 82 cpu->CP15[CP15_MEMORY_MODEL_FEATURE_3] = 0x00000000;
83 cpu->CP15[CP15(CP15_ISA_FEATURE_0)] = 0x00100011; 83 cpu->CP15[CP15_ISA_FEATURE_0] = 0x00100011;
84 cpu->CP15[CP15(CP15_ISA_FEATURE_1)] = 0x12002111; 84 cpu->CP15[CP15_ISA_FEATURE_1] = 0x12002111;
85 cpu->CP15[CP15(CP15_ISA_FEATURE_2)] = 0x11221011; 85 cpu->CP15[CP15_ISA_FEATURE_2] = 0x11221011;
86 cpu->CP15[CP15(CP15_ISA_FEATURE_3)] = 0x01102131; 86 cpu->CP15[CP15_ISA_FEATURE_3] = 0x01102131;
87 cpu->CP15[CP15(CP15_ISA_FEATURE_4)] = 0x00000141; 87 cpu->CP15[CP15_ISA_FEATURE_4] = 0x00000141;
88 88
89 // c1 89 // c1
90 cpu->CP15[CP15(CP15_CONTROL)] = 0x00054078; 90 cpu->CP15[CP15_CONTROL] = 0x00054078;
91 cpu->CP15[CP15(CP15_AUXILIARY_CONTROL)] = 0x0000000F; 91 cpu->CP15[CP15_AUXILIARY_CONTROL] = 0x0000000F;
92 cpu->CP15[CP15(CP15_COPROCESSOR_ACCESS_CONTROL)] = 0x00000000; 92 cpu->CP15[CP15_COPROCESSOR_ACCESS_CONTROL] = 0x00000000;
93 93
94 // c2 94 // c2
95 cpu->CP15[CP15(CP15_TRANSLATION_BASE_TABLE_0)] = 0x00000000; 95 cpu->CP15[CP15_TRANSLATION_BASE_TABLE_0] = 0x00000000;
96 cpu->CP15[CP15(CP15_TRANSLATION_BASE_TABLE_1)] = 0x00000000; 96 cpu->CP15[CP15_TRANSLATION_BASE_TABLE_1] = 0x00000000;
97 cpu->CP15[CP15(CP15_TRANSLATION_BASE_CONTROL)] = 0x00000000; 97 cpu->CP15[CP15_TRANSLATION_BASE_CONTROL] = 0x00000000;
98 98
99 // c3 99 // c3
100 cpu->CP15[CP15(CP15_DOMAIN_ACCESS_CONTROL)] = 0x00000000; 100 cpu->CP15[CP15_DOMAIN_ACCESS_CONTROL] = 0x00000000;
101 101
102 // c7 102 // c7
103 cpu->CP15[CP15(CP15_PHYS_ADDRESS)] = 0x00000000; 103 cpu->CP15[CP15_PHYS_ADDRESS] = 0x00000000;
104 104
105 // c9 105 // c9
106 cpu->CP15[CP15(CP15_DATA_CACHE_LOCKDOWN)] = 0xFFFFFFF0; 106 cpu->CP15[CP15_DATA_CACHE_LOCKDOWN] = 0xFFFFFFF0;
107 107
108 // c10 108 // c10
109 cpu->CP15[CP15(CP15_TLB_LOCKDOWN)] = 0x00000000; 109 cpu->CP15[CP15_TLB_LOCKDOWN] = 0x00000000;
110 cpu->CP15[CP15(CP15_PRIMARY_REGION_REMAP)] = 0x00098AA4; 110 cpu->CP15[CP15_PRIMARY_REGION_REMAP] = 0x00098AA4;
111 cpu->CP15[CP15(CP15_NORMAL_REGION_REMAP)] = 0x44E048E0; 111 cpu->CP15[CP15_NORMAL_REGION_REMAP] = 0x44E048E0;
112 112
113 // c13 113 // c13
114 cpu->CP15[CP15(CP15_PID)] = 0x00000000; 114 cpu->CP15[CP15_PID] = 0x00000000;
115 cpu->CP15[CP15(CP15_CONTEXT_ID)] = 0x00000000; 115 cpu->CP15[CP15_CONTEXT_ID] = 0x00000000;
116 cpu->CP15[CP15(CP15_THREAD_UPRW)] = 0x00000000; 116 cpu->CP15[CP15_THREAD_UPRW] = 0x00000000;
117 cpu->CP15[CP15(CP15_THREAD_URO)] = 0x00000000; 117 cpu->CP15[CP15_THREAD_URO] = 0x00000000;
118 cpu->CP15[CP15(CP15_THREAD_PRW)] = 0x00000000; 118 cpu->CP15[CP15_THREAD_PRW] = 0x00000000;
119 119
120 // c15 120 // c15
121 cpu->CP15[CP15(CP15_PERFORMANCE_MONITOR_CONTROL)] = 0x00000000; 121 cpu->CP15[CP15_PERFORMANCE_MONITOR_CONTROL] = 0x00000000;
122 cpu->CP15[CP15(CP15_MAIN_TLB_LOCKDOWN_VIRT_ADDRESS)] = 0x00000000; 122 cpu->CP15[CP15_MAIN_TLB_LOCKDOWN_VIRT_ADDRESS] = 0x00000000;
123 cpu->CP15[CP15(CP15_MAIN_TLB_LOCKDOWN_PHYS_ADDRESS)] = 0x00000000; 123 cpu->CP15[CP15_MAIN_TLB_LOCKDOWN_PHYS_ADDRESS] = 0x00000000;
124 cpu->CP15[CP15(CP15_MAIN_TLB_LOCKDOWN_ATTRIBUTE)] = 0x00000000; 124 cpu->CP15[CP15_MAIN_TLB_LOCKDOWN_ATTRIBUTE] = 0x00000000;
125 cpu->CP15[CP15(CP15_TLB_DEBUG_CONTROL)] = 0x00000000; 125 cpu->CP15[CP15_TLB_DEBUG_CONTROL] = 0x00000000;
126} 126}
127 127
128/***************************************************************************\ 128/***************************************************************************\
@@ -147,7 +147,7 @@ void ARMul_Reset(ARMul_State* state)
147 // 147 //
148 // TODO: Whenever TLS is implemented, this should contain 148 // TODO: Whenever TLS is implemented, this should contain
149 // the address of the 0x200-byte TLS 149 // the address of the 0x200-byte TLS
150 state->CP15[CP15(CP15_THREAD_URO)] = Memory::KERNEL_MEMORY_VADDR; 150 state->CP15[CP15_THREAD_URO] = Memory::KERNEL_MEMORY_VADDR;
151 151
152 state->EndCondition = 0; 152 state->EndCondition = 0;
153 state->ErrorCode = 0; 153 state->ErrorCode = 0;
diff --git a/src/core/arm/interpreter/armsupp.cpp b/src/core/arm/interpreter/armsupp.cpp
index f28fd8c9d..a68d53695 100644
--- a/src/core/arm/interpreter/armsupp.cpp
+++ b/src/core/arm/interpreter/armsupp.cpp
@@ -225,10 +225,10 @@ u32 ReadCP15Register(ARMul_State* cpu, u32 crn, u32 opcode_1, u32 crm, u32 opcod
225 if (crn == 13 && opcode_1 == 0 && crm == 0) 225 if (crn == 13 && opcode_1 == 0 && crm == 0)
226 { 226 {
227 if (opcode_2 == 2) 227 if (opcode_2 == 2)
228 return cpu->CP15[CP15(CP15_THREAD_UPRW)]; 228 return cpu->CP15[CP15_THREAD_UPRW];
229 229
230 if (opcode_2 == 3) 230 if (opcode_2 == 3)
231 return cpu->CP15[CP15(CP15_THREAD_URO)]; 231 return cpu->CP15[CP15_THREAD_URO];
232 } 232 }
233 233
234 if (InAPrivilegedMode(cpu)) 234 if (InAPrivilegedMode(cpu))
@@ -238,135 +238,135 @@ u32 ReadCP15Register(ARMul_State* cpu, u32 crn, u32 opcode_1, u32 crm, u32 opcod
238 if (crm == 0) 238 if (crm == 0)
239 { 239 {
240 if (opcode_2 == 0) 240 if (opcode_2 == 0)
241 return cpu->CP15[CP15(CP15_MAIN_ID)]; 241 return cpu->CP15[CP15_MAIN_ID];
242 242
243 if (opcode_2 == 1) 243 if (opcode_2 == 1)
244 return cpu->CP15[CP15(CP15_CACHE_TYPE)]; 244 return cpu->CP15[CP15_CACHE_TYPE];
245 245
246 if (opcode_2 == 3) 246 if (opcode_2 == 3)
247 return cpu->CP15[CP15(CP15_TLB_TYPE)]; 247 return cpu->CP15[CP15_TLB_TYPE];
248 248
249 if (opcode_2 == 5) 249 if (opcode_2 == 5)
250 return cpu->CP15[CP15(CP15_CPU_ID)]; 250 return cpu->CP15[CP15_CPU_ID];
251 } 251 }
252 else if (crm == 1) 252 else if (crm == 1)
253 { 253 {
254 if (opcode_2 == 0) 254 if (opcode_2 == 0)
255 return cpu->CP15[CP15(CP15_PROCESSOR_FEATURE_0)]; 255 return cpu->CP15[CP15_PROCESSOR_FEATURE_0];
256 256
257 if (opcode_2 == 1) 257 if (opcode_2 == 1)
258 return cpu->CP15[CP15(CP15_PROCESSOR_FEATURE_1)]; 258 return cpu->CP15[CP15_PROCESSOR_FEATURE_1];
259 259
260 if (opcode_2 == 2) 260 if (opcode_2 == 2)
261 return cpu->CP15[CP15(CP15_DEBUG_FEATURE_0)]; 261 return cpu->CP15[CP15_DEBUG_FEATURE_0];
262 262
263 if (opcode_2 == 4) 263 if (opcode_2 == 4)
264 return cpu->CP15[CP15(CP15_MEMORY_MODEL_FEATURE_0)]; 264 return cpu->CP15[CP15_MEMORY_MODEL_FEATURE_0];
265 265
266 if (opcode_2 == 5) 266 if (opcode_2 == 5)
267 return cpu->CP15[CP15(CP15_MEMORY_MODEL_FEATURE_1)]; 267 return cpu->CP15[CP15_MEMORY_MODEL_FEATURE_1];
268 268
269 if (opcode_2 == 6) 269 if (opcode_2 == 6)
270 return cpu->CP15[CP15(CP15_MEMORY_MODEL_FEATURE_2)]; 270 return cpu->CP15[CP15_MEMORY_MODEL_FEATURE_2];
271 271
272 if (opcode_2 == 7) 272 if (opcode_2 == 7)
273 return cpu->CP15[CP15(CP15_MEMORY_MODEL_FEATURE_3)]; 273 return cpu->CP15[CP15_MEMORY_MODEL_FEATURE_3];
274 } 274 }
275 else if (crm == 2) 275 else if (crm == 2)
276 { 276 {
277 if (opcode_2 == 0) 277 if (opcode_2 == 0)
278 return cpu->CP15[CP15(CP15_ISA_FEATURE_0)]; 278 return cpu->CP15[CP15_ISA_FEATURE_0];
279 279
280 if (opcode_2 == 1) 280 if (opcode_2 == 1)
281 return cpu->CP15[CP15(CP15_ISA_FEATURE_1)]; 281 return cpu->CP15[CP15_ISA_FEATURE_1];
282 282
283 if (opcode_2 == 2) 283 if (opcode_2 == 2)
284 return cpu->CP15[CP15(CP15_ISA_FEATURE_2)]; 284 return cpu->CP15[CP15_ISA_FEATURE_2];
285 285
286 if (opcode_2 == 3) 286 if (opcode_2 == 3)
287 return cpu->CP15[CP15(CP15_ISA_FEATURE_3)]; 287 return cpu->CP15[CP15_ISA_FEATURE_3];
288 288
289 if (opcode_2 == 4) 289 if (opcode_2 == 4)
290 return cpu->CP15[CP15(CP15_ISA_FEATURE_4)]; 290 return cpu->CP15[CP15_ISA_FEATURE_4];
291 } 291 }
292 } 292 }
293 293
294 if (crn == 1 && opcode_1 == 0 && crm == 0) 294 if (crn == 1 && opcode_1 == 0 && crm == 0)
295 { 295 {
296 if (opcode_2 == 0) 296 if (opcode_2 == 0)
297 return cpu->CP15[CP15(CP15_CONTROL)]; 297 return cpu->CP15[CP15_CONTROL];
298 298
299 if (opcode_2 == 1) 299 if (opcode_2 == 1)
300 return cpu->CP15[CP15(CP15_AUXILIARY_CONTROL)]; 300 return cpu->CP15[CP15_AUXILIARY_CONTROL];
301 301
302 if (opcode_2 == 2) 302 if (opcode_2 == 2)
303 return cpu->CP15[CP15(CP15_COPROCESSOR_ACCESS_CONTROL)]; 303 return cpu->CP15[CP15_COPROCESSOR_ACCESS_CONTROL];
304 } 304 }
305 305
306 if (crn == 2 && opcode_1 == 0 && crm == 0) 306 if (crn == 2 && opcode_1 == 0 && crm == 0)
307 { 307 {
308 if (opcode_2 == 0) 308 if (opcode_2 == 0)
309 return cpu->CP15[CP15(CP15_TRANSLATION_BASE_TABLE_0)]; 309 return cpu->CP15[CP15_TRANSLATION_BASE_TABLE_0];
310 310
311 if (opcode_2 == 1) 311 if (opcode_2 == 1)
312 return cpu->CP15[CP15(CP15_TRANSLATION_BASE_TABLE_1)]; 312 return cpu->CP15[CP15_TRANSLATION_BASE_TABLE_1];
313 313
314 if (opcode_2 == 2) 314 if (opcode_2 == 2)
315 return cpu->CP15[CP15(CP15_TRANSLATION_BASE_CONTROL)]; 315 return cpu->CP15[CP15_TRANSLATION_BASE_CONTROL];
316 } 316 }
317 317
318 if (crn == 3 && opcode_1 == 0 && crm == 0 && opcode_2 == 0) 318 if (crn == 3 && opcode_1 == 0 && crm == 0 && opcode_2 == 0)
319 return cpu->CP15[CP15(CP15_DOMAIN_ACCESS_CONTROL)]; 319 return cpu->CP15[CP15_DOMAIN_ACCESS_CONTROL];
320 320
321 if (crn == 5 && opcode_1 == 0 && crm == 0) 321 if (crn == 5 && opcode_1 == 0 && crm == 0)
322 { 322 {
323 if (opcode_2 == 0) 323 if (opcode_2 == 0)
324 return cpu->CP15[CP15(CP15_FAULT_STATUS)]; 324 return cpu->CP15[CP15_FAULT_STATUS];
325 325
326 if (opcode_2 == 1) 326 if (opcode_2 == 1)
327 return cpu->CP15[CP15(CP15_INSTR_FAULT_STATUS)]; 327 return cpu->CP15[CP15_INSTR_FAULT_STATUS];
328 } 328 }
329 329
330 if (crn == 6 && opcode_1 == 0 && crm == 0) 330 if (crn == 6 && opcode_1 == 0 && crm == 0)
331 { 331 {
332 if (opcode_2 == 0) 332 if (opcode_2 == 0)
333 return cpu->CP15[CP15(CP15_FAULT_ADDRESS)]; 333 return cpu->CP15[CP15_FAULT_ADDRESS];
334 334
335 if (opcode_2 == 1) 335 if (opcode_2 == 1)
336 return cpu->CP15[CP15(CP15_WFAR)]; 336 return cpu->CP15[CP15_WFAR];
337 } 337 }
338 338
339 if (crn == 7 && opcode_1 == 0 && crm == 4 && opcode_2 == 0) 339 if (crn == 7 && opcode_1 == 0 && crm == 4 && opcode_2 == 0)
340 return cpu->CP15[CP15(CP15_PHYS_ADDRESS)]; 340 return cpu->CP15[CP15_PHYS_ADDRESS];
341 341
342 if (crn == 9 && opcode_1 == 0 && crm == 0 && opcode_2 == 0) 342 if (crn == 9 && opcode_1 == 0 && crm == 0 && opcode_2 == 0)
343 return cpu->CP15[CP15(CP15_DATA_CACHE_LOCKDOWN)]; 343 return cpu->CP15[CP15_DATA_CACHE_LOCKDOWN];
344 344
345 if (crn == 10 && opcode_1 == 0) 345 if (crn == 10 && opcode_1 == 0)
346 { 346 {
347 if (crm == 0 && opcode_2 == 0) 347 if (crm == 0 && opcode_2 == 0)
348 return cpu->CP15[CP15(CP15_TLB_LOCKDOWN)]; 348 return cpu->CP15[CP15_TLB_LOCKDOWN];
349 349
350 if (crm == 2) 350 if (crm == 2)
351 { 351 {
352 if (opcode_2 == 0) 352 if (opcode_2 == 0)
353 return cpu->CP15[CP15(CP15_PRIMARY_REGION_REMAP)]; 353 return cpu->CP15[CP15_PRIMARY_REGION_REMAP];
354 354
355 if (opcode_2 == 1) 355 if (opcode_2 == 1)
356 return cpu->CP15[CP15(CP15_NORMAL_REGION_REMAP)]; 356 return cpu->CP15[CP15_NORMAL_REGION_REMAP];
357 } 357 }
358 } 358 }
359 359
360 if (crn == 13 && crm == 0) 360 if (crn == 13 && crm == 0)
361 { 361 {
362 if (opcode_2 == 0) 362 if (opcode_2 == 0)
363 return cpu->CP15[CP15(CP15_PID)]; 363 return cpu->CP15[CP15_PID];
364 364
365 if (opcode_2 == 1) 365 if (opcode_2 == 1)
366 return cpu->CP15[CP15(CP15_CONTEXT_ID)]; 366 return cpu->CP15[CP15_CONTEXT_ID];
367 367
368 if (opcode_2 == 4) 368 if (opcode_2 == 4)
369 return cpu->CP15[CP15(CP15_THREAD_PRW)]; 369 return cpu->CP15[CP15_THREAD_PRW];
370 } 370 }
371 371
372 if (crn == 15) 372 if (crn == 15)
@@ -374,32 +374,32 @@ u32 ReadCP15Register(ARMul_State* cpu, u32 crn, u32 opcode_1, u32 crm, u32 opcod
374 if (opcode_1 == 0 && crm == 12) 374 if (opcode_1 == 0 && crm == 12)
375 { 375 {
376 if (opcode_2 == 0) 376 if (opcode_2 == 0)
377 return cpu->CP15[CP15(CP15_PERFORMANCE_MONITOR_CONTROL)]; 377 return cpu->CP15[CP15_PERFORMANCE_MONITOR_CONTROL];
378 378
379 if (opcode_2 == 1) 379 if (opcode_2 == 1)
380 return cpu->CP15[CP15(CP15_CYCLE_COUNTER)]; 380 return cpu->CP15[CP15_CYCLE_COUNTER];
381 381
382 if (opcode_2 == 2) 382 if (opcode_2 == 2)
383 return cpu->CP15[CP15(CP15_COUNT_0)]; 383 return cpu->CP15[CP15_COUNT_0];
384 384
385 if (opcode_2 == 3) 385 if (opcode_2 == 3)
386 return cpu->CP15[CP15(CP15_COUNT_1)]; 386 return cpu->CP15[CP15_COUNT_1];
387 } 387 }
388 388
389 if (opcode_1 == 5 && opcode_2 == 2) 389 if (opcode_1 == 5 && opcode_2 == 2)
390 { 390 {
391 if (crm == 5) 391 if (crm == 5)
392 return cpu->CP15[CP15(CP15_MAIN_TLB_LOCKDOWN_VIRT_ADDRESS)]; 392 return cpu->CP15[CP15_MAIN_TLB_LOCKDOWN_VIRT_ADDRESS];
393 393
394 if (crm == 6) 394 if (crm == 6)
395 return cpu->CP15[CP15(CP15_MAIN_TLB_LOCKDOWN_PHYS_ADDRESS)]; 395 return cpu->CP15[CP15_MAIN_TLB_LOCKDOWN_PHYS_ADDRESS];
396 396
397 if (crm == 7) 397 if (crm == 7)
398 return cpu->CP15[CP15(CP15_MAIN_TLB_LOCKDOWN_ATTRIBUTE)]; 398 return cpu->CP15[CP15_MAIN_TLB_LOCKDOWN_ATTRIBUTE];
399 } 399 }
400 400
401 if (opcode_1 == 7 && crm == 1 && opcode_2 == 0) 401 if (opcode_1 == 7 && crm == 1 && opcode_2 == 0)
402 return cpu->CP15[CP15(CP15_TLB_DEBUG_CONTROL)]; 402 return cpu->CP15[CP15_TLB_DEBUG_CONTROL];
403 } 403 }
404 } 404 }
405 405
@@ -417,38 +417,38 @@ void WriteCP15Register(ARMul_State* cpu, u32 value, u32 crn, u32 opcode_1, u32 c
417 if (crn == 1 && opcode_1 == 0 && crm == 0) 417 if (crn == 1 && opcode_1 == 0 && crm == 0)
418 { 418 {
419 if (opcode_2 == 0) 419 if (opcode_2 == 0)
420 cpu->CP15[CP15(CP15_CONTROL)] = value; 420 cpu->CP15[CP15_CONTROL] = value;
421 else if (opcode_2 == 1) 421 else if (opcode_2 == 1)
422 cpu->CP15[CP15(CP15_AUXILIARY_CONTROL)] = value; 422 cpu->CP15[CP15_AUXILIARY_CONTROL] = value;
423 else if (opcode_2 == 2) 423 else if (opcode_2 == 2)
424 cpu->CP15[CP15(CP15_COPROCESSOR_ACCESS_CONTROL)] = value; 424 cpu->CP15[CP15_COPROCESSOR_ACCESS_CONTROL] = value;
425 } 425 }
426 else if (crn == 2 && opcode_1 == 0 && crm == 0) 426 else if (crn == 2 && opcode_1 == 0 && crm == 0)
427 { 427 {
428 if (opcode_2 == 0) 428 if (opcode_2 == 0)
429 cpu->CP15[CP15(CP15_TRANSLATION_BASE_TABLE_0)] = value; 429 cpu->CP15[CP15_TRANSLATION_BASE_TABLE_0] = value;
430 else if (opcode_2 == 1) 430 else if (opcode_2 == 1)
431 cpu->CP15[CP15(CP15_TRANSLATION_BASE_TABLE_1)] = value; 431 cpu->CP15[CP15_TRANSLATION_BASE_TABLE_1] = value;
432 else if (opcode_2 == 2) 432 else if (opcode_2 == 2)
433 cpu->CP15[CP15(CP15_TRANSLATION_BASE_CONTROL)] = value; 433 cpu->CP15[CP15_TRANSLATION_BASE_CONTROL] = value;
434 } 434 }
435 else if (crn == 3 && opcode_1 == 0 && crm == 0 && opcode_2 == 0) 435 else if (crn == 3 && opcode_1 == 0 && crm == 0 && opcode_2 == 0)
436 { 436 {
437 cpu->CP15[CP15(CP15_DOMAIN_ACCESS_CONTROL)] = value; 437 cpu->CP15[CP15_DOMAIN_ACCESS_CONTROL] = value;
438 } 438 }
439 else if (crn == 5 && opcode_1 == 0 && crm == 0) 439 else if (crn == 5 && opcode_1 == 0 && crm == 0)
440 { 440 {
441 if (opcode_2 == 0) 441 if (opcode_2 == 0)
442 cpu->CP15[CP15(CP15_FAULT_STATUS)] = value; 442 cpu->CP15[CP15_FAULT_STATUS] = value;
443 else if (opcode_2 == 1) 443 else if (opcode_2 == 1)
444 cpu->CP15[CP15(CP15_INSTR_FAULT_STATUS)] = value; 444 cpu->CP15[CP15_INSTR_FAULT_STATUS] = value;
445 } 445 }
446 else if (crn == 6 && opcode_1 == 0 && crm == 0) 446 else if (crn == 6 && opcode_1 == 0 && crm == 0)
447 { 447 {
448 if (opcode_2 == 0) 448 if (opcode_2 == 0)
449 cpu->CP15[CP15(CP15_FAULT_ADDRESS)] = value; 449 cpu->CP15[CP15_FAULT_ADDRESS] = value;
450 else if (opcode_2 == 1) 450 else if (opcode_2 == 1)
451 cpu->CP15[CP15(CP15_WFAR)] = value; 451 cpu->CP15[CP15_WFAR] = value;
452 } 452 }
453 else if (crn == 7 && opcode_1 == 0) 453 else if (crn == 7 && opcode_1 == 0)
454 { 454 {
@@ -456,56 +456,56 @@ void WriteCP15Register(ARMul_State* cpu, u32 value, u32 crn, u32 opcode_1, u32 c
456 456
457 if (crm == 0 && opcode_2 == 4) 457 if (crm == 0 && opcode_2 == 4)
458 { 458 {
459 cpu->CP15[CP15(CP15_WAIT_FOR_INTERRUPT)] = value; 459 cpu->CP15[CP15_WAIT_FOR_INTERRUPT] = value;
460 } 460 }
461 else if (crm == 4 && opcode_2 == 0) 461 else if (crm == 4 && opcode_2 == 0)
462 { 462 {
463 // NOTE: Not entirely accurate. This should do permission checks. 463 // NOTE: Not entirely accurate. This should do permission checks.
464 cpu->CP15[CP15(CP15_PHYS_ADDRESS)] = Memory::VirtualToPhysicalAddress(value); 464 cpu->CP15[CP15_PHYS_ADDRESS] = Memory::VirtualToPhysicalAddress(value);
465 } 465 }
466 else if (crm == 5) 466 else if (crm == 5)
467 { 467 {
468 if (opcode_2 == 0) 468 if (opcode_2 == 0)
469 cpu->CP15[CP15(CP15_INVALIDATE_INSTR_CACHE)] = value; 469 cpu->CP15[CP15_INVALIDATE_INSTR_CACHE] = value;
470 else if (opcode_2 == 1) 470 else if (opcode_2 == 1)
471 cpu->CP15[CP15(CP15_INVALIDATE_INSTR_CACHE_USING_MVA)] = value; 471 cpu->CP15[CP15_INVALIDATE_INSTR_CACHE_USING_MVA] = value;
472 else if (opcode_2 == 2) 472 else if (opcode_2 == 2)
473 cpu->CP15[CP15(CP15_INVALIDATE_INSTR_CACHE_USING_INDEX)] = value; 473 cpu->CP15[CP15_INVALIDATE_INSTR_CACHE_USING_INDEX] = value;
474 else if (opcode_2 == 6) 474 else if (opcode_2 == 6)
475 cpu->CP15[CP15(CP15_FLUSH_BRANCH_TARGET_CACHE)] = value; 475 cpu->CP15[CP15_FLUSH_BRANCH_TARGET_CACHE] = value;
476 else if (opcode_2 == 7) 476 else if (opcode_2 == 7)
477 cpu->CP15[CP15(CP15_FLUSH_BRANCH_TARGET_CACHE_ENTRY)] = value; 477 cpu->CP15[CP15_FLUSH_BRANCH_TARGET_CACHE_ENTRY] = value;
478 } 478 }
479 else if (crm == 6) 479 else if (crm == 6)
480 { 480 {
481 if (opcode_2 == 0) 481 if (opcode_2 == 0)
482 cpu->CP15[CP15(CP15_INVALIDATE_DATA_CACHE)] = value; 482 cpu->CP15[CP15_INVALIDATE_DATA_CACHE] = value;
483 else if (opcode_2 == 1) 483 else if (opcode_2 == 1)
484 cpu->CP15[CP15(CP15_INVALIDATE_DATA_CACHE_LINE_USING_MVA)] = value; 484 cpu->CP15[CP15_INVALIDATE_DATA_CACHE_LINE_USING_MVA] = value;
485 else if (opcode_2 == 2) 485 else if (opcode_2 == 2)
486 cpu->CP15[CP15(CP15_INVALIDATE_DATA_CACHE_LINE_USING_INDEX)] = value; 486 cpu->CP15[CP15_INVALIDATE_DATA_CACHE_LINE_USING_INDEX] = value;
487 } 487 }
488 else if (crm == 7 && opcode_2 == 0) 488 else if (crm == 7 && opcode_2 == 0)
489 { 489 {
490 cpu->CP15[CP15(CP15_INVALIDATE_DATA_AND_INSTR_CACHE)] = value; 490 cpu->CP15[CP15_INVALIDATE_DATA_AND_INSTR_CACHE] = value;
491 } 491 }
492 else if (crm == 10) 492 else if (crm == 10)
493 { 493 {
494 if (opcode_2 == 0) 494 if (opcode_2 == 0)
495 cpu->CP15[CP15(CP15_CLEAN_DATA_CACHE)] = value; 495 cpu->CP15[CP15_CLEAN_DATA_CACHE] = value;
496 else if (opcode_2 == 1) 496 else if (opcode_2 == 1)
497 cpu->CP15[CP15(CP15_CLEAN_DATA_CACHE_LINE_USING_MVA)] = value; 497 cpu->CP15[CP15_CLEAN_DATA_CACHE_LINE_USING_MVA] = value;
498 else if (opcode_2 == 2) 498 else if (opcode_2 == 2)
499 cpu->CP15[CP15(CP15_CLEAN_DATA_CACHE_LINE_USING_INDEX)] = value; 499 cpu->CP15[CP15_CLEAN_DATA_CACHE_LINE_USING_INDEX] = value;
500 } 500 }
501 else if (crm == 14) 501 else if (crm == 14)
502 { 502 {
503 if (opcode_2 == 0) 503 if (opcode_2 == 0)
504 cpu->CP15[CP15(CP15_CLEAN_AND_INVALIDATE_DATA_CACHE)] = value; 504 cpu->CP15[CP15_CLEAN_AND_INVALIDATE_DATA_CACHE] = value;
505 else if (opcode_2 == 1) 505 else if (opcode_2 == 1)
506 cpu->CP15[CP15(CP15_CLEAN_AND_INVALIDATE_DATA_CACHE_LINE_USING_MVA)] = value; 506 cpu->CP15[CP15_CLEAN_AND_INVALIDATE_DATA_CACHE_LINE_USING_MVA] = value;
507 else if (opcode_2 == 2) 507 else if (opcode_2 == 2)
508 cpu->CP15[CP15(CP15_CLEAN_AND_INVALIDATE_DATA_CACHE_LINE_USING_INDEX)] = value; 508 cpu->CP15[CP15_CLEAN_AND_INVALIDATE_DATA_CACHE_LINE_USING_INDEX] = value;
509 } 509 }
510 } 510 }
511 else if (crn == 8 && opcode_1 == 0) 511 else if (crn == 8 && opcode_1 == 0)
@@ -515,104 +515,104 @@ void WriteCP15Register(ARMul_State* cpu, u32 value, u32 crn, u32 opcode_1, u32 c
515 if (crm == 5) 515 if (crm == 5)
516 { 516 {
517 if (opcode_2 == 0) 517 if (opcode_2 == 0)
518 cpu->CP15[CP15(CP15_INVALIDATE_ITLB)] = value; 518 cpu->CP15[CP15_INVALIDATE_ITLB] = value;
519 else if (opcode_2 == 1) 519 else if (opcode_2 == 1)
520 cpu->CP15[CP15(CP15_INVALIDATE_ITLB_SINGLE_ENTRY)] = value; 520 cpu->CP15[CP15_INVALIDATE_ITLB_SINGLE_ENTRY] = value;
521 else if (opcode_2 == 2) 521 else if (opcode_2 == 2)
522 cpu->CP15[CP15(CP15_INVALIDATE_ITLB_ENTRY_ON_ASID_MATCH)] = value; 522 cpu->CP15[CP15_INVALIDATE_ITLB_ENTRY_ON_ASID_MATCH] = value;
523 else if (opcode_2 == 3) 523 else if (opcode_2 == 3)
524 cpu->CP15[CP15(CP15_INVALIDATE_ITLB_ENTRY_ON_MVA)] = value; 524 cpu->CP15[CP15_INVALIDATE_ITLB_ENTRY_ON_MVA] = value;
525 } 525 }
526 else if (crm == 6) 526 else if (crm == 6)
527 { 527 {
528 if (opcode_2 == 0) 528 if (opcode_2 == 0)
529 cpu->CP15[CP15(CP15_INVALIDATE_DTLB)] = value; 529 cpu->CP15[CP15_INVALIDATE_DTLB] = value;
530 else if (opcode_2 == 1) 530 else if (opcode_2 == 1)
531 cpu->CP15[CP15(CP15_INVALIDATE_DTLB_SINGLE_ENTRY)] = value; 531 cpu->CP15[CP15_INVALIDATE_DTLB_SINGLE_ENTRY] = value;
532 else if (opcode_2 == 2) 532 else if (opcode_2 == 2)
533 cpu->CP15[CP15(CP15_INVALIDATE_DTLB_ENTRY_ON_ASID_MATCH)] = value; 533 cpu->CP15[CP15_INVALIDATE_DTLB_ENTRY_ON_ASID_MATCH] = value;
534 else if (opcode_2 == 3) 534 else if (opcode_2 == 3)
535 cpu->CP15[CP15(CP15_INVALIDATE_DTLB_ENTRY_ON_MVA)] = value; 535 cpu->CP15[CP15_INVALIDATE_DTLB_ENTRY_ON_MVA] = value;
536 } 536 }
537 else if (crm == 7) 537 else if (crm == 7)
538 { 538 {
539 if (opcode_2 == 0) 539 if (opcode_2 == 0)
540 cpu->CP15[CP15(CP15_INVALIDATE_UTLB)] = value; 540 cpu->CP15[CP15_INVALIDATE_UTLB] = value;
541 else if (opcode_2 == 1) 541 else if (opcode_2 == 1)
542 cpu->CP15[CP15(CP15_INVALIDATE_UTLB_SINGLE_ENTRY)] = value; 542 cpu->CP15[CP15_INVALIDATE_UTLB_SINGLE_ENTRY] = value;
543 else if (opcode_2 == 2) 543 else if (opcode_2 == 2)
544 cpu->CP15[CP15(CP15_INVALIDATE_UTLB_ENTRY_ON_ASID_MATCH)] = value; 544 cpu->CP15[CP15_INVALIDATE_UTLB_ENTRY_ON_ASID_MATCH] = value;
545 else if (opcode_2 == 3) 545 else if (opcode_2 == 3)
546 cpu->CP15[CP15(CP15_INVALIDATE_UTLB_ENTRY_ON_MVA)] = value; 546 cpu->CP15[CP15_INVALIDATE_UTLB_ENTRY_ON_MVA] = value;
547 } 547 }
548 } 548 }
549 else if (crn == 9 && opcode_1 == 0 && crm == 0 && opcode_2 == 0) 549 else if (crn == 9 && opcode_1 == 0 && crm == 0 && opcode_2 == 0)
550 { 550 {
551 cpu->CP15[CP15(CP15_DATA_CACHE_LOCKDOWN)] = value; 551 cpu->CP15[CP15_DATA_CACHE_LOCKDOWN] = value;
552 } 552 }
553 else if (crn == 10 && opcode_1 == 0) 553 else if (crn == 10 && opcode_1 == 0)
554 { 554 {
555 if (crm == 0 && opcode_2 == 0) 555 if (crm == 0 && opcode_2 == 0)
556 { 556 {
557 cpu->CP15[CP15(CP15_TLB_LOCKDOWN)] = value; 557 cpu->CP15[CP15_TLB_LOCKDOWN] = value;
558 } 558 }
559 else if (crm == 2) 559 else if (crm == 2)
560 { 560 {
561 if (opcode_2 == 0) 561 if (opcode_2 == 0)
562 cpu->CP15[CP15(CP15_PRIMARY_REGION_REMAP)] = value; 562 cpu->CP15[CP15_PRIMARY_REGION_REMAP] = value;
563 else if (opcode_2 == 1) 563 else if (opcode_2 == 1)
564 cpu->CP15[CP15(CP15_NORMAL_REGION_REMAP)] = value; 564 cpu->CP15[CP15_NORMAL_REGION_REMAP] = value;
565 } 565 }
566 } 566 }
567 else if (crn == 13 && opcode_1 == 0 && crm == 0) 567 else if (crn == 13 && opcode_1 == 0 && crm == 0)
568 { 568 {
569 if (opcode_2 == 0) 569 if (opcode_2 == 0)
570 cpu->CP15[CP15(CP15_PID)] = value; 570 cpu->CP15[CP15_PID] = value;
571 else if (opcode_2 == 1) 571 else if (opcode_2 == 1)
572 cpu->CP15[CP15(CP15_CONTEXT_ID)] = value; 572 cpu->CP15[CP15_CONTEXT_ID] = value;
573 else if (opcode_2 == 3) 573 else if (opcode_2 == 3)
574 cpu->CP15[CP15(CP15_THREAD_URO)] = value; 574 cpu->CP15[CP15_THREAD_URO] = value;
575 else if (opcode_2 == 4) 575 else if (opcode_2 == 4)
576 cpu->CP15[CP15(CP15_THREAD_PRW)] = value; 576 cpu->CP15[CP15_THREAD_PRW] = value;
577 } 577 }
578 else if (crn == 15) 578 else if (crn == 15)
579 { 579 {
580 if (opcode_1 == 0 && crm == 12) 580 if (opcode_1 == 0 && crm == 12)
581 { 581 {
582 if (opcode_2 == 0) 582 if (opcode_2 == 0)
583 cpu->CP15[CP15(CP15_PERFORMANCE_MONITOR_CONTROL)] = value; 583 cpu->CP15[CP15_PERFORMANCE_MONITOR_CONTROL] = value;
584 else if (opcode_2 == 1) 584 else if (opcode_2 == 1)
585 cpu->CP15[CP15(CP15_CYCLE_COUNTER)] = value; 585 cpu->CP15[CP15_CYCLE_COUNTER] = value;
586 else if (opcode_2 == 2) 586 else if (opcode_2 == 2)
587 cpu->CP15[CP15(CP15_COUNT_0)] = value; 587 cpu->CP15[CP15_COUNT_0] = value;
588 else if (opcode_2 == 3) 588 else if (opcode_2 == 3)
589 cpu->CP15[CP15(CP15_COUNT_1)] = value; 589 cpu->CP15[CP15_COUNT_1] = value;
590 } 590 }
591 else if (opcode_1 == 5) 591 else if (opcode_1 == 5)
592 { 592 {
593 if (crm == 4) 593 if (crm == 4)
594 { 594 {
595 if (opcode_2 == 2) 595 if (opcode_2 == 2)
596 cpu->CP15[CP15(CP15_READ_MAIN_TLB_LOCKDOWN_ENTRY)] = value; 596 cpu->CP15[CP15_READ_MAIN_TLB_LOCKDOWN_ENTRY] = value;
597 else if (opcode_2 == 4) 597 else if (opcode_2 == 4)
598 cpu->CP15[CP15(CP15_WRITE_MAIN_TLB_LOCKDOWN_ENTRY)] = value; 598 cpu->CP15[CP15_WRITE_MAIN_TLB_LOCKDOWN_ENTRY] = value;
599 } 599 }
600 else if (crm == 5 && opcode_2 == 2) 600 else if (crm == 5 && opcode_2 == 2)
601 { 601 {
602 cpu->CP15[CP15(CP15_MAIN_TLB_LOCKDOWN_VIRT_ADDRESS)] = value; 602 cpu->CP15[CP15_MAIN_TLB_LOCKDOWN_VIRT_ADDRESS] = value;
603 } 603 }
604 else if (crm == 6 && opcode_2 == 2) 604 else if (crm == 6 && opcode_2 == 2)
605 { 605 {
606 cpu->CP15[CP15(CP15_MAIN_TLB_LOCKDOWN_PHYS_ADDRESS)] = value; 606 cpu->CP15[CP15_MAIN_TLB_LOCKDOWN_PHYS_ADDRESS] = value;
607 } 607 }
608 else if (crm == 7 && opcode_2 == 2) 608 else if (crm == 7 && opcode_2 == 2)
609 { 609 {
610 cpu->CP15[CP15(CP15_MAIN_TLB_LOCKDOWN_ATTRIBUTE)] = value; 610 cpu->CP15[CP15_MAIN_TLB_LOCKDOWN_ATTRIBUTE] = value;
611 } 611 }
612 } 612 }
613 else if (opcode_1 == 7 && crm == 1 && opcode_2 == 0) 613 else if (opcode_1 == 7 && crm == 1 && opcode_2 == 0)
614 { 614 {
615 cpu->CP15[CP15(CP15_TLB_DEBUG_CONTROL)] = value; 615 cpu->CP15[CP15_TLB_DEBUG_CONTROL] = value;
616 } 616 }
617 } 617 }
618 } 618 }
@@ -620,18 +620,18 @@ void WriteCP15Register(ARMul_State* cpu, u32 value, u32 crn, u32 opcode_1, u32 c
620 // Unprivileged registers 620 // Unprivileged registers
621 if (crn == 7 && opcode_1 == 0 && crm == 5 && opcode_2 == 4) 621 if (crn == 7 && opcode_1 == 0 && crm == 5 && opcode_2 == 4)
622 { 622 {
623 cpu->CP15[CP15(CP15_FLUSH_PREFETCH_BUFFER)] = value; 623 cpu->CP15[CP15_FLUSH_PREFETCH_BUFFER] = value;
624 } 624 }
625 else if (crn == 7 && opcode_1 == 0 && crm == 10) 625 else if (crn == 7 && opcode_1 == 0 && crm == 10)
626 { 626 {
627 if (opcode_2 == 4) 627 if (opcode_2 == 4)
628 cpu->CP15[CP15(CP15_DATA_SYNC_BARRIER)] = value; 628 cpu->CP15[CP15_DATA_SYNC_BARRIER] = value;
629 else if (opcode_2 == 5) 629 else if (opcode_2 == 5)
630 cpu->CP15[CP15(CP15_DATA_MEMORY_BARRIER)] = value; 630 cpu->CP15[CP15_DATA_MEMORY_BARRIER] = value;
631 631
632 } 632 }
633 else if (crn == 13 && opcode_1 == 0 && crm == 0 && opcode_2 == 2) 633 else if (crn == 13 && opcode_1 == 0 && crm == 0 && opcode_2 == 2)
634 { 634 {
635 cpu->CP15[CP15(CP15_THREAD_UPRW)] = value; 635 cpu->CP15[CP15_THREAD_UPRW] = value;
636 } 636 }
637} 637}
diff --git a/src/core/arm/skyeye_common/arm_regformat.h b/src/core/arm/skyeye_common/arm_regformat.h
index c232376e0..d125dc2fc 100644
--- a/src/core/arm/skyeye_common/arm_regformat.h
+++ b/src/core/arm/skyeye_common/arm_regformat.h
@@ -51,17 +51,23 @@ enum {
51 EXCLUSIVE_STATE, 51 EXCLUSIVE_STATE,
52 EXCLUSIVE_RESULT, 52 EXCLUSIVE_RESULT,
53 53
54 // VFP registers
55 VFP_BASE,
56 VFP_FPSID = VFP_BASE,
57 VFP_FPSCR,
58 VFP_FPEXC,
59
60 MAX_REG_NUM,
61};
62
63enum CP15Register {
54 // c0 - Information registers 64 // c0 - Information registers
55 CP15_BASE, 65 CP15_MAIN_ID,
56 CP15_C0 = CP15_BASE,
57 CP15_C0_C0 = CP15_C0,
58 CP15_MAIN_ID = CP15_C0_C0,
59 CP15_CACHE_TYPE, 66 CP15_CACHE_TYPE,
60 CP15_TCM_STATUS, 67 CP15_TCM_STATUS,
61 CP15_TLB_TYPE, 68 CP15_TLB_TYPE,
62 CP15_CPU_ID, 69 CP15_CPU_ID,
63 CP15_C0_C1, 70 CP15_PROCESSOR_FEATURE_0,
64 CP15_PROCESSOR_FEATURE_0 = CP15_C0_C1,
65 CP15_PROCESSOR_FEATURE_1, 71 CP15_PROCESSOR_FEATURE_1,
66 CP15_DEBUG_FEATURE_0, 72 CP15_DEBUG_FEATURE_0,
67 CP15_AUXILIARY_FEATURE_0, 73 CP15_AUXILIARY_FEATURE_0,
@@ -69,24 +75,19 @@ enum {
69 CP15_MEMORY_MODEL_FEATURE_1, 75 CP15_MEMORY_MODEL_FEATURE_1,
70 CP15_MEMORY_MODEL_FEATURE_2, 76 CP15_MEMORY_MODEL_FEATURE_2,
71 CP15_MEMORY_MODEL_FEATURE_3, 77 CP15_MEMORY_MODEL_FEATURE_3,
72 CP15_C0_C2, 78 CP15_ISA_FEATURE_0,
73 CP15_ISA_FEATURE_0 = CP15_C0_C2,
74 CP15_ISA_FEATURE_1, 79 CP15_ISA_FEATURE_1,
75 CP15_ISA_FEATURE_2, 80 CP15_ISA_FEATURE_2,
76 CP15_ISA_FEATURE_3, 81 CP15_ISA_FEATURE_3,
77 CP15_ISA_FEATURE_4, 82 CP15_ISA_FEATURE_4,
78 83
79 // c1 - Control registers 84 // c1 - Control registers
80 CP15_C1_C0, 85 CP15_CONTROL,
81 CP15_CONTROL = CP15_C1_C0,
82 CP15_AUXILIARY_CONTROL, 86 CP15_AUXILIARY_CONTROL,
83 CP15_COPROCESSOR_ACCESS_CONTROL, 87 CP15_COPROCESSOR_ACCESS_CONTROL,
84 88
85 // c2 - Translation table registers 89 // c2 - Translation table registers
86 CP15_C2, 90 CP15_TRANSLATION_BASE_TABLE_0,
87 CP15_C2_C0 = CP15_C2,
88 CP15_TRANSLATION_BASE = CP15_C2_C0,
89 CP15_TRANSLATION_BASE_TABLE_0 = CP15_TRANSLATION_BASE,
90 CP15_TRANSLATION_BASE_TABLE_1, 91 CP15_TRANSLATION_BASE_TABLE_1,
91 CP15_TRANSLATION_BASE_CONTROL, 92 CP15_TRANSLATION_BASE_CONTROL,
92 CP15_DOMAIN_ACCESS_CONTROL, 93 CP15_DOMAIN_ACCESS_CONTROL,
@@ -171,14 +172,9 @@ enum {
171 CP15_TLB_FAULT_ADDR, 172 CP15_TLB_FAULT_ADDR,
172 CP15_TLB_FAULT_STATUS, 173 CP15_TLB_FAULT_STATUS,
173 174
174 // VFP registers 175 // Not an actual register.
175 VFP_BASE, 176 // All registers should be defined above this.
176 VFP_FPSID = VFP_BASE, 177 CP15_REGISTER_COUNT,
177 VFP_FPSCR,
178 VFP_FPEXC,
179
180 MAX_REG_NUM,
181}; 178};
182 179
183#define CP15(idx) (idx - CP15_BASE)
184#define VFP_OFFSET(x) (x - VFP_BASE) 180#define VFP_OFFSET(x) (x - VFP_BASE)
diff --git a/src/core/arm/skyeye_common/armdefs.h b/src/core/arm/skyeye_common/armdefs.h
index d5b0242c3..12fa533f7 100644
--- a/src/core/arm/skyeye_common/armdefs.h
+++ b/src/core/arm/skyeye_common/armdefs.h
@@ -91,7 +91,7 @@ struct ARMul_State
91 ARMword exclusive_tag; // The address for which the local monitor is in exclusive access mode 91 ARMword exclusive_tag; // The address for which the local monitor is in exclusive access mode
92 ARMword exclusive_state; 92 ARMword exclusive_state;
93 ARMword exclusive_result; 93 ARMword exclusive_result;
94 ARMword CP15[VFP_BASE - CP15_BASE]; 94 ARMword CP15[CP15_REGISTER_COUNT];
95 ARMword VFP[3]; // FPSID, FPSCR, and FPEXC 95 ARMword VFP[3]; // FPSID, FPSCR, and FPEXC
96 // VFPv2 and VFPv3-D16 has 16 doubleword registers (D0-D16 or S0-S31). 96 // VFPv2 and VFPv3-D16 has 16 doubleword registers (D0-D16 or S0-S31).
97 // VFPv3-D32/ASIMD may have up to 32 doubleword registers (D0-D31), 97 // VFPv3-D32/ASIMD may have up to 32 doubleword registers (D0-D31),