[commit: ghc] master: includes/stg/Prim.h: add matching 'hs_atomic_*' prototypes (4333a91)

git at git.haskell.org git at git.haskell.org
Tue Aug 19 07:09:25 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/4333a91eee6d14a974632101d1bc41ee7573ddf7/ghc

>---------------------------------------------------------------

commit 4333a91eee6d14a974632101d1bc41ee7573ddf7
Author: Sergei Trofimovich <slyfox at gentoo.org>
Date:   Tue Aug 19 10:05:43 2014 +0300

    includes/stg/Prim.h: add matching 'hs_atomic_*' prototypes
    
    Fixes implicit function declarations in C codegen.
    
    Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>


>---------------------------------------------------------------

4333a91eee6d14a974632101d1bc41ee7573ddf7
 includes/stg/Prim.h | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/includes/stg/Prim.h b/includes/stg/Prim.h
index 48bbddb..80f4f8e 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);



More information about the ghc-commits mailing list