Author: cognet
Date: Mon Apr 10 21:44:13 2017
New Revision: 316691
URL: https://svnweb.freebsd.org/changeset/base/316691

Log:
  Provide some kind of __sync_bool_compare_and_swap_4(), as it is used by CK,
  and our gcc is too ancient to provide it.
  This should fix the build on mips.

Modified:
  head/sys/mips/mips/stdatomic.c

Modified: head/sys/mips/mips/stdatomic.c
==============================================================================
--- head/sys/mips/mips/stdatomic.c      Mon Apr 10 21:26:37 2017        
(r316690)
+++ head/sys/mips/mips/stdatomic.c      Mon Apr 10 21:44:13 2017        
(r316691)
@@ -287,8 +287,8 @@ EMIT_BITWISE_FETCH_AND_OP_N(2, uint16_t,
  * 32-bit routines.
  */
 
-uint32_t
-__sync_val_compare_and_swap_4(uint32_t *mem, uint32_t expected,
+static __inline uint32_t
+do_compare_and_swap_4(uint32_t *mem, uint32_t expected,
     uint32_t desired)
 {
        uint32_t old, temp;
@@ -307,6 +307,23 @@ __sync_val_compare_and_swap_4(uint32_t *
        return (old);
 }
 
+uint32_t
+__sync_val_compare_and_swap_4(uint32_t *mem, uint32_t expected,
+    uint32_t desired)
+{
+
+       return (do_compare_and_swap_4(mem, expected, desired));
+}
+
+bool
+__sync_bool_compare_and_swap_4(uint32_t *mem, uint32_t expected,
+    uint32_t desired)
+{
+
+       return (do_compare_and_swap_4(mem, expected, desired) ==
+           desired);
+}
+
 #define        EMIT_FETCH_AND_OP_4(name, op)                                   
\
 uint32_t                                                               \
 __sync_##name##_4(uint32_t *mem, uint32_t val)                         \
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to