Index: src/arm/cpu-arm.cc |
diff --git a/src/arm/cpu-arm.cc b/src/arm/cpu-arm.cc |
index 5bd20291c8a30c3708de3e2fd483f42d93363efd..51cfeb6c87fc217f44fbc24f144e82b9dc32a76a 100644 |
--- a/src/arm/cpu-arm.cc |
+++ b/src/arm/cpu-arm.cc |
@@ -75,62 +75,33 @@ void CPU::FlushICache(void* start, size_t size) { |
register uint32_t end asm("a2") = |
reinterpret_cast<uint32_t>(start) + size; |
register uint32_t flg asm("a3") = 0; |
- #ifdef __ARM_EABI__ |
- #if defined (__arm__) && !defined(__thumb__) |
- // __arm__ may be defined in thumb mode. |
- register uint32_t scno asm("r7") = __ARM_NR_cacheflush; |
- asm volatile( |
- "svc 0x0" |
- : "=r" (beg) |
- : "0" (beg), "r" (end), "r" (flg), "r" (scno)); |
- #else |
- // r7 is reserved by the EABI in thumb mode. |
- asm volatile( |
- "@ Enter ARM Mode \n\t" |
- "adr r3, 1f \n\t" |
- "bx r3 \n\t" |
- ".ALIGN 4 \n\t" |
- ".ARM \n" |
- "1: push {r7} \n\t" |
- "mov r7, %4 \n\t" |
- "svc 0x0 \n\t" |
- "pop {r7} \n\t" |
- "@ Enter THUMB Mode\n\t" |
- "adr r3, 2f+1 \n\t" |
- "bx r3 \n\t" |
- ".THUMB \n" |
- "2: \n\t" |
- : "=r" (beg) |
- : "0" (beg), "r" (end), "r" (flg), "r" (__ARM_NR_cacheflush) |
- : "r3"); |
- #endif |
+ #if defined (__arm__) && !defined(__thumb__) |
+ // __arm__ may be defined in thumb mode. |
+ register uint32_t scno asm("r7") = __ARM_NR_cacheflush; |
+ asm volatile( |
+ "svc 0x0" |
+ : "=r" (beg) |
+ : "0" (beg), "r" (end), "r" (flg), "r" (scno)); |
#else |
- #if defined (__arm__) && !defined(__thumb__) |
- // __arm__ may be defined in thumb mode. |
- asm volatile( |
- "svc %1" |
- : "=r" (beg) |
- : "i" (__ARM_NR_cacheflush), "0" (beg), "r" (end), "r" (flg)); |
- #else |
- // Do not use the value of __ARM_NR_cacheflush in the inline assembly |
- // below, because the thumb mode value would be used, which would be |
- // wrong, since we switch to ARM mode before executing the svc instruction |
- asm volatile( |
- "@ Enter ARM Mode \n\t" |
- "adr r3, 1f \n\t" |
- "bx r3 \n\t" |
- ".ALIGN 4 \n\t" |
- ".ARM \n" |
- "1: svc 0x9f0002 \n" |
- "@ Enter THUMB Mode\n\t" |
- "adr r3, 2f+1 \n\t" |
- "bx r3 \n\t" |
- ".THUMB \n" |
- "2: \n\t" |
- : "=r" (beg) |
- : "0" (beg), "r" (end), "r" (flg) |
- : "r3"); |
- #endif |
+ // r7 is reserved by the EABI in thumb mode. |
+ asm volatile( |
+ "@ Enter ARM Mode \n\t" |
+ "adr r3, 1f \n\t" |
+ "bx r3 \n\t" |
+ ".ALIGN 4 \n\t" |
+ ".ARM \n" |
+ "1: push {r7} \n\t" |
+ "mov r7, %4 \n\t" |
+ "svc 0x0 \n\t" |
+ "pop {r7} \n\t" |
+ "@ Enter THUMB Mode\n\t" |
+ "adr r3, 2f+1 \n\t" |
+ "bx r3 \n\t" |
+ ".THUMB \n" |
+ "2: \n\t" |
+ : "=r" (beg) |
+ : "0" (beg), "r" (end), "r" (flg), "r" (__ARM_NR_cacheflush) |
+ : "r3"); |
#endif |
#endif |
} |