]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/unix/sysv/linux/sparc/sysdep.h
Update.
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / sparc / sysdep.h
CommitLineData
6aca81bb 1/* Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
4d76a0ec
UD
2 This file is part of the GNU C Library.
3 Contributed by Jakub Jelinek <jakub@redhat.com>, 2000.
4
5 The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
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.
4d76a0ec
UD
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
41bdb6e2 13 Lesser General Public License for more details.
4d76a0ec 14
41bdb6e2
AJ
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 02111-1307 USA. */
4d76a0ec
UD
19
20#ifndef _LINUX_SPARC_SYSDEP_H
21#define _LINUX_SPARC_SYSDEP_H 1
22
23#undef INLINE_SYSCALL
369b849f
RM
24#define INLINE_SYSCALL(name, nr, args...) \
25 inline_syscall##nr(__SYSCALL_STRING, name, args)
4d76a0ec 26
6aca81bb
UD
27#undef INTERNAL_SYSCALL_DECL
28#define INTERNAL_SYSCALL_DECL(err) do { } while (0)
29
369b849f 30#undef INTERNAL_SYSCALL
6aca81bb 31#define INTERNAL_SYSCALL(name, err, nr, args...) \
369b849f
RM
32 inline_syscall##nr(__INTERNAL_SYSCALL_STRING, name, args)
33
34#undef INTERNAL_SYSCALL_ERROR_P
6aca81bb
UD
35#define INTERNAL_SYSCALL_ERROR_P(val, err) \
36 ((unsigned long) (val) >= -515L)
369b849f
RM
37
38#undef INTERNAL_SYSCALL_ERRNO
6aca81bb 39#define INTERNAL_SYSCALL_ERRNO(val, err) (-(val))
369b849f
RM
40
41#define inline_syscall0(string,name,dummy...) \
4d76a0ec
UD
42({ \
43 register long __o0 __asm__ ("o0"); \
44 register long __g1 __asm__ ("g1") = __NR_##name; \
369b849f 45 __asm __volatile (string : "=r" (__g1), "=r" (__o0) : \
72d4c33d
RM
46 "0" (__g1) : \
47 __SYSCALL_CLOBBERS); \
4d76a0ec
UD
48 __o0; \
49})
50
369b849f 51#define inline_syscall1(string,name,arg1) \
4d76a0ec
UD
52({ \
53 register long __o0 __asm__ ("o0") = (long)(arg1); \
54 register long __g1 __asm__ ("g1") = __NR_##name; \
369b849f 55 __asm __volatile (string : "=r" (__g1), "=r" (__o0) : \
72d4c33d
RM
56 "0" (__g1), "1" (__o0) : \
57 __SYSCALL_CLOBBERS); \
4d76a0ec
UD
58 __o0; \
59})
60
369b849f 61#define inline_syscall2(string,name,arg1,arg2) \
4d76a0ec
UD
62({ \
63 register long __o0 __asm__ ("o0") = (long)(arg1); \
64 register long __o1 __asm__ ("o1") = (long)(arg2); \
65 register long __g1 __asm__ ("g1") = __NR_##name; \
369b849f 66 __asm __volatile (string : "=r" (__g1), "=r" (__o0) : \
72d4c33d
RM
67 "0" (__g1), "1" (__o0), "r" (__o1) : \
68 __SYSCALL_CLOBBERS); \
4d76a0ec
UD
69 __o0; \
70})
71
369b849f 72#define inline_syscall3(string,name,arg1,arg2,arg3) \
4d76a0ec
UD
73({ \
74 register long __o0 __asm__ ("o0") = (long)(arg1); \
75 register long __o1 __asm__ ("o1") = (long)(arg2); \
76 register long __o2 __asm__ ("o2") = (long)(arg3); \
77 register long __g1 __asm__ ("g1") = __NR_##name; \
369b849f 78 __asm __volatile (string : "=r" (__g1), "=r" (__o0) : \
72d4c33d
RM
79 "0" (__g1), "1" (__o0), "r" (__o1), \
80 "r" (__o2) : \
81 __SYSCALL_CLOBBERS); \
4d76a0ec
UD
82 __o0; \
83})
84
369b849f 85#define inline_syscall4(string,name,arg1,arg2,arg3,arg4) \
4d76a0ec
UD
86({ \
87 register long __o0 __asm__ ("o0") = (long)(arg1); \
88 register long __o1 __asm__ ("o1") = (long)(arg2); \
89 register long __o2 __asm__ ("o2") = (long)(arg3); \
90 register long __o3 __asm__ ("o3") = (long)(arg4); \
91 register long __g1 __asm__ ("g1") = __NR_##name; \
369b849f 92 __asm __volatile (string : "=r" (__g1), "=r" (__o0) : \
72d4c33d
RM
93 "0" (__g1), "1" (__o0), "r" (__o1), \
94 "r" (__o2), "r" (__o3) : \
95 __SYSCALL_CLOBBERS); \
4d76a0ec
UD
96 __o0; \
97})
98
369b849f 99#define inline_syscall5(string,name,arg1,arg2,arg3,arg4,arg5) \
4d76a0ec
UD
100({ \
101 register long __o0 __asm__ ("o0") = (long)(arg1); \
102 register long __o1 __asm__ ("o1") = (long)(arg2); \
103 register long __o2 __asm__ ("o2") = (long)(arg3); \
104 register long __o3 __asm__ ("o3") = (long)(arg4); \
105 register long __o4 __asm__ ("o4") = (long)(arg5); \
106 register long __g1 __asm__ ("g1") = __NR_##name; \
369b849f 107 __asm __volatile (string : "=r" (__g1), "=r" (__o0) : \
72d4c33d
RM
108 "0" (__g1), "1" (__o0), "r" (__o1), \
109 "r" (__o2), "r" (__o3), "r" (__o4) : \
110 __SYSCALL_CLOBBERS); \
4d76a0ec
UD
111 __o0; \
112})
113
369b849f 114#define inline_syscall6(string,name,arg1,arg2,arg3,arg4,arg5,arg6) \
4d76a0ec
UD
115({ \
116 register long __o0 __asm__ ("o0") = (long)(arg1); \
117 register long __o1 __asm__ ("o1") = (long)(arg2); \
118 register long __o2 __asm__ ("o2") = (long)(arg3); \
119 register long __o3 __asm__ ("o3") = (long)(arg4); \
120 register long __o4 __asm__ ("o4") = (long)(arg5); \
121 register long __o5 __asm__ ("o5") = (long)(arg6); \
122 register long __g1 __asm__ ("g1") = __NR_##name; \
369b849f 123 __asm __volatile (string : "=r" (__g1), "=r" (__o0) : \
72d4c33d
RM
124 "0" (__g1), "1" (__o0), "r" (__o1), \
125 "r" (__o2), "r" (__o3), "r" (__o4), \
126 "r" (__o5) : \
127 __SYSCALL_CLOBBERS); \
4d76a0ec
UD
128 __o0; \
129})
130
131#endif /* _LINUX_SPARC_SYSDEP_H */