Cleanup: Re-organise source dir Re-organise the sources, add a top level "src" and "include" dir and move relevant files. Disable autotools automated includes and define them manually. This fixes problems with collision of header names with system headers. Include the autoconf config.h in the default includes and remove it where it's explicitely included. Remove _GNU_SOURCE defines since it's detected at configure for platforms that requires it and added to the config.h. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix uatomic sign cast Passing an unsigned int to uatomic_sub does not honor sign extend to long, as we should be allowed by assume. Fix this by introducing caa_cast_long_keep_sign(), which casts either to long or unsigned long depending on the signedness of the argument received. It is used in uatomic_sub before applying the "-" operator, since this operator needs to operate on the "long" type size (since sign extension might not be performed if the argument received is unsigned). Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
atomic: provide seq_cst semantics on powerpc We provide sequential consistency semantic over all architectures for cmpxchg and add_return family of primitives, but the powerpc implementation does not match that. Change the isync after the atomic primitives to sync, and explain the scheme. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>