File: x86.gcc

package info (click to toggle)
glibc-pre2.1 2.0.93-980414-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 43,920 kB
  • ctags: 42,602
  • sloc: ansic: 325,848; asm: 23,534; makefile: 3,352; sh: 3,283; awk: 582; perl: 474; csh: 15; sed: 10
file content (17 lines) | stat: -rw-r--r-- 416 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*
 * @(#)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)