]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/uclibc/lib/contrib/uclibc/libc/sysdeps/linux/i386/sync_file_range.S
update
[l4.git] / l4 / pkg / uclibc / lib / contrib / uclibc / libc / sysdeps / linux / i386 / sync_file_range.S
1 /* Copyright (C) 2006, 2007 Free Software Foundation, Inc.
2    This file is part of the GNU C Library.
3
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.
8
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.
13
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/>.  */
17
18 #define _ERRNO_H        1
19 #include <features.h>
20 #include <bits/errno.h>
21 #include <sys/syscall.h>
22
23 .text
24 .global sync_file_range
25 .type   sync_file_range,%function
26 sync_file_range:
27 #ifdef __NR_sync_file_range
28
29         /* Save regs */
30         pushl   %ebx
31         pushl   %esi
32         pushl   %edi
33         pushl   %ebp
34
35         movl $__NR_sync_file_range, %eax        /* Syscall number in %eax.  */
36
37         movl    20(%esp), %ebx
38         movl    24(%esp), %ecx
39         movl    28(%esp), %edx
40         movl    32(%esp), %esi
41         movl    36(%esp), %edi
42         movl    40(%esp), %ebp
43
44         /* Do the system call trap.  */
45         int $0x80
46
47         /* Restore regs  */
48         popl    %ebp
49         popl    %edi
50         popl    %esi
51         popl    %ebx
52
53         /* If 0 > %eax > -4096 there was an error.  */
54         cmpl $-4096, %eax
55         ja __syscall_error
56 #else
57         movl    $-ENOSYS, %eax
58         jmp __syscall_error
59 #endif
60         /* Successful; return the syscall's value.  */
61         ret
62
63 .size sync_file_range,.-sync_file_range
64
65 libc_hidden_def(sync_file_range)
66