2014-01-01 11:03:15 +00:00
|
|
|
/* Copyright (C) 2003-2014 Free Software Foundation, Inc.
|
2003-04-02 23:49:47 +00:00
|
|
|
This file is part of the GNU C Library.
|
|
|
|
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
|
|
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2012-02-09 23:18:22 +00:00
|
|
|
License along with the GNU C Library; if not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
2003-04-02 23:49:47 +00:00
|
|
|
|
|
|
|
#include <sysdep.h>
|
|
|
|
|
|
|
|
#define SYSOP_semtimedop 4
|
|
|
|
|
|
|
|
#define SVRSP 12 /* saved register space */
|
2013-02-21 22:21:52 +00:00
|
|
|
#define PARMS 4+SVRSP /* space for 3 saved regs */
|
2003-04-02 23:49:47 +00:00
|
|
|
#define SEMID PARMS
|
|
|
|
#define SOPS SEMID+4
|
2013-02-21 22:21:52 +00:00
|
|
|
#define NSOPS SOPS+4
|
2003-04-02 23:49:47 +00:00
|
|
|
#define TIMEOUT NSOPS+4
|
|
|
|
|
|
|
|
.text
|
2013-02-21 22:21:52 +00:00
|
|
|
ENTRY (semtimedop)
|
2003-04-02 23:49:47 +00:00
|
|
|
|
|
|
|
pushl %ebp
|
2005-05-04 06:22:30 +00:00
|
|
|
cfi_adjust_cfa_offset (4)
|
2003-04-02 23:49:47 +00:00
|
|
|
pushl %ebx
|
2005-05-04 06:22:30 +00:00
|
|
|
cfi_adjust_cfa_offset (4)
|
2003-04-02 23:49:47 +00:00
|
|
|
pushl %edi
|
2005-05-04 06:22:30 +00:00
|
|
|
cfi_adjust_cfa_offset (4)
|
2003-04-02 23:49:47 +00:00
|
|
|
|
|
|
|
movl $SYSOP_semtimedop, %ebx
|
2005-05-04 06:22:30 +00:00
|
|
|
cfi_rel_offset (ebx, 4)
|
2003-04-02 23:49:47 +00:00
|
|
|
movl SEMID(%esp), %ecx
|
|
|
|
movl NSOPS(%esp), %edx
|
|
|
|
movl SOPS(%esp), %edi
|
2005-05-04 06:22:30 +00:00
|
|
|
cfi_rel_offset (edi, 0)
|
2003-04-02 23:49:47 +00:00
|
|
|
movl TIMEOUT(%esp), %ebp
|
2005-05-04 06:22:30 +00:00
|
|
|
cfi_rel_offset (ebp, 8)
|
2003-04-02 23:49:47 +00:00
|
|
|
movl $__NR_ipc, %eax
|
|
|
|
|
|
|
|
ENTER_KERNEL
|
|
|
|
|
|
|
|
/* Restore registers. */
|
|
|
|
popl %edi
|
2005-05-04 06:22:30 +00:00
|
|
|
cfi_adjust_cfa_offset (-4)
|
|
|
|
cfi_restore (edi)
|
2003-04-02 23:49:47 +00:00
|
|
|
popl %ebx
|
2005-05-04 06:22:30 +00:00
|
|
|
cfi_adjust_cfa_offset (-4)
|
|
|
|
cfi_restore (ebx)
|
2003-04-02 23:49:47 +00:00
|
|
|
popl %ebp
|
2005-05-04 06:22:30 +00:00
|
|
|
cfi_adjust_cfa_offset (-4)
|
|
|
|
cfi_restore (ebp)
|
2003-04-02 23:49:47 +00:00
|
|
|
|
|
|
|
/* If 0 > %eax > -4096 there was an error. */
|
|
|
|
cmpl $-4096, %eax
|
|
|
|
ja SYSCALL_ERROR_LABEL
|
|
|
|
|
|
|
|
/* Successful; return the syscall's value. */
|
|
|
|
ret
|
|
|
|
|
|
|
|
#ifdef PIC
|
|
|
|
.align 4
|
|
|
|
#endif
|
2013-02-21 22:21:52 +00:00
|
|
|
PSEUDO_END (semtimedop)
|