summaryrefslogtreecommitdiff
path: root/linux/src/arch/i386/lib/semaphore.S
blob: e09655c3f9ead18068f8211484f1bec0c40604f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 *  linux/arch/i386/lib/semaphore.S
 *
 *  Copyright (C) 1996  Linus Torvalds
 */

#include <linux/linkage.h>

/*
 * "down_failed" is called with the eventual return address
 * in %eax, and the address of the semaphore in %ecx. We need
 * to increment the number of waiters on the semaphore,
 * call "__down()", and then eventually return to try again.
 */
ENTRY(down_failed)
	pushl %eax
	pushl %ecx
	call SYMBOL_NAME(__down)
	popl %ecx
	ret

ENTRY(up_wakeup)
	pushl %eax
	pushl %ecx
	call SYMBOL_NAME(__up)
	popl %ecx
	ret

ENTRY(down_failed_interruptible)
	pushl %eax
	pushl %ecx
	call SYMBOL_NAME(__down_interruptible)
	popl %ecx
	ret