source: trunk/packages/xen-3.1/xen-3.1/xen/arch/x86/rwlock.c @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

File size: 721 bytes
Line 
1#include <asm/atomic.h>
2#include <asm/rwlock.h>
3
4#if defined(CONFIG_SMP)
5asm(
6".align  4\n"
7".globl  __write_lock_failed\n"
8"__write_lock_failed:\n"
9"        " LOCK "addl    $" RW_LOCK_BIAS_STR ",(%"__OP"ax)\n"
10"1:      rep; nop\n"
11"        cmpl    $" RW_LOCK_BIAS_STR ",(%"__OP"ax)\n"
12"        jne     1b\n"
13"        " LOCK "subl    $" RW_LOCK_BIAS_STR ",(%"__OP"ax)\n"
14"        jnz     __write_lock_failed\n"
15"        ret\n"
16
17".align  4\n"
18".globl  __read_lock_failed\n"
19"__read_lock_failed:\n"
20"        lock ; incl     (%"__OP"ax)\n"
21"1:      rep; nop\n"
22"        cmpl    $1,(%"__OP"ax)\n"
23"        js      1b\n"
24"        lock ; decl     (%"__OP"ax)\n"
25"        js      __read_lock_failed\n"
26"        ret\n"
27);
28#endif
Note: See TracBrowser for help on using the repository browser.