1 #define __SYSCALL_LL_E(x) (x)
2 #define __SYSCALL_LL_O(x) (x)
4 __attribute__((visibility("hidden")))
5 long (__syscall
)(long, ...);
7 #define SYSCALL_RLIM_INFINITY (-1UL/2)
9 #if _MIPSEL || __MIPSEL || __MIPSEL__
10 #define __stat_fix(st) ((st),(void)0)
13 static inline void __stat_fix(long p
)
15 struct stat
*st
= (struct stat
*)p
;
23 static inline long __syscall0(long n
)
25 register long r7
__asm__("$7");
26 register long r2
__asm__("$2");
27 __asm__
__volatile__ (
28 "addu $2,$0,%2 ; syscall"
29 : "=&r"(r2
), "=r"(r7
) : "ir"(n
), "0"(r2
), "1"(r7
)
30 : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
31 "$14", "$15", "$24", "$25", "hi", "lo", "memory");
35 static inline long __syscall1(long n
, long a
)
37 register long r4
__asm__("$4") = a
;
38 register long r7
__asm__("$7");
39 register long r2
__asm__("$2");
40 __asm__
__volatile__ (
41 "addu $2,$0,%2 ; syscall"
42 : "=&r"(r2
), "=r"(r7
) : "ir"(n
), "0"(r2
), "1"(r7
),
44 : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
45 "$14", "$15", "$24", "$25", "hi", "lo", "memory");
49 static inline long __syscall2(long n
, long a
, long b
)
51 register long r4
__asm__("$4") = a
;
52 register long r5
__asm__("$5") = b
;
53 register long r7
__asm__("$7");
54 register long r2
__asm__("$2");
55 __asm__
__volatile__ (
56 "addu $2,$0,%2 ; syscall"
57 : "=&r"(r2
), "=r"(r7
) : "ir"(n
), "0"(r2
), "1"(r7
),
59 : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
60 "$14", "$15", "$24", "$25", "hi", "lo", "memory");
63 if (n
== SYS_stat
|| n
== SYS_fstat
|| n
== SYS_lstat
) __stat_fix(b
);
67 static inline long __syscall3(long n
, long a
, long b
, long c
)
69 register long r4
__asm__("$4") = a
;
70 register long r5
__asm__("$5") = b
;
71 register long r6
__asm__("$6") = c
;
72 register long r7
__asm__("$7");
73 register long r2
__asm__("$2");
74 __asm__
__volatile__ (
75 "addu $2,$0,%2 ; syscall"
76 : "=&r"(r2
), "=r"(r7
) : "ir"(n
), "0"(r2
), "1"(r7
),
77 "r"(r4
), "r"(r5
), "r"(r6
)
78 : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
79 "$14", "$15", "$24", "$25", "hi", "lo", "memory");
82 if (n
== SYS_stat
|| n
== SYS_fstat
|| n
== SYS_lstat
) __stat_fix(b
);
86 static inline long __syscall4(long n
, long a
, long b
, long c
, long d
)
88 register long r4
__asm__("$4") = a
;
89 register long r5
__asm__("$5") = b
;
90 register long r6
__asm__("$6") = c
;
91 register long r7
__asm__("$7") = d
;
92 register long r2
__asm__("$2");
93 __asm__
__volatile__ (
94 "addu $2,$0,%2 ; syscall"
95 : "=&r"(r2
), "=r"(r7
) : "ir"(n
), "0"(r2
), "1"(r7
),
96 "r"(r4
), "r"(r5
), "r"(r6
)
97 : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13",
98 "$14", "$15", "$24", "$25", "hi", "lo", "memory");
101 if (n
== SYS_stat
|| n
== SYS_fstat
|| n
== SYS_lstat
) __stat_fix(b
);
102 if (n
== SYS_fstatat
) __stat_fix(c
);
108 static inline long __syscall0(long n
)
110 return (__syscall
)(n
);
113 static inline long __syscall1(long n
, long a
)
115 return (__syscall
)(n
, a
);
118 static inline long __syscall2(long n
, long a
, long b
)
120 long r2
= (__syscall
)(n
, a
, b
);
121 if (r2
> -4096UL) return r2
;
122 if (n
== SYS_stat
|| n
== SYS_fstat
|| n
== SYS_lstat
) __stat_fix(b
);
126 static inline long __syscall3(long n
, long a
, long b
, long c
)
128 long r2
= (__syscall
)(n
, a
, b
, c
);
129 if (r2
> -4096UL) return r2
;
130 if (n
== SYS_stat
|| n
== SYS_fstat
|| n
== SYS_lstat
) __stat_fix(b
);
134 static inline long __syscall4(long n
, long a
, long b
, long c
, long d
)
136 long r2
= (__syscall
)(n
, a
, b
, c
, d
);
137 if (r2
> -4096UL) return r2
;
138 if (n
== SYS_stat
|| n
== SYS_fstat
|| n
== SYS_lstat
) __stat_fix(b
);
139 if (n
== SYS_fstatat
) __stat_fix(c
);
145 static inline long __syscall5(long n
, long a
, long b
, long c
, long d
, long e
)
147 long r2
= (__syscall
)(n
, a
, b
, c
, d
, e
);
148 if (r2
> -4096UL) return r2
;
149 if (n
== SYS_stat
|| n
== SYS_fstat
|| n
== SYS_lstat
) __stat_fix(b
);
150 if (n
== SYS_fstatat
) __stat_fix(c
);
154 static inline long __syscall6(long n
, long a
, long b
, long c
, long d
, long e
, long f
)
156 long r2
= (__syscall
)(n
, a
, b
, c
, d
, e
, f
);
157 if (r2
> -4096UL) return r2
;
158 if (n
== SYS_stat
|| n
== SYS_fstat
|| n
== SYS_lstat
) __stat_fix(b
);
159 if (n
== SYS_fstatat
) __stat_fix(c
);
164 #define VDSO_CGT_SYM "__vdso_clock_gettime"
165 #define VDSO_CGT_VER "LINUX_2.6"