Module Name:    src
Committed By:   joerg
Date:           Wed Jan 29 15:59:12 UTC 2014

Modified Files:
        src/common/lib/libc/atomic: atomic_add_32_cas.c atomic_and_32_cas.c
            atomic_or_32_cas.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/common/lib/libc/atomic/atomic_add_32_cas.c
cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/atomic/atomic_and_32_cas.c \
    src/common/lib/libc/atomic/atomic_or_32_cas.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libc/atomic/atomic_add_32_cas.c
diff -u src/common/lib/libc/atomic/atomic_add_32_cas.c:1.6 src/common/lib/libc/atomic/atomic_add_32_cas.c:1.7
--- src/common/lib/libc/atomic/atomic_add_32_cas.c:1.6	Mon Jan 27 18:29:47 2014
+++ src/common/lib/libc/atomic/atomic_add_32_cas.c	Wed Jan 29 15:59:11 2014
@@ -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 @@ __sync_fetch_and_add_4(volatile uint32_t
 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

Index: src/common/lib/libc/atomic/atomic_and_32_cas.c
diff -u src/common/lib/libc/atomic/atomic_and_32_cas.c:1.7 src/common/lib/libc/atomic/atomic_and_32_cas.c:1.8
--- src/common/lib/libc/atomic/atomic_and_32_cas.c:1.7	Mon Jan 27 18:36:52 2014
+++ src/common/lib/libc/atomic/atomic_and_32_cas.c	Wed Jan 29 15:59:11 2014
@@ -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 @@ __sync_fetch_and_and_4(volatile uint32_t
 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
Index: src/common/lib/libc/atomic/atomic_or_32_cas.c
diff -u src/common/lib/libc/atomic/atomic_or_32_cas.c:1.7 src/common/lib/libc/atomic/atomic_or_32_cas.c:1.8
--- src/common/lib/libc/atomic/atomic_or_32_cas.c:1.7	Mon Jan 27 18:36:52 2014
+++ src/common/lib/libc/atomic/atomic_or_32_cas.c	Wed Jan 29 15:59:11 2014
@@ -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 @@ __sync_fetch_and_or_4(volatile uint32_t 
 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

Reply via email to