Add Thumb and Arm versions of CPU_ProbeARMv7()

pull/853/head
Jeffrey Walton 2019-05-26 17:06:55 -04:00
parent 7cd8d0278a
commit d4b533a60f
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 7 additions and 2 deletions

View File

@ -103,12 +103,17 @@ bool CPU_ProbeARMv7()
24: e12fff1e bx lr 24: e12fff1e bx lr
#endif #endif
volatile int a; unsigned int a;
asm volatile ( asm volatile (
".arm \n\t" #if defined(__thumb__)
".inst.n 0xf241, 0x2034 \n\t" // movw r0, 0x1234
".inst.n 0xf2c1, 0x2034 \n\t" // movt r0, 0x1234
"mov %0, r0 \n\t" // mov [a], r0
#else
".inst 0xe3010234 \n\t" // movw r0, 0x1234 ".inst 0xe3010234 \n\t" // movw r0, 0x1234
".inst 0xe3410234 \n\t" // movt r0, 0x1234 ".inst 0xe3410234 \n\t" // movt r0, 0x1234
"mov %0, r0 \n\t" // mov [a], r0 "mov %0, r0 \n\t" // mov [a], r0
#endif
: "=r" (a) : : "r0"); : "=r" (a) : : "r0");
result = (a == 0x12341234); result = (a == 0x12341234);