From 3371f81482067d8fa993d6385a78919b647b30c3 Mon Sep 17 00:00:00 2001
From: Arvind S Raj <sraj.arvind@gmail.com>
Date: Tue, 12 Aug 2014 20:02:38 +0530
Subject: [PATCH] Set return value of atomic_get_and_set to prevent a double
spinlock acquire when booting which causes KDL. Also some style fixes have
been made.
---
src/system/libroot/os/arch/arm/atomic.S | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/system/libroot/os/arch/arm/atomic.S b/src/system/libroot/os/arch/arm/atomic.S
index 5728e5c..a2f93a0 100644
a
|
b
|
FUNCTION_END(atomic_set)
|
58 | 58 | */ |
59 | 59 | FUNCTION(atomic_get_and_set): |
60 | 60 | miss4: ldrex r12, [r0] |
61 | | strex r3, r1, [r0] |
62 | | teq r3, #0 |
63 | | bne miss4 |
64 | | bx lr |
| 61 | strex r3, r1, [r0] |
| 62 | teq r3, #0 |
| 63 | bne miss4 |
| 64 | mov r0, r12 |
| 65 | bx lr |
65 | 66 | FUNCTION_END(atomic_get_and_set) |
66 | 67 | |
67 | 68 | /* int atomic_test_and_set(int *value, int setTo, int testValue) |