patch-2.4.22 linux-2.4.22/include/asm-mips/unistd.h
Next file: linux-2.4.22/include/asm-mips/vr4181/irq.h
Previous file: linux-2.4.22/include/asm-mips/umap.h
Back to the patch index
Back to the overall index
- Lines: 239
- Date:
2003-08-25 04:44:44.000000000 -0700
- Orig file:
linux-2.4.21/include/asm-mips/unistd.h
- Orig date:
2002-08-02 17:39:45.000000000 -0700
diff -urN linux-2.4.21/include/asm-mips/unistd.h linux-2.4.22/include/asm-mips/unistd.h
@@ -27,7 +27,7 @@
#define __NR_chmod (__NR_Linux + 15)
#define __NR_lchown (__NR_Linux + 16)
#define __NR_break (__NR_Linux + 17)
-#define __NR_oldstat (__NR_Linux + 18)
+#define __NR_unused18 (__NR_Linux + 18)
#define __NR_lseek (__NR_Linux + 19)
#define __NR_getpid (__NR_Linux + 20)
#define __NR_mount (__NR_Linux + 21)
@@ -37,7 +37,7 @@
#define __NR_stime (__NR_Linux + 25)
#define __NR_ptrace (__NR_Linux + 26)
#define __NR_alarm (__NR_Linux + 27)
-#define __NR_oldfstat (__NR_Linux + 28)
+#define __NR_unused28 (__NR_Linux + 28)
#define __NR_pause (__NR_Linux + 29)
#define __NR_utime (__NR_Linux + 30)
#define __NR_stty (__NR_Linux + 31)
@@ -93,7 +93,7 @@
#define __NR_setgroups (__NR_Linux + 81)
#define __NR_reserved82 (__NR_Linux + 82)
#define __NR_symlink (__NR_Linux + 83)
-#define __NR_oldlstat (__NR_Linux + 84)
+#define __NR_unused84 (__NR_Linux + 84)
#define __NR_readlink (__NR_Linux + 85)
#define __NR_uselib (__NR_Linux + 86)
#define __NR_swapon (__NR_Linux + 87)
@@ -262,17 +262,18 @@
#define _syscall0(type,name) \
type name(void) \
{ \
- register unsigned long __v0 asm("$2") = __NR_##name; \
register unsigned long __a3 asm("$7"); \
+ unsigned long __v0; \
\
__asm__ volatile ( \
".set\tnoreorder\n\t" \
"li\t$2, %2\t\t\t# " #name "\n\t" \
"syscall\n\t" \
+ "move\t%0, $2\n\t" \
".set\treorder" \
: "=&r" (__v0), "=r" (__a3) \
: "i" (__NR_##name) \
- : "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
+ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
\
if (__a3 == 0) \
return (type) __v0; \
@@ -287,18 +288,19 @@
#define _syscall1(type,name,atype,a) \
type name(atype a) \
{ \
- register unsigned long __v0 asm("$2") = __NR_##name; \
register unsigned long __a0 asm("$4") = (unsigned long) a; \
register unsigned long __a3 asm("$7"); \
+ unsigned long __v0; \
\
__asm__ volatile ( \
".set\tnoreorder\n\t" \
"li\t$2, %3\t\t\t# " #name "\n\t" \
"syscall\n\t" \
+ "move\t%0, $2\n\t" \
".set\treorder" \
: "=&r" (__v0), "=r" (__a3) \
: "r" (__a0), "i" (__NR_##name) \
- : "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
+ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
\
if (__a3 == 0) \
return (type) __v0; \
@@ -309,19 +311,20 @@
#define _syscall2(type,name,atype,a,btype,b) \
type name(atype a, btype b) \
{ \
- register unsigned long __v0 asm("$2") = __NR_##name; \
register unsigned long __a0 asm("$4") = (unsigned long) a; \
register unsigned long __a1 asm("$5") = (unsigned long) b; \
register unsigned long __a3 asm("$7"); \
+ unsigned long __v0; \
\
__asm__ volatile ( \
".set\tnoreorder\n\t" \
"li\t$2, %4\t\t\t# " #name "\n\t" \
"syscall\n\t" \
+ "move\t%0, $2\n\t" \
".set\treorder" \
: "=&r" (__v0), "=r" (__a3) \
: "r" (__a0), "r" (__a1), "i" (__NR_##name) \
- : "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
+ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
\
if (__a3 == 0) \
return (type) __v0; \
@@ -332,20 +335,21 @@
#define _syscall3(type,name,atype,a,btype,b,ctype,c) \
type name(atype a, btype b, ctype c) \
{ \
- register unsigned long __v0 asm("$2") = __NR_##name; \
register unsigned long __a0 asm("$4") = (unsigned long) a; \
register unsigned long __a1 asm("$5") = (unsigned long) b; \
register unsigned long __a2 asm("$6") = (unsigned long) c; \
register unsigned long __a3 asm("$7"); \
+ unsigned long __v0; \
\
__asm__ volatile ( \
".set\tnoreorder\n\t" \
"li\t$2, %5\t\t\t# " #name "\n\t" \
"syscall\n\t" \
+ "move\t%0, $2\n\t" \
".set\treorder" \
: "=&r" (__v0), "=r" (__a3) \
: "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##name) \
- : "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
+ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
\
if (__a3 == 0) \
return (type) __v0; \
@@ -356,20 +360,21 @@
#define _syscall4(type,name,atype,a,btype,b,ctype,c,dtype,d) \
type name(atype a, btype b, ctype c, dtype d) \
{ \
- register unsigned long __v0 asm("$2") = __NR_##name; \
register unsigned long __a0 asm("$4") = (unsigned long) a; \
register unsigned long __a1 asm("$5") = (unsigned long) b; \
register unsigned long __a2 asm("$6") = (unsigned long) c; \
register unsigned long __a3 asm("$7") = (unsigned long) d; \
+ unsigned long __v0; \
\
__asm__ volatile ( \
".set\tnoreorder\n\t" \
"li\t$2, %5\t\t\t# " #name "\n\t" \
"syscall\n\t" \
+ "move\t%0, $2\n\t" \
".set\treorder" \
: "=&r" (__v0), "+r" (__a3) \
: "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##name) \
- : "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
+ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
\
if (__a3 == 0) \
return (type) __v0; \
@@ -384,11 +389,11 @@
#define _syscall5(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
type name(atype a, btype b, ctype c, dtype d, etype e) \
{ \
- register unsigned long __v0 asm("$2") = __NR_##name; \
register unsigned long __a0 asm("$4") = (unsigned long) a; \
register unsigned long __a1 asm("$5") = (unsigned long) b; \
register unsigned long __a2 asm("$6") = (unsigned long) c; \
register unsigned long __a3 asm("$7") = (unsigned long) d; \
+ unsigned long __v0; \
\
__asm__ volatile ( \
".set\tnoreorder\n\t" \
@@ -397,12 +402,13 @@
"sw\t$2, 16($29)\n\t" \
"li\t$2, %5\t\t\t# " #name "\n\t" \
"syscall\n\t" \
+ "move\t%0, $2\n\t" \
"addiu\t$29, 32\n\t" \
".set\treorder" \
: "=&r" (__v0), "+r" (__a3) \
: "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##name), \
"m" ((unsigned long)e) \
- : "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
+ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
\
if (__a3 == 0) \
return (type) __v0; \
@@ -413,11 +419,11 @@
#define _syscall6(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f) \
type name(atype a, btype b, ctype c, dtype d, etype e, ftype f) \
{ \
- register unsigned long __v0 asm("$2") = __NR_##name; \
register unsigned long __a0 asm("$4") = (unsigned long) a; \
register unsigned long __a1 asm("$5") = (unsigned long) b; \
register unsigned long __a2 asm("$6") = (unsigned long) c; \
register unsigned long __a3 asm("$7") = (unsigned long) d; \
+ unsigned long __v0; \
\
__asm__ volatile ( \
".set\tnoreorder\n\t" \
@@ -428,12 +434,13 @@
"sw\t$8, 20($29)\n\t" \
"li\t$2, %5\t\t\t# " #name "\n\t" \
"syscall\n\t" \
+ "move\t%0, $2\n\t" \
"addiu\t$29, 32\n\t" \
".set\treorder" \
: "=&r" (__v0), "+r" (__a3) \
: "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##name), \
"m" ((unsigned long)e), "m" ((unsigned long)f) \
- : "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
+ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
\
if (__a3 == 0) \
return (type) __v0; \
@@ -441,41 +448,6 @@
return -1; \
}
-#define _syscall7(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f,gtype,g) \
-type name(atype a, btype b, ctype c, dtype d, etype e, ftype f, gtype g) \
-{ \
- register unsigned long __v0 asm("$2") = __NR_##name; \
- register unsigned long __a0 asm("$4") = (unsigned long) a; \
- register unsigned long __a1 asm("$5") = (unsigned long) b; \
- register unsigned long __a2 asm("$6") = (unsigned long) c; \
- register unsigned long __a3 asm("$7") = (unsigned long) d; \
- \
- __asm__ volatile ( \
- ".set\tnoreorder\n\t" \
- "lw\t$2, %6\n\t" \
- "lw\t$8, %7\n\t" \
- "lw\t$9, %8\n\t" \
- "subu\t$29, 32\n\t" \
- "sw\t$2, 16($29)\n\t" \
- "sw\t$8, 20($29)\n\t" \
- "sw\t$9, 24($29)\n\t" \
- "li\t$2, %5\t\t\t# " #name "\n\t" \
- "syscall\n\t" \
- "addiu\t$29, 32\n\t" \
- ".set\treorder" \
- : "=&r" (__v0), "+r" (__a3) \
- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##name), \
- "m" ((unsigned long)e), "m" ((unsigned long)f), \
- "m" ((unsigned long)g), \
- : "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24"); \
- \
- if (__a3 == 0) \
- return (type) __v0; \
- errno = __v0; \
- return -1; \
-}
-
-
#ifdef __KERNEL_SYSCALLS__
/*
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)