Go to the documentation of this file.
9 #ifndef _ASM_X86_MUTEX_64_H
10 #define _ASM_X86_MUTEX_64_H
19 #define __mutex_fastpath_lock(v, fail_fn) \
21 unsigned long dummy; \
23 typecheck(atomic_t *, v); \
24 typecheck_fn(void (*)(atomic_t *), fail_fn); \
26 asm volatile(LOCK_PREFIX " decl (%%rdi)\n" \
28 " call " #fail_fn "\n" \
32 : "rax", "rsi", "rdx", "rcx", \
33 "r8", "r9", "r10", "r11", "memory"); \
50 return fail_fn(count);
62 #define __mutex_fastpath_unlock(v, fail_fn) \
64 unsigned long dummy; \
66 typecheck(atomic_t *, v); \
67 typecheck_fn(void (*)(atomic_t *), fail_fn); \
69 asm volatile(LOCK_PREFIX " incl (%%rdi)\n" \
71 " call " #fail_fn "\n" \
75 : "rax", "rsi", "rdx", "rcx", \
76 "r8", "r9", "r10", "r11", "memory"); \
79 #define __mutex_slowpath_needs_to_unlock() 1