mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 21:29:15 +02:00
fix InterlockedCompareExchange on ARM-Linux: kuser_cmpxchg destroys r3, which needs to be restored, if we have to loop
git-svn-id: trunk@32063 -
This commit is contained in:
parent
7e6ba9db2a
commit
c81290bc94
@ -970,8 +970,6 @@ asm
|
||||
{$else}
|
||||
{$ifdef SYSTEM_HAS_KUSER_CMPXCHG}
|
||||
stmfd r13!, {r4, lr}
|
||||
mvn r3, #0x0000f000
|
||||
sub r3, r3, #0x3F
|
||||
|
||||
mov r4, r2 // Swap parameters around
|
||||
mov r2, r0
|
||||
@ -979,7 +977,11 @@ asm
|
||||
|
||||
// r1 and r2 will not be clobbered by kuser_cmpxchg
|
||||
// If we have to loop, r0 will be set to the original Comperand
|
||||
// kuser_cmpxchg is documented to destroy r3, therefore setting
|
||||
// r3 must be in the loop
|
||||
.Linterlocked_compare_exchange_loop:
|
||||
mvn r3, #0x0000f000
|
||||
sub r3, r3, #0x3F
|
||||
{$ifdef CPUARM_HAS_BLX}
|
||||
blx r3 // Call kuser_cmpxchg, sets C-Flag on success
|
||||
{$else}
|
||||
|
Loading…
Reference in New Issue
Block a user