[parisc-linux-cvs] Implement syscall

Richard Hirst rhirst@linuxcare.com
Mon, 30 Apr 2001 15:27:13 +0100


--- glibc-clean/ChangeLog	Tue Mar 20 21:56:23 2001
+++ glibc/ChangeLog	Fri Apr 20 02:57:24 2001
@@ -1,6 +1,11 @@
 puffin.external.hp.com pending changes
 --------------------------------------
 
+2001-04-20  Richard Hirst <rhirst@linuxcare.com>
+
+	* sysdeps/unix/sysv/linux/hppa/syscall.S: remove dummy syscall.
+	* sysdeps/unix/sysv/linux/hppa/sysdep.c: implement syscall.
+
 2001-03-21  Alan Modra  <alan@linuxcare.com.au>
 
 	* sysdeps/hppa/dl-machine.h (RTLD_START): Set up dp with DT_PLTGOT
diff -ur glibc-clean/sysdeps/unix/sysv/linux/hppa/syscall.S glibc/sysdeps/unix/sysv/linux/hppa/syscall.S
--- glibc-clean/sysdeps/unix/sysv/linux/hppa/syscall.S	Tue Mar 28 10:29:29 2000
+++ glibc/sysdeps/unix/sysv/linux/hppa/syscall.S	Tue Apr 10 06:56:30 2001
@@ -21,8 +21,5 @@
 /* Please consult the file sysdeps/unix/sysv/linux/i386/sysdep.h for
    more information about the value -4095 used below.*/
 
-	.text
-ENTRY (syscall)
-	b .
-	nop
+/* hppa implements syscall() in 'C'; see sysdep.c */
 
diff -ur glibc-clean/sysdeps/unix/sysv/linux/hppa/sysdep.c glibc/sysdeps/unix/sysv/linux/hppa/sysdep.c
--- glibc-clean/sysdeps/unix/sysv/linux/hppa/sysdep.c	Mon Oct  2 15:27:04 2000
+++ glibc/sysdeps/unix/sysv/linux/hppa/sysdep.c	Fri Apr 20 02:53:25 2001
@@ -32,3 +32,28 @@
 #undef errno
 int errno = 0;
 weak_alias (errno, _errno)
+
+/* hppa implements syscall() in 'C'; would typically be in syscall.S */
+
+int
+syscall(int sysnum, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5)
+{
+	long __sys_res;
+	{
+		register unsigned long __res asm("r28");
+		LOAD_ARGS_6(arg0, arg1, arg2, arg3, arg4, arg5)
+		asm volatile(
+			"ble  0x100(%%sr2, %%r0)\n\t"
+			"copy %1, %%r20"
+			: "=r" (__res)
+			: "r" (sysnum) ASM_ARGS_6
+			);
+		__sys_res = __res;
+	}
+	if ((unsigned long) __sys_res >= (unsigned long)-4095) {
+		__set_errno(-__sys_res);
+		__sys_res = -1;
+	}
+	return __sys_res;
+}
+