/[qemu]/qemu/exec-all.h
ViewVC logotype

Diff of /qemu/exec-all.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.26 by bellard, Mon Jan 10 23:23:48 2005 UTC revision 1.27 by bellard, Mon Feb 7 14:09:05 2005 UTC
# Line 392  static inline int testandset (int *p) Line 392  static inline int testandset (int *p)
392  #ifdef __i386__  #ifdef __i386__
393  static inline int testandset (int *p)  static inline int testandset (int *p)
394  {  {
395      char ret;      long int readval = 0;
     long int readval;  
396            
397      __asm__ __volatile__ ("lock; cmpxchgl %3, %1; sete %0"      __asm__ __volatile__ ("lock; cmpxchgl %2, %0"
398                            : "=q" (ret), "=m" (*p), "=a" (readval)                            : "+m" (*p), "+a" (readval)
399                            : "r" (1), "m" (*p), "a" (0)                            : "r" (1)
400                            : "memory");                            : "cc");
401      return ret;      return readval;
402  }  }
403  #endif  #endif
404    
405  #ifdef __x86_64__  #ifdef __x86_64__
406  static inline int testandset (int *p)  static inline int testandset (int *p)
407  {  {
408      char ret;      long int readval = 0;
     int readval;  
409            
410      __asm__ __volatile__ ("lock; cmpxchgl %3, %1; sete %0"      __asm__ __volatile__ ("lock; cmpxchgl %2, %0"
411                            : "=q" (ret), "=m" (*p), "=a" (readval)                            : "+m" (*p), "+a" (readval)
412                            : "r" (1), "m" (*p), "a" (0)                            : "r" (1)
413                            : "memory");                            : "cc");
414      return ret;      return readval;
415  }  }
416  #endif  #endif
417    
# Line 484  static inline int testandset (int *p) Line 482  static inline int testandset (int *p)
482                           : "=r" (ret)                           : "=r" (ret)
483                           : "m" (p)                           : "m" (p)
484                           : "cc","memory");                           : "cc","memory");
485      return ret == 0;      return ret;
486  }  }
487  #endif  #endif
488    

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26