2 * x86-64 rwsem wrappers
4 * This interfaces the inline asm code to the slow-path
5 * C routines. We need to save the call-clobbered regs
6 * that the asm does not mark as clobbered, and move the
7 * argument from %rax to %rdi.
9 * NOTE! We don't need to save %rax, because the functions
10 * will always return the semaphore pointer in %rax (which
11 * is also the input argument to these helpers)
13 * The following can clobber %rdx because the asm clobbers it:
14 * call_rwsem_down_write_failed
16 * but %rdi, %rsi, %rcx, %r8-r11 always need saving.
19 #include <linux/linkage.h>
20 #include <asm/rwlock.h>
21 #include <asm/alternative-asm.h>
22 #include <asm/frame.h>
23 #include <asm/dwarf2.h>
25 #define save_common_regs \
34 #define restore_common_regs \
43 /* Fix up special calling conventions */
44 ENTRY(call_rwsem_down_read_failed)
48 call rwsem_down_read_failed
52 ENDPROC(call_rwsem_down_read_failed)
54 ENTRY(call_rwsem_down_write_failed)
57 call rwsem_down_write_failed
60 ENDPROC(call_rwsem_down_write_failed)
62 ENTRY(call_rwsem_wake)
63 decw %dx /* do nothing if still outstanding active readers */
70 ENDPROC(call_rwsem_wake)
72 /* Fix up special calling conventions */
73 ENTRY(call_rwsem_downgrade_wake)
77 call rwsem_downgrade_wake
81 ENDPROC(call_rwsem_downgrade_wake)