aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2005-09-16 12:20:49 +0000
committerAndreas Jaeger <aj@suse.de>2005-09-16 12:20:49 +0000
commit2c923c369e087169ae1a769a8934807df41b273f (patch)
tree16f49140c1e4569ee72e42d117f14cd6d9c9ddf0
parent141f0a9cbefa2ed88486f836bd4dad1b14f277e6 (diff)
downloadglibc-2c923c369e087169ae1a769a8934807df41b273f.zip
glibc-2c923c369e087169ae1a769a8934807df41b273f.tar.gz
glibc-2c923c369e087169ae1a769a8934807df41b273f.tar.bz2
[BZ #933]
2005-09-16 Maciej W. Rozycki <macro@linux-mips.org> [BZ #933] * sysdeps/unix/sysv/linux/mips/brk.c (__brk): Load the number of the syscall immediately before invocation. * sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S (__ioctl): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/syscall.S (syscall): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S (__ioctl): Use macros to handle GP. * sysdeps/unix/sysv/linux/mips/mips64/syscall.S (syscall): Likewise. Update inaccurate comments. 2005-09-16 Maciej W. Rozycki <macro@linux-mips.org> [BZ #933] * sysdeps/unix/sysv/linux/mips/brk.c (__brk): Load the number of the syscall immediately before invocation. * sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S (__ioctl): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/syscall.S (syscall): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S (__ioctl): Use macros to handle GP. * sysdeps/unix/sysv/linux/mips/mips64/syscall.S (syscall): Likewise. Update inaccurate comments.
-rw-r--r--ChangeLog13
-rw-r--r--sysdeps/unix/sysv/linux/mips/brk.c5
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S10
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/syscall.S31
4 files changed, 40 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index 45839e0..9ea4056 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2005-09-16 Maciej W. Rozycki <macro@linux-mips.org>
+
+ [BZ #933]
+ * sysdeps/unix/sysv/linux/mips/brk.c (__brk): Load the number of
+ the syscall immediately before invocation.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S (__ioctl): Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/syscall.S (syscall): Likewise.
+
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S (__ioctl): Use
+ macros to handle GP.
+ * sysdeps/unix/sysv/linux/mips/mips64/syscall.S (syscall):
+ Likewise. Update inaccurate comments.
+
2005-09-13 Ulrich Drepper <drepper@redhat.com>
* sysdeps/posix/spawni.c (__spawni): Automatically recognize some
diff --git a/sysdeps/unix/sysv/linux/mips/brk.c b/sysdeps/unix/sysv/linux/mips/brk.c
index 4be88a9..5c31bec 100644
--- a/sysdeps/unix/sysv/linux/mips/brk.c
+++ b/sysdeps/unix/sysv/linux/mips/brk.c
@@ -1,5 +1,5 @@
/* brk system call for Linux/MIPS.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -37,9 +37,10 @@ __brk (void *addr)
register long int res __asm__ ("$2");
asm ("move\t$4,%2\n\t"
+ "li\t%0,%1\n\t"
"syscall" /* Perform the system call. */
: "=r" (res)
- : "0" (SYS_ify (brk)), "r" (addr)
+ : "I" (SYS_ify (brk)), "r" (addr)
: "$4", "$7");
newbrk = (void *) res;
}
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S b/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S
index 7b14089..e4b4f00 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S
@@ -1,4 +1,4 @@
-/* Copyright 2003 Free Software Foundation, Inc.
+/* Copyright 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,16 +25,16 @@
.text
ENTRY (__ioctl)
+ sll a1, a1, 0
li v0, __NR_ioctl
- sll a1,a1,0
syscall /* Do the system call. */
bne a3, zero, L(error)
ret
L(error):
- .cpsetup t9, a0, __ioctl
- PTR_LA t9,__syscall_error
- .cprestore
+ SETUP_GP64 (a0, __ioctl)
+ PTR_LA t9, __syscall_error
+ RESTORE_GP64
jr t9
PSEUDO_END (__ioctl)
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/syscall.S b/sysdeps/unix/sysv/linux/mips/mips64/syscall.S
index ea5bf49..3c6aaac8 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/syscall.S
+++ b/sysdeps/unix/sysv/linux/mips/mips64/syscall.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,17 +20,20 @@
#include <sys/asm.h>
-/* Please consult the file sysdeps/unix/sysv/linux/x86-64/sysdep.h for
- more information about the value -4095 used below. */
+/* Usage:
+ long syscall (syscall_number, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
-/* Usage: long syscall (syscall_number, arg1, arg2, arg3, arg4, arg5)
- We need to do some arg shifting, the syscall_number will be in
- rax. */
+ We need to do some arg shifting, syscall_number will be in v0. */
.text
-ENTRY (syscall)
- move v0, a0 /* Syscall number -> v0 */
+NESTED (syscall, SZREG, ra)
+ .mask 0x00010000, -SZREG
+ .fmask 0x00000000, 0
+ PTR_ADDIU sp, -SZREG
+ REG_S s0, (sp)
+
+ move s0, a0
move a0, a1 /* shift arg1 - arg7. */
move a1, a2
move a2, a3
@@ -39,15 +42,19 @@ ENTRY (syscall)
move a5, a6
move a6, a7
+ move v0, s0 /* Syscall number -> v0 */
syscall /* Do the system call. */
+
+ REG_L s0, (sp)
+ PTR_ADDIU sp, SZREG
bne a3, zero, L(error)
ret
L(error):
- .cpsetup t9, a0, syscall
- PTR_LA t9,__syscall_error
- .cprestore
+ SETUP_GP64 (a0, syscall)
+ PTR_LA t9, __syscall_error
+ RESTORE_GP64
jr t9
-PSEUDO_END (syscall)
+END (syscall)