Update.
[glibc.git] / db2 / mutex / x86.gcc
blob566b9c4433e7248a52959852df375fb9db08bd54
1 /*
2  * @(#)x86.gcc  10.3 (Sleepycat) 8/27/97
3  *
4  * For gcc/x86, 0 is clear, 1 is set.
5  */
6 #define TSL_SET(tsl) ({                                                 \
7         register tsl_t *__l = (tsl);                                    \
8         int __r;                                                        \
9         asm volatile("movl $1,%%eax; lock; xchgb %1,%%al; xorl $1,%%eax"\
10             : "=&a" (__r), "=m" (*__l)                                  \
11             : "1" (*__l)                                                \
12             );                                                          \
13         __r & 1;                                                        \
16 #define TSL_UNSET(tsl)  (*(tsl) = 0)
17 #define TSL_INIT(tsl)   TSL_UNSET(tsl)