patch-2.3.99-pre6 linux/include/asm-sh/unistd.h

Next file: linux/include/asm-sparc/asm_offsets.h
Previous file: linux/include/asm-sh/system.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre5/linux/include/asm-sh/unistd.h linux/include/asm-sh/unistd.h
@@ -248,8 +248,8 @@
 #define _syscall0(type,name) \
 type name(void) \
 { \
-register long __sc0 __asm__ ("$r0") = __NR_##name; \
-__asm__ __volatile__ ("trapa	#0" \
+register long __sc0 __asm__ ("$r3") = __NR_##name; \
+__asm__ __volatile__ ("trapa	#0x10" \
 	: "=z" (__sc0) \
 	: "0" (__sc0) \
 	: "memory" ); \
@@ -259,9 +259,9 @@
 #define _syscall1(type,name,type1,arg1) \
 type name(type1 arg1) \
 { \
-register long __sc0 __asm__ ("$r0") = __NR_##name; \
+register long __sc0 __asm__ ("$r3") = __NR_##name; \
 register long __sc4 __asm__ ("$r4") = (long) arg1; \
-__asm__ __volatile__ ("trapa	#0" \
+__asm__ __volatile__ ("trapa	#0x11" \
 	: "=z" (__sc0) \
 	: "0" (__sc0), "r" (__sc4) \
 	: "memory"); \
@@ -271,10 +271,10 @@
 #define _syscall2(type,name,type1,arg1,type2,arg2) \
 type name(type1 arg1,type2 arg2) \
 { \
-register long __sc0 __asm__ ("$r0") = __NR_##name; \
+register long __sc0 __asm__ ("$r3") = __NR_##name; \
 register long __sc4 __asm__ ("$r4") = (long) arg1; \
 register long __sc5 __asm__ ("$r5") = (long) arg2; \
-__asm__ __volatile__ ("trapa	#0" \
+__asm__ __volatile__ ("trapa	#0x12" \
 	: "=z" (__sc0) \
 	: "0" (__sc0), "r" (__sc4), "r" (__sc5) \
 	: "memory"); \
@@ -284,11 +284,11 @@
 #define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
 type name(type1 arg1,type2 arg2,type3 arg3) \
 { \
-register long __sc0 __asm__ ("$r0") = __NR_##name; \
+register long __sc0 __asm__ ("$r3") = __NR_##name; \
 register long __sc4 __asm__ ("$r4") = (long) arg1; \
 register long __sc5 __asm__ ("$r5") = (long) arg2; \
 register long __sc6 __asm__ ("$r6") = (long) arg3; \
-__asm__ __volatile__ ("trapa	#0" \
+__asm__ __volatile__ ("trapa	#0x13" \
 	: "=z" (__sc0) \
 	: "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6) \
 	: "memory"); \
@@ -298,12 +298,12 @@
 #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
 type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
 { \
-register long __sc0 __asm__ ("$r0") = __NR_##name; \
+register long __sc0 __asm__ ("$r3") = __NR_##name; \
 register long __sc4 __asm__ ("$r4") = (long) arg1; \
 register long __sc5 __asm__ ("$r5") = (long) arg2; \
 register long __sc6 __asm__ ("$r6") = (long) arg3; \
 register long __sc7 __asm__ ("$r7") = (long) arg4; \
-__asm__ __volatile__ ("trapa	#0" \
+__asm__ __volatile__ ("trapa	#0x14" \
 	: "=z" (__sc0) \
 	: "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6),  \
 	  "r" (__sc7) \
@@ -314,16 +314,16 @@
 #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
 type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
 { \
-register long __sc0 __asm__ ("$r0") = __NR_##name; \
+register long __sc0 __asm__ ("$r3") = __NR_##name; \
 register long __sc4 __asm__ ("$r4") = (long) arg1; \
 register long __sc5 __asm__ ("$r5") = (long) arg2; \
 register long __sc6 __asm__ ("$r6") = (long) arg3; \
 register long __sc7 __asm__ ("$r7") = (long) arg4; \
-__asm__ __volatile__ ("mov.l	%2, @-$r15\n\t" \
-		      "trapa	#0" \
+register long __sc2 __asm__ ("$r0") = (long) arg5; \
+__asm__ __volatile__ ("trapa	#0x15" \
 	: "=z" (__sc0) \
-	: "0" (__sc0), "r" (arg5), \
-	  "r" (__sc4), "r" (__sc5), "r" (__sc6), "r" (__sc7) \
+	: "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), "r" (__sc7),  \
+	  "r" (__sc7), "r" (__sc2) \
 	: "memory" ); \
 __syscall_return(type,__sc0); \
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)