2 * i386 semaphore implementation.
4 * (C) Copyright 1999 Linus Torvalds
6 * Portions Copyright 1999 Red Hat, Inc.
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
13 * rw semaphores implemented November 1999 by Benjamin LaHaise <bcrl@kvack.org>
16 #include <linux/linkage.h>
17 #include <asm/frame.h>
18 #include <asm/dwarf2.h>
21 * The semaphore operations have a special calling sequence that
22 * allow us to do a simpler in-line version of them. These routines
23 * need to convert that sequence back into the C sequence when
24 * there is contention on the semaphore.
26 * %eax contains the semaphore pointer on entry. Save the C-clobbered
27 * registers (%eax, %edx and %ecx) except %eax whish is either a return
28 * value or just clobbered..
30 .section .sched.text, "ax"
32 /* Fix up special calling conventions */
33 ENTRY(call_rwsem_down_read_failed)
39 call rwsem_down_read_failed
44 ENDPROC(call_rwsem_down_read_failed)
46 ENTRY(call_rwsem_down_write_failed)
50 calll rwsem_down_write_failed
54 ENDPROC(call_rwsem_down_write_failed)
56 ENTRY(call_rwsem_wake)
58 decw %dx /* do nothing if still outstanding active readers */
66 ENDPROC(call_rwsem_wake)
68 /* Fix up special calling conventions */
69 ENTRY(call_rwsem_downgrade_wake)
75 call rwsem_downgrade_wake
80 ENDPROC(call_rwsem_downgrade_wake)