aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/sync
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2013-01-24 19:44:23 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2013-01-24 19:44:23 +0000
commitf6b1e65ec393b757a70cb30b0d8ab0ed1af3dedf (patch)
treedf60a3ed3befa98bc7bd75b2c51377fb20837ea7 /libgo/go/sync
parentf5ba49ac2e76583f732bc2cdb76ed54e59bffd09 (diff)
downloadgcc-f6b1e65ec393b757a70cb30b0d8ab0ed1af3dedf.zip
gcc-f6b1e65ec393b757a70cb30b0d8ab0ed1af3dedf.tar.gz
gcc-f6b1e65ec393b757a70cb30b0d8ab0ed1af3dedf.tar.bz2
re PR go/46986 (Go is not supported on Darwin)
PR go/46986 all: prepend #__USER_LABEL_PREFIX__ to mangled Go symbols For old-fashioned Darwin. From-SVN: r195438
Diffstat (limited to 'libgo/go/sync')
-rw-r--r--libgo/go/sync/atomic/atomic.c48
-rw-r--r--libgo/go/sync/cas.c4
2 files changed, 28 insertions, 24 deletions
diff --git a/libgo/go/sync/atomic/atomic.c b/libgo/go/sync/atomic/atomic.c
index 14bc789..32430df 100644
--- a/libgo/go/sync/atomic/atomic.c
+++ b/libgo/go/sync/atomic/atomic.c
@@ -6,8 +6,10 @@
#include <stdint.h>
+#include "runtime.h"
+
_Bool CompareAndSwapInt32 (int32_t *, int32_t, int32_t)
- asm ("sync_atomic.CompareAndSwapInt32");
+ __asm__ (GOSYM_PREFIX "sync_atomic.CompareAndSwapInt32");
_Bool
CompareAndSwapInt32 (int32_t *val, int32_t old, int32_t new)
@@ -16,7 +18,7 @@ CompareAndSwapInt32 (int32_t *val, int32_t old, int32_t new)
}
_Bool CompareAndSwapInt64 (int64_t *, int64_t, int64_t)
- asm ("sync_atomic.CompareAndSwapInt64");
+ __asm__ (GOSYM_PREFIX "sync_atomic.CompareAndSwapInt64");
_Bool
CompareAndSwapInt64 (int64_t *val, int64_t old, int64_t new)
@@ -25,7 +27,7 @@ CompareAndSwapInt64 (int64_t *val, int64_t old, int64_t new)
}
_Bool CompareAndSwapUint32 (uint32_t *, uint32_t, uint32_t)
- asm ("sync_atomic.CompareAndSwapUint32");
+ __asm__ (GOSYM_PREFIX "sync_atomic.CompareAndSwapUint32");
_Bool
CompareAndSwapUint32 (uint32_t *val, uint32_t old, uint32_t new)
@@ -34,7 +36,7 @@ CompareAndSwapUint32 (uint32_t *val, uint32_t old, uint32_t new)
}
_Bool CompareAndSwapUint64 (uint64_t *, uint64_t, uint64_t)
- asm ("sync_atomic.CompareAndSwapUint64");
+ __asm__ (GOSYM_PREFIX "sync_atomic.CompareAndSwapUint64");
_Bool
CompareAndSwapUint64 (uint64_t *val, uint64_t old, uint64_t new)
@@ -43,7 +45,7 @@ CompareAndSwapUint64 (uint64_t *val, uint64_t old, uint64_t new)
}
_Bool CompareAndSwapUintptr (uintptr_t *, uintptr_t, uintptr_t)
- asm ("sync_atomic.CompareAndSwapUintptr");
+ __asm__ (GOSYM_PREFIX "sync_atomic.CompareAndSwapUintptr");
_Bool
CompareAndSwapUintptr (uintptr_t *val, uintptr_t old, uintptr_t new)
@@ -52,7 +54,7 @@ CompareAndSwapUintptr (uintptr_t *val, uintptr_t old, uintptr_t new)
}
_Bool CompareAndSwapPointer (void **, void *, void *)
- asm ("sync_atomic.CompareAndSwapPointer");
+ __asm__ (GOSYM_PREFIX "sync_atomic.CompareAndSwapPointer");
_Bool
CompareAndSwapPointer (void **val, void *old, void *new)
@@ -61,7 +63,7 @@ CompareAndSwapPointer (void **val, void *old, void *new)
}
int32_t AddInt32 (int32_t *, int32_t)
- asm ("sync_atomic.AddInt32");
+ __asm__ (GOSYM_PREFIX "sync_atomic.AddInt32");
int32_t
AddInt32 (int32_t *val, int32_t delta)
@@ -70,7 +72,7 @@ AddInt32 (int32_t *val, int32_t delta)
}
uint32_t AddUint32 (uint32_t *, uint32_t)
- asm ("sync_atomic.AddUint32");
+ __asm__ (GOSYM_PREFIX "sync_atomic.AddUint32");
uint32_t
AddUint32 (uint32_t *val, uint32_t delta)
@@ -79,7 +81,7 @@ AddUint32 (uint32_t *val, uint32_t delta)
}
int64_t AddInt64 (int64_t *, int64_t)
- asm ("sync_atomic.AddInt64");
+ __asm__ (GOSYM_PREFIX "sync_atomic.AddInt64");
int64_t
AddInt64 (int64_t *val, int64_t delta)
@@ -88,7 +90,7 @@ AddInt64 (int64_t *val, int64_t delta)
}
uint64_t AddUint64 (uint64_t *, uint64_t)
- asm ("sync_atomic.AddUint64");
+ __asm__ (GOSYM_PREFIX "sync_atomic.AddUint64");
uint64_t
AddUint64 (uint64_t *val, uint64_t delta)
@@ -97,7 +99,7 @@ AddUint64 (uint64_t *val, uint64_t delta)
}
uintptr_t AddUintptr (uintptr_t *, uintptr_t)
- asm ("sync_atomic.AddUintptr");
+ __asm__ (GOSYM_PREFIX "sync_atomic.AddUintptr");
uintptr_t
AddUintptr (uintptr_t *val, uintptr_t delta)
@@ -106,7 +108,7 @@ AddUintptr (uintptr_t *val, uintptr_t delta)
}
int32_t LoadInt32 (int32_t *addr)
- asm ("sync_atomic.LoadInt32");
+ __asm__ (GOSYM_PREFIX "sync_atomic.LoadInt32");
int32_t
LoadInt32 (int32_t *addr)
@@ -120,7 +122,7 @@ LoadInt32 (int32_t *addr)
}
int64_t LoadInt64 (int64_t *addr)
- asm ("sync_atomic.LoadInt64");
+ __asm__ (GOSYM_PREFIX "sync_atomic.LoadInt64");
int64_t
LoadInt64 (int64_t *addr)
@@ -134,7 +136,7 @@ LoadInt64 (int64_t *addr)
}
uint32_t LoadUint32 (uint32_t *addr)
- asm ("sync_atomic.LoadUint32");
+ __asm__ (GOSYM_PREFIX "sync_atomic.LoadUint32");
uint32_t
LoadUint32 (uint32_t *addr)
@@ -148,7 +150,7 @@ LoadUint32 (uint32_t *addr)
}
uint64_t LoadUint64 (uint64_t *addr)
- asm ("sync_atomic.LoadUint64");
+ __asm__ (GOSYM_PREFIX "sync_atomic.LoadUint64");
uint64_t
LoadUint64 (uint64_t *addr)
@@ -162,7 +164,7 @@ LoadUint64 (uint64_t *addr)
}
uintptr_t LoadUintptr (uintptr_t *addr)
- asm ("sync_atomic.LoadUintptr");
+ __asm__ (GOSYM_PREFIX "sync_atomic.LoadUintptr");
uintptr_t
LoadUintptr (uintptr_t *addr)
@@ -176,7 +178,7 @@ LoadUintptr (uintptr_t *addr)
}
void *LoadPointer (void **addr)
- asm ("sync_atomic.LoadPointer");
+ __asm__ (GOSYM_PREFIX "sync_atomic.LoadPointer");
void *
LoadPointer (void **addr)
@@ -190,7 +192,7 @@ LoadPointer (void **addr)
}
void StoreInt32 (int32_t *addr, int32_t val)
- asm ("sync_atomic.StoreInt32");
+ __asm__ (GOSYM_PREFIX "sync_atomic.StoreInt32");
void
StoreInt32 (int32_t *addr, int32_t val)
@@ -203,7 +205,7 @@ StoreInt32 (int32_t *addr, int32_t val)
}
void StoreInt64 (int64_t *addr, int64_t val)
- asm ("sync_atomic.StoreInt64");
+ __asm__ (GOSYM_PREFIX "sync_atomic.StoreInt64");
void
StoreInt64 (int64_t *addr, int64_t val)
@@ -216,7 +218,7 @@ StoreInt64 (int64_t *addr, int64_t val)
}
void StoreUint32 (uint32_t *addr, uint32_t val)
- asm ("sync_atomic.StoreUint32");
+ __asm__ (GOSYM_PREFIX "sync_atomic.StoreUint32");
void
StoreUint32 (uint32_t *addr, uint32_t val)
@@ -229,7 +231,7 @@ StoreUint32 (uint32_t *addr, uint32_t val)
}
void StoreUint64 (uint64_t *addr, uint64_t val)
- asm ("sync_atomic.StoreUint64");
+ __asm__ (GOSYM_PREFIX "sync_atomic.StoreUint64");
void
StoreUint64 (uint64_t *addr, uint64_t val)
@@ -242,7 +244,7 @@ StoreUint64 (uint64_t *addr, uint64_t val)
}
void StoreUintptr (uintptr_t *addr, uintptr_t val)
- asm ("sync_atomic.StoreUintptr");
+ __asm__ (GOSYM_PREFIX "sync_atomic.StoreUintptr");
void
StoreUintptr (uintptr_t *addr, uintptr_t val)
@@ -255,7 +257,7 @@ StoreUintptr (uintptr_t *addr, uintptr_t val)
}
void StorePointer (void **addr, void *val)
- asm ("sync_atomic.StorePointer");
+ __asm__ (GOSYM_PREFIX "sync_atomic.StorePointer");
void
StorePointer (void **addr, void *val)
diff --git a/libgo/go/sync/cas.c b/libgo/go/sync/cas.c
index ffcd133..7571c64 100644
--- a/libgo/go/sync/cas.c
+++ b/libgo/go/sync/cas.c
@@ -6,7 +6,9 @@
#include <stdint.h>
-_Bool cas (int32_t *, int32_t, int32_t) asm ("libgo_sync.sync.cas");
+#include "runtime.h"
+
+_Bool cas (int32_t *, int32_t, int32_t) __asm__ (GOSYM_PREFIX "libgo_sync.sync.cas");
_Bool
cas (int32_t *ptr, int32_t old, int32_t new)