mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 00:25:27 +00:00
18 lines
416 B
Plaintext
18 lines
416 B
Plaintext
/*
|
|
* @(#)x86.gcc 10.3 (Sleepycat) 8/27/97
|
|
*
|
|
* For gcc/x86, 0 is clear, 1 is set.
|
|
*/
|
|
#define TSL_SET(tsl) ({ \
|
|
register tsl_t *__l = (tsl); \
|
|
int __r; \
|
|
asm volatile("movl $1,%%eax; lock; xchgb %1,%%al; xorl $1,%%eax"\
|
|
: "=&a" (__r), "=m" (*__l) \
|
|
: "1" (*__l) \
|
|
); \
|
|
__r & 1; \
|
|
})
|
|
|
|
#define TSL_UNSET(tsl) (*(tsl) = 0)
|
|
#define TSL_INIT(tsl) TSL_UNSET(tsl)
|