patch-2.3.38 linux/include/asm-sparc64/unistd.h

Next file: linux/include/linux/blk.h
Previous file: linux/include/asm-sparc64/processor.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.37/linux/include/asm-sparc64/unistd.h linux/include/asm-sparc64/unistd.h
@@ -1,4 +1,4 @@
-/* $Id: unistd.h,v 1.36 1999/12/21 14:09:51 jj Exp $ */
+/* $Id: unistd.h,v 1.37 2000/01/05 07:37:55 jj Exp $ */
 #ifndef _SPARC64_UNISTD_H
 #define _SPARC64_UNISTD_H
 
@@ -276,13 +276,13 @@
 type name(void) \
 { \
 long __res; \
-__asm__ __volatile__ ("mov %0, %%g1\n\t" \
-		      "t 0x6d\n\t" \
+register long __g1 __asm__ ("g1") = __NR_##name; \
+__asm__ __volatile__ ("t 0x6d\n\t" \
 		      "sub %%g0, %%o0, %0\n\t" \
 		      "movcc %%xcc, %%o0, %0\n\t" \
 		      : "=r" (__res)\
-		      : "0" (__NR_##name) \
-		      : "g1", "o0", "cc"); \
+		      : "r" (__g1) \
+		      : "o0", "cc"); \
 if (__res >= 0) \
     return (type) __res; \
 errno = -__res; \
@@ -293,14 +293,14 @@
 type name(type1 arg1) \
 { \
 long __res; \
-__asm__ __volatile__ ("mov %0, %%g1\n\t" \
-		      "mov %1, %%o0\n\t" \
-		      "t 0x6d\n\t" \
+register long __g1 __asm__ ("g1") = __NR_##name; \
+register long __o0 __asm__ ("o0") = (long)(arg1); \
+__asm__ __volatile__ ("t 0x6d\n\t" \
 		      "sub %%g0, %%o0, %0\n\t" \
 		      "movcc %%xcc, %%o0, %0\n\t" \
-		      : "=r" (__res), "=r" ((long)(arg1)) \
-		      : "0" (__NR_##name),"1" ((long)(arg1)) \
-		      : "g1", "o0", "cc"); \
+		      : "=r" (__res), "=&r" (__o0) \
+		      : "1" (__o0), "r" (__g1) \
+		      : "cc"); \
 if (__res >= 0) \
 	return (type) __res; \
 errno = -__res; \
@@ -311,15 +311,15 @@
 type name(type1 arg1,type2 arg2) \
 { \
 long __res; \
-__asm__ __volatile__ ("mov %0, %%g1\n\t" \
-		      "mov %1, %%o0\n\t" \
-		      "mov %2, %%o1\n\t" \
-		      "t 0x6d\n\t" \
+register long __g1 __asm__ ("g1") = __NR_##name; \
+register long __o0 __asm__ ("o0") = (long)(arg1); \
+register long __o1 __asm__ ("o1") = (long)(arg2); \
+__asm__ __volatile__ ("t 0x6d\n\t" \
 		      "sub %%g0, %%o0, %0\n\t" \
 		      "movcc %%xcc, %%o0, %0\n\t" \
-		      : "=r" (__res), "=r" ((long)(arg1)), "=r" ((long)(arg2)) \
-		      : "0" (__NR_##name),"1" ((long)(arg1)),"2" ((long)(arg2)) \
-		      : "g1", "o0", "o1", "cc"); \
+		      : "=r" (__res), "=&r" (__o0) \
+		      : "1" (__o0), "r" (__o1), "r" (__g1) \
+		      : "cc"); \
 if (__res >= 0) \
 	return (type) __res; \
 errno = -__res; \
@@ -330,18 +330,16 @@
 type name(type1 arg1,type2 arg2,type3 arg3) \
 { \
 long __res; \
-__asm__ __volatile__ ("mov %0, %%g1\n\t" \
-		      "mov %1, %%o0\n\t" \
-		      "mov %2, %%o1\n\t" \
-		      "mov %3, %%o2\n\t" \
-		      "t 0x6d\n\t" \
+register long __g1 __asm__ ("g1") = __NR_##name; \
+register long __o0 __asm__ ("o0") = (long)(arg1); \
+register long __o1 __asm__ ("o1") = (long)(arg2); \
+register long __o2 __asm__ ("o2") = (long)(arg3); \
+__asm__ __volatile__ ("t 0x6d\n\t" \
 		      "sub %%g0, %%o0, %0\n\t" \
 		      "movcc %%xcc, %%o0, %0\n\t" \
-		      : "=r" (__res), "=r" ((long)(arg1)), "=r" ((long)(arg2)), \
-		        "=r" ((long)(arg3)) \
-		      : "0" (__NR_##name), "1" ((long)(arg1)), "2" ((long)(arg2)), \
-		        "3" ((long)(arg3)) \
-		      : "g1", "o0", "o1", "o2", "cc"); \
+		      : "=r" (__res), "=&r" (__o0) \
+		      : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__g1) \
+		      : "cc"); \
 if (__res>=0) \
 	return (type) __res; \
 errno = -__res; \
@@ -352,19 +350,17 @@
 type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
 { \
 long __res; \
-__asm__ __volatile__ ("mov %0, %%g1\n\t" \
-		      "mov %1, %%o0\n\t" \
-		      "mov %2, %%o1\n\t" \
-		      "mov %3, %%o2\n\t" \
-		      "mov %4, %%o3\n\t" \
-		      "t 0x6d\n\t" \
-		      "sub %%g0,%%o0, %0\n\t" \
+register long __g1 __asm__ ("g1") = __NR_##name; \
+register long __o0 __asm__ ("o0") = (long)(arg1); \
+register long __o1 __asm__ ("o1") = (long)(arg2); \
+register long __o2 __asm__ ("o2") = (long)(arg3); \
+register long __o3 __asm__ ("o3") = (long)(arg4); \
+__asm__ __volatile__ ("t 0x6d\n\t" \
+		      "sub %%g0, %%o0, %0\n\t" \
 		      "movcc %%xcc, %%o0, %0\n\t" \
-		      : "=r" (__res), "=r" ((long)(arg1)), "=r" ((long)(arg2)), \
-		        "=r" ((long)(arg3)), "=r" ((long)(arg4)) \
-		      : "0" (__NR_##name),"1" ((long)(arg1)),"2" ((long)(arg2)), \
-		        "3" ((long)(arg3)),"4" ((long)(arg4)) \
-		      : "g1", "o0", "o1", "o2", "o3", "cc"); \
+		      : "=r" (__res), "=&r" (__o0) \
+		      : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__g1) \
+		      : "cc"); \
 if (__res>=0) \
 	return (type) __res; \
 errno = -__res; \
@@ -375,22 +371,19 @@
 	  type5,arg5) \
 type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
 { \
-      long __res; \
-\
-__asm__ __volatile__ ("mov %1, %%o0\n\t" \
-		      "mov %2, %%o1\n\t" \
-		      "mov %3, %%o2\n\t" \
-		      "mov %4, %%o3\n\t" \
-		      "mov %5, %%o4\n\t" \
-		      "mov %6, %%g1\n\t" \
-		      "t 0x6d\n\t" \
+long __res; \
+register long __g1 __asm__ ("g1") = __NR_##name; \
+register long __o0 __asm__ ("o0") = (long)(arg1); \
+register long __o1 __asm__ ("o1") = (long)(arg2); \
+register long __o2 __asm__ ("o2") = (long)(arg3); \
+register long __o3 __asm__ ("o3") = (long)(arg4); \
+register long __o4 __asm__ ("o4") = (long)(arg5); \
+__asm__ __volatile__ ("t 0x6d\n\t" \
 		      "sub %%g0, %%o0, %0\n\t" \
 		      "movcc %%xcc, %%o0, %0\n\t" \
-		      : "=r" (__res) \
-		      : "r" ((long)(arg1)),"r" ((long)(arg2)), \
-		        "r" ((long)(arg3)),"r" ((long)(arg4)),"r" ((long)(arg5)), \
-		        "i" (__NR_##name)  \
-		      : "g1", "o0", "o1", "o2", "o3", "o4", "cc"); \
+		      : "=r" (__res), "=&r" (__o0) \
+		      : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__o4), "r" (__g1) \
+		      : "cc"); \
 if (__res>=0) \
 	return (type) __res; \
 errno = -__res; \

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