darwin-lock.h File Reference

Include dependency graph for darwin-lock.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define MUTEX_OPEN   0
#define MUTEX_CLOSED   1
#define _papi_hwd_lock(lck)
#define _papi_hwd_unlock(lck)

Variables

volatile unsigned int _papi_hwd_lock_data [PAPI_MAX_LOCK]

Define Documentation

#define _papi_hwd_lock ( lck   ) 
Value:
do                                              \
{                                               \
   unsigned int res = 0;                        \
   do {                                         \
      __asm__ __volatile__ ("lock ; " "cmpxchg %1,%2" : "=a"(res) : "q"(MUTEX_CLOSED), "m"(_papi_hwd_lock_data[lck]), "0"(MUTEX_OPEN) : "memory");  \
   } while(res != (unsigned int)MUTEX_OPEN);   \
} while(0)

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

#define _papi_hwd_unlock ( lck   ) 
Value:
do                                              \
{                                               \
   unsigned int res = 0;                       \
   __asm__ __volatile__ ("xchg %0,%1" : "=r"(res) : "m"(_papi_hwd_lock_data[lck]), "0"(MUTEX_OPEN) : "memory");                                \
} while(0)

Definition at line 40 of file darwin-lock.h.

#define MUTEX_CLOSED   1

Definition at line 30 of file darwin-lock.h.

#define MUTEX_OPEN   0

Definition at line 29 of file darwin-lock.h.


Variable Documentation

volatile unsigned int _papi_hwd_lock_data[PAPI_MAX_LOCK]

Definition at line 32 of file darwin-common.c.


Generated on 8 Sep 2016 for PAPI by  doxygen 1.6.1