]>
Commit | Line | Data |
---|---|---|
b168057a | 1 | /* Copyright (C) 1998-2015 Free Software Foundation, Inc. |
a62da368 UD |
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 | |
3214b89b AJ |
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. | |
a62da368 UD |
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 | |
3214b89b | 12 | Lesser General Public License for more details. |
a62da368 | 13 | |
3214b89b | 14 | You should have received a copy of the GNU Lesser General Public |
ab84e3ff PE |
15 | License along with the GNU C Library. If not, see |
16 | <http://www.gnu.org/licenses/>. */ | |
a62da368 UD |
17 | |
18 | #include <sysdep.h> | |
2c659124 UD |
19 | |
20 | #define EINVAL 22 | |
a62da368 UD |
21 | |
22 | .text | |
23 | ||
24 | ENTRY (__mmap) | |
2c659124 | 25 | /* shuffle args */ |
55668624 | 26 | push { r5 } |
01b32e73 TS |
27 | cfi_adjust_cfa_offset (4) |
28 | cfi_rel_offset (r5, 0) | |
2c659124 | 29 | ldr r5, [sp, #8] |
55668624 | 30 | push { r4 } |
01b32e73 TS |
31 | cfi_adjust_cfa_offset (4) |
32 | cfi_rel_offset (r4, 0) | |
33 | cfi_remember_state | |
2c659124 UD |
34 | ldr r4, [sp, #8] |
35 | ||
36 | /* convert offset to pages */ | |
37 | movs ip, r5, lsl #20 | |
38 | bne .Linval | |
39 | mov r5, r5, lsr #12 | |
5556231d | 40 | |
2c659124 | 41 | /* do the syscall */ |
de96d148 | 42 | DO_CALL (mmap2, 0) |
2c659124 UD |
43 | |
44 | /* restore registers */ | |
45 | 2: | |
55668624 | 46 | pop { r4 } |
01b32e73 TS |
47 | cfi_adjust_cfa_offset (-4) |
48 | cfi_restore (r4) | |
55668624 | 49 | pop { r5 } |
01b32e73 TS |
50 | cfi_adjust_cfa_offset (-4) |
51 | cfi_restore (r5) | |
2c659124 UD |
52 | |
53 | cmn r0, $4096 | |
6ccd0107 | 54 | it cc |
47f0752a | 55 | RETINSTR(cc, lr) |
2c659124 | 56 | b PLTJMP(syscall_error) |
a62da368 | 57 | |
01b32e73 | 58 | cfi_restore_state |
2c659124 UD |
59 | .Linval: |
60 | mov r0, #-EINVAL | |
61 | b 2b | |
a62da368 UD |
62 | PSEUDO_END (__mmap) |
63 | ||
64 | weak_alias (__mmap, mmap) |