hal/armv7a: fix spinlock in hal_cpuReschedule
In the code alternately has been used strb or strexb, it was wrong approach. Unifed to use only strexb in spinlocks.
After usage of strexb, the status has to be checked. If the operation has failed, it has to be repeated.
JIRA:
@@ -150,10 +150,13 @@ hal_cpuReschedule:
add r0, #12
/* Spinlock clear */
+spinlock:
ldrexb r1, [r0]
add r1, r1, #1
dmb
strexb r2, r1, [r0]
+ cmp r2, #0
+ bne spinlock
ldrb r1, [r3]
bic r4, #0xff
