OSDN Git Service

2004-06-14 Jeff Johnston <jjohnstn@redhat.com>
authorjjohnstn <jjohnstn>
Mon, 14 Jun 2004 20:57:06 +0000 (20:57 +0000)
committerjjohnstn <jjohnstn>
Mon, 14 Jun 2004 20:57:06 +0000 (20:57 +0000)
        * libc/sys/linux/machine/i386/syscall.h: For now, set up
        __syscall_return macro for systems with vsyscall.

newlib/ChangeLog
newlib/libc/sys/linux/machine/i386/syscall.h

index 5c2b536..2c39467 100644 (file)
@@ -1,3 +1,8 @@
+2004-06-14  Jeff Johnston  <jjohnstn@redhat.com>
+
+       * libc/sys/linux/machine/i386/syscall.h: For now, set up
+       __syscall_return macro for systems with vsyscall.
+
 2004-06-11  Antony King  <antony.king@st.com>
 
        * libc/include/sys/_types.h: Include <sys/lock.h> and change
index 2dbb84f..ec9bc24 100644 (file)
  * PIC uses %ebx, so we need to save it during system calls
  */
 
-#ifdef __syscall_return
+#ifndef __syscall_return
 
+/* FIXME: remove this and switch over to use vsyscall.  */
+
+#define __syscall_return(type, res) \
+do { \
+  if ((unsigned long)(res) >= (unsigned long)(-125)) { \
+    errno = -(res); \
+    res = -1; \
+  } \
+  return (type) (res); \
+} while (0)
+
+#endif                                                                                
 #undef __inline_syscall0
 #define __inline_syscall0(name,ret) \
 __asm__ volatile ("int $0x80" \
@@ -136,59 +148,6 @@ __inline_syscall6(name,__res,arg1,arg2,arg3,arg4,arg5,arg6) \
 __syscall_return(type,__res); \
 }
 
-#else /* !__syscall_return */
-
-#undef _syscall0_base
-#define _syscall0_base(type,name) \
-type __libc_##name (void) \
-{ \
-  return (type)syscall (__NR_##name); \
-}
-
-#undef _syscall1_base
-#define _syscall1_base(type,name,type1,arg1) \
-type __libc_##name (type1 arg1) \
-{ \
-  return (type)syscall (__NR_##name, arg1); \
-}
-
-#undef _syscall2_base
-#define _syscall2_base(type,name,type1,arg1,type2,arg2) \
-type __libc_##name (type1 arg1, type2 arg2) \
-{ \
-  return (type)syscall (__NR_##name, arg1, arg2); \
-}
-
-#undef _syscall3_base
-#define _syscall3_base(type,name,type1,arg1,type2,arg2,type3,arg3) \
-type __libc_##name (type1 arg1, type2 arg2, type3 arg3) \
-{ \
-  return (type)syscall (__NR_##name, arg1, arg2, arg3); \
-}
-
-#undef _syscall4_base
-#define _syscall4_base(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
-type __libc_##name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
-{ \
-  return (type)syscall (__NR_##name, arg1, arg2, arg3, arg4); \
-}
-
-#undef _syscall5_base
-#define _syscall5_base(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
-type __libc_##name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
-{ \
-  return (type)syscall (__NR_##name, arg1, arg2, arg3, arg4, arg5); \
-}
-
-#undef _syscall6_base
-#define _syscall6_base(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \
-type __libc_##name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \
-{ \
-  return (type)syscall (__NR_##name, arg1, arg2, arg3, arg4, arg5, arg6); \
-}
-
-#endif /* !__syscall_return */
-
 #undef _syscall0
 #define _syscall0(type,name) \
 _syscall0_base(type,name) \