OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [i386/] [980709-1.c] - Blame information for rev 318

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 318 jeremybenn
/* { dg-do compile } */
2
/* { dg-options -O2 } */
3
 
4
extern __inline__ int test_and_set_bit(int nr, volatile void * addr)
5
{
6
        int oldbit;
7
        __asm__ __volatile__( ""
8
                "btsl %2,%1\n\tsbbl %0,%0"
9
                :"=r" (oldbit),"=m" (addr)
10
                :"ir" (nr));
11
        return oldbit;
12
}
13
struct buffer_head {
14
        unsigned long b_state;
15
};
16
extern void lock_buffer(struct buffer_head * bh)
17
{
18
        while (test_and_set_bit(2 , &bh->b_state))
19
                __wait_on_buffer(bh);
20
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.