MdePkg/BaseSynchronizationLib: fix AArch64 return values
authorHaojian Zhuang <haojian.zhuang@linaro.org>
Tue, 27 Oct 2015 11:56:57 +0000 (11:56 +0000)
committerleiflindholm <leiflindholm@Edk2>
Tue, 27 Oct 2015 11:56:57 +0000 (11:56 +0000)
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 <haojian.zhuang@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18685 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/BaseSynchronizationLib/AArch64/Synchronization.S

index ecb87fc127556df03e84d9bb22ca4faf9888088c..9513b1a1bb02c1fe03544af2a6bc763bd2bcbe7c 100644 (file)
@@ -171,6 +171,7 @@ TryInternalSyncIncrement:
   add     w1, w1, #1\r
   stxr    w2, w1, [x0]\r
   cbnz    w2, TryInternalSyncIncrement\r
+  mov     w0, w1\r
   dmb     sy\r
   ret\r
 \r
@@ -199,5 +200,6 @@ TryInternalSyncDecrement:
   sub     w1, w1, #1\r
   stxr    w2, w1, [x0]\r
   cbnz    w2, TryInternalSyncDecrement\r
+  mov     w0, w1\r
   dmb     sy\r
   ret\r