]>
Commit | Line | Data |
---|---|---|
b8386c28 | 1 | /* Syscall definitions, Linux s390 version. |
6d7e8eda | 2 | Copyright (C) 2019-2023 Free Software Foundation, Inc. |
b8386c28 AZ |
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 | <http://www.gnu.org/licenses/>. */ | |
18 | ||
9a973da6 AZ |
19 | #ifndef __ASSEMBLY__ |
20 | ||
21 | #undef SYS_ify | |
22 | #define SYS_ify(syscall_name) __NR_##syscall_name | |
23 | ||
9a973da6 | 24 | #undef INTERNAL_SYSCALL_NCS |
bc2eb932 | 25 | #define INTERNAL_SYSCALL_NCS(no, nr, args...) \ |
9a973da6 AZ |
26 | ({ \ |
27 | DECLARGS_##nr(args) \ | |
28 | register unsigned long int _nr __asm__("1") = (unsigned long int)(no); \ | |
29 | register long int _ret __asm__("2"); \ | |
30 | __asm__ __volatile__ ( \ | |
31 | "svc 0\n\t" \ | |
32 | : "=d" (_ret) \ | |
33 | : "d" (_nr) ASMFMT_##nr \ | |
34 | : "memory" ); \ | |
35 | _ret; }) | |
36 | ||
37 | #undef INTERNAL_SYSCALL | |
e57d8fc9 SL |
38 | #define INTERNAL_SYSCALL(name, nr, args...) \ |
39 | INTERNAL_SYSCALL_NCS(__NR_##name, nr, args) | |
9a973da6 | 40 | |
9a973da6 AZ |
41 | #define DECLARGS_0() |
42 | #define DECLARGS_1(arg1) \ | |
43 | register unsigned long int gpr2 __asm__ ("2") = (unsigned long int)(arg1); | |
44 | #define DECLARGS_2(arg1, arg2) \ | |
45 | DECLARGS_1(arg1) \ | |
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); | |
59 | ||
60 | #define ASMFMT_0 | |
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) | |
67 | ||
b8386c28 AZ |
68 | #define VDSO_NAME "LINUX_2.6.29" |
69 | #define VDSO_HASH 123718585 | |
70 | ||
71 | /* List of system calls which are supported as vsyscalls. */ | |
ff500a62 | 72 | #ifdef __s390x__ |
0dc1a378 | 73 | #define HAVE_CLOCK_GETRES64_VSYSCALL "__kernel_clock_getres" |
ff500a62 AZ |
74 | #define HAVE_CLOCK_GETTIME64_VSYSCALL "__kernel_clock_gettime" |
75 | #else | |
0dc1a378 | 76 | #define HAVE_CLOCK_GETRES_VSYSCALL "__kernel_clock_getres" |
b8a7c7da | 77 | #define HAVE_CLOCK_GETTIME_VSYSCALL "__kernel_clock_gettime" |
ff500a62 | 78 | #endif |
b8a7c7da AZ |
79 | #define HAVE_GETTIMEOFDAY_VSYSCALL "__kernel_gettimeofday" |
80 | #define HAVE_GETCPU_VSYSCALL "__kernel_getcpu" | |
9a973da6 AZ |
81 | |
82 | #endif |