blob: fa33758589ab94fd67cd1003360e0eef451f7400 [file] [log] [blame]
Elliott Hughes4cdde5f2013-03-21 22:48:18 -07001#include <asm/unistd.h>
Elliott Hughesbdff26d2013-02-11 17:08:16 -08002#include <machine/asm.h>
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08003
4#define FUTEX_WAIT 0
5#define FUTEX_WAKE 1
6
Elliott Hughesbdff26d2013-02-11 17:08:16 -08007// int __futex_wait(volatile void *ftx, int val, const struct timespec *timeout)
8ENTRY(__futex_wait)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08009 pushl %ebx
10 pushl %esi
11 mov 12(%esp), %ebx /* ftx */
12 movl $FUTEX_WAIT, %ecx
13 mov 16(%esp), %edx /* val */
14 mov 20(%esp), %esi /* timeout */
15 movl $__NR_futex, %eax
16 int $0x80
17 popl %esi
18 popl %ebx
19 ret
Elliott Hughesbdff26d2013-02-11 17:08:16 -080020END(__futex_wait)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080021
Elliott Hughesbdff26d2013-02-11 17:08:16 -080022// int __futex_wake(volatile void *ftx, int count)
23ENTRY(__futex_wake)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080024 pushl %ebx
25 mov 8(%esp), %ebx /* ftx */
26 movl $FUTEX_WAKE, %ecx
27 mov 12(%esp), %edx /* count */
28 movl $__NR_futex, %eax
29 int $0x80
30 popl %ebx
31 ret
Elliott Hughesbdff26d2013-02-11 17:08:16 -080032END(__futex_wake)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080033
Elliott Hughesbdff26d2013-02-11 17:08:16 -080034// int __futex_syscall3(volatile void *ftx, int op, int count)
35ENTRY(__futex_syscall3)
David 'Digit' Turner88f06cd2010-03-18 17:13:41 -070036 pushl %ebx
37 movl 8(%esp), %ebx /* ftx */
38 movl 12(%esp), %ecx /* op */
39 movl 16(%esp), %edx /* value */
40 movl $__NR_futex, %eax
41 int $0x80
42 popl %ebx
43 ret
Elliott Hughesbdff26d2013-02-11 17:08:16 -080044END(__futex_syscall3)
David 'Digit' Turner88f06cd2010-03-18 17:13:41 -070045
Elliott Hughesbdff26d2013-02-11 17:08:16 -080046// int __futex_syscall4(volatile void *ftx, int op, int val, const struct timespec *timeout)
47ENTRY(__futex_syscall4)
David 'Digit' Turner88f06cd2010-03-18 17:13:41 -070048 pushl %ebx
49 pushl %esi
50 movl 12(%esp), %ebx /* ftx */
51 movl 16(%esp), %ecx /* op */
52 movl 20(%esp), %edx /* val */
53 movl 24(%esp), %esi /* timeout */
54 movl $__NR_futex, %eax
55 int $0x80
56 popl %esi
57 popl %ebx
58 ret
Elliott Hughesbdff26d2013-02-11 17:08:16 -080059END(__futex_syscall4)