Commit e3d2bab8 authored by Andreas Schwab's avatar Andreas Schwab Committed by Ben Gamari

Fix signature of atomic builtins

This patch is due to Andreas Schwab.

This fixes #10926, which reports (on AArch64) errors of the form,

/tmp/ghc1492_0/ghc_1.hc:2844:25: warning: passing argument 1 of
'hs_atomic_xor64' makes pointer from integer without a cast
     _c1Ho = hs_atomic_xor64((*Sp) + (((Sp[1]) << 0x3UL) + 0x10UL), Sp[2]);

In file included from
/home/abuild/rpmbuild/BUILD/ghc-7.10.2/includes/Stg.h:273:0: 0,
                 from /tmp/ghc1492_0/ghc_1.hc:3:

     note: expected 'volatile StgWord64 *
           {aka volatile long unsigned int *}'
           but argument is of type 'long unsigned int'
     StgWord64 hs_atomic_xor64(volatile StgWord64 *x, StgWord64 val);

Test Plan: Validate

Reviewers: austin, simonmar

Reviewed By: simonmar

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #10926
parent 74424346
......@@ -15,42 +15,42 @@
#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);
StgWord hs_atomic_add8(StgWord x, StgWord val);
StgWord hs_atomic_add16(StgWord x, StgWord val);
StgWord hs_atomic_add32(StgWord x, StgWord val);
StgWord64 hs_atomic_add64(StgWord x, StgWord64 val);
StgWord hs_atomic_sub8(StgWord x, StgWord val);
StgWord hs_atomic_sub16(StgWord x, StgWord val);
StgWord hs_atomic_sub32(StgWord x, StgWord val);
StgWord64 hs_atomic_sub64(StgWord x, StgWord64 val);
StgWord hs_atomic_and8(StgWord x, StgWord val);
StgWord hs_atomic_and16(StgWord x, StgWord val);
StgWord hs_atomic_and32(StgWord x, StgWord val);
StgWord64 hs_atomic_and64(StgWord x, StgWord64 val);
StgWord hs_atomic_nand8(StgWord x, StgWord val);
StgWord hs_atomic_nand16(StgWord x, StgWord val);
StgWord hs_atomic_nand32(StgWord x, StgWord val);
StgWord64 hs_atomic_nand64(StgWord x, StgWord64 val);
StgWord hs_atomic_or8(StgWord x, StgWord val);
StgWord hs_atomic_or16(StgWord x, StgWord val);
StgWord hs_atomic_or32(StgWord x, StgWord val);
StgWord64 hs_atomic_or64(StgWord x, StgWord64 val);
StgWord hs_atomic_xor8(StgWord x, StgWord val);
StgWord hs_atomic_xor16(StgWord x, StgWord val);
StgWord hs_atomic_xor32(StgWord x, StgWord val);
StgWord64 hs_atomic_xor64(StgWord x, StgWord64 val);
StgWord hs_cmpxchg8(StgWord x, StgWord old, StgWord new_);
StgWord hs_cmpxchg16(StgWord x, StgWord old, StgWord new_);
StgWord hs_cmpxchg32(StgWord x, StgWord old, StgWord new_);
StgWord hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new_);
StgWord hs_atomicread8(StgWord x);
StgWord hs_atomicread16(StgWord x);
StgWord hs_atomicread32(StgWord x);
StgWord64 hs_atomicread64(StgWord x);
void hs_atomicwrite8(StgWord x, StgWord val);
void hs_atomicwrite16(StgWord x, StgWord val);
void hs_atomicwrite32(StgWord x, StgWord val);
void hs_atomicwrite64(StgWord x, StgWord64 val);
/* libraries/ghc-prim/cbits/bswap.c */
StgWord16 hs_bswap16(StgWord16 x);
This diff is collapsed.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment