PAPI 7.1.0.0
Loading...
Searching...
No Matches
s390.h File Reference
Include dependency graph for s390.h:

Go to the source code of this file.

Macros

#define AO_HAVE_compare_and_swap_full
 
#define AO_HAVE_fetch_compare_and_swap_full
 

Functions

AO_INLINE int AO_compare_and_swap_full (volatile AO_t *addr, AO_t old, AO_t new_val)
 
AO_INLINE AO_t AO_fetch_compare_and_swap_full (volatile AO_t *addr, AO_t old, AO_t new_val)
 

Macro Definition Documentation

◆ AO_HAVE_compare_and_swap_full

#define AO_HAVE_compare_and_swap_full

Definition at line 70 of file s390.h.

◆ AO_HAVE_fetch_compare_and_swap_full

#define AO_HAVE_fetch_compare_and_swap_full

Definition at line 88 of file s390.h.

Function Documentation

◆ AO_compare_and_swap_full()

AO_INLINE int AO_compare_and_swap_full ( volatile AO_t addr,
AO_t  old,
AO_t  new_val 
)

Definition at line 53 of file s390.h.

55{
56 int retval;
57 __asm__ __volatile__ (
58# ifndef __s390x__
59 " cs %1,%2,0(%3)\n"
60# else
61 " csg %1,%2,0(%3)\n"
62# endif
63 " ipm %0\n"
64 " srl %0,28\n"
65 : "=&d" (retval), "+d" (old)
66 : "d" (new_val), "a" (addr)
67 : "cc", "memory");
68 return retval == 0;
69}
int retval
Definition: zero_fork.c:53

◆ AO_fetch_compare_and_swap_full()

AO_INLINE AO_t AO_fetch_compare_and_swap_full ( volatile AO_t addr,
AO_t  old,
AO_t  new_val 
)

Definition at line 74 of file s390.h.

76{
77 __asm__ __volatile__ (
78# ifndef __s390x__
79 " cs %0,%2,%1\n"
80# else
81 " csg %0,%2,%1\n"
82# endif
83 : "+d" (old), "=Q" (*addr)
84 : "d" (new_val), "m" (*addr)
85 : "cc", "memory");
86 return old;
87}