[BACK]Return to lock.h CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / arch / mips / 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/mips/include/lock.h between version 1.12 and 1.12.22.2

version 1.12, 2007/02/15 15:27:54 version 1.12.22.2, 2007/12/03 16:14:05
Line 46 
Line 46 
 #ifndef _MIPS_LOCK_H_  #ifndef _MIPS_LOCK_H_
 #define _MIPS_LOCK_H_  #define _MIPS_LOCK_H_
   
   static __inline int
   __SIMPLELOCK_LOCKED_P(__cpu_simple_lock_t *__ptr)
   {
           return *__ptr == __SIMPLELOCK_LOCKED;
   }
   
   static __inline int
   __SIMPLELOCK_UNLOCKED_P(__cpu_simple_lock_t *__ptr)
   {
           return *__ptr == __SIMPLELOCK_UNLOCKED;
   }
   
   static __inline void
   __cpu_simple_lock_clear(__cpu_simple_lock_t *__ptr)
   {
           *__ptr = __SIMPLELOCK_UNLOCKED;
   }
   
   static __inline void
   __cpu_simple_lock_set(__cpu_simple_lock_t *__ptr)
   {
           *__ptr = __SIMPLELOCK_LOCKED;
   }
   
 #ifndef _KERNEL  #ifndef _KERNEL
   
 static __inline int  static __inline int
Line 125  mb_memory(void)
Line 149  mb_memory(void)
   
 #else   /* !_KERNEL */  #else   /* !_KERNEL */
   
 int     _lock_cas4(volatile uint32_t *, uint32_t, uint32_t);  unsigned _atomic_cas_uint(volatile unsigned *, unsigned, unsigned);
 void    mb_read(void);  void    mb_read(void);
 void    mb_write(void);  void    mb_write(void);
 void    mb_memory(void);  void    mb_memory(void);
Line 134  static __inline int
Line 158  static __inline int
 __cpu_simple_lock_try(__cpu_simple_lock_t *lp)  __cpu_simple_lock_try(__cpu_simple_lock_t *lp)
 {  {
   
         return _lock_cas4((volatile uint32_t *)lp,          return _atomic_cas_uint((volatile unsigned *)lp,
             __SIMPLELOCK_UNLOCKED, __SIMPLELOCK_LOCKED);              __SIMPLELOCK_UNLOCKED, __SIMPLELOCK_LOCKED) ==
               __SIMPLELOCK_UNLOCKED;
 }  }
   
 #endif  /* _KERNEL */  #endif  /* _KERNEL */

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.12.22.2

CVSweb <webmaster@jp.NetBSD.org>