Update.
[glibc.git] / sysdeps / unix / sysv / linux / sparc / sysdep.h
blob5fd9a158b07652c4141dc38b966fdc14844ce8b2
1 /* Copyright (C) 2000 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Jakub Jelinek <jakub@redhat.com>, 2000.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 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 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
20 #ifndef _LINUX_SPARC_SYSDEP_H
21 #define _LINUX_SPARC_SYSDEP_H 1
23 #undef INLINE_SYSCALL
24 #define INLINE_SYSCALL(name, nr, args...) inline_syscall##nr(name, args)
26 #define inline_syscall0(name,dummy...) \
27 ({ \
28 register long __o0 __asm__ ("o0"); \
29 register long __g1 __asm__ ("g1") = __NR_##name; \
30 __asm__ (__SYSCALL_STRING : "=r" (__g1), "=r" (__o0) : \
31 "0" (__g1) : \
32 __SYSCALL_CLOBBERS); \
33 __o0; \
36 #define inline_syscall1(name,arg1) \
37 ({ \
38 register long __o0 __asm__ ("o0") = (long)(arg1); \
39 register long __g1 __asm__ ("g1") = __NR_##name; \
40 __asm__ (__SYSCALL_STRING : "=r" (__g1), "=r" (__o0) : \
41 "0" (__g1), "1" (__o0) : \
42 __SYSCALL_CLOBBERS); \
43 __o0; \
46 #define inline_syscall2(name,arg1,arg2) \
47 ({ \
48 register long __o0 __asm__ ("o0") = (long)(arg1); \
49 register long __o1 __asm__ ("o1") = (long)(arg2); \
50 register long __g1 __asm__ ("g1") = __NR_##name; \
51 __asm__ (__SYSCALL_STRING : "=r" (__g1), "=r" (__o0) : \
52 "0" (__g1), "1" (__o0), "r" (__o1) : \
53 __SYSCALL_CLOBBERS); \
54 __o0; \
57 #define inline_syscall3(name,arg1,arg2,arg3) \
58 ({ \
59 register long __o0 __asm__ ("o0") = (long)(arg1); \
60 register long __o1 __asm__ ("o1") = (long)(arg2); \
61 register long __o2 __asm__ ("o2") = (long)(arg3); \
62 register long __g1 __asm__ ("g1") = __NR_##name; \
63 __asm__ (__SYSCALL_STRING : "=r" (__g1), "=r" (__o0) : \
64 "0" (__g1), "1" (__o0), "r" (__o1), "r" (__o2) : \
65 __SYSCALL_CLOBBERS); \
66 __o0; \
69 #define inline_syscall4(name,arg1,arg2,arg3,arg4) \
70 ({ \
71 register long __o0 __asm__ ("o0") = (long)(arg1); \
72 register long __o1 __asm__ ("o1") = (long)(arg2); \
73 register long __o2 __asm__ ("o2") = (long)(arg3); \
74 register long __o3 __asm__ ("o3") = (long)(arg4); \
75 register long __g1 __asm__ ("g1") = __NR_##name; \
76 __asm__ (__SYSCALL_STRING : "=r" (__g1), "=r" (__o0) : \
77 "0" (__g1), "1" (__o0), "r" (__o1), "r" (__o2), \
78 "r" (__o3) : \
79 __SYSCALL_CLOBBERS); \
80 __o0; \
83 #define inline_syscall5(name,arg1,arg2,arg3,arg4,arg5) \
84 ({ \
85 register long __o0 __asm__ ("o0") = (long)(arg1); \
86 register long __o1 __asm__ ("o1") = (long)(arg2); \
87 register long __o2 __asm__ ("o2") = (long)(arg3); \
88 register long __o3 __asm__ ("o3") = (long)(arg4); \
89 register long __o4 __asm__ ("o4") = (long)(arg5); \
90 register long __g1 __asm__ ("g1") = __NR_##name; \
91 __asm__ (__SYSCALL_STRING : "=r" (__g1), "=r" (__o0) : \
92 "0" (__g1), "1" (__o0), "r" (__o1), "r" (__o2), \
93 "r" (__o3), "r" (__o4) : \
94 __SYSCALL_CLOBBERS); \
95 __o0; \
98 #define inline_syscall6(name,arg1,arg2,arg3,arg4,arg5,arg6) \
99 ({ \
100 register long __o0 __asm__ ("o0") = (long)(arg1); \
101 register long __o1 __asm__ ("o1") = (long)(arg2); \
102 register long __o2 __asm__ ("o2") = (long)(arg3); \
103 register long __o3 __asm__ ("o3") = (long)(arg4); \
104 register long __o4 __asm__ ("o4") = (long)(arg5); \
105 register long __o5 __asm__ ("o5") = (long)(arg6); \
106 register long __g1 __asm__ ("g1") = __NR_##name; \
107 __asm__ (__SYSCALL_STRING : "=r" (__g1), "=r" (__o0) : \
108 "0" (__g1), "1" (__o0), "r" (__o1), "r" (__o2), \
109 "r" (__o3), "r" (__o4), "r" (__o5) : \
110 __SYSCALL_CLOBBERS); \
111 __o0; \
114 #endif /* _LINUX_SPARC_SYSDEP_H */