From 4333a91eee6d14a974632101d1bc41ee7573ddf7 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Tue, 19 Aug 2014 10:05:43 +0300 Subject: includes/stg/Prim.h: add matching 'hs_atomic_*' prototypes Fixes implicit function declarations in C codegen. Signed-off-by: Sergei Trofimovich --- includes/stg/Prim.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'includes') 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); -- cgit v1.2.1