@@ -514,28 +514,28 @@ target_ulong calc_retaddr_linux_arm(CPUState* cpu, target_ulong pc) {
514
514
offset = 4 ; // Note: this is NOT 8 for AARCH64!
515
515
}
516
516
517
- // 32-bit specific
518
- #if !defined(TARGET_AARCH64)
517
+ #if defined(TARGET_AARCH64)
518
+ // 64-bit specific
519
+ // if (!in_thumb_mode) {
520
+ // unsigned char buf[4] = {};
521
+ // panda_virtual_memory_rw(cpu, pc, buf, 4, 0);
522
+ // if (!((buf[0] == 0x01) && (buf[1] == 0) && (buf[2] == 0) && (buf[3] == 0xd4))) {
523
+ // assert((1==0) && "Tried to calculate AARCH64 ret addr when instr was not a syscall!");
524
+ // }
525
+ // }
526
+ #else
527
+ // 32-bit specific
519
528
// TODO: check syscall encoding here?
520
529
// If so, check both EABI and OABI!
521
530
522
- // 64-bit specific
523
- #else
524
- if (!in_thumb_mode) {
525
- unsigned char buf[4 ] = {};
526
- panda_virtual_memory_rw (cpu, pc, buf, 4 , 0 );
527
- if (!((buf[0 ] == 0x01 ) && (buf[1 ] == 0 ) && (buf[2 ] == 0 ) && (buf[3 ] == 0xd4 ))) {
528
- assert ((1 ==0 ) && " Tried to calculate AARCH64 ret addr when instr was not a syscall!" );
529
- }
530
- }
531
- #endif
532
531
if (in_thumb_mode) {
533
532
unsigned char buf[2 ] = {};
534
533
panda_virtual_memory_rw (cpu, pc, buf, 2 , 0 );
535
534
if (!(buf[1 ] == 0xDF && buf[0 ] == 0 )) {
536
535
assert ((1 ==0 ) && " Tried to calculate THUMB ret addr when instr was not a syscall!" );
537
536
}
538
537
}
538
+ #endif
539
539
540
540
return mask_retaddr_to_pc (pc + offset);
541
541
#else
@@ -1074,7 +1074,7 @@ target_ulong doesBlockContainSyscall(CPUState *cpu, TranslationBlock *tb, int* s
1074
1074
return pc;
1075
1075
}
1076
1076
1077
- #else
1077
+ #endif
1078
1078
// ARM32
1079
1079
// Check for ARM mode syscall
1080
1080
CPUArchState *env = (CPUArchState*)cpu->env_ptr ;
@@ -1105,7 +1105,6 @@ target_ulong doesBlockContainSyscall(CPUState *cpu, TranslationBlock *tb, int* s
1105
1105
return pc;
1106
1106
}
1107
1107
}
1108
- #endif
1109
1108
// Arm32/aarch64 - not a match
1110
1109
return 0 ;
1111
1110
#elif defined(TARGET_MIPS)
0 commit comments