diff src/core/ngx_atomic.h @ 297:ee394e997c77

nginx-0.0.3-2004-03-29-21:43:58 import
author Igor Sysoev <igor@sysoev.ru>
date Mon, 29 Mar 2004 17:43:58 +0000
parents 0ba4821f4460
children 4a3f18406832
line wrap: on
line diff
--- a/src/core/ngx_atomic.h
+++ b/src/core/ngx_atomic.h
@@ -21,13 +21,14 @@ static ngx_inline uint32_t ngx_atomic_in
 {
     uint32_t  old;
 
+    old = 1;
+
     __asm__ volatile (
 
-    "   movl   $1, %0;   "
         NGX_SMP_LOCK
     "   xaddl  %0, %1;   "
 
-    : "=a" (old) : "m" (*value));
+    : "=q" (old) : "m" (*value));
 
     return old;
 }
@@ -37,13 +38,14 @@ static ngx_inline uint32_t ngx_atomic_de
 {
     uint32_t  old;
 
+    old = (uint32_t) -1;
+
     __asm__ volatile (
 
-    "   movl   $-1, %0;  "
         NGX_SMP_LOCK
     "   xaddl  %0, %1;   "
 
-    : "=a" (old) : "m" (*value));
+    : "=q" (old) : "m" (*value));
 
     return old;
 }
@@ -62,7 +64,7 @@ static ngx_inline uint32_t ngx_atomic_cm
     "   setz      %%al;     "
     "   movzbl    %%al, %0; "
 
-    : "=a" (res) : "m" (*lock), "a" (old), "q" (set));
+    : "+a" (res) : "m" (*lock), "a" (old), "q" (set));
 
     return res;
 }