dreid 2003/11/03 05:42:10
Modified: . CHANGES
include apr_atomic.h
Log:
Change the FreeBSD i386 atomics to use the asm routines in the apr_atomic
header file. This was tesetd on 4.8 and reported as also working for
-CURRENT and 5.1 by Paul Querna.
Revision Changes Path
1.439 +4 -0 apr/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/apr/CHANGES,v
retrieving revision 1.438
retrieving revision 1.439
diff -u -r1.438 -r1.439
--- CHANGES 3 Nov 2003 13:25:00 -0000 1.438
+++ CHANGES 3 Nov 2003 13:42:10 -0000 1.439
@@ -1,5 +1,9 @@
Changes with APR 1.0
+ *) Change i386 FreeBSD to use the asm routines in apr_atomic.h
+ to overcome issues with the FreeBSD atomic functions return
+ type on i386. [David Reid]
+
*) Add a new PRNG. Note that the implementation of SHA-256 is a
stop-gap pending snarfing the SHA-1 implementation from apr-util
and upgrading it to do SHA-256. Not yet ready for prime time.
1.62 +5 -4 apr/include/apr_atomic.h
Index: apr_atomic.h
===================================================================
RCS file: /home/cvs/apr/include/apr_atomic.h,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- apr_atomic.h 3 Nov 2003 13:25:00 -0000 1.61
+++ apr_atomic.h 3 Nov 2003 13:42:10 -0000 1.62
@@ -70,7 +70,7 @@
/* Platform includes for atomics */
#if defined(NETWARE) || defined(__MVS__) /* OS/390 */
#include <stdlib.h>
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) && !defined(__i386__)
#include <machine/atomic.h>
#endif
@@ -325,7 +325,7 @@
#define APR_OVERRIDE_ATOMIC_DEC 1
#define APR_OVERRIDE_ATOMIC_CAS 1
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) && !defined(__i386__)
#define apr_atomic_t apr_uint32_t
#define apr_atomic_add(mem, val) atomic_add_int(mem,val)
@@ -337,10 +337,11 @@
#define apr_atomic_add32(mem, val) apr_atomic_add(mem, val)
#define apr_atomic_dec32(mem) apr_atomic_dec(mem)
#define apr_atomic_inc32(mem) apr_atomic_inc(mem)
-#define apr_atomic_set32(mem,val) apr_atomic_set(mem,val)
+#define apr_atomic_set32(mem, val) apr_atomic_set(mem, val)
#define apr_atomic_read32(mem) apr_atomic_read(mem)
-#elif (defined(__linux__) || defined(__EMX__)) && defined(__i386__) &&
!APR_FORCE_ATOMIC_GENERIC
+#elif (defined(__linux__) || defined(__EMX__) || defined(__FreeBSD__)) \
+ && defined(__i386__) && !APR_FORCE_ATOMIC_GENERIC
#define apr_atomic_t apr_uint32_t
#define apr_atomic_cas(mem,with,cmp) \