xen-vtx-unstable

view xen/arch/x86/rwlock.c @ 6774:4d899a738d59

merge?
author cl349@firebug.cl.cam.ac.uk
date Tue Sep 13 15:05:49 2005 +0000 (2005-09-13)
parents 0e23f01219c6
children
line source
1 #include <asm/atomic.h>
2 #include <asm/rwlock.h>
4 #if defined(CONFIG_SMP)
5 asm(
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"
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