Update copyright notices with scripts/update-copyrights
[glibc.git] / sysdeps / unix / sysv / linux / i386 / epoll_pwait.S
blob457d84e3e6620da3bcc11a6f27f21e3ecae7a0d1
1 /* Copyright (C) 2007-2014 Free Software Foundation, Inc.
2    This file is part of the GNU C Library.
4    The GNU C Library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Lesser General Public
6    License as published by the Free Software Foundation; either
7    version 2.1 of the License, or (at your option) any later version.
9    The GNU C Library is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    Lesser General Public License for more details.
14    You should have received a copy of the GNU Lesser General Public
15    License along with the GNU C Library; if not, see
16    <http://www.gnu.org/licenses/>.  */
18 #include <sysdep.h>
19 #define _ERRNO_H
20 #include <bits/errno.h>
21 #define _SIGNAL_H
22 #include <bits/signum.h>
25         .text
26 ENTRY (epoll_pwait)
28 #ifdef __NR_epoll_pwait
30         /* Save registers.  */
31         pushl %ebp
32         cfi_adjust_cfa_offset (4)
33         pushl %ebx
34         cfi_adjust_cfa_offset (4)
35         pushl %esi
36         cfi_adjust_cfa_offset (4)
37         pushl %edi
38         cfi_adjust_cfa_offset (4)
39         cfi_rel_offset (edi, 0)
40         cfi_rel_offset (esi, 4)
41         cfi_rel_offset (ebx, 8)
42         cfi_rel_offset (ebp, 12)
44         movl 20(%esp), %ebx
45         movl 24(%esp), %ecx
46         movl 28(%esp), %edx
47         movl 32(%esp), %esi
48         movl 36(%esp), %edi
49         movl $_NSIG/8, %ebp
50         movl $__NR_epoll_pwait, %eax
52         ENTER_KERNEL
54         /* Restore registers.  */
55         popl %edi
56         cfi_adjust_cfa_offset (-4)
57         cfi_restore (edi)
58         popl %esi
59         cfi_adjust_cfa_offset (-4)
60         cfi_restore (esi)
61         popl %ebx
62         cfi_adjust_cfa_offset (-4)
63         cfi_restore (ebx)
64         popl %ebp
65         cfi_adjust_cfa_offset (-4)
66         cfi_restore (ebp)
68         /* If 0 > %eax > -4096 there was an error.  */
69         cmpl $-4096, %eax
70         ja SYSCALL_ERROR_LABEL
72         /* Successful; return the syscall's value.  */
73 #else
74         movl $-ENOSYS, %eax
75         jmp SYSCALL_ERROR_LABEL
76 #endif
77         ret
78 PSEUDO_END (epoll_pwait)