1 /* Wrapper around mmap system call. 64 bit S/390 version.
2 Copyright (C) 2001-2014 Free Software Foundation, Inc.
3 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <http://www.gnu.org/licenses/>. */
27 /* Save registers and setup stack frame. */
28 stmg %r6,%r15,48(%r15)
40 lg %r0,8(%r15) /* Load eos. */
41 aghi %r15,-208 /* Buy stack space. */
42 cfi_adjust_cfa_offset (208)
43 stg %r1,0(%r15) /* Store back chain. */
44 stg %r0,8(%r15) /* Store eos. */
46 /* Store parameters on stack, because old_mmap
47 takes only one parameter: a pointer to the parameter area. */
48 mvc 200(8,%r15),368(%r15) /* Move 'offset'. */
50 stg %r6,192(%r15) /* Store 'fd'. */
52 stg %r5,184(%r15) /* Store 'flags'. */
54 stg %r4,176(%r15) /* Store 'prot'. */
55 stg %r3,168(%r15) /* Store 'length'. */
56 stg %r2,160(%r15) /* Store 'start'. */
58 la %r2,160(%r15) /* Load address of parameter list. */
59 /* Do the system call trap. */
62 lg %r15,0(%r15) /* Load back chain. */
63 cfi_adjust_cfa_offset (-208)
64 lmg %r6,%r15,48(%r15) /* Load registers. */
66 /* Check gpr 2 for error. */
69 jgnl SYSCALL_ERROR_LABEL
71 /* Successful; return the syscall's value. */
76 weak_alias (__mmap, mmap)
77 weak_alias (__mmap, mmap64)
78 weak_alias (__mmap, __mmap64)