Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/common/lib/libc/atomic Fix up the remaining __sync_* functio...



details:   https://anonhg.NetBSD.org/src/rev/f25ab190207a
branches:  trunk
changeset: 326445:f25ab190207a
user:      joerg <joerg%NetBSD.org@localhost>
date:      Wed Jan 29 15:59:11 2014 +0000

description:
Fix up the remaining __sync_* functions to build with Clang on ARM.

diffstat:

 common/lib/libc/atomic/atomic_add_32_cas.c |  9 +++++----
 common/lib/libc/atomic/atomic_and_32_cas.c |  9 +++++----
 common/lib/libc/atomic/atomic_or_32_cas.c  |  9 +++++----
 3 files changed, 15 insertions(+), 12 deletions(-)

diffs (96 lines):

diff -r 2cc8de427265 -r f25ab190207a common/lib/libc/atomic/atomic_add_32_cas.c
--- a/common/lib/libc/atomic/atomic_add_32_cas.c        Wed Jan 29 14:49:35 2014 +0000
+++ b/common/lib/libc/atomic/atomic_add_32_cas.c        Wed Jan 29 15:59:11 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atomic_add_32_cas.c,v 1.6 2014/01/27 18:29:47 matt Exp $       */
+/*     $NetBSD: atomic_add_32_cas.c,v 1.7 2014/01/29 15:59:11 joerg Exp $      */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -33,10 +33,11 @@
 
 #include <sys/atomic.h>
 
-uint32_t __sync_fetch_and_add_4(volatile uint32_t *, int32_t);
+uint32_t fetch_and_add_4(volatile uint32_t *, uint32_t, ...)
+    asm("__sync_fetch_and_add_4");
 
 uint32_t
-__sync_fetch_and_add_4(volatile uint32_t *addr, int32_t val)
+fetch_and_add_4(volatile uint32_t *addr, uint32_t val, ...)
 {
        uint32_t old, new;
 
@@ -50,7 +51,7 @@
 void
 atomic_add_32(volatile uint32_t *addr, int32_t val)
 {
-       (void) __sync_fetch_and_add_4(addr, val);
+       (void) fetch_and_add_4(addr, val);
 }
 
 #undef atomic_add_32
diff -r 2cc8de427265 -r f25ab190207a common/lib/libc/atomic/atomic_and_32_cas.c
--- a/common/lib/libc/atomic/atomic_and_32_cas.c        Wed Jan 29 14:49:35 2014 +0000
+++ b/common/lib/libc/atomic/atomic_and_32_cas.c        Wed Jan 29 15:59:11 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atomic_and_32_cas.c,v 1.7 2014/01/27 18:36:52 matt Exp $       */
+/*     $NetBSD: atomic_and_32_cas.c,v 1.8 2014/01/29 15:59:11 joerg Exp $      */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -33,10 +33,11 @@
 
 #include <sys/atomic.h>
 
-uint32_t __sync_fetch_and_and_4(volatile uint32_t *, uint32_t);
+uint32_t fetch_and_and_4(volatile uint32_t *, uint32_t, ...)
+    asm("__sync_fetch_and_and_4");
 
 uint32_t
-__sync_fetch_and_and_4(volatile uint32_t *addr, uint32_t val)
+fetch_and_and_4(volatile uint32_t *addr, uint32_t val, ...)
 {
        uint32_t old, new;
 
@@ -50,7 +51,7 @@
 void
 atomic_and_32(volatile uint32_t *addr, uint32_t val)
 {
-       (void) __sync_fetch_and_and_4(addr, val);
+       (void) fetch_and_and_4(addr, val);
 }
 
 #undef atomic_and_32
diff -r 2cc8de427265 -r f25ab190207a common/lib/libc/atomic/atomic_or_32_cas.c
--- a/common/lib/libc/atomic/atomic_or_32_cas.c Wed Jan 29 14:49:35 2014 +0000
+++ b/common/lib/libc/atomic/atomic_or_32_cas.c Wed Jan 29 15:59:11 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atomic_or_32_cas.c,v 1.7 2014/01/27 18:36:52 matt Exp $        */
+/*     $NetBSD: atomic_or_32_cas.c,v 1.8 2014/01/29 15:59:11 joerg Exp $       */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -33,10 +33,11 @@
 
 #include <sys/atomic.h>
 
-uint32_t __sync_fetch_and_or_4(volatile uint32_t *, uint32_t);
+uint32_t fetch_and_or_4(volatile uint32_t *, uint32_t, ...)
+    asm("__sync_fetch_and_or_4");
 
 uint32_t
-__sync_fetch_and_or_4(volatile uint32_t *addr, uint32_t val)
+fetch_and_or_4(volatile uint32_t *addr, uint32_t val, ...)
 {
        uint32_t old, new;
 
@@ -50,7 +51,7 @@
 void
 atomic_or_32(volatile uint32_t *addr, uint32_t val)
 {
-       (void) __sync_fetch_and_or_4(addr, val);
+       (void) fetch_and_or_4(addr, val);
 }
 
 #undef atomic_or_32



Home | Main Index | Thread Index | Old Index