Fix the wrong return value of both InternalSyncIncrement()
and InternalSyncDecrement(). The return value shouldn't
be the address of input parameter. It should be the updated
value of input parameter instead.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Haojian Zhuang <[email protected]>
---
 MdePkg/Library/BaseSynchronizationLib/AArch64/Synchronization.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MdePkg/Library/BaseSynchronizationLib/AArch64/Synchronization.S 
b/MdePkg/Library/BaseSynchronizationLib/AArch64/Synchronization.S
index ecb87fc..830ea5b 100644
--- a/MdePkg/Library/BaseSynchronizationLib/AArch64/Synchronization.S
+++ b/MdePkg/Library/BaseSynchronizationLib/AArch64/Synchronization.S
@@ -171,6 +171,7 @@ TryInternalSyncIncrement:
   add     w1, w1, #1
   stxr    w2, w1, [x0]
   cbnz    w2, TryInternalSyncIncrement
+  mov     x0, x1
   dmb     sy
   ret
 
@@ -199,5 +200,6 @@ TryInternalSyncDecrement:
   sub     w1, w1, #1
   stxr    w2, w1, [x0]
   cbnz    w2, TryInternalSyncDecrement
+  mov     x0, x1
   dmb     sy
   ret
-- 
1.9.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to