Back to index

glibc  2.9
Defines | Typedefs | Functions
machine-lock.h File Reference
#include <mach/mips/mips_instruction.h>

Go to the source code of this file.

Defines

#define __SPIN_LOCK_INITIALIZER   0
#define _EXTERN_INLINE   extern __inline

Typedefs

typedef __volatile int __spin_lock_t

Functions

_EXTERN_INLINE void __spin_unlock (__spin_lock_t *__lock)
_EXTERN_INLINE int __spin_try_lock (register __spin_lock_t *__lock)
_EXTERN_INLINE int __spin_lock_locked (__spin_lock_t *__lock)

Define Documentation

#define __SPIN_LOCK_INITIALIZER   0

Definition at line 32 of file machine-lock.h.

#define _EXTERN_INLINE   extern __inline

Definition at line 36 of file machine-lock.h.


Typedef Documentation

Definition at line 28 of file machine-lock.h.


Function Documentation

Definition at line 86 of file machine-lock.h.

{
  return *__lock != 0;
}

Definition at line 50 of file machine-lock.h.

{
#if (__mips >= 2)
  int __rtn;

  __asm__ __volatile (".set noreorder");
#if (__mips64)
  __asm__ __volatile ("lld %0,0(%1)" : "=r" (__rtn) : "r" (__lock));
#else
  __asm__ __volatile ("ll %0,0(%1)" : "=r" (__rtn) : "r" (__lock));
#endif
  if (__rtn)
    return 0;
  __asm__ __volatile ("move %0,%1" : "=r" (__rtn) : "r" (__lock));
#if (__mips64)
  __asm__ __volatile ("scd %0,0(%1)" : "=r" (__rtn) : "r" (__lock));
#else
  __asm__ __volatile ("sc %0,0(%1)" : "=r" (__rtn) : "r" (__lock));
#endif
  __asm__ __volatile (".set reorder");
  return __rtn;
#else
  register int __rtn __asm__ ("a0");

  /* Use the Mach microkernel's emulated TAS pseudo-instruction.  */
  __asm__ __volatile (".set noreorder");
  __asm__ __volatile (".word %1" : "=r" (__rtn) : "i" (op_tas), "0" (__lock));
  __asm__ __volatile ("nop");
  __asm__ __volatile (".set reorder");
  return __rtn ^ (int) __lock;
#endif
}

Here is the call graph for this function:

Definition at line 42 of file machine-lock.h.

{
  *__lock = 0;
}