]>
git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/unix/sysv/linux/s390/sysdep.h
1 /* Syscall definitions, Linux s390 version.
2 Copyright (C) 2019-2021 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_DIRECT
25 #define INTERNAL_SYSCALL_DIRECT(name, nr, args...) \
28 register long int _ret __asm__("2"); \
29 __asm__ __volatile__ ( \
32 : "i" (__NR_##name) ASMFMT_##nr \
36 #undef INTERNAL_SYSCALL_SVC0
37 #define INTERNAL_SYSCALL_SVC0(name, nr, args...) \
40 register unsigned long int _nr __asm__("1") = \
41 (unsigned long int)(__NR_##name); \
42 register long int _ret __asm__("2"); \
43 __asm__ __volatile__ ( \
46 : "d" (_nr) ASMFMT_##nr \
50 #undef INTERNAL_SYSCALL_NCS
51 #define INTERNAL_SYSCALL_NCS(no, nr, args...) \
54 register unsigned long int _nr __asm__("1") = (unsigned long int)(no); \
55 register long int _ret __asm__("2"); \
56 __asm__ __volatile__ ( \
59 : "d" (_nr) ASMFMT_##nr \
63 #undef INTERNAL_SYSCALL
64 #define INTERNAL_SYSCALL(name, nr, args...) \
65 (((__NR_##name) < 256) \
66 ? INTERNAL_SYSCALL_DIRECT(name, nr, args) \
67 : INTERNAL_SYSCALL_SVC0(name, nr, args))
70 #define DECLARGS_1(arg1) \
71 register unsigned long int gpr2 __asm__ ("2") = (unsigned long int)(arg1);
72 #define DECLARGS_2(arg1, arg2) \
74 register unsigned long int gpr3 __asm__ ("3") = (unsigned long int)(arg2);
75 #define DECLARGS_3(arg1, arg2, arg3) \
76 DECLARGS_2(arg1, arg2) \
77 register unsigned long int gpr4 __asm__ ("4") = (unsigned long int)(arg3);
78 #define DECLARGS_4(arg1, arg2, arg3, arg4) \
79 DECLARGS_3(arg1, arg2, arg3) \
80 register unsigned long int gpr5 __asm__ ("5") = (unsigned long int)(arg4);
81 #define DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \
82 DECLARGS_4(arg1, arg2, arg3, arg4) \
83 register unsigned long int gpr6 __asm__ ("6") = (unsigned long int)(arg5);
84 #define DECLARGS_6(arg1, arg2, arg3, arg4, arg5, arg6) \
85 DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \
86 register unsigned long int gpr7 __asm__ ("7") = (unsigned long int)(arg6);
89 #define ASMFMT_1 , "0" (gpr2)
90 #define ASMFMT_2 , "0" (gpr2), "d" (gpr3)
91 #define ASMFMT_3 , "0" (gpr2), "d" (gpr3), "d" (gpr4)
92 #define ASMFMT_4 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5)
93 #define ASMFMT_5 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6)
94 #define ASMFMT_6 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6), "d" (gpr7)
96 #define SINGLE_THREAD_BY_GLOBAL 1
99 #define VDSO_NAME "LINUX_2.6.29"
100 #define VDSO_HASH 123718585
102 /* List of system calls which are supported as vsyscalls. */
104 #define HAVE_CLOCK_GETRES64_VSYSCALL "__kernel_clock_getres"
105 #define HAVE_CLOCK_GETTIME64_VSYSCALL "__kernel_clock_gettime"
107 #define HAVE_CLOCK_GETRES_VSYSCALL "__kernel_clock_getres"
108 #define HAVE_CLOCK_GETTIME_VSYSCALL "__kernel_clock_gettime"
110 #define HAVE_GETTIMEOFDAY_VSYSCALL "__kernel_gettimeofday"
111 #define HAVE_GETCPU_VSYSCALL "__kernel_getcpu"