summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2014-08-19 10:05:43 +0300
committerSergei Trofimovich <slyfox@gentoo.org>2014-08-19 10:08:55 +0300
commit4333a91eee6d14a974632101d1bc41ee7573ddf7 (patch)
tree450cf024a9a7ebc341881b39915f75db4a1e7ec2
parent955dfcba4d48e9b5795bc80e79c5c7c2bade432b (diff)
downloadhaskell-4333a91eee6d14a974632101d1bc41ee7573ddf7.tar.gz
includes/stg/Prim.h: add matching 'hs_atomic_*' prototypes
Fixes implicit function declarations in C codegen. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-rw-r--r--includes/stg/Prim.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/includes/stg/Prim.h b/includes/stg/Prim.h
index 48bbddb09c..80f4f8e9aa 100644
--- a/includes/stg/Prim.h
+++ b/includes/stg/Prim.h
@@ -14,6 +14,44 @@
#ifndef PRIM_H
#define PRIM_H
+/* libraries/ghc-prim/cbits/atomic.c */
+StgWord hs_atomic_add8(volatile StgWord8 *x, StgWord val);
+StgWord hs_atomic_add16(volatile StgWord16 *x, StgWord val);
+StgWord hs_atomic_add32(volatile StgWord32 *x, StgWord val);
+StgWord64 hs_atomic_add64(volatile StgWord64 *x, StgWord64 val);
+StgWord hs_atomic_sub8(volatile StgWord8 *x, StgWord val);
+StgWord hs_atomic_sub16(volatile StgWord16 *x, StgWord val);
+StgWord hs_atomic_sub32(volatile StgWord32 *x, StgWord val);
+StgWord64 hs_atomic_sub64(volatile StgWord64 *x, StgWord64 val);
+StgWord hs_atomic_and8(volatile StgWord8 *x, StgWord val);
+StgWord hs_atomic_and16(volatile StgWord16 *x, StgWord val);
+StgWord hs_atomic_and32(volatile StgWord32 *x, StgWord val);
+StgWord64 hs_atomic_and64(volatile StgWord64 *x, StgWord64 val);
+StgWord hs_atomic_nand8(volatile StgWord8 *x, StgWord val);
+StgWord hs_atomic_nand16(volatile StgWord16 *x, StgWord val);
+StgWord hs_atomic_nand32(volatile StgWord32 *x, StgWord val);
+StgWord64 hs_atomic_nand64(volatile StgWord64 *x, StgWord64 val);
+StgWord hs_atomic_or8(volatile StgWord8 *x, StgWord val);
+StgWord hs_atomic_or16(volatile StgWord16 *x, StgWord val);
+StgWord hs_atomic_or32(volatile StgWord32 *x, StgWord val);
+StgWord64 hs_atomic_or64(volatile StgWord64 *x, StgWord64 val);
+StgWord hs_atomic_xor8(volatile StgWord8 *x, StgWord val);
+StgWord hs_atomic_xor16(volatile StgWord16 *x, StgWord val);
+StgWord hs_atomic_xor32(volatile StgWord32 *x, StgWord val);
+StgWord64 hs_atomic_xor64(volatile StgWord64 *x, StgWord64 val);
+StgWord hs_cmpxchg8(volatile StgWord8 *x, StgWord old, StgWord new);
+StgWord hs_cmpxchg16(volatile StgWord16 *x, StgWord old, StgWord new);
+StgWord hs_cmpxchg32(volatile StgWord32 *x, StgWord old, StgWord new);
+StgWord hs_cmpxchg64(volatile StgWord64 *x, StgWord64 old, StgWord64 new);
+StgWord hs_atomicread8(volatile StgWord8 *x);
+StgWord hs_atomicread16(volatile StgWord16 *x);
+StgWord hs_atomicread32(volatile StgWord32 *x);
+StgWord64 hs_atomicread64(volatile StgWord64 *x);
+void hs_atomicwrite8(volatile StgWord8 *x, StgWord val);
+void hs_atomicwrite16(volatile StgWord16 *x, StgWord val);
+void hs_atomicwrite32(volatile StgWord32 *x, StgWord val);
+void hs_atomicwrite64(volatile StgWord64 *x, StgWord64 val);
+
/* libraries/ghc-prim/cbits/bswap.c */
StgWord16 hs_bswap16(StgWord16 x);
StgWord32 hs_bswap32(StgWord32 x);