]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/unix/sysv/linux/i386/semtimedop.S
Update copyright notices with scripts/update-copyrights
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / i386 / semtimedop.S
CommitLineData
d4697bc9 1/* Copyright (C) 2003-2014 Free Software Foundation, Inc.
d903678a
UD
2 This file is part of the GNU C Library.
3 Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
59ba27a6
PE
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
d903678a
UD
18
19#include <sysdep.h>
20
21#define SYSOP_semtimedop 4
22
23#define SVRSP 12 /* saved register space */
2366713d 24#define PARMS 4+SVRSP /* space for 3 saved regs */
d903678a
UD
25#define SEMID PARMS
26#define SOPS SEMID+4
2366713d 27#define NSOPS SOPS+4
d903678a
UD
28#define TIMEOUT NSOPS+4
29
30 .text
2366713d 31ENTRY (semtimedop)
d903678a
UD
32
33 pushl %ebp
1ad9da69 34 cfi_adjust_cfa_offset (4)
d903678a 35 pushl %ebx
1ad9da69 36 cfi_adjust_cfa_offset (4)
d903678a 37 pushl %edi
1ad9da69 38 cfi_adjust_cfa_offset (4)
d903678a
UD
39
40 movl $SYSOP_semtimedop, %ebx
1ad9da69 41 cfi_rel_offset (ebx, 4)
d903678a
UD
42 movl SEMID(%esp), %ecx
43 movl NSOPS(%esp), %edx
44 movl SOPS(%esp), %edi
1ad9da69 45 cfi_rel_offset (edi, 0)
d903678a 46 movl TIMEOUT(%esp), %ebp
1ad9da69 47 cfi_rel_offset (ebp, 8)
d903678a
UD
48 movl $__NR_ipc, %eax
49
50 ENTER_KERNEL
51
52 /* Restore registers. */
53 popl %edi
1ad9da69
UD
54 cfi_adjust_cfa_offset (-4)
55 cfi_restore (edi)
d903678a 56 popl %ebx
1ad9da69
UD
57 cfi_adjust_cfa_offset (-4)
58 cfi_restore (ebx)
d903678a 59 popl %ebp
1ad9da69
UD
60 cfi_adjust_cfa_offset (-4)
61 cfi_restore (ebp)
d903678a
UD
62
63 /* If 0 > %eax > -4096 there was an error. */
64 cmpl $-4096, %eax
65 ja SYSCALL_ERROR_LABEL
66
67 /* Successful; return the syscall's value. */
d903678a
UD
68 ret
69
70#ifdef PIC
71 .align 4
72#endif
2366713d 73PSEUDO_END (semtimedop)