1 /* Syscall definitions, Linux s390 version.
2 Copyright (C) 2019-2022 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
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.
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.
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 <http://www.gnu.org/licenses/>. */
22 #define SYS_ify(syscall_name) __NR_##syscall_name
24 #undef INTERNAL_SYSCALL_NCS
25 #define INTERNAL_SYSCALL_NCS(no, nr, args...) \
28 register unsigned long int _nr __asm__("1") = (unsigned long int)(no); \
29 register long int _ret __asm__("2"); \
30 __asm__ __volatile__ ( \
33 : "d" (_nr) ASMFMT_##nr \
37 #undef INTERNAL_SYSCALL
38 #define INTERNAL_SYSCALL(name, nr, args...) \
39 INTERNAL_SYSCALL_NCS(__NR_##name, nr, args)
42 #define DECLARGS_1(arg1) \
43 register unsigned long int gpr2 __asm__ ("2") = (unsigned long int)(arg1);
44 #define DECLARGS_2(arg1, arg2) \
46 register unsigned long int gpr3 __asm__ ("3") = (unsigned long int)(arg2);
47 #define DECLARGS_3(arg1, arg2, arg3) \
48 DECLARGS_2(arg1, arg2) \
49 register unsigned long int gpr4 __asm__ ("4") = (unsigned long int)(arg3);
50 #define DECLARGS_4(arg1, arg2, arg3, arg4) \
51 DECLARGS_3(arg1, arg2, arg3) \
52 register unsigned long int gpr5 __asm__ ("5") = (unsigned long int)(arg4);
53 #define DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \
54 DECLARGS_4(arg1, arg2, arg3, arg4) \
55 register unsigned long int gpr6 __asm__ ("6") = (unsigned long int)(arg5);
56 #define DECLARGS_6(arg1, arg2, arg3, arg4, arg5, arg6) \
57 DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \
58 register unsigned long int gpr7 __asm__ ("7") = (unsigned long int)(arg6);
61 #define ASMFMT_1 , "0" (gpr2)
62 #define ASMFMT_2 , "0" (gpr2), "d" (gpr3)
63 #define ASMFMT_3 , "0" (gpr2), "d" (gpr3), "d" (gpr4)
64 #define ASMFMT_4 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5)
65 #define ASMFMT_5 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6)
66 #define ASMFMT_6 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6), "d" (gpr7)
68 #define VDSO_NAME "LINUX_2.6.29"
69 #define VDSO_HASH 123718585
71 /* List of system calls which are supported as vsyscalls. */
73 #define HAVE_CLOCK_GETRES64_VSYSCALL "__kernel_clock_getres"
74 #define HAVE_CLOCK_GETTIME64_VSYSCALL "__kernel_clock_gettime"
76 #define HAVE_CLOCK_GETRES_VSYSCALL "__kernel_clock_getres"
77 #define HAVE_CLOCK_GETTIME_VSYSCALL "__kernel_clock_gettime"
79 #define HAVE_GETTIMEOFDAY_VSYSCALL "__kernel_gettimeofday"
80 #define HAVE_GETCPU_VSYSCALL "__kernel_getcpu"