includes/stg/Prim.h: add matching 'hs_atomic_*' prototypes
authorSergei Trofimovich <slyfox@gentoo.org>
Tue, 19 Aug 2014 07:05:43 +0000 (10:05 +0300)
committerSergei Trofimovich <slyfox@gentoo.org>
Tue, 19 Aug 2014 07:08:55 +0000 (10:08 +0300)
Fixes implicit function declarations in C codegen.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
includes/stg/Prim.h

index 48bbddb..80f4f8e 100644 (file)
 #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);