[BACK]Return to lock.h CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / arch / x86 / include

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/arch/x86/include/lock.h between version 1.14 and 1.14.12.1

version 1.14, 2007/02/10 16:19:39 version 1.14.12.1, 2007/04/18 04:45:13
Line 58  extern void __cpu_simple_unlock(__cpu_si
Line 58  extern void __cpu_simple_unlock(__cpu_si
   
 #else  #else
   
 #include <machine/atomic.h>  #include <sys/atomic.h>
   
 static __inline void __cpu_simple_lock_init(__cpu_simple_lock_t *)  static __inline void __cpu_simple_lock_init(__cpu_simple_lock_t *)
         __attribute__((__unused__));          __attribute__((__unused__));
Line 81  static __inline void
Line 81  static __inline void
 __cpu_simple_lock(__cpu_simple_lock_t *lockp)  __cpu_simple_lock(__cpu_simple_lock_t *lockp)
 {  {
   
         while (x86_atomic_testset_b(lockp, __SIMPLELOCK_LOCKED)          while (atomic_swap_8(lockp, __SIMPLELOCK_LOCKED)
             != __SIMPLELOCK_UNLOCKED) {              != __SIMPLELOCK_UNLOCKED) {
                 do {                  do {
                         x86_pause();                          x86_pause();
Line 93  __cpu_simple_lock(__cpu_simple_lock_t *l
Line 93  __cpu_simple_lock(__cpu_simple_lock_t *l
 static __inline int  static __inline int
 __cpu_simple_lock_try(__cpu_simple_lock_t *lockp)  __cpu_simple_lock_try(__cpu_simple_lock_t *lockp)
 {  {
         int r = (x86_atomic_testset_b(lockp, __SIMPLELOCK_LOCKED)          int r = (atomic_swap_8(lockp, __SIMPLELOCK_LOCKED)
             == __SIMPLELOCK_UNLOCKED);              == __SIMPLELOCK_UNLOCKED);
   
         __insn_barrier();          __insn_barrier();

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.14.12.1

CVSweb <webmaster@jp.NetBSD.org>