]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Properly set the return value for casueword to 0 upon success.
authored <ed@FreeBSD.org>
Thu, 15 Oct 2015 17:50:28 +0000 (17:50 +0000)
committered <ed@FreeBSD.org>
Thu, 15 Oct 2015 17:50:28 +0000 (17:50 +0000)
While trying to get multithreading working for CloudABI on aarch64, I
noticed that compare-and-exchange operations in kernelspace would always
fail. It turns out that we don't properly set the return value to 0 when
the compare and exchange succeeds.

Approved by: andrew
Differential Revision: https://reviews.freebsd.org/D3899

sys/arm64/arm64/support.S

index 73ef6a4ac5813658acee0318b2d1a22d08aad497..914a6e3145e9589582e5249c805306ac56de1d47 100644 (file)
@@ -59,6 +59,7 @@ ENTRY(casueword32)
        ldrb    w0, [x0]                /* Try loading the data */
 2:     SET_FAULT_HANDLER(xzr, x5)      /* Reset the fault handler */
        str     w4, [x2]                /* Store the read data */
+       mov     x0, #0                  /* Success */
        ret                             /* Return */
 END(casueword32)
 
@@ -76,6 +77,7 @@ ENTRY(casueword)
        ldrb    w0, [x0]                /* Try loading the data */
 2:     SET_FAULT_HANDLER(xzr, x5)      /* Reset the fault handler */
        str     x4, [x2]                /* Store the read data */
+       mov     x0, #0                  /* Success */
        ret                             /* Return */
 END(casueword)