zig/lib/libc/musl/arch/s390x/atomic_arch.h
Andrew Kelley 49d1a4c562 move lib dirs to lib subdir
also start prefering NtDll API. so far:
 * NtQueryInformationFile
 * NtClose

adds a performance workaround for windows unicode conversion. but that
should probably be removed before merging
2019-07-15 17:54:50 -04:00

31 lines
609 B
C

#define a_cas a_cas
static inline int a_cas(volatile int *p, int t, int s)
{
__asm__ __volatile__ (
"cs %0, %2, %1"
: "+d"(t), "+Q"(*p) : "d"(s) : "memory", "cc");
return t;
}
#define a_cas_p a_cas_p
static inline void *a_cas_p(volatile void *p, void *t, void *s)
{
__asm__ __volatile__ (
"csg %0, %2, %1"
: "+d"(t), "+Q"(*(void *volatile *)p) : "d"(s)
: "memory", "cc");
return t;
}
#define a_barrier a_barrier
static inline void a_barrier()
{
__asm__ __volatile__ ("bcr 15,0" : : : "memory");
}
#define a_crash a_crash
static inline void a_crash()
{
__asm__ __volatile__ (".insn e,0");
}