1 /* Copyright (C) 1995-2015 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/>. */
23 #define SVRSP 16 /* saved register space */
24 #define PARMS 4+SVRSP /* space for 4 saved regs */
38 cfi_adjust_cfa_offset (4)
40 cfi_adjust_cfa_offset (4)
42 cfi_adjust_cfa_offset (4)
44 cfi_adjust_cfa_offset (4)
46 movl OFFLO(%esp), %edx
47 movl OFFHI(%esp), %ecx
50 shrdl $12, %ecx, %edx /* mmap2 takes the offset in pages. */
54 cfi_rel_offset (ebp, 12)
57 cfi_rel_offset (ebx, 8)
60 movl FLAGS(%esp), %esi
61 cfi_rel_offset (esi, 4)
63 cfi_rel_offset (edi, 0)
65 movl $SYS_ify(mmap2), %eax /* System call number in %eax. */
67 /* Do the system call trap. */
71 /* Restore registers. */
73 cfi_adjust_cfa_offset (-4)
76 cfi_adjust_cfa_offset (-4)
79 cfi_adjust_cfa_offset (-4)
82 cfi_adjust_cfa_offset (-4)
85 /* If 0 > %eax > -4096 there was an error. */
87 ja SYSCALL_ERROR_LABEL
89 /* Successful; return the syscall's value. */
92 cfi_adjust_cfa_offset (16)
93 cfi_rel_offset (ebp, 12)
94 cfi_rel_offset (ebx, 8)
95 cfi_rel_offset (esi, 4)
96 cfi_rel_offset (edi, 0)
97 /* This means the offset value is too large. */
100 cfi_adjust_cfa_offset (-4)
103 cfi_adjust_cfa_offset (-4)
106 cfi_adjust_cfa_offset (-4)
109 cfi_adjust_cfa_offset (-4)
112 jmp SYSCALL_ERROR_LABEL
114 PSEUDO_END (__mmap64)
116 weak_alias (__mmap64, mmap64)