Generic semaphore implementation
Semaphores are no longer performance-critical, so a generic C implementation is better for maintainability, debuggability and extensibility. Thanks to Peter Zijlstra for fixing the lockdep warning. Thanks to Harvey Harrison for pointing out that the unlikely() was unnecessary. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Acked-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:

committed by
Matthew Wilcox

parent
e48b3deee4
commit
64ac24e738
@@ -30,89 +30,6 @@
|
||||
* value or just clobbered..
|
||||
*/
|
||||
.section .sched.text, "ax"
|
||||
ENTRY(__down_failed)
|
||||
CFI_STARTPROC
|
||||
FRAME
|
||||
pushl %edx
|
||||
CFI_ADJUST_CFA_OFFSET 4
|
||||
CFI_REL_OFFSET edx,0
|
||||
pushl %ecx
|
||||
CFI_ADJUST_CFA_OFFSET 4
|
||||
CFI_REL_OFFSET ecx,0
|
||||
call __down
|
||||
popl %ecx
|
||||
CFI_ADJUST_CFA_OFFSET -4
|
||||
CFI_RESTORE ecx
|
||||
popl %edx
|
||||
CFI_ADJUST_CFA_OFFSET -4
|
||||
CFI_RESTORE edx
|
||||
ENDFRAME
|
||||
ret
|
||||
CFI_ENDPROC
|
||||
ENDPROC(__down_failed)
|
||||
|
||||
ENTRY(__down_failed_interruptible)
|
||||
CFI_STARTPROC
|
||||
FRAME
|
||||
pushl %edx
|
||||
CFI_ADJUST_CFA_OFFSET 4
|
||||
CFI_REL_OFFSET edx,0
|
||||
pushl %ecx
|
||||
CFI_ADJUST_CFA_OFFSET 4
|
||||
CFI_REL_OFFSET ecx,0
|
||||
call __down_interruptible
|
||||
popl %ecx
|
||||
CFI_ADJUST_CFA_OFFSET -4
|
||||
CFI_RESTORE ecx
|
||||
popl %edx
|
||||
CFI_ADJUST_CFA_OFFSET -4
|
||||
CFI_RESTORE edx
|
||||
ENDFRAME
|
||||
ret
|
||||
CFI_ENDPROC
|
||||
ENDPROC(__down_failed_interruptible)
|
||||
|
||||
ENTRY(__down_failed_trylock)
|
||||
CFI_STARTPROC
|
||||
FRAME
|
||||
pushl %edx
|
||||
CFI_ADJUST_CFA_OFFSET 4
|
||||
CFI_REL_OFFSET edx,0
|
||||
pushl %ecx
|
||||
CFI_ADJUST_CFA_OFFSET 4
|
||||
CFI_REL_OFFSET ecx,0
|
||||
call __down_trylock
|
||||
popl %ecx
|
||||
CFI_ADJUST_CFA_OFFSET -4
|
||||
CFI_RESTORE ecx
|
||||
popl %edx
|
||||
CFI_ADJUST_CFA_OFFSET -4
|
||||
CFI_RESTORE edx
|
||||
ENDFRAME
|
||||
ret
|
||||
CFI_ENDPROC
|
||||
ENDPROC(__down_failed_trylock)
|
||||
|
||||
ENTRY(__up_wakeup)
|
||||
CFI_STARTPROC
|
||||
FRAME
|
||||
pushl %edx
|
||||
CFI_ADJUST_CFA_OFFSET 4
|
||||
CFI_REL_OFFSET edx,0
|
||||
pushl %ecx
|
||||
CFI_ADJUST_CFA_OFFSET 4
|
||||
CFI_REL_OFFSET ecx,0
|
||||
call __up
|
||||
popl %ecx
|
||||
CFI_ADJUST_CFA_OFFSET -4
|
||||
CFI_RESTORE ecx
|
||||
popl %edx
|
||||
CFI_ADJUST_CFA_OFFSET -4
|
||||
CFI_RESTORE edx
|
||||
ENDFRAME
|
||||
ret
|
||||
CFI_ENDPROC
|
||||
ENDPROC(__up_wakeup)
|
||||
|
||||
/*
|
||||
* rw spinlock fallbacks
|
||||
|
Reference in New Issue
Block a user