httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Akins <bak...@web.turner.com>
Subject {PATCH] Re: x86_64 atomics and linux
Date Tue, 15 Jun 2004 15:50:02 GMT
Joe Orton wrote:

>On Wed, Jun 02, 2004 at 03:40:52PM -0400, Brian Akins wrote:
>  
>
>>AFAIK, the linux x86 atomic stuff can be used unchanged on Linux 
>>x86_64.  This is based on my digging in the kernel source.  All the 
>>"functions" apr uses are identical.
>>    
>>
>
>This is already done for APR HEAD: a backport would probably need to
>include the cleanup of the configure logic too, I think.
>
>joe
>
>  
>
Works on my test box.  I wasn't sure what to do about casptr, so I just 
let x86_64 use the default init.

Suggestions are welcome.



diff -aur httpd-2.0.49/srclib/apr/configure 
httpd-2.0.49.new/srclib/apr/configure
--- httpd-2.0.49/srclib/apr/configure    2004-03-18 07:32:25.000000000 -0500
+++ httpd-2.0.49.new/srclib/apr/configure    2004-06-15 
11:42:36.988650440 -0400
@@ -13268,7 +13268,7 @@
    *linux*)
        apr_force_atomic_generic=1
        case $host_cpu in
-         i486|i586|i686)
+         i486|i586|i686|x86_64)
             if test "$nonportable_atomics_enabled" = 1; then
               apr_force_atomic_generic=0
             fi
diff -aur httpd-2.0.49/srclib/apr/include/apr_atomic.h 
httpd-2.0.49.new/srclib/apr/include/apr_atomic.h
--- httpd-2.0.49/srclib/apr/include/apr_atomic.h    2004-02-13 
04:33:44.000000000 -0500
+++ httpd-2.0.49.new/srclib/apr/include/apr_atomic.h    2004-06-15 
11:33:48.286025456 -0400
@@ -168,7 +168,7 @@
 #define apr_atomic_set(mem, val)     atomic_set_int(mem, val)
 #define apr_atomic_read(mem)         (*mem)
 
-#elif (defined(__linux__) || defined(__EMX__)) && defined(__i386__) && 
!APR_FORCE_ATOMIC_GENERIC
+#elif (defined(__linux__) || defined(__EMX__)) && (defined(__x86_64__) 
|| defined(__x86_64__)) && !APR_FORCE_ATOMIC_GENERIC
 
 #define apr_atomic_t apr_uint32_t
 #define apr_atomic_cas(mem,with,cmp) \
@@ -202,7 +202,10 @@
 
 #define apr_atomic_set(mem, val)     (*(mem) = val)
 #define apr_atomic_read(mem)        (*(mem))
+
+#if !defined(__x86_64__)
 #define apr_atomic_init(pool)        APR_SUCCESS
+#endif
 
 #elif defined(__MVS__) /* OS/390 */
 


-- 
Brian Akins
Senior Systems Engineer
CNN Internet Technologies


Mime
View raw message