]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/unix/sysv/linux/s390/s390-64/syscall.S
85dd32d5a3ed1688e9bd8e29e01487ee0fc99215
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / s390 / s390-64 / syscall.S
1 /* Copyright (C) 2001-2020 Free Software Foundation, Inc.
2 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
18
19 #include <sysdep.h>
20
21 /* Please consult the file sysdeps/unix/sysv/linux/s390/sysdep.h for
22 more information about the value -4095 used below.*/
23
24 ENTRY (syscall)
25 stmg %r6,%r7,48(%r15) /* Save registers. */
26 cfi_offset (%r7,-104)
27 cfi_offset (%r6,-112)
28
29 lgr %r1,%r2 /* Move syscall number. */
30 lgr %r2,%r3 /* First parameter. */
31 lgr %r3,%r4 /* Second parameter. */
32 lgr %r4,%r5 /* Third parameter. */
33 lgr %r5,%r6 /* Fourth parameter. */
34 lmg %r6,%r7,160(%r15) /* Fifth / Sixth parameter. */
35 svc 0
36
37 lmg %r6,%r7,48(%r15) /* Load registers. */
38
39 lghi %r0,-4095
40 clgr %r2,%r0 /* Check R2 for error. */
41 jgnl SYSCALL_ERROR_LABEL
42 br %r14 /* Return to caller. */
43 PSEUDO_END (syscall)