summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/980709-1.c
blob: a4359300587ab1f80e6d545407677964c922de81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* { dg-do compile { target i?86-*-* } } */
/* { dg-options -O2 } */

extern __inline__ int test_and_set_bit(int nr, volatile void * addr)
{
	int oldbit;
	__asm__ __volatile__( "" 
		"btsl %2,%1\n\tsbbl %0,%0"
		:"=r" (oldbit),"=m" (addr)
		:"ir" (nr));
	return oldbit;
}
struct buffer_head {
	unsigned long b_state;		 
};
extern void lock_buffer(struct buffer_head * bh)
{
	while (test_and_set_bit(2 , &bh->b_state))
		__wait_on_buffer(bh);
}